Jump to content

Patcher error


Go to solution Solved by Rook,

25 posts in this topic

Recommended Posts

Posted (edited)

Hi guys

 

I am on iPad Air 9.3.3 with a THEOS from Dhowett.

 

I made a patcher for a game using Flex Converter and a tutorial on the site (in order to show options). Patcher compiles successfully and installs with Error Code 0. However there is no effect on the app itself.

 

I can see the list in preferences but it doesnt effect the game. If i turn it on in flex however, it works

 

Any tips? I already checked for bundle identifiers. They are correct (checked from info.plist)

 

Linked prefbundle and tweak.xm http://www.mediafire.com/file/f979l7tcjlbu80e/TankNations.zip

Updated by Archangel04
Posted (edited)

You didn't link it properly in your pref bundle, post your tweak.xm and your pref plist here

Updated by Crypto
Posted

You didn't link it properly in your pref bundle, post your tweak.xm and your pref plist here

okay

You didn't link it properly in your pref bundle, post your tweak.xm and your pref plist here

done

Posted (edited)

Tweak.xm

 

#define PLIST_PATH @"/var/mobile/Library/PreferenceBundles/tnprefbundle.bundle/tnprefbundle.plist"

 

inline bool GetPrefBool(NSString *key)

{

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

}

 

%hook CurrencyStoreLayer

-(void) boltButtonTouch:(int)arg1 withGemCost:(int)arg2 {

arg1 = 9999999;

arg2 = 1;

if(GetPrefBool(@"kInfiniteBolts")) {

}

return %orig;

}

%end

 

%hook GameRules

-(int) getGemCostForFuel:(int)arg1 {

if(GetPrefBool(@"kFuelrefill")) {

return 1;

}

return %orig;

}

%end

 

%hook GameRules

-(int) getGemCostForTickets:(int)arg1 {

if(GetPrefBool(@"kArenaTickets")) {

return 1;

}

return %orig;

}

%end

 

%hook MakePartsLayer

-(BOOL) canAffordToUsePartMaker:(int)arg1 {

if(GetPrefBool(@"kParts")) {

return TRUE;

}

return %orig;

}

%end

 

%hook TankPartPlayerItem

-(int) quality {

if(GetPrefBool(@"kQuality")) {

return 5;

}

return %orig;

}

%end

 

%hook TankPartData

-(unsigned int) level {

if(GetPrefBool(@"kLevel")) {

return 5;

}

return %orig;

}

%end

 

%hook TankPartData

-(void) setLevel:(int)arg1 {

arg1 = 10;

if(GetPrefBool(@"kLevel")) {

}

return %orig;

}

%end

 

%hook PlayerLevelInfo

-(int) gemReward {

if(GetPrefBool(@"kGem")) {

return 9999;

}

return %orig;

}

%end

 

%hook MissionTemplate

-(int) fuelCost {

if(GetPrefBool(@"kFuelcost")) {

return 1;

}

return %orig;

}

%end

 

%hook TankPartData

-(int) energyCost {

if(GetPrefBool(@"kInfiniteenergy")) {

return 0;

}

return %orig;

}

%end

 

%hook PlayerData

-(BOOL) hasBoltDoubler {

if(GetPrefBool(@"kBoltDoubler")) {

return TRUE;

}

return %orig;

}

%end

 

%hook LootDropItem

-(BOOL) shouldRewardOnDefeat {

if(GetPrefBool(@"kRewardsdefeat")) {

return TRUE;

}

return %orig;

}

%end

 

%hook PlayerLevelInfo

-(BOOL) doesRefillFuel {

if(GetPrefBool(@"krefillsfuel")) {

return TRUE;

}

return %orig;

}

%end

 

%hook PlayerLevelInfo

-(BOOL) doesAddTankSlot {

if(GetPrefBool(@"kaddstankslot")) {

return TRUE;

}

return %orig;

}

%end

 

 

 

Plist

 

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

<string>Tank Nations cheats by iOSGods</string>

</dict>

<dict>

<key>action</key>

<string>apply</string>

<key>cell</key>

<string>PSButtonCell</string>

<key>label</key>

<string>Credits</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kInfiniteBolts</string>

<key>label</key>

<string>Infinite Bolts (buy for 1 gem in shop)</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kFuelrefill</string>

<key>label</key>

<string>Fuel refill costs 1 gem</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kArenaTickets</string>

<key>label</key>

<string>Arena Tickets cost 1 gem</string>

</dict>

<dict>

<key>cell</key>o

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kParts</string>

<key>label</key>

<string>Can purchase parts anytime (ignore error message)</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kQuality</string>

<key>label</key>

<string>All tank parts are 5* quality</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kLevel</string>

<key>label</key>

<string>All tank parts are level 10</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kGem</string>

<key>label</key>

<string>Level up reward is 9999 gems</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kFuelcost</string>

<key>label</key>

<string>Fuel cost 1 for all levels</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kInfiniteenergy</string>

<key>label</key>

<string>Infinite energy (can use weapons/move unlimited times)</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kBoltDoubler</string>

<key>label</key>

<string>DOUBLE bolt rewards (untested)</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kRewardsdefeat</string>

<key>label</key>

<string>Loot even on loss</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>krefillsfuel</string>

<key>label</key>

<string>Levelup refills fuel</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.archangel.tnprefbundle</string>

<key>key</key>

<string>kaddstankslot</string>

<key>label</key>

<string>Levelup adds tank slot (till max)</string>

</dict>

</array>

<key>title</key>

<string>Tank Nations Cheats</string>

</dict>

</plist>

 

 

I already tried PreferenceLoader in first line of Tweak.xm and just Preferences as well

Updated by Archangel04
Posted (edited)

First problem I see :

 

%hook CurrencyStoreLayer

-(void) boltButtonTouch:(int)arg1 withGemCost:(int)arg2 {

arg1 = 9999999;

arg2 = 1;

if(GetPrefBool(@"kInfiniteBolts")) {

}

return %orig;

}

%end

 

 

This : if(GetPrefBool(@"kInfiniteBolts")) { <------- needs to be below your method/class which is : -(void) boltButtonTouch:(int)arg1 withGemCost:(int)arg2 {

 

 

Error 2 : (BOOL) needs to be changed to (bool)

 

 

Your pref plist looks fine

Updated by Crypto
Posted

First problem I see :

%hook CurrencyStoreLayer

-(void) boltButtonTouch:(int)arg1 withGemCost:(int)arg2 {

arg1 = 9999999;

arg2 = 1;

if(GetPrefBool(@"kInfiniteBolts")) {

}

return %orig;

}

%end

This : if(GetPrefBool(@"kInfiniteBolts")) { <------- needs to be below your method/class which is : -(void) boltButtonTouch:(int)arg1 withGemCost:(int)arg2 {

Error 2 : (BOOL) needs to be changed to (bool)

Your pref plist looks fine

Its still not working for the other ones. Even the fuelcost (which works in flex) isnt working here
Posted

Its still not working for the other ones. Even the fuelcost (which works in flex) isnt working here

All of them aren't working? Or a few?

Posted

All of them aren't working? Or a few?

Ive tried everything except the level up and the arena tickers. Fuel isnt working, buy parts isnt working. Then the level hack isnt working

Posted

You didn't give any value to arg1 :

 

 

%hook MakePartsLayer

-(BOOL) canAffordToUsePartMaker:(int)arg1 {

if(GetPrefBool(@"kParts")) {

return TRUE;

}

return %orig;

}

%end

 

 

You didn't give any value to arg1 :

 

%hook GameRules

-(int) getGemCostForTickets:(int)arg1 {

if(GetPrefBool(@"kArenaTickets")) {

return 1;

}

return %orig;

}

%end

 

 

Actually, you didn't return any value to arguments lol I just noticed :p

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
×
  • 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