com.apple.*.plist binary files processing help needed. >>iPhone

Discussion in 'iOS Development' started by kam20, Dec 8, 2008.

  1. kam20

    kam20 New Member

    Joined:
    Nov 17, 2008
    Messages:
    1
    Likes Received:
    0
    I am new in iPhone devlopment (actually I am Java developer). I play with iPhone for fun. During my tests with programming an iPhone I found really big problem with processing binary (not xml decrypted) com.apple.springboard.plist file. I would like to ask you for help.
    I set all environment for my iPhone (Xcode with SDK 2.1 - currently 2.2, Jailbroken iPhone 2.2, etc.) I am able to build app and test it on my iPhone directly from Xcode. Also I tested some UI functions - everything seems to be ok, BUT...
    Yes, but I am not able to process plist files. When I run following code in applicationDidFinishLaunching:

    NSMutableDictionary *springBoardConfiguration;
    springBoardConfiguration = [[NSMutableDictionary alloc] initWithContentsOfFile

    Please Register or Log in to view images

    "/private/var/mobile/Library/Preferences/com.apple.springboard.plist"];
    NSString* lock = [springBoardConfiguration objectForKey

    Please Register or Log in to view images

    "SBAutoLockTime" ];
    if (lock != NULL) {
    NSLog (lock);
    } else {
    NSLog(@"NULL");
    }

    it always returns NULL for me. Could you make simple complete app example how to retrieve keys form such plist files? It seems that my app is not able to retrive this file at all.

    Second thing, I am also not able to run system() command from the code...
    I tried this also in applicationDidFinishLaunching function:
    int out = 0;
    out = system("/usr/bin/plutil -v -1 -i SBAutoLockTime /private/var/mobile/Library/Preferences/com.apple.springboard.plist");
    NSString *log = (NSString *)[NSString stringWithUTF8String: out];
    NSLog(log);

    The command never runs, I always get -1 as a result (it should return 0 as a result when command running is finished successfully).

    Thanks in advance for your help.

    kam20.
  2. andydam123

    andydam123 Member

    Joined:
    Aug 11, 2008
    Messages:
    447
    Likes Received:
    0
    You can't use the "Build & Run" button in XCode with that. When you do that, it basically installs your app like an IPA, inside a "sandbox". You need to build it and SSH it into /Applications so it would be able to access the plist and so you could run system()s. Although I would use NSTask to run the system() instead.

Share This Page