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

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>

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

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>

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

Archived

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

  • Our picks

    • My Talking Tom Friends Cheats v3.9.2 +2
      Modded/Hacked App: My Talking Tom Friends by Outfit7 Limited
      Bundle ID: com.outfit7.mytalkingtomfriends
      iTunes Store Link: https://apps.apple.com/us/app/my-talking-tom-friends/id1473424857?uo=4&at=1010lce4


      Hack Features:
      - Infinite Coin
      - No Ads


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/128377-arm64-my-talking-tom-friends-v1012-jailed-cheats-2/


      iOS Hack Download Link: https://iosgods.com/topic/128376-arm64-my-talking-tom-friends-cheats-all-versions-2/
        • Informative
        • Like
      • 140 replies
    • Modern Warships Cheats v0.87.3 +7
      Modded/Hacked App: Modern Warships By Sergiy Petrov
      Bundle ID: com.Shooter.ModernWarships
      iTunes Store Link: https://apps.apple.com/us/app/modern-warships/id1541751298?uo=4


      Hack Features:
      - Multiply Attack
      - Multiply Defense
      - Infinite Ammo
      - No Reload
      - Freeze Boosters
      - Free Subscription?
       + 10% EXP
       + 50% Cash + Gold


      iOS Hack Download Link: https://iosgods.com/topic/146309-modern-warships-cheats-v0450-6/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,212 replies
    • PunBall Cheats v5.6.0 +2
      Modded/Hacked App: PunBall By HABBY PTE. LTD.
      Bundle ID: com.habby.punball
      iTunes Store Link: https://apps.apple.com/us/app/punball/id1585781366?uo=4


      Hack Features:
      - Dumb Enemies
      - One Hit Kill


      iOS Hack Download Link: https://iosgods.com/topic/151406-punball-cheats-v100-2/
        • Informative
        • Haha
        • Like
      • 662 replies
    • Matchington Mansion v1.172.0 Jailed Cheats +3
      Modded/Hacked App: Matchington Mansion By Magic Tavern, Inc.
      Bundle ID: com.matchington.mansion
      iTunes Store Link: https://apps.apple.com/us/app/matchington-mansion/id1216575026?uo=4


      Hack Features:
      - Infinite Moves
      - Infinite Booster
      - Infinite Lives
       


      Jailbreak required hack(s): https://iosgods.com/topic/75127-arm64-matchington-mansion-cheats-all-versions-5/#


      Hack Download Link: https://iosgods.com/topic/75130-arm64-matchington-mansion-v1970-jailed-cheats-3/
        • Agree
        • Thanks
        • Like
      • 620 replies
    • [ FREE ] The Wolf: Online RPG Simulator v3.6.1 +1++ Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: The Wolf: Online RPG Simulator By SWIFT APPS SP Z O O SPOLKA KOMANDYTOWA
      Bundle ID: com.swiftappskom.thewolfrpg
      iTunes Store Link: https://apps.apple.com/us/app/the-wolf-online-rpg-simulator/id1189578604?uo=4


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


      Jailbreak required hack(s): [Mod Menu Hack] [ FREE ] The Wolf: Online RPG Simulator v3.4.0 +1++ 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/
        • Agree
        • Winner
      • 78 replies
    • [ FREE ] The Wolf: Online RPG Simulator v3.6.0 +1++ Cheats [ Unlimited Currencies ]
      Modded/Hacked App: The Wolf: Online RPG Simulator By SWIFT APPS SP Z O O SPOLKA KOMANDYTOWA
      Bundle ID: com.swiftappskom.thewolfrpg
      iTunes Store Link: https://apps.apple.com/us/app/the-wolf-online-rpg-simulator/id1189578604?uo=4


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


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] [ FREE ] The Wolf: Online RPG Simulator v3.4.0 +1++ 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/
        • Haha
        • Winner
      • 59 replies
    • Hunter Assassin 2 v1.137 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Hunter Assassin 2 By RUBY OYUN VE YAZILIM DANISMANLIK SANAYI TICARET ANONIM SIRKETI
      Bundle ID: com.rubygames.hunterassassin2
      iTunes Store Link: https://apps.apple.com/us/app/hunter-assassin-2/id1544743032?uo=4


      Hack Features:
      - Unlimited Coins -> Earn some in a specific way. This could be by levelling up, quitting the game or daily rewards.
      - Unlimited Gems -> Earn some in a specific way. This could be by levelling up, daily rewards or spinning the wheel.
      - Unlimited Energy -> Earn some in a specific way. This could be by levelling up.

      Note  

      - No I can't hack ads. Either buy to disable or use an ad-blocker?
      - In order for these features to work, you must see the value hacked. If the value is not hacked, then it won't work. Examples below.


      Jailbreak required hack(s): [Mod Menu Hack] Hunter Assassin 2 v1.134 +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/
      • 11 replies
    • [ VIP ] The Wolf: Online RPG Simulator v3.6.1 +1++ Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: The Wolf: Online RPG Simulator By Swift Apps sp. z o.o. sp. kom.
      Bundle ID: com.swiftappskom.thewolfrpg
      iTunes Store Link: https://apps.apple.com/us/app/the-wolf-online-rpg-simulator/id1189578604
       

      Hack Features:
      - Unlimited Currencies -> Spend some.


      Jailbreak required hack(s): [Mod Menu Hack] [ VIP ] The Wolf: Online RPG Simulator v3.4.0 +1++ Cheats [ Unlimited Currencies ] - ViP 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/
        • Informative
        • Agree
        • Haha
        • Winner
        • Like
      • 151 replies
    • [ VIP ] The Wolf: Online RPG Simulator v3.6.1 +1++ Cheats [ Unlimited Currencies ]
      Modded/Hacked App: The Wolf: Online RPG Simulator By Swift Apps sp. z o.o. sp. kom.
      Bundle ID: com.swiftappskom.thewolfrpg
      iTunes Store Link: https://apps.apple.com/us/app/the-wolf-online-rpg-simulator/id1189578604
       

      Hack Features:
      - Unlimited Currencies -> Spend some.


      Non-Jailbroken & No Jailbreak required hack(s): [No Jailbreak Required] The Wolf: Online RPG Simulator v3.3.1 +1++ Jailed Cheat [ Free Shopping ] - 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/
        • Informative
        • Like
      • 291 replies
    • Business Empire: RichMan v1.20.05 +2 Jailed Cheats [ Unlimited Money ]
      Modded/Hacked App: Business Empire: RichMan By NewPubCo, Inc
      Bundle ID: com.xentech.empire
      iTunes Store Link: https://apps.apple.com/us/app/business-empire-richman/id6451208928?uo=4


      Hack Features:
      - Unlimited Money -> Will increase instead of decrease.
      - No Ads


      Jailbreak required hack(s): [Mod Menu Hack] Business Empire: RichMan v1.12.12 +2 Cheats [ Unlimited Money ] - 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/
        • Informative
        • Agree
        • Winner
        • Like
      • 172 replies
    • Business Empire: RichMan v1.20.05 +2 Cheats [ Unlimited Money ]
      Modded/Hacked App: Business Empire: RichMan By NewPubCo, Inc
      Bundle ID: com.xentech.empire
      iTunes Store Link: https://apps.apple.com/us/app/business-empire-richman/id6451208928?uo=4


      Hack Features:
      - Unlimited Money -> Will increase instead of decrease.
      -- No Ads


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Business Empire: RichMan v1.12.12 +2 Jailed Cheats [ Unlimited Money ] - 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/
      • 54 replies
    • Hunter Assassin 2 v1.137 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Hunter Assassin 2 By RUBY OYUN VE YAZILIM DANISMANLIK SANAYI TICARET ANONIM SIRKETI
      Bundle ID: com.rubygames.hunterassassin2
      iTunes Store Link: https://apps.apple.com/us/app/hunter-assassin-2/id1544743032?uo=4


      Hack Features:
      - Unlimited Coins -> Earn some in a specific way. This could be by levelling up, quitting the game or daily rewards.
      - Unlimited Gems -> Earn some in a specific way. This could be by levelling up, daily rewards or spinning the wheel.
      - Unlimited Energy -> Earn some in a specific way. This could be by levelling up.

      Note  

      - No I can't hack ads. Either buy to disable or use an ad-blocker?
      - In order for these features to work, you must see the value hacked. If the value is not hacked, then it won't work. Examples below.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Hunter Assassin 2 v1.134 +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/
      • 6 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