Jump to content

Hooking method(s) with a dot class in Flex to Tweak.xm


13 posts in this topic

Recommended Posts

Updated (edited)

In some of the apps, when you try to hack a class with a  "." or a dot function.

nKz8Kcz.png

 

Flex to Tweak.xm Tutorial:

https://iosgods.com/topic/904-tutorialvideo-hack-games-with-flex-and-convert-it-to-deb-tweak/

There are more on this kind, check them out!

 

Let's get started!

In Flex, it would work fine, but when you try to convert flex to tweak.xm and make package.

It gives you an error, "error: cannot use dot operator on a type"

*I don't hack this application, it's an example to solve this issue*

 

Using the tutorial, flex to tweak.xm.

I get this,

%hook OkCupid.OKMessage
-(BOOL)read {
return TRUE;
}
%end

It will throw me an error after "make package" command in terminal.

 

A way around the error template:

%hook AnyRandomNameHere
- (id)description {
    return %orig();
}
%end

%ctor {
    %init(AnyRandomNameHere = objc_getClass("ClassNameWithADotHere"));
}

 

Now, I will convert it in this way.

Final Code:

%hook CupidMess
-(BOOL)read {
return TRUE;
}
%end

%ctor {
    %init(CupidMess = objc_getClass("OkCupid.OKMessage"));
};

I saved the file and use "make package" command and it proceed without error!

 

 

Adding 2 or more dot functions Guide

 

 

 

Regular: Throws error


%hook OkCupid.OKMessage
-(BOOL)read {
return TRUE;
}
%end

%hook OkCupid.OKProfileQuestions
-(BOOL)showUnansweredState {
return FALSE;
}
%end

Wrong way:


%hook CupidMess
-(BOOL)read {
return TRUE;
}
%end

%hook CupidQ
-(BOOL)showUnansweredState {
return FALSE;
}
%end

%ctor {
    %init(CupidMess = objc_getClass("OkCupid.OKMessage"));
    %init(CupidQ = objc_getClass("OkCupid.OKProfileQuestions"));
};

Throws "error: re-%init of %group _ungrouped, first initialized at Tweak.xm:xx"

 

A way around the error template:


%hook AnyRandomNameHere
- (id)description {
    return %orig();
}
%end

%hook AnyRandomNameHere2
- (bool)description {
    return %orig();
}
%end

%ctor {
    %init(AnyRandomNameHere = objc_getClass("ClassNameWithADotHere"), AnyRandomNameHere2 = objc_getClass("ClassNameWithADotHere2"));
  	/* Add a comma "," between both function. 
    AnyRandomNameHere = objc_getClass("ClassNameWithADotHere")
    AnyRandomNameHere2 = objc_getClass("ClassNameWithADotHere2")
  	*/
}

 

Final Code:


%hook CupidMess
-(BOOL)read {
return TRUE;
}
%end

%hook CupidQ
-(BOOL)showUnansweredState {
return FALSE;
}
%end


%ctor {
    %init(CupidMess = objc_getClass("OkCupid.OKMessage"), CupidQ = objc_getClass("OkCupid.OKProfileQuestions"));
};

I saved the file and use "make package" command and it proceed without error!

 

 

Credits:

@Amuyea for this tutorial.

@AnotherLurker for this post regard to this issue in Help & Support.

https://iosgods.com/topic/41019-theos-errorswift/?do=findComment&comment=1340552

 

Updated by Amuyea
  • Like 7
  • Winner 2
  • Thanks 2
  • Agree 1
Posted
4 minutes ago, Ted2 said:

Very nice & well explained tutorial! :) 

Thanks :D

  • Agree 1
Posted (edited)
1 minute ago, xiaov said:

i was looking for method to replace the Class Name last night. Thanks @Amuyea

You are welcome :p

Updated by Amuyea
Posted (edited)

saved my day

P.S.: Do not use tabulator or other white spaces after "%init(", it will interpret it as an illegal classname (using theos git from 30.01.2018). After the first argument you are free to use what you want for pretty printing.

Updated by wallis

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

    • Alien Survivor: Survival Arena v1.38.1 [ +7 Cheats ] Currency Max
      Modded/Hacked App: Alien Survivor: Survival Arena By IMPONILOX LIMITED
      Bundle ID: world.playme.x
      iTunes Store Link: https://apps.apple.com/us/app/alien-survivor-survival-arena/id1669761844?uo=4
       

      🚀 Hack Features

      - ADS NO [ Rewards Free ]

      - Gems [ Achievements Rewards Only One Get ]

      - Energy [ Just Buy ]

      - HP [ Just Equip & Unequip ]

      - ATK [ Just Equip & Unequip ]

      - DEF [ Just Equip & Unequip ]

      - Skill CD [ First Get Then Use ]


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/forum/79-no-jailbreak-section/
      🤖 Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      • 15 replies
    • Alien Survivor: Survival Arena v1.38.1 [ +7 Jailed ] Currency Max
      Modded/Hacked App: Alien Survivor: Survival Arena By IMPONILOX LIMITED
      Bundle ID: world.playme.x
      iTunes Store Link: https://apps.apple.com/us/app/alien-survivor-survival-arena/id1669761844?uo=4


      🚀 Hack Features

      - ADS NO [ Rewards Free ]

      - Gems [ Achievements Rewards Only One Get ]

      - Energy [ Just Buy ]

      - HP [ Just Equip & Unequip ]

      - ATK [ Just Equip & Unequip ]

      - DEF [ Just Equip & Unequip ]

      - Skill CD [ First Get Then Use ]


      🍏 Jailbreak iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      🤖 Modded Android APKs: https://iosgods.com/forum/68-android-section/
      • 26 replies
    • Legend of Survivors V1.2.8 [ +17 Jailed ] Currency Max
      Modded/Hacked App: Legend of Survivors By ABI GLOBAL LTD.
      Bundle ID: com.abi.legendofsurvivors
      iTunes Store Link: https://apps.apple.com/us/app/legend-of-survivors/id6489580730?uo=4


      Hack Features:

      - NO ADS

      - Gems 

      - Gold

      - Energy 

      - Material

      - Health Max [ Equip & Upgrade ]

      - Damage [ Equip & Upgrade ]

      - Skill Cooldown

      - EXP + Level [ Patrol Reward ]

      - Patrol Reward [ Claim Unlimited ]

      - Growth Pack Unlock

      - Growth Pack [ Claim Unlimited ]

      - Monthly card Pack Unlock

      - Monthly card Pack [ Claim Unlimited ]


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 48 replies
    • Legend of Survivors V1.2.8 [ +17 Cheats ] Currency Max
      Modded/Hacked App: Legend of Survivors By ABI GLOBAL LTD.
      Bundle ID: com.abi.legendofsurvivors
      iTunes Store Link: https://apps.apple.com/us/app/legend-of-survivors/id6489580730?uo=4


      Hack Features:
      - IAP Free [ Buy Anything - Gems Gold Ads Premium Packs ]

      - NO ADS

      - Gems 

      - Gold

      - Energy 

      - Material

      - Health Max [ Equip & Upgrade ]

      - Damage [ Equip & Upgrade ]

      - Skill Cooldown

      - EXP + Level [ Patrol Reward ]

      - Patrol Reward [ Claim Unlimited ]

      - Growth Pack Unlock

      - Growth Pack [ Claim Unlimited ]

      - Monthly card Pack Unlock

      - Monthly card Pack [ Claim Unlimited ]
      • 132 replies
    • Kitchen Masters v15.0.0 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Kitchen Masters By Bigger Oyun Yazilim ve Pazarlama Anonim Sirketi
      Bundle ID: com.bigger.kitchenmasters
      iTunes Store Link: https://apps.apple.com/ph/app/kitchen-masters/id6474870266?uo=4


      🤩 Hack Features

      - Coins

      - Cash

      - Lives

      - Tile Cost 0
      • 6 replies
    • Kitchen Masters v15.0.0 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Kitchen Masters By Bigger Oyun Yazilim ve Pazarlama Anonim Sirketi
      Bundle ID: com.bigger.kitchenmasters
      iTunes Store Link: https://apps.apple.com/ph/app/kitchen-masters/id6474870266?uo=4
       

      🤩 Hack Features

      - Coins

      - Cash

      - Lives

      - Tile Cost 0
      • 10 replies
    • Score Masters v2.2 [ +7 Jailed ] Always Win
      Modded/Hacked App: Score Masters By SKYLOFT YAZILIM BILISIM VE TICARET ANONIM SIRKETI
      Bundle ID: com.bh.hypergoal
      iTunes Store Link: https://apps.apple.com/us/app/score-masters/id6473402760?uo=4


      🚀 Hack Features

      - Auto ADS Disable

      - Gems [ Mission Rewards ]

      - Coins [ Mission Rewards ]

      - Player Score 20 Max

      - Always Win Player

      - AI Score 0

      - AI Miss
      • 5 replies
    • Score Masters v2.2 [ +7 Cheats ] Always Win
      Modded/Hacked App: Score Masters By SKYLOFT YAZILIM BILISIM VE TICARET ANONIM SIRKETI
      Bundle ID: com.bh.hypergoal
      iTunes Store Link: https://apps.apple.com/us/app/score-masters/id6473402760?uo=4


      🚀 Hack Features

      - Auto ADS Disable

      - Gems [ Mission Rewards ]

      - Coins [ Mission Rewards ]

      - Player Score 20 Max

      - Always Win Player

      - AI Score 0

      - AI Miss
      • 8 replies
    • Adventure Bay - Farm Games v1.42.14 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Adventure Bay - Farm Games By Gamegos Teknoloji A.S.
      Bundle ID: com.gamegos.adventure.bay.paradise.farm
      iTunes Store Link: https://apps.apple.com/us/app/adventure-bay-farm-games/id1578449819?uo=4
       

      🤩 Hack Features

      - Gems
      - Coins
      - Energy
      - Avatar Unlock
      • 19 replies
    • Adventure Bay - Farm Games v1.42.14 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Adventure Bay - Farm Games By Gamegos Teknoloji A.S.
      Bundle ID: com.gamegos.adventure.bay.paradise.farm
      iTunes Store Link: https://apps.apple.com/us/app/adventure-bay-farm-games/id1578449819?uo=4


      🤩 Hack Features

      - Gems
      - Coins
      - Energy
      - Avatar Unlock
      • 25 replies
    • Disney Solitaire v1.3.0 [ +7 Cheats ] Auto Win
      Modded/Hacked App: Disney Solitaire By SuperPlay LTD
      Bundle ID: com.superplaystudios.disneysolitairedreams
      iTunes Store Link: https://apps.apple.com/ph/app/disney-solitaire/id6475757306?uo=4
       

      🤩 Hack Features

      - Coins [ Win Match ]

      - Task [ No Need Star ]

      - Stars

      - Undo

      - Wild Card

      - Free Ticket

      - Auto Win
      • 15 replies
    • Disney Solitaire v1.3.0 [ +7 Jailed ] Auto Win
      Modded/Hacked App: Disney Solitaire By SuperPlay LTD
      Bundle ID: com.superplaystudios.disneysolitairedreams
      iTunes Store Link: https://apps.apple.com/ph/app/disney-solitaire/id6475757306?uo=4


      🤩 Hack Features

      - Coins [ Win Match ]

      - Task [ No Need Star ]

      - Stars

      - Undo

      - Wild Card

      - Free Ticket

      - Auto Win
      • 21 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