I am creating a sbsettings switch for a cydia application with an on / off button in the settings.
I downloaded "SBsettings Scripty" from the insanely cydia repo, which is a ready-made switch. I need to write a command to execute when the button is on and off.
There are two files for editing:
1- com.mytoggle.toggle1-launch-when-toggle-is-on
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
This turns off the switch and writes "now the switch is off" in scripty.txt .
Another file, com.mytoggle.toggle1-launch-when-toggle-is-off, does exactly the opposite: turns on the switch and writes "the switch is now on."
I am trying to replace this script; instead of writing text in a scripty.txt file, I want to change the values ββin the application .plist.
This is my plist file:
<?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>
I want to replace </false> with <key>something1</key> by </true> which will enable the button.
source share