App needs enhanced rights

Discussion in 'iOS Development' started by imakroy, Jun 26, 2009.

  1. imakroy

    imakroy New Member

    Joined:
    Sep 1, 2008
    Messages:
    8
    Likes Received:
    0
    hey guys,
    i am developing a nice app for the iphone at the moment. i am not very experienced with the iphone os and so i have a question.
    my tool needs root rights, cause if have to move a system file which belongs to the user root.
    how could i gain that rights?
    thx a lot.
  2. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Generally moving system files is a VERY bad thing.
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    Not necessarily.

    @OP this can be achieved. Cydia does it. Look in the application directory for Cydia, and notice that the actual binary is named 'Cydia_', and 'Cydia' is a script that runs Cydia_ as root.
  4. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    That’s why I said generally.
  5. imakroy

    imakroy New Member

    Joined:
    Sep 1, 2008
    Messages:
    8
    Likes Received:
    0
    thx, i´ll have a look
    ------------------double post merged------------------
    well. i have already tried. for me it doesn´t work.
    what exactly should be written in that shell script file?

    my shell script file looks like this:

    #!/bin/bash
    exec "/Applications/XY.app/MainApplication.sh"

    edit: i also experimented with the same "launcher" that SBSettings use. but the "whoami" command just tells me, that i am the user "mobile".
    SBSettings like shell script:

    #!/bin/bash
    AppDir=$(dirname "$0")
    exec "${AppDir}"/MainApplication.sh
    ------------------double post merged------------------
    one more thing.
    i had a close look at Cydia again and discovered, that Cydia has got the permissions "-rwsr-sr-x".
    so i had given my application files the same rights. but that doesn´t affect the behaviour of the application. it still runs as "mobile"

    Please Register or Log in to view images

  6. Pelaez-1

    Pelaez-1 New Member

    Joined:
    May 5, 2008
    Messages:
    822
    Likes Received:
    0
    Device:
    iPhone
    The permissions won't affect how it runs, the owner won't affect it either.

    And you shouldn't be moving important files if you are not experienced with the iPhone, you'll screw up your iPhone if you don't have the right fail-safe mechanisms.

    If you insist to do it, at least don't release it...
  7. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    Unless you know precisely what he's planning to do, don't make stupid comments like that. Many applications change system files, and it's the reason they're run as root:wheel.
  8. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    As you've just said yourself, they CHANGE not MOVE.
  9. Pelaez-1

    Pelaez-1 New Member

    Joined:
    May 5, 2008
    Messages:
    822
    Likes Received:
    0
    Device:
    iPhone
    You are missing my point. Of course there are apps that do that, but they don't do it unless it's completely necessary.
    Besides, those apps aren't made by newbs, they are made by people like saurik who knows how he's doing and knows what he's doing so that you aren't left with an unusable device.
  10. imakroy

    imakroy New Member

    Joined:
    Sep 1, 2008
    Messages:
    8
    Likes Received:
    0
    well. for now i have not the idea to publish that App ever. it is just for personal usage, so it is my own problem if i get an unstable iphone os.
    but back to the topic. can you please help me now to rewrite those, i call it "root script", to work for me?

    Please Register or Log in to view images

Share This Page