Jump to content

I'm getting confused on making switches for my patcher


Go to solution Solved by Rook,

8 posts in this topic

Recommended Posts

Posted

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

Posted

Each switch relys on a key. You include the key for each switch made and function in the tweak.xm.

  • Solution
Posted

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>
Posted (edited)

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

 

LOVE YOU GUYS

Updated by Tustin
Posted

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. :)

Posted

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>

Posted

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. :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • SuperStar STARSHIP Cheats v3.24.3 +3
      Modded/Hacked App: SuperStar STARSHIP By Dalcomsoft Inc.
      Bundle ID: com.dalcomsoft.sss
      iTunes Store Link: https://apps.apple.com/us/app/superstar-starship/id1480181152?uo=4


      Hack Features:
      - Never Lose
      - Auto Dance
      - Always S.Perfect


      iOS Hack Download Link: https://iosgods.com/topic/164185-superstar-starship-cheats-v378-3/
      • 127 replies
    • Merge Studio: Fashion Makeover v3.5.0 +50++ Jailed Cheats [ Debug Menu ]
      Modded/Hacked App: Merge Studio: Fashion Makeover By Paxie Games Oyun ve Yazilim Anonim Sirketi
      Bundle ID: com.paxiegames.mergestudio
      iTunes Store Link: https://apps.apple.com/us/app/merge-studio-fashion-makeover/id1615964753?uo=4


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


      Jailbreak required hack(s): [Mod Menu Hack] Merge Studio: Fashion Makeover v2.3.0 +50++ Cheats [ Debug Menu ] - 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/
      • 54 replies
    • Merge Studio: Fashion Makeover v3.5.0 +50++ Cheats [ Debug Menu ]
      Modded/Hacked App: Merge Studio: Fashion Makeover By Paxie Games Oyun ve Yazilim Anonim Sirketi
      Bundle ID: com.paxiegames.mergestudio
      iTunes Store Link: https://apps.apple.com/us/app/merge-studio-fashion-makeover/id1615964753?uo=4


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


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Merge Studio: Fashion Makeover v2.3.0 +50++ Jailed Cheats [ Debug Menu ] - 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/
      • 45 replies
    • Royal Kingdom v17794 +4 Jailed Cheats [ Coins + More ]
      Modded/Hacked App: Royal Kingdom By Dream Games
      Bundle ID: com.dreamgames.royalkingdom
      iTunes Store Link: https://apps.apple.com/ph/app/royal-kingdom/id1606549505
       

      Hack Features:
      - Freeze Coins
      - Freeze Lives
      - Freeze Boosters
      - Freeze Moves


      Jailbreak required hack(s): [Mod Menu Hack] Royal Kingdom v3987 +4 Cheats [ Unlimited Coins ] - 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/
      • 116 replies
    • Royal Kingdom v17794 +4 Cheats [ Coins + More ]
      Modded/Hacked App: Royal Kingdom By Dream Games
      Bundle ID: com.dreamgames.royalkingdom
      iTunes Store Link: https://apps.apple.com/ph/app/royal-kingdom/id1606549505
       

      Hack Features:
      - Freeze Coins
      - Freeze Lives
      - Freeze Boosters
      - Freeze Moves


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Royal Kingdom v3987 +4 Jailed Cheats [ Unlimited Coins ] - 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/
      • 65 replies
    • Duskwood - Detective Story v1.10.17 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Duskwood - Detective Story By Everbyte GmbH
      Bundle ID: com.everbytestudio.interactive.text.chat.story.rpg.cyoa.duskwood
      iTunes Store Link: https://apps.apple.com/us/app/duskwood-detective-story/id1479430106?uo=4


      Hack Features:
      - Unlimited Coins -> Earn or spend some.
      - Unlimited Hearts -> Earn or spend some.
      - Free In-App Purchases -> Toggle via iGMenu.


      Jailbreak required hack(s): [Mod Menu Hack] Duskwood - Detective Story v1.10.14 +3 Cheats [ Unlimited Currencies ] - 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/
      • 54 replies
    • Duskwood - Detective Story v1.10.17 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Duskwood - Detective Story By Everbyte GmbH
      Bundle ID: com.everbytestudio.interactive.text.chat.story.rpg.cyoa.duskwood
      iTunes Store Link: https://apps.apple.com/us/app/duskwood-detective-story/id1479430106?uo=4


      Hack Features:
      - Unlimited Coins -> Earn or spend some.
      - Unlimited Hearts -> Earn or spend some.
      - Free In-App Purchases


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Duskwood - Detective Story v1.10.14 +3 Jailed Cheats [ Unlimited Currencies ] - 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/
      • 22 replies
    • Idle Zombie Miner: Gold Tycoon v2.212.1660 +1++ Jailed Cheat [ Currencies ]
      Modded/Hacked App: Idle Zombie Miner: Gold Tycoon By VISTREX LIMITED
      Bundle ID: com.zombie.idleminertycoon
      iTunes Store Link: https://apps.apple.com/us/app/idle-zombie-miner-gold-tycoon/id6471983323?uo=4


      Hack Features:
      - Unlimited Currencies -> Will increase instead of decrease.


      Jailbreak required hack(s): [Mod Menu Hack] Idle Zombie Miner: Gold Tycoon v2.53.1001 +1++ Cheat [ Unlimited Currencies ] - 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/
      • 81 replies
    • Idle Zombie Miner: Gold Tycoon v2.212.1660 +1++ Cheat [ Currencies ]
      Modded/Hacked App: Idle Zombie Miner: Gold Tycoon By VISTREX LIMITED
      Bundle ID: com.zombie.idleminertycoon
      iTunes Store Link: https://apps.apple.com/us/app/idle-zombie-miner-gold-tycoon/id6471983323?uo=4


      Hack Features:
      - Unlimited Currencies -> Will increase instead of decrease.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Idle Zombie Miner: Gold Tycoon v2.53.1001 +1++ Jailed Cheat [ Unlimited Currencies ] - 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/
      • 58 replies
    • Loot Heroes v1.4.7 +8 Jailed Cheats [ Unlimited Currencies + More ]
      Modded/Hacked App: Loot Heroes: Fantasy RPG Games By BoomBit, Inc.
      Bundle ID: com.bbp.lootheroes
      iTunes Store Link: https://apps.apple.com/us/app/loot-heroes-fantasy-rpg-games/id6642699678?uo=4


      Hack Features:
      - Freeze Currencies
      - Unlimited Currencies [ VIP ]
      - God Mode -> Traps still cause damage.
      - One-Hit Kill
      - All Heroes Unlocked
      - Auto Win [ VIP ]
      - Battle Pass Unlocked [ VIP ]


      Jailbreak required hack(s): [Mod Menu Hack] Loot Heroes v1.1.5 +8 Cheats [ Unlimited Currencies + More ] - 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/
      • 71 replies
    • Loot Heroes v1.4.7 +8 Cheats [ Unlimited Currencies + More ]
      Modded/Hacked App: Loot Heroes By BoomBit, Inc.
      Bundle ID: com.bbp.lootheroes
      iTunes Store Link: https://apps.apple.com/us/app/loot-heroes/id6642699678?uo=4


      Hack Features:
      - Freeze Currencies
      - Unlimited Currencies [ VIP ]
      - God Mode -> Traps still cause damage.
      - One-Hit Kill
      - All Heroes Unlocked
      - Auto Win [ VIP ]
      - Battle Pass Unlocked [ VIP ]


      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/
        • Like
      • 202 replies
    • AltLife - Life Simulator v43 +2 Jailed Cheats [ Unlimited Money ]
      Modded/Hacked App: AltLife - Life Simulator By Mark Benyei
      Bundle ID: com.qmzapps.altlife
      App Store Link: https://apps.apple.com/us/app/altlife-life-simulator/id1567044511?uo=4

       


      🤩 Hack Features

      - Unlimited Money -> Will increase instead of decrease.
      - Premium Enabled
      • 0 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