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

    • Lands of Jail v1.0.7 [+1 Jailed Cheats]
      Modded/Hacked App: Lands of Jail By SINGAPORE JUST GAME TECHNOLOGY PTE. LTD.
      Bundle ID: com.justgame.jails.global
      App Store Link: https://apps.apple.com/us/app/lands-of-jail/id6738469826?uo=4



      🤩 Hack Features

      - Enemy Can't Attack (Enable Before Enter the Stage)

      • 0 replies
    • Lands of Jail v1.0.7 [+1 Cheats]
      Modded/Hacked App: Lands of Jail By SINGAPORE JUST GAME TECHNOLOGY PTE. LTD.
      Bundle ID: com.justgame.jails.global
      App Store Link: https://apps.apple.com/us/app/lands-of-jail/id6738469826?uo=4



      🤩 Hack Features

      - Enemy Can't Attack (Enable Before Enter the Stage)
       
      • 0 replies
    • Obsidian Knight RPG v1.97 [+3 Jailed Cheats]
      Modded/Hacked App: Obsidian Knight RPG By ActFirst Games AB
      Bundle ID: com.actfirstgames.obsidianknight
      iTunes Store Link: https://apps.apple.com/us/app/obsidian-knight-rpg/id6505061490?uo=4



      🚀 Hack Features

      - Unlimited Currency
      - God Mode / Never Die
      - High Damage / OHK
        • Informative
        • Winner
        • Like
      • 16 replies
    • Obsidian Knight RPG v1.97 [+3 Cheats]
      Modded/Hacked App: Obsidian Knight RPG By ActFirst Games AB
      Bundle ID: com.actfirstgames.obsidianknight
      iTunes Store Link: https://apps.apple.com/us/app/obsidian-knight-rpg/id6505061490?uo=4

       

      🚀 Hack Features

      - Unlimited Currency
      - God Mode / Never Die
      - High Damage / OHK
        • Agree
        • Haha
        • Winner
        • Like
      • 19 replies
    • Z Survivor: Backpack Shooter v0.59 [+2 Cheats]
      Modded/Hacked App: Z Survivor: Backpack Shooter By Tapped Ltd
      Bundle ID: com.tapped.zsurvivor
      iTunes Store Link: https://apps.apple.com/us/app/z-survivor-backpack-shooter/id6557072922?uo=4



      🤩 Hack Features

      - Debug Menu (Auto Play, Skip Level and more)
      - Never Die
      - Unlimited Resource (Currency, Keys, Blueprints)
        • Thanks
        • Winner
        • Like
      • 5 replies
    • Z Survivor: Backpack Shooter v0.59 [+2 Jailed Cheats]
      Modded/Hacked App: Z Survivor: Backpack Shooter By Tapped Ltd
      Bundle ID: com.tapped.zsurvivor
      iTunes Store Link: https://apps.apple.com/us/app/z-survivor-backpack-shooter/id6557072922?uo=4



      🤩 Hack Features

      - Debug Menu (Auto Play, Skip Level and more)
      - Never Die
      - Unlimited Resource (Currency, Keys, Blueprints)
        • Informative
        • Winner
        • Like
      • 4 replies
    • Kingdom Survivors v1.0720 [+4 Cheats]
      Modded/Hacked App: Kingdom Survivors By a plant standing on a chair Game Studio HB
      Bundle ID: com.DefaultCompany.MonsJacobSurvivorGame
      iTunes Store Link: https://apps.apple.com/us/app/kingdom-survivors/id1662497248?uo=4



      🚀 Hack Features

      - Never Die
      - Gain Exp (Toggle On gives you exp in battle)
      - Unlock All Characters
      - Add Currency
        • Like
      • 16 replies
    • Kingdom Survivors v1.0720 [+4 Jailed Cheats]
      Modded/Hacked App: Kingdom Survivors By a plant standing on a chair Game Studio HB
      Bundle ID: com.DefaultCompany.MonsJacobSurvivorGame
      iTunes Store Link: https://apps.apple.com/us/app/kingdom-survivors/id1662497248?uo=4



      Hack Features:

      - Never Die
      - Gain Exp (Toggle On gives you exp in battle)
      - Unlock All Characters
      - Add Currency

        • Informative
        • Agree
        • Thanks
        • Like
      • 12 replies
    • Dwarf Kingdom - Idle Survival v5.2 Debug Menu [+6 Jailed Cheats]
      Modded/Hacked App: Dwarf Kingdom - Idle Survival By PAPER PIGEON YAZILIM VE OYUN GELISTIRME LIMITED SIRKETI
      Bundle ID: com.PaperPigeon.DwarfKingdom
      iTunes Store Link: https://apps.apple.com/us/app/dwarf-kingdom-idle-survival/id6477745778?uo=4



      🤩 Hack Features

      - Debug Menu (Enable cheat and debug menu will open)
       
        • Informative
        • Like
      • 4 replies
    • Dwarf Kingdom - Idle Survival v5.2 Debug Menu [+6 Cheats]
      Modded/Hacked App: Dwarf Kingdom - Idle Survival By PAPER PIGEON YAZILIM VE OYUN GELISTIRME LIMITED SIRKETI
      Bundle ID: com.PaperPigeon.DwarfKingdom
      iTunes Store Link: https://apps.apple.com/us/app/dwarf-kingdom-idle-survival/id6477745778?uo=4



      🤩 Hack Features

      - Debug Menu (Enable cheat and debug menu will open)
        • Agree
        • Thanks
        • Winner
        • Like
      • 4 replies
    • Cup Quest - Hero's Journey v1.4 [+3 Cheats]
      Modded/Hacked App: Cup Quest - Hero's Journey By DOGSTER TECHNOLOGIES PRIVATE LIMITED
      Bundle ID: com.felicity.cupquest
      App Store Link: https://apps.apple.com/us/app/cup-quest-heros-journey/id6742395137?uo=4



      🤩 Hack Features

      - One Hit Kill
      - Add Currency
      - Unlock Double Speed
        • Like
      • 3 replies
    • Cup Quest - Hero's Journey v1.4 [+3 Jailed Cheats]
      Modded/Hacked App: Cup Quest - Hero's Journey By DOGSTER TECHNOLOGIES PRIVATE LIMITED
      Bundle ID: com.felicity.cupquest
      App Store Link: https://apps.apple.com/us/app/cup-quest-heros-journey/id6742395137?uo=4



      🤩 Hack Features

      - One Hit Kill
      - Add Currency
      - Unlock Double Speed
        • 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