Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
Thread: Editing .plist with a commandis a discussion within the
iPhone / iPod Touch SDK | Development Discussionforums, a part of the
3rd Party Apps For iPhone | iPod Touchsection;
Hi, What im trying to do is creating an sbsettings toggle for a cydia app with a on/off button in settings I've downloaded the "SBsettings Scripty" from insanely cydia repo...
07-28-2013, 03:59 PM #1Editing .plist with a command
What im trying to do is creating an sbsettings toggle for a cydia app with a on/off button in settings I've downloaded the "SBsettings Scripty" from insanely cydia repo which is a prebuilt toggle all i need to do is write the command to execute when the button is on and off... there are 2 files to edit:
it contains by default:
#!/bin/sh rm /var/mobile/Library/Preferences/com.mytoggle.toggle1.flagfile echo "the toggle is now OFF" >>/var/mobile/scripty.txt
and the other file com.mytoggle.toggle1-launch-when-toggle-is-off does exactly the opposite, turn the toggle ON and writes "the toggle is now ON
so im trying to replace this script of writing text in scripty.txt file to a command that change values in the .plist of the app
this is how my plist file looks like:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>something1</key> <false/> <key>something2</key> <false/> </dict> </plist>
YES i'm noob but i'd like to make this toggle work!
Thanks in advance!
09-05-2013, 05:21 AM #2
For changing the plist, try looking into using plutil; the syntax for it is
plutil -key something1 -value 1 -type bool /path/to/file.plist
You may need to add a dependancy for Erica Utilities in Cydia if this will be a .deb, but may not need it