Java.perform(function () {
console.log("start hooking...");
function showstack() {
var log = Java.use("android.util.Log");
var Throwable = Java.use("java.lang.Throwable");
console.log(log.getStackTraceString(Throwable.$new()))
}
var EditTest = Java.use("android.widget.EditText");
EditTest.getText.overload().implementation = function () {
var result=this.getText();
var result1 =Java.cast(result,Java.use("java.lang.CharSequence"));
console.log(result1);
return result;
}
})
光标定在哪儿,就hook那儿的编辑框的内容
对此我们就可以打印堆栈了
另外,本次hook使用到了Frida的强转:
var result1 =Java.cast(result,Java.use(“java.lang.CharSequence”));
将result转换为CharSequence类型