Jump to content

[Help/Tweak]How to hook the ASIdentifierManager (using NSClassFromString)?


Go to solution Solved by youngzzzzzzz,

7 posts in this topic

Recommended Posts

Posted (edited)

Edited 25/5

it's been solved.

I added the AdSupport framework to the makefile in the tweak project and done.
:)

 

 

I want to change the idfa value (like what PMP doing) and try to write some hooking codes.

//target codes #1

#import <AdSupport/AdSupport.h>
- (NSString *)idfaString {
    
    NSBundle *adSupportBundle = [NSBundle bundleWithPath:@"/System/Library/Frameworks/AdSupport.framework"];
    [adSupportBundle load];
    
    if (adSupportBundle == nil) {
        return @"";
    }
    else{
        
        Class asIdentifierMClass = NSClassFromString(@"ASIdentifierManager");
        
        if(asIdentifierMClass == nil){
            return @"";
        }
        else{
            
            //for no arc
            //ASIdentifierManager *asIM = [[[asIdentifierMClass alloc] init] autorelease];
            //for arc
            ASIdentifierManager *asIM = [[asIdentifierMClass alloc] init];
            
            if (asIM == nil) {
                return @"";
            }
            else{
                
                if(asIM.advertisingTrackingEnabled){
                    return [asIM.advertisingIdentifier UUIDString]; //target value
                }
                else{
                    return [asIM.advertisingIdentifier UUIDString];//target value
                }
            }
        }
    }
}

Tweak.xm


#import <AdSupport/ASIdentifierManager.h>
#import <AdSupport/AdSupport.h>

%hook ASIdentifierManager

-(NSUUID*)advertisingIdentifier
{
    %log;
    NSUUID *x = [[NSUUID alloc] initWithUUIDString:@"11111111-1111-1111-1111-111111111111"];
    return x;
}

%end

unfortunately , it doesnt works.

So I took another try,

//target codes #2

#import <AdSupport/AdSupport.h>
- (NSString *)idfaString {
            ASIdentifierManager *aim = [[ASIdentifierManager alloc] init];
            if (aim != nil) {
                if (aim.isAdvertisingTrackingEnabled) {
                    return [[aim advertisingIdentifier] UUIDString];
                }else{
                    return @"";
                }
            }
    return @"";
}

and it works!

 

I want to know why target codes #1 didn't work and how to make it work.

Updated by youngzzzzzzz
Posted (edited)

I cant help u, im a total newb :(:sad:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

jk,

Im not sure, but i dont see how u can load a Framework as a Bundle, a Bundle requires Info.plist among other things, which framework doesnt have, if not,

You should try NSLogging before returning @"" then checking syslog to see what happened

Updated by RickHaks
Posted

I cant help u, im a total newb :(:sad:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

jk,

Im not sure, but i dont see how u can load a Framework as a Bundle, a Bundle requires Info.plist among other things, which framework doesnt have, if not,

You should try NSLogging before returning @"" then checking syslog to see what happened

 

Mmm..the syslog show:

<Warning>: MS:Warning: nil class argument for selector advertisingIdentifier

I thought it could not hook the function while using the Bundle to new the Class.


Maybe NSUUID is deprecated

But code No.2 works.

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

    • Puzzle & Dragons (English) v22.2.1 Jailed Cheats +2
      Modded/Hacked App: Puzzle & Dragons (English) By GungHo Online Entertainment, INC.
      Bundle ID: jp.gungho.padEN
      iTunes Store Link: https://apps.apple.com/us/app/puzzle-dragons-english/id563474464?uo=4


      Hack Features:
      - God Mode
      - One Hit Kill


      Jailbreak required hack(s): https://iosgods.com/topic/133984-puzzle-dragons-japan-english-cheats-all-versions-3/


      iOS Hack Download Link: https://iosgods.com/topic/135066-puzzle-dragons-english-v1931-jailed-cheats-2/
        • Haha
        • Like
      • 314 replies
    • [ Puzzle & Dragons KR ] 퍼즐앤드래곤 v22.2.1 Jailed Cheats +2
      Modded/Hacked App: 퍼즐앤드래곤 By GungHo Online Entertainment, INC.
      Bundle ID: jp.gungho.padKO
      iTunes Store Link: https://apps.apple.com/kr/app/%ED%8D%BC%EC%A6%90%EC%95%A4%EB%93%9C%EB%9E%98%EA%B3%A4/id588637521?uo=4


      Hack Features:
      - God Mode
      - One Hit Kill


      Jailbreak required hack(s): https://iosgods.com/topic/133984-puzzle-dragons-japan-english-cheats-all-versions-3/


      iOS Hack Download Link: https://iosgods.com/topic/146388-puzzle-dragons-korea-%ED%8D%BC%EC%A6%90%EC%95%A4%EB%93%9C%EB%9E%98%EA%B3%A4-v1920-jailed-cheats-2/
      • 21 replies
    • [ FFBE WoTV Japan ] FFBE幻影戦争 WAR OF THE VISIONS Cheats v12.2.0 +3
      Modded/Hacked App: FFBE幻影戦争 戦略RPG/シミュレーションゲーム By SQUARE ENIX Co., Ltd.
      Bundle ID: com.square-enix.WOTVffbejp
      iTunes Store Link: https://apps.apple.com/jp/app/ffbe%E5%B9%BB%E5%BD%B1%E6%88%A6%E4%BA%89-%E6%88%A6%E7%95%A5rpg-%E3%82%B7%E3%83%9F%E3%83%A5%E3%83%AC%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%B2%E3%83%BC%E3%83%A0/id1443703517?uo=4


      Hack Features:
      - Multiply Attack
      - Multiply Defense
      - Full Map Movement


      iOS Hack Download Link: https://iosgods.com/topic/173484-ffbe-wotv-japan-ffbe%E5%B9%BB%E5%BD%B1%E6%88%A6%E4%BA%89-war-of-the-visions-cheats-v916-3/
      • 96 replies
    • Eatventure v1.38.1 Jailed Cheats +2
      Modded/Hacked App: Eatventure By Lessmore UG haftungsbeschraenkt
      Bundle ID: com.hwqgrhhjfd.idlefastfood
      iTunes Store Link: https://apps.apple.com/us/app/eatventure/id1600871388?uo=4


      Hack Features:
      - Freeze Currencies
      - Free iAP (Turn on inside iOSGods Mod Menu first)


      Jailbreak required hack(s): https://iosgods.com/topic/168170-eatventure-cheats-all-versions-1/


      iOS Hack Download IPA Link: https://iosgods.com/topic/168169-eatventure-v110-jailed-cheats-2/
        • Informative
        • Agree
        • Haha
        • Like
      • 333 replies
    • Cooking Diary Restaurant Game v2.41.0 Jailed Cheats +3
      Modded/Hacked App: Cooking Diary® Restaurant Game by MyTona Pte Ltd
      Bundle ID: com.mytonallc.cookingdiary
      iTunes Store Link: https://apps.apple.com/us/app/cooking-diary-restaurant-game/id1214763610?uo=4&at=1010lce4


      Hack Features:
      - Infinite Currencies (Get some)
      - Freeze Boosters


      iOS Hack Download Link: https://iosgods.com/topic/110310-arm64-cooking-diary-restaurant-game-v1160-3/
        • Like
      • 680 replies
    • Tiny Reaper: Reborn v1.0.3 +4 Jailed Cheats [ God Mode + More ]
      Modded/Hacked App: Tiny Reaper: Reborn By DAERI SOFT
      Bundle ID: com.daerigame.babysasin
      App Store Link: https://apps.apple.com/us/app/tiny-reaper-reborn/id6739761698?uo=4

       


      🤩 Hack Features

      - God Mode
      - One-Hit Kill
      - No Skill Cooldown
      - Dumb Enemies
      • 13 replies
    • Tiny Reaper: Reborn v1.0.3 +4 Cheats [ God Mode + More ]
      Modded/Hacked App: Tiny Reaper: Reborn By DAERI SOFT
      Bundle ID: com.daerigame.babysasin
      App Store Link: https://apps.apple.com/us/app/tiny-reaper-reborn/id6739761698?uo=4

       


      🤩 Hack Features

      - God Mode
      - One-Hit Kill
      - No Skill Cooldown
      - Dumb Enemies
      • 14 replies
    • Brotato v1.3.177 +4 Jailed Cheats [ Damage + More ]
      Modded/Hacked App: Brotato By QI YU SG. PTE. LTD.
      Bundle ID: com.brotato.shooting.survivors.action.games.bullethell.ios
      iTunes Store Link: https://apps.apple.com/us/app/brotato/id6445884925?uo=4

       
       

      🤩 Hack Features

      - Damage Multiplier
      - God Mode
      - Move Speed Multiplier
      - Free In-App Purchases
      • 22 replies
    • Brotato v1.3.177 +4 Cheats [ Damage + More ]
      Modded/Hacked App: Brotato By QI YU SG. PTE. LTD.
      Bundle ID: com.brotato.shooting.survivors.action.games.bullethell.ios
      iTunes Store Link: https://apps.apple.com/us/app/brotato/id6445884925?uo=4

       


      🤩 Hack Features

      - Damage Multiplier
      - God Mode
      - Move Speed Multiplier
      - Free In-App Purchases
      • 6 replies
    • Eterspire - Fantasy MMORPG v53.1 +2 Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: Eterspire - Fantasy MMORPG By Stonehollow Workshop LLC
      Bundle ID: com.stonehollow-workshop.Eterspire
      iTunes Store Link: https://apps.apple.com/us/app/eterspire-fantasy-mmorpg/id1658183817?uo=4

       
       

      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      • 22 replies
    • Eterspire - Fantasy MMORPG v53.1 +2 Cheats [ Damage & Defence ]
      Modded/Hacked App: Eterspire - Fantasy MMORPG By Stonehollow Workshop LLC
      Bundle ID: com.stonehollow-workshop.Eterspire
      iTunes Store Link: https://apps.apple.com/us/app/eterspire-fantasy-mmorpg/id1658183817?uo=4

       
       

      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      • 88 replies
    • Forest Survival - Zombie War v3.9 [+3 Jailed Cheats]
      Modded/Hacked App: Forest Survival - Zombie War By APPWILL COMPANY LTD
      Bundle ID: com.g1.forest.survival
      App Store Link: https://apps.apple.com/us/app/forest-survival-zombie-war/id6450904348?uo=4



      🤩 Hack Features

      - Enemy Can't Attack
      - Add Resources
      - Auto Win
      • 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