-
Notifications
You must be signed in to change notification settings - Fork 10
/
SwitchConfig_HookUpdate.js
40 lines (34 loc) · 1.21 KB
/
SwitchConfig_HookUpdate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function pass_ssl(){
var ClassName = "com.android.org.conscrypt.Platform";
var Platform = Java.use(ClassName);
var targetMethod = "checkServerTrusted";
var len = Platform[targetMethod].overloads.length;
console.log(len);
for (var i = 0; i < len; ++i) {
Platform[targetMethod].overloads[i].implementation = function () {
console.log("class:", ClassName, "target:", targetMethod, " i:", i, arguments);
};
}
}
// hook强制更新
function hook_update(){
var appUpdateActivity = Java.use("com.huawei.updatesdk.service.otaupdate.AppUpdateActivity");
appUpdateActivity.onCreate.implementation = function (aaa){
console.log("--------hook update--------")
showStacks()
this.finish();
};
}
function main(){
Java.perform(function(){
var SwitchConfig = Java.use('mtopsdk.mtop.global.SwitchConfig')
SwitchConfig.isGlobalSpdySwitchOpen.implementation = function(){
console.log('SwitchConfig')
return false
}
pass_ssl();
hook_update();
})
}
//frida -U com.taobao.taobao -l hook_socker.js
setTimeout(main, 100);