就是 import 个 JSPatch.framework
我已经把 JSPatch.framework 拷贝到了 theos 工程目录了。
JSPatch.framework 的指令集
Architectures in the fat file: JSPatch.framework/JSPatch are: armv7 armv7s i386 x86_64 arm64
请问下 makefile 要怎么写?
Tweak.xm
#import <JSPatch/JSPatch.h>
%hook AppDelegate
- (BOOL)application:(id)arg1 didFinishLaunchingWithOptions:(id)arg2{
BOOL supBool = %orig(arg1,arg2);
[%c(JSPatch) startWithAppKey:@"xxxxxxxx"];
[%c(JSPatch) sync];
return supBool;
}
%end
makefile:
THEOS_DEVICE_IP = 192.168.199.240
SDKVERSION=0.1
ARCHS=armv7 arm64
TARGET = iphone:latest:8.0
include theos/makefiles/common.mk
TWEAK_NAME = MyTest
MyTest_FILES = Tweak.xm
MyTest_FRAMEWORKS = UIKit JSPatch
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec "killall -9 MyTestApp"
错误提示
fatal error: 'JSPatch/JSPatch.h'
file not found
#import <JSPatch/JSPatch.h>
^
1 error generated.
1
h4x3rotab 2016-04-26 18:37:21 +08:00 via iPhone
为什么不用 iosod
|
2
qq2511296 OP @h4x3rotab 请问下, iosod 这是什么? iOSOpenDev ?
这个注入的话貌似是可以吧,难道 theos 就不行吗?感觉 iOSOpenDev 调试安装 没 theos 方便 |
5
qq2511296 OP @h4x3rotab 我不知道为什么用 iOSOpenDev 这个直接 install 到手机里 选择 Logos Tweak 或者 CaptainHook Tweak 这 2 个模板,代码是一样的 但是用这 2 个模板直接安装到手机里就是不通过 报一个 error
``` Apr 26 22:36:34 Rickde-iPhone WeChat[11434] <Error>: MS:Error: Invalid CoreFoundationVersion: <CFArray 0x145e05f40 [0x1a1ce2b68]>{type = immutable, count = 0, values = ()} Apr 26 22:36:34 Rickde-iPhone WeChat[11434] <Error>: MS:Error: failure to check xxx.dylib ``` |
6
h4x3rotab 2016-05-05 10:57:51 +08:00
据说是 CaptainHook 的问题,另一个同学换成了 Logos 就好了
|
7
jcyangzh 2017-01-02 20:48:50 +08:00
可以直接复制 jspatch 源代码进去啊.
|