Search code examples
iphonexcodejailbreak

Still cant write to /System/Library/CoreService although my app is root


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 developing for Jailbroken iOS4 (iOS 4 SDK).


Solution

  • 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.