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 str = Java.use("java.lang.String");
str.getBytes.overload().implementation = function () {
// showStack();
var result = this.getBytes();
var newStr = str.$new(result);
console.log("str.getBytes result: ", newStr);
return result;
}
str.getBytes.overload('java.lang.String').implementation = function (a) {
// showStack();
var result = this.getBytes(a);
var newStr = str.$new(result, a);
console.log("str.getBytes result: ", newStr);
return result;
}
})
重载函数没有hook完整,后续补充;