Jump to content

Can't get Preference bundle working on theos-jailed app


sm0ke

4 posts in this topic

Recommended Posts

Posted

I am unable to get preference bundle settings working on a theos-jailed application. I am using an iPhone X on 12.2 non jailbroken. Jailed apps with preference bundle from iOSGods work on my phone so the issue is with my code.

I have successfully created a theos-jailed project, added a preference bundle to it. The ipa compiles and i can see the GCPrefs.bundle compile (with root.plist, info.plist and a unix file) in the debug folder however it doesnt get copied into the ipa.

I have manually copied the GCPrefs.bundle containing only the Root.plist into the IPA and i can see the settings in the settings app however my app cant read them.

Any help would be appreciated.

makefile (preference bundle)

ARCHS = arm64

include $(THEOS)/makefiles/common.mk

BUNDLE_NAME = GCPPrefs
GCPPrefs_FILES = GCPPrefsRootListController.m
GCPPrefs_INSTALL_PATH = /Library/PreferenceBundles
GCPPrefs_FRAMEWORKS = UIKit
GCPPrefs_PRIVATE_FRAMEWORKS = Preferences

include $(THEOS_MAKE_PATH)/bundle.mk

internal-stage::
	$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
	$(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/GCPPrefs.plist$(ECHO_END)

 

makefile (theos-jailed app)

MODULES = jailed
ARCHS = arm64
TARGET = iphone:clang:latest:latest
FINALPACKAGE = 1
FOR_RELEASE = 1

include $(THEOS)/makefiles/common.mk

TWEAK_NAME = GolfClashPlus
DISPLAY_NAME = Golf Clash Plus
BUNDLE_ID = com.sm0ke.golfclashplus

GolfClashPlus_FILES = Tweak.xm
GolfClashPlus_IPA = /Users/<USERNAME>/tweaks/Golf Clash v2.33.2.ipa
GolfClashPlus_LDFLAGS += -Wl,-segalign,4000

include $(THEOS_MAKE_PATH)/tweak.mk
SUBPROJECTS += GCPPrefs
include $(THEOS_MAKE_PATH)/aggregate.mk

 

tweak.xm

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.sm0ke.gcpprefs.plist"     //here the name of your .plist (it's stored in the "Resources" folder)
 
inline bool GetPrefBool(NSString *key)
{
    return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}

-(void)applicationDidBecomeActive:(id)arg0 {
    %orig(arg0);

    if(GetPrefBool(@"kGrids")) {    
      //Code i want to run here
	}
}

 

 

Root.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>PreferenceSpecifiers</key>
	<array>
		<dict>
			<key>Type</key>
			<string>PSToggleSwitchSpecifier</string>
			<key>Title</key>
			<string>Grids</string>
			<key>Key</key>
			<string>kGrids</string>
			<key>DefaultValue</key>
			<false/>
			<key>defaults</key>
			<string>com.sm0ke.gcpprefs</string>
		</dict>
		<dict>
			<key>Type</key>
			<string>PSGroupSpecifier</string>
			<key>Title</key>
			<string></string>
		</dict>
	</array>
</dict>
</plist>

 

Posted
On 5/23/2019 at 1:58 AM, sm0ke said:

Anyone? :) 

If you still need help with this, here's an example:

inline bool GetPrefBool(NSString *key) {
    return [[[NSUserDefaults standardUserDefaults] valueForKey:key] boolValue];
}

%hook Coins
- (int)have {
    if(GetPrefBool(@"key1")) {
        return 99999;
    }
        return %orig;
}
%end

Then you will need to place a /AppName.app/Settings.bundle/Root.plist inside the IPA.

Posted
4 hours ago, DADi said:

If you still need help with this, here's an example:


inline bool GetPrefBool(NSString *key) {
    return [[[NSUserDefaults standardUserDefaults] valueForKey:key] boolValue];
}

%hook Coins
- (int)have {
    if(GetPrefBool(@"key1")) {
        return 99999;
    }
        return %orig;
}
%end

Then you will need to place a /AppName.app/Settings.bundle/Root.plist inside the IPA.

I ended up working it out myself.

Needed to use a settings.bundle as you said but then needed to sync the values into the userdefaults.

Thanks for replying though.

Archived

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

  • Our picks

    • Backpacker™ Go! v1.7.6 [ +3 Cheats ] Dice Unlimited
      Modded/Hacked App: Backpacker™ Go! By Qiiwi Games AB
      Bundle ID: com.qiiwi.backpackergo
      iTunes Store Link: https://apps.apple.com/us/app/backpacker-go/id6478389736?uo=4


      Hack Features:
      - ADS NO [ Between Playing ] 
      - Cash Unlimited [ This Hack Linked Other Items - Ticket Exp Etc. Use Only Cash ] Use Another Items Maybe Game Freeze But Works  
      - Dice Unlimited
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 35 replies
    • Backpacker™ Go! v1.7.6 [ +3 Jailed ] Dice Unlimited
      Modded/Hacked App: Backpacker™ Go! By Qiiwi Games AB
      Bundle ID: com.qiiwi.backpackergo
      iTunes Store Link: https://apps.apple.com/us/app/backpacker-go/id6478389736?uo=4



      Hack Features:
      - ADS NO [ Between Playing ] 
      - Cash Unlimited [ This Hack Linked Other Items - Ticket Exp Etc. Use Only Cash ] Use Another Items Maybe Game Freeze But Works  
      - Dice Unlimited 
        • Informative
        • Agree
        • Thanks
        • Like
      • 40 replies
    • Nonogram Crossing Logic Puzzle v1.093.09 [ +3 Cheats ] Currency Max
      Modded/Hacked App: Nonogram Crossing Logic Puzzle By Two Desperados Ltd
      Bundle ID: com.twodesperados.pic.cross.picross.logic
      App Store Link: https://apps.apple.com/us/app/nonogram-crossing-logic-puzzle/id1613958816?uo=4


      🤩 Hack Features

      - Coins
      - Energy
      - Booster
        • Like
      • 11 replies
    • Nonogram Crossing Logic Puzzle v1.093.09 [ +3 Jailed ] Currency Max
      Modded/Hacked App: Nonogram Crossing Logic Puzzle By Two Desperados Ltd
      Bundle ID: com.twodesperados.pic.cross.picross.logic
      App Store Link: https://apps.apple.com/us/app/nonogram-crossing-logic-puzzle/id1613958816?uo=4


      🤩 Hack Features

      - Coins
      - Energy
      - Booster
        • Like
      • 14 replies
    • Cooking Chaos Cooking Games v2.2.0 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Cooking Chaos Cooking Games By Flowmotion Entertainment: Top Free Fun Addictive Cool Games Inc.
      Bundle ID: com.cooking.chaos.restaurant.games
      App Store Link: https://apps.apple.com/us/app/cooking-chaos-cooking-games/id6739048278?uo=4

       
      🤩 Hack Features

      - Gems [ Time Mod Match - Match Time Over Then Show ] Check ScreenShoot
      - Coins [ Tip Reward ] Disable After Get
      - Life
      - Booster + Unlock
        • Like
      • 6 replies
    • Cooking Chaos Cooking Games v2.2.0 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Cooking Chaos Cooking Games By Flowmotion Entertainment: Top Free Fun Addictive Cool Games Inc.
      Bundle ID: com.cooking.chaos.restaurant.games
      App Store Link: https://apps.apple.com/us/app/cooking-chaos-cooking-games/id6739048278?uo=4


      🤩 Hack Features

      - Gems [ Time Mod Match - Match Time Over Then Show ] Check ScreenShoot
      - Coins [ Tip Reward ] Disable After Get
      - Life
      - Booster + Unlock 
        • Thanks
        • Winner
        • Like
      • 7 replies
    • Squad Heroes v5.2 [ +7 Cheats ] Currency Max
      Modded/Hacked App: Squad Heroes By Tapugo FZCO
      Bundle ID: com.tapugo.squadheroes
      App Store Link: https://apps.apple.com/ca/app/squad-heroes/id6748544956?uo=4

      🤩 Hack Features

      - Unlimited Gems
      - Unlimited Gold
      - Unlimited Energy
      - Unlimited Mana
      - Max ATK
      - Max DEF
      - Max ATK Speed
        • Like
      • 8 replies
    • Squad Heroes v5.2 [ +7 Jailed ] Currency Max
      Modded/Hacked App: Squad Heroes By Tapugo FZCO
      Bundle ID: com.tapugo.squadheroes
      App Store Link: https://apps.apple.com/ca/app/squad-heroes/id6748544956?uo=4

      🤩 Hack Features

      - Unlimited Gems
      - Unlimited Gold
      - Unlimited Energy
      - Unlimited Mana
      - Max ATK
      - Max DEF
      - Max ATK Speed
        • Haha
        • Like
      • 6 replies
    • Archer Heroes: Tower Defense v1.0.18 [ +4 Cheats ] Currency Freeze
      Modded/Hacked App: Archer Heroes: Tower Defense By pokoko Studio UG (haftungsbeschraenkt)
      Bundle ID: com.pokokoStudio.ArcherDefense
      App Store Link: https://apps.apple.com/us/app/archer-heroes-tower-defense/id6504802483?uo=4

      🤩 Hack Features

      - Currency Freeze / Buy Energy Only / Before The Battle Disable
      - Resources Freeze / Upgrade Only / Before The Battle Disable
      - Build Tower / No Need Wood
      - DMG
        • Agree
        • Winner
        • Like
      • 4 replies
    • Archer Heroes: Tower Defense v1.0.18 [ +4 Jailed ] Currency Freeze
      Modded/Hacked App: Archer Heroes: Tower Defense By pokoko Studio UG (haftungsbeschraenkt)
      Bundle ID: com.pokokoStudio.ArcherDefense
      App Store Link: https://apps.apple.com/us/app/archer-heroes-tower-defense/id6504802483?uo=4

      🤩 Hack Features

      - Currency Freeze / Buy Energy Only / Before The Battle Disable
      - Resources Freeze / Upgrade Only / Before The Battle Disable
      - Build Tower / No Need Wood
      - DMG
        • Thanks
        • Winner
        • Like
      • 7 replies
    • Zombie Hunter: Shoot or Dead v0.0.2.5 [ +5 Cheats ] Never Die
      Modded/Hacked App: Zombie Hunter: Shoot or Dead By HORUS ENTERTAINMENT COMPANY LIMITED
      Bundle ID: com.horusent.zombie.war
      App Store Link: https://apps.apple.com/ca/app/zombie-hunter-shoot-or-dead/id6746404278?uo=4


      🤩 Hack Features

      - HP

      - Armor

      - M Gun Ammo

      - M Gun DMG

      - M Gun Fire Rate
        • Thanks
        • Like
      • 2 replies
    • Zombie Hunter: Shoot or Dead v0.0.2.5 [ +5 Jailed ] Never Die
      Modded/Hacked App: Zombie Hunter: Shoot or Dead By HORUS ENTERTAINMENT COMPANY LIMITED
      Bundle ID: com.horusent.zombie.war
      App Store Link: https://apps.apple.com/ca/app/zombie-hunter-shoot-or-dead/id6746404278?uo=4 

      🤩 Hack Features

      - HP

      - Armor

      - M Gun Ammo

      - M Gun DMG

      - M Gun Fire Rate
        • Like
      • 2 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