Closed lanchc closed 3 years ago
you can have a look at https://github.com/xindizhiyin2014/JKUBSAspects, it have the operation of class method hook
// #import <objc/message.h> NSString* nameClass = NSStringFromClass(AspectsViewController.class); Class catMetal = objc_getMetaClass([nameClass UTF8String]); [catMetal aspect_hookSelector:@selector(hello) withOptions:AspectPositionAfter usingBlock:^(id aspectInfo){ NSLog(@"hello"); } error:NULL];
if use this method, you can not hook the instance method, it will crash, do you have more solution for hooking class method use Aspects lib, thanks!
thanks,I will try later!
发自我的 iPhone
在 2020年1月15日,上午10:33,Assuner notifications@github.com 写道:
May you can also try Stinger https://github.com/eleme/Stinger
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
you can have a look at https://github.com/xindizhiyin2014/JKUBSAspects, it have the operation of class method hook
照抄一份加前缀有意思?