I am working on mobilesubstrate plugins on a JB iPhone. i have created a dylib in xcode for my iphone which builds fine for Device, but when i try to build it for Simulator, it gives me an error "_MSHOOKMESSAGE reference from: blah blah". I have placed all the headers in proper locations. I got libsubstrate from device but that is i think the problem. The libsubstrate from device is not gonna work for Simulator. So my question is how to create a libsubstrate for Simulator?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If you simply need to use MSHookMessageEx
(which superseded MSHookMessage
), you can
#define MSHookMessageEx(class, selector, replacement, result) \
(*(result) = method_setImplementation(class_getInstanceMethod((class), (selector)), (replacement)))
Of course, MSHookMessageEx
in Mobile Substrate is more complex than this, but for testing purpose this is usually enough.
回答2:
http://www.ipodtouchfans.com/forums/showthread.php?t=103558 May be this can help you. Good luck.