As the topic describes, my app is in /Applications folder and it has got root access but still i cant write/Edit a file in /System/Library/CoreServices.
Can anyone advice me on how to do this?
P.S. I m develo开发者_JAVA百科ping for Jailbroken iOS4 (iOS 4 SDK).
Alright, got this working, you got to have root access with admin as group and SetUID flag should be set to write to that specific location. What i did is, i saw the directory structure of Cydia.app and compiled my app according to that(e.g. Cydia and Cydia_).
Rename your app name to YourApp_ and make a new file named YourApp and post the text below into it, set the proper permissions and you are good to go.
#!/bin/bash
C=/${0}
C=${C%/*}
declare -a flags
exec "${C:-.}"/MyApp_"${flags[@]}" -- "$@" 2>>/tmp/MyApp.log`
BTW YourApp binary should have a permission of 4755 to setuid flag as well.
Have you checked the flags for that directory? Maybe it's set as "system immutable". Take a look at the chflags command to learn more about file's flags.
精彩评论