I’m developing an app for jailbroken phones. I’m new to Obj-c. I want to:
-
Read a plist file in /var/mobile/Library/Preferences [specifically com.apple.assistant.plist] (Jailbroken, remember?)
-
Change the string for the key, “Hostname”.
-
Save the plist file.
Then I plan to throw the code in a IBAction and link it to a button in IB.
Does anyone know how to achieve this? Can you post the code for it?
I assume you’re mainly wondering about how to read/write the plist. Here’s an example of doing that:
Edit: If your dictionary (plist) is actually a dictionary of dictionaries, you might use something like this:
The above code should work for any path that user mobile has permission to read and write.