Skip to content
Guest Big Announcement

IGM not appearing

Featured Replies

Title says it all...

 

Here's the code

 

Tweak.xm

#import <UIKit/UIKit.h>
#import "Hack.h"
#import "HackManager.h"
@class Hack;
@class HackManager;

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

#define CURRENCYHACK 0
#define DUSTHACK 1
#define STARHACK 2
#define SPINHACK 3
#define HEALTHHACK 4
#define STORECOSTHACK 5
#define STATHACK 6

HackManager *hackmanager = nil;

%hook AppDelegate
- (BOOL)application:(id)fp8 didFinishLaunchingWithOptions:(id)fp12
{

    struct AllowedOrientations supportedOrientations = MakeInitialOrientations();
    supportedOrientations.landscapeLeft = true;
    supportedOrientations.landscapeRight = true;
    supportedOrientations.portrait = true;
    supportedOrientations.portraitUpsideDown = true;

    hackmanager = [[HackManager alloc]initWithDictPath:PLIST_PATH hackerName:@"Goggwell Swaginston" coordX:10 coordY:20 andOrientation:UIInterfaceOrientationLandscapeRight andSupportedOrientations:supportedOrientations];

    [hackmanager addHackWithKey:@"kCurrency" andName:@"Currency" andType:NUMBER];
    [hackmanager addHackWithKey:@"kDust" andName:@"Dust" andType:NUMBER];
    [hackmanager addHackWithKey:@"kStar" andName:@"Stars" andType:NUMBER];
    [hackmanager addHackWithKey:@"kSpin" andName:@"Spins" andType:NUMBER];
    [hackmanager addHackWithKey:@"kHealth" andName:@"Health" andType:NUMBER];
    [hackmanager addHackWithKey:@"kStorecost" andName:@"Store Cost" andType:NUMBER];
    [hackmanager addHackWithKey:@"kStat" andName:@"Stats" andType:NUMBER];
    return %orig;
}
%end



%hook Player
-(int) getCoinBalance
{
    return [[hackmanager getHackValueAtIndex:CURRENCYHACK]intValue];
}

-(int) getGemBalance
{
    return [[hackmanager getHackValueAtIndex:CURRENCYHACK]intValue];
}

-(int) getDustBalance
{
    return [[hackmanager getHackValueAtIndex:DUSTHACK]intValue];
}

-(int) starCount
{
    return [[hackmanager getHackValueAtIndex:STARHACK]intValue];
}

-(void) setStarCount:(int)fp8
{
    %orig([[hackmanager getHackValueAtIndex:STARHACK]intValue]);
}

-(int) spinsPurchased
{
    return [[hackmanager getHackValueAtIndex:SPINHACK]intValue];
}

-(void) setSpinsPurchased:(int)fp8
{
    %orig([[hackmanager getHackValueAtIndex:SPINHACK]intValue]);
}
%end

%hook BattleLayer
-(int) playerMaxHealth
{
    return [[hackmanager getHackValueAtIndex:HEALTHHACK]intValue];
}

-(int) playerHealth
{
    return [[hackmanager getHackValueAtIndex:HEALTHHACK]intValue];
}
%end

%hook ShopItem
-(int) cost
{
    return [[hackmanager getHackValueAtIndex:STORECOSTHACK]intValue];
}
%end

%hook AlchemyCard
-(int) getUpgradeStatBonusForRarity
{
    return [[hackmanager getHackValueAtIndex:STATHACK]intValue];
}
%end
Makefile
include theos/makefiles/common.mk

TWEAK_NAME = LittleAlch
LittleAlch_FILES = Tweak.xm HackManager.m Hack.m
LittleAlch_FRAMEWORKS = Foundation UIKit CoreGraphics

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
        install.exec "killall -9 SpringBoard"
SUBPROJECTS += littlealch
include $(THEOS_MAKE_PATH)/aggregate.mk

Updated by Goggwell

  • Author

 

It's the wrong AppDelegate function[/quote

 

Is it just applicationDidFinishLaunching? Or is it LaunchingWithOptions?

  • Author

No %hook AppDelegate in line 19

It's the right AppDelegate. Only one with LaunchingWithOptions

It's the right AppDelegate. Only one with LaunchingWithOptions

But that's not forced to be the same

  • Author

But that's not forced to be the same

Does it matter if your device is arm64?

Mine is

Create an account or sign in to comment

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.