在运用logify.pl /path/to/BaseMsgContentViewController.h > /out/to/Tweak.xm
方法输出tewak文件:
%hook BaseMsgContentViewController
- (id).cxx_construct { %log; id r = %orig; HBLogDebug(@" = %@", r); return r; }
- (void)AsyncSendMessage:(id)arg1 { %log; %orig; }
- (void).cxx_destruct { %log; %orig; }
- (void)BeginPlaying:(id)arg1 FromTouch:(_Bool)arg2 { %log; %orig; }
然后覆盖需要编写的Tweak.xm, 并修改好makefile文件和control后, 最后在pc终端进入项目目录,输入 make package install 命令后:
出现错误:Tweak.xm:2: error: %orig does not make sense outside a method
make[3]: *** [/Users/mac/Desktop/Tweak/wechathongbao/.theos/obj/debug/armv7/Tweak.xm.99cf66c8.o] Error 22
make[2]: *** [/Users/mac/Desktop/Tweak/wechathongbao/.theos/obj/debug/armv7/WeChatHongBao.dylib] Error 2
make[1]: *** [internal-library-all_] Error 2
make: *** [WeChatHongBao.all.tweak.variables] Error 2
该怎么解决?