Results 1 to 2 of 2

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Editing .plist with a command

  1. #1
    Default Editing .plist with a command
    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 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:

    1- com.mytoggle.toggle1-launch-when-toggle-is-on

    it contains by default:
    Code:
    #!/bin/sh
    rm /var/mobile/Library/Preferences/com.mytoggle.toggle1.flagfile
    echo "the toggle is now OFF" >>/var/mobile/scripty.txt
    so basically this turn the toggle off and writes "the toggle is now OFF" in the 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:


    Code:
    <?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> of the <key>something1</key> with </true> which will turn the button on...

    YES i'm noob but i'd like to make this toggle work!
    Thanks in advance!

  2. #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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •