How to hook into a framework method?

426 Views Asked by At

I want to hook a iOS App and modify some viewController by use Theos/tweak. But these ViewController are defined on dynamic Framework. Is that cause the hook code in Tweak.x be disabled? The code can be build and installed successfully. Just the hook didn't work. How to fix it? Thx.

1

There are 1 best solutions below

0
Xjjjjyn On

You can hook any method in any class, dump the header file for the target class and select any method, the hook would look like below.

%hook ClassName

-(return type)MethodName{
     
    }

%end

Please see this for more info. https://iphonedev.wiki/index.php/Logos#.25hook