我在 python 中(在 android + frida 环境中)使用以下 javascrip 来挂钩一个方法。
jscode ="""
Java.perform(function () {
console.log("start hook...");
var d =java.use("myapp.okhttp3.internal.f.a");
d.verify.implementation =function(p1, p2){
console.log("ssl unpinning for");
return true;
}
});
"""
这是python文件:
import sys
import os
import threading
import subprocess
import frida
import time
jscode ="""
Java.perform(function () {
console.log("start hook...");
var d =java.use("myapp.okhttp3.internal.f.a");
d.verify.implementation =function(p1, p2){
console.log("ssl unpinning for");
return true;
}
});
"""
os.system('adb forward tcp:27042 tcp:27042')
os.system('adb forward tcp:27043 tcp:27043')
APP_NAME = 'myapp'
device = frida.get_usb_device(1)
pid = device.spawn([APP_NAME])
device.resume(pid)
time.sleep(1)
process = device.attach(pid)
print('success')
script = process.create_script(jscode)
print(pid)
script.load()
print('script loaded')
input()
我的问题是:var d =java.use("myapp.okhttp3.internal.f.a")
找不到类时是否抛出“类未找到异常”,如何查看此异常?我可以使用console.log(java.use("myapp.okhttp3.internal.fa")之类的代码来记录“类未找到异常”吗?