Jump to content

I'm getting confused on making switches for my patcher


Incognite

8 posts in this topic

Recommended Posts

Hi guys! I don't have much explaining to do because the title says most of it. But, I have been spending hours on making my first patcher. I understand 99% of it but the last "1%" is on making the switches. I am a little confused on how it works. So I was wondering if someone could explain a bit on how to do it? Also, what I need to add a switch :) 

 

First Off, this is how my tweak.xm looks like. It's basically ready to go (As always please don't steal it :p )

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.iOSGods.crazykingshacks.plist"

 

inline bool GetPrefBool(NSString *key)

{

return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];

}

 

%hook GameState

 

-(int)total_stars {

if(GetPrefBool(@"kUnlimited Stars")) {

return 999999999;

}

return %orig;

}

 

-(int)total_crowns {       

if(GetPrefBool(@"kUnlimited Crowns")) {

return 999999999;

}

return %orig;

}

 

-(int)energy {

if(GetPrefBool(@"kUnlimited Energy")) {

return 999999999;

}

return %orig;

}

 

-(int)tickets {

if(GetPrefBool(@"kUnlimited Tickets")) {

return 999999999;

}

return %orig;

}

 

-(int)energy_play_cost_level {

if(GetPrefBool(@"kNo Energy Cost")) {

return 0;

}

return %orig;

}

 

-(int)gems {

if(GetPrefBool(@"kUnlimited Gems")) {

return 999999999;

}

return %orig;

}

 

-(int)twinkle_stars {

if(GetPrefBool(@"kUnlimited Twinkle Stars")) {

return 999999999;

}

return %orig;

}

 

%end

 

%hook FlurryUtil

 

+(BOOL)deviceIsJailbroken {

if(GetPrefBool(@"kDisable JB Protection")) {

return FALSE;

}

return %orig;

}

 

+(BOOL)appIsCracked {

if(GetPrefBool(@"kNo Cracked App Protection")) {

return FALSE;

}

return %orig;

}

 

%end

 

%hook Tower

 

-(float)reload_max {

if(GetPrefBool(@"kNo Reload*")) {

return 1;

}

return %orig;

}

 

-(float)card_cooldown {

if(GetPrefBool(@"kNo Card Cooldown*")) {

return 1;

}

return %orig;

}

 

%end

 

%hook TowerUpgradeLevel

 

-(int)cost {

if(GetPrefBool(@"kFree Tower Upgrade")) {

return 0;

}

return %orig;

}

 

%end

 

%hook HeroIcon

 

-(int)revive_cost {

if(GetPrefBool(@"kFree Revives")) {

return 0;

}

return %orig;

}

 

%end

 

%hook Friend

 

-(int)borrow_cost {

if(GetPrefBool(@"kFree Borrowing")) {

return 0;

}

return %orig;

}

 

%end

 

%hook UnitType

 

-(float)health_spawn {

if(GetPrefBool(@"kOne Hit Kill*")) {

return 1;

}

return %orig;

}

 

-(float)health {

if(GetPrefBool(@"kGod Mode")) {

return 999999999;

}

return %orig;

}

 

%end

 

 

 

So yeah It's All Ready! But again, I don't know how to apply all those hacks into switches. I honestly don't know how to explain but I think I know a little. Okay look, so here is the .plist right? Take a look. 

 

Red text will be my comments 

<?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>items</key>

  <array>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

      <key>footerText</key>

      <string>This text will appear under your first switch.</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSSwitchCell</string>

      <key>default</key>

      <false/>

      <key>defaults</key>

      <string>com.iOSGods.crazykingshacks</string>

      <key>key</key>

      <string>kKey</string>

      <key>label</key>

      <string>Switch Text 1</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

      <key>footerText</key>

      <string>This text will appear under your second switch.</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSSwitchCell</string>

      <key>default</key>

      <false/>

      <key>defaults</key>

      <string>com.iOSGods.crazykingshacks</string>

      <key>key</key>

      <string>kGems</string>

      <key>label</key>

      <string>Switch Text 2</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

      <key>footerText</key>

      <string>This text will appear under your third switch.</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSSwitchCell</string>

      <key>default</key>

      <false/>

      <key>defaults</key>

      <string>com.iOSGods.crazykingshacks</string>

      <key>key</key>

      <string>kLives</string>

      <key>label</key>

      <string>Switch Text 3</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

      <key>footerText</key>

      <string>This text will appear under your fourth switch.</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSSwitchCell</string>

      <key>default</key>

      <false/>

      <key>defaults</key>

      <string>com.iOSGods.crazykingshacks</string>

      <key>key</key>

      <string>kLives</string>             /// This got me extremely curious making me think that maybe I replace everything after "k" with my my hacks in tweak.xm like kUnlimited Coins

      <key>label</key>

      <string>Switch Text 4</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSTextCell</string>

      <key>label</key>

      <string>Made by Tustin.</string>

    </dict>

    <dict>

      <key>action</key>

      <string>link</string>

      <key>cell</key>

      <string>PSButtonCell</string>

      <key>icon</key>

      <string>[email protected]</string>

      <key>label</key>

      <string>Visit iOSGods.com</string>

    </dict>

  </array>

  <key>title</key>

  <string>CrazyKingsPatcher</string>

</dict>

</plist>

 

Please if you could help please do as it will be highly appreciated! Or if you need to see anything else tell me as well and I will add it ASAP

Link to comment
Share on other sites

Here's an example of how to add a key to a switch:

 

Tweak.xm:

%hook GameState
 
-(int)total_stars {
if(GetPrefBool(@"kstars")) { //same key as in preference.plist
return 999999999;
}
return %orig;
}

Preference:

<dict>
      <key>cell</key>
      <string>PSGroupCell</string>
      <key>footerText</key>
      <string>Hello! The switch above gives you unlimited Stars!</string>
    </dict>
    <dict>
      <key>cell</key>
      <string>PSSwitchCell</string>
      <key>default</key>
      <false/>
      <key>defaults</key>
      <string>com.iOSGods.crazykingshacks</string>
      <key>key</key>
      <string>kstars</string> //same key used as in tweak.xm
      <key>label</key>
      <string>Unlimited stars!</string> //This is the text next to the switch
    </dict>
Link to comment
Share on other sites

why don't i get notifications when some one replies to my topics  <_< anyways, thanks @DiDA and @Chrizk0   

 

LOVE YOU GUYS

Yes, just like here on the forum

 

You open a tag then you must close the tag for it to work. :)

Link to comment
Share on other sites

Yes, just like here on the forum

 

You open a tag then you must close the tag for it to work. :)

hold on i think i missed something look. i filled out most of them but look at the red text, it does not have the "text under switch" thing 

 

<?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>items</key>

  <array>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

      <key>footerText</key>

      <string>This text will appear under your first switch.</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSSwitchCell</string>

      <key>default</key>

      <false/>

      <key>defaults</key>

      <string>com.iOSGods.crazykingshacks</string>

      <key>key</key>

      <string>kUnlimited Stars</string>

      <key>label</key>

      <string>Unlimited Stars</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

      <key>footerText</key>

      <string>Gives you 999,999,999 stars! But stays at that value.</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSSwitchCell</string>

      <key>default</key>

      <false/>

      <key>defaults</key>

      <string>com.iOSGods.crazykingshacks</string>

      <key>key</key>

      <string>kUnlimited Crowns</string>

      <key>label</key>

      <string>Unlimited Crowns</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

      <key>footerText</key>

      <string>Gives you 999,999,999 crowns! But stays at that value.</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSSwitchCell</string>

      <key>default</key>

      <false/>

      <key>defaults</key>

      <string>com.iOSGods.crazykingshacks</string>

      <key>key</key>

      <string>kUnlimited Energy</string>

      <key>label</key>

      <string>Unlimited Energy</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

      <key>footerText</key>

      <string>Gives you 999,999,999 energy! But stays at that value.</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSSwitchCell</string>

      <key>default</key>

      <false/>

      <key>defaults</key>

      <string>com.iOSGods.crazykingshacks</string>

      <key>key</key>

      <string>kUnlimited Tickets</string>

      <key>label</key>

      <string>Unlimited Tickets</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSGroupCell</string>

    </dict>

    <dict>

      <key>cell</key>

      <string>PSTextCell</string>

      <key>label</key>

      <string>Made by Tustin.</string>

    </dict>

    <dict>

      <key>action</key>

      <string>link</string>

      <key>cell</key>

      <string>PSButtonCell</string>

      <key>icon</key>

      <string>[email protected]</string>

      <key>label</key>

      <string>Visit iOSGods.com</string>

    </dict>

  </array>

  <key>title</key>

  <string>CrazyKingsPatcher</string>

</dict>

</plist>

was i supposed to add another switch? this

 

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>Hello! The switch above gives you unlimited Stars!</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iOSGods.crazykingshacks</string>

<key>key</key>

<string>kstars</string> //same key used as in tweak.xm

<key>label</key>

<string>Unlimited stars!</string> //This is the text next to the switch

</dict>

Link to comment
Share on other sites

You can add it without a problem:

<dict>
      <key>cell</key>
      <string>PSGroupCell</string>
      <key>footerText</key>
      <string>Gives you xxxxxxx Tickets!! But stays at that value.</string>
    </dict>
    <dict>
      <key>cell</key>
      <string>PSSwitchCell</string>
      <key>default</key>
      <false/>
      <key>defaults</key>
      <string>com.iOSGods.crazykingshacks</string>
      <key>key</key>
      <string>kUnlimited Tickets</string>
      <key>label</key>
      <string>Unlimited Tickets</string>
    </dict>

I also suggest you use the keys all lowercase and no spaces because you might make a type and you'll just make it harder for you to make the patcher. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Our picks

    • Gwen’s Getaway v1.5.0 +2 Jailed Cheats [ Unlimited Moves ]
      Modded/Hacked App: Gwen’s Getaway By Ubisoft
      Bundle ID: com.ubisoft.gwens.getaway.cozy.cabin.renovation.puzzle
      iTunes Store Link: https://apps.apple.com/us/app/gwens-getaway/id6450510272?uo=4


      Hack Features:
      - Unlimited Moves -> Will not decrease.
      - Unlimited In-Game Boosters -> Will not decrease.


      Jailbreak required hack(s): [Mod Menu Hack] Gwen’s Getaway v1.4.0 +3 Cheats [ Auto Win ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Like
      • 4 replies
    • Gwen’s Getaway v1.5.0 +3 Cheats [ Auto Win ]
      Modded/Hacked App: Gwen’s Getaway By Ubisoft
      Bundle ID: com.ubisoft.gwens.getaway.cozy.cabin.renovation.puzzle
      iTunes Store Link: https://apps.apple.com/us/app/gwens-getaway/id6450510272?uo=4


      Hack Features:
      - Unlimited Moves -> Will not decrease.
      - Unlimited In-Game Boosters -> Will not decrease.
      - Auto Win


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Gwen’s Getaway v1.4.0 +2 Jailed Cheats [ Unlimited Moves ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 3 replies
    • Polygon Arena: Online Shooter v0.600 +2 Jailed Cheats [ Unlimited Ammo ]
      Modded/Hacked App: Polygon Arena: Online Shooter By SIRIUS GAMES YAZILIM ANONIM SIRKETI
      Bundle ID: com.polygon.arena
      iTunes Store Link: https://apps.apple.com/ph/app/polygon-arena-online-shooter/id6451040780?uo=4


      Hack Features:
      - Unlimited Ammo -> Will not decrease.
      - No Camera Shake


      Jailbreak required hack(s): [Mod Menu Hack] Polygon Arena: Online Shooter v0.365 +5 Cheats [ Damage & Defence ] - Free Jailbroken Cydia Cheats - iOSGods
      VIP version: [No Jailbreak Required] Polygon Arena v0.365 [+5] - No JB - ViP Non-Jailbroken Hacks & Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 12 replies
    • Polygon Arena: Online Shooter v0.600 +5 Cheats [ Damage & Defence ]
      Modded/Hacked App: Polygon Arena: Online Shooter By SIRIUS GAMES YAZILIM ANONIM SIRKETI
      Bundle ID: com.polygon.arena
      iTunes Store Link: https://apps.apple.com/ph/app/polygon-arena-online-shooter/id6451040780?uo=4


      Hack Features:
      - Unlimited Ammo -> Will not decrease.
      - No Camera Shake
      - Damage Multiplier
      - Defence Multiplier
      - Speed Multiplier


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Polygon Arena: Online Shooter v0.365 +2 Jailed Cheats [ Unlimited Ammo ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Haha
        • Like
      • 51 replies
    • Spell Masters v1.3.2 +1 Jailed Cheat [ God Mode ]
      Modded/Hacked App: Spell Masters By Wild Spark Oy
      Bundle ID: com.wildsparkgames.ricochet
      iTunes Store Link: https://apps.apple.com/us/app/spell-masters/id6448452145?uo=4


      Hack Features:
      - God Mode


      Jailbreak required hack(s): [Mod Menu Hack] Spell Masters v1.0.2 +1 Cheat [ Defence Multiplier ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 10 replies
    • Spell Masters v1.3.2 +1 Cheat [ Defence Multiplier ]
      Modded/Hacked App: Spell Masters By Wild Spark Oy
      Bundle ID: com.wildsparkgames.ricochet
      iTunes Store Link: https://apps.apple.com/us/app/spell-masters/id6448452145?uo=4


      Hack Features:
      - Defence Multiplier


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Spell Masters v1.0.2 +1 Jailed Cheat [ God Mode ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Like
      • 28 replies
    • Little Piggy Defense v1.05.30 +1 Jailed Cheat [ God Mode ]
      Modded/Hacked App: Little Piggy Defense By Game Duo Co.,Ltd.
      Bundle ID: net.gameduo.tbd
      iTunes Store Link: https://apps.apple.com/us/app/little-piggy-defense/id6467606457?uo=4


      Hack Features:
      - God Mode


      Jailbreak required hack(s): [Mod Menu Hack] Little Piggy Defense v1.00.11 +3 Cheats [ Damage & Defence ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 40 replies
    • Little Piggy Defense v1.05.30 +3 Cheats [ Damage & Defence ]
      Modded/Hacked App: Little Piggy Defense By Game Duo Co.,Ltd.
      Bundle ID: net.gameduo.tbd
      iTunes Store Link: https://apps.apple.com/us/app/little-piggy-defense/id6467606457?uo=4


      Hack Features:
      - Damage Multiplier
      - Defence Multiplier
      - Tower Defence Multiplier


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Little Piggy Defense v1.00.11 +1 Jailed Cheat [ God Mode ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 68 replies
    • Cookie Clickers v1.63.3 +7 Jailed Cheats [ MEGA HACK ]
      Modded/Hacked App: Cookie Clickers By Tiny Games srl
      Bundle ID: it.junglestudios.cookieclicker
      iTunes Store Link: https://apps.apple.com/us/app/cookie-clickers/id703439482?uo=4


      Hack Features:
      - Cookie Multiplier
      - Unlimited Golden Cookies
      - Unlimited Skip Ad Tokens
      - Unlimited Time Warps
      - Unlimited Chest Keys
      - Free Card Upgrades
      - Free CPS Item Upgrades


      Jailbreak required hack(s): [Mod Menu Hack] Cookie Clickers v1.61.1 +7 Cheats [ MEGA HACK ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Agree
      • 28 replies
    • Cookie Clickers v1.63.3 +7 Cheats [ MEGA HACK ]
      Modded/Hacked App: Cookie Clickers By Tiny Games srl
      Bundle ID: it.junglestudios.cookieclicker
      iTunes Store Link: https://apps.apple.com/us/app/cookie-clickers/id703439482?uo=4


      Hack Features:
      - Cookie Multiplier
      - Unlimited Golden Cookies
      - Unlimited Skip Ad Tokens
      - Unlimited Time Warps
      - Unlimited Chest Keys
      - Free Card Upgrades
      - Free CPS Item Upgrades


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Cookie Clickers v1.61.1 +7 Jailed Cheats [ MEGA HACK ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 23 replies
    • The Oregon Trail: Boom Town v1.36.9 +1++ Jailed Cheats [ Debug Menu ]
      Modded/Hacked App: The Oregon Trail: Boom Town By Tilting Point LLC
      Bundle ID: com.tiltingpoint.oregon.trail.settlers
      iTunes Store Link: https://apps.apple.com/us/app/the-oregon-trail-boom-town/id1598307047
       

      Hack Features:
      - Debug Menu -> Head over to Settings and toggle the Sound button to load up SRDebugger.


      Jailbreak required hack(s): https://iosgods.com/topic/171468-the-oregon-trail-boom-town-v12111-1-cheats-debug-menu/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 41 replies
    • The Oregon Trail: Boom Town v1.36.9 +1++ Cheats [ Debug Menu ]
      Modded/Hacked App: The Oregon Trail: Boom Town By Tilting Point LLC
      Bundle ID: com.tiltingpoint.oregon.trail.settlers
      iTunes Store Link: https://apps.apple.com/us/app/the-oregon-trail-boom-town/id1598307047
       

      Hack Features:
      - Debug Menu -> Head over to Settings and toggle the Sound button to load up SRDebugger.


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 52 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines