-
Notifications
You must be signed in to change notification settings - Fork 110
进阶用法
刘全有 edited this page May 9, 2020
·
5 revisions
TTPatch
可以通过源码检测,但是还是要谨慎使用. 谨防翻车!!!!
- 【必须】 开关配置请求, 版本号,
JavaScript
不要明文传递,接口中不要有版本更新字样,如update
等等.防止触发2.3.1隐藏功能 - 【可选】
TTPatch
通过服务器开关控制是否需要初始化, TTPatch初始化同时会初始化JSCore引擎,启动时初始化会增加APP启动耗时.
动态执行js前要确保动态库已经加载.
var adbundle = NSBundle.bundleWithPath_("/System/Library/Frameworks/SafariServices.framework");
adbundle.load();
var session = TTPatchURLSession.sharedSession();
var url = "https://yangyangfeng.github.io/TTPatch_Convertor_Flutter/js/JPConvertor.js";
var req = NSURLRequest.requestWithURL_(NSURL.URLWithString_(url));
var dataTask = session.ttpatch__dataTaskWithRequest_completionHandler_(req, block('void,id,id,id', function(data, response, error) {
Utils.log_info(data);
}));
dataTask.resume();