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 base64 = Java.use("android.util.Base64");
base64.encodeToString.overload('[B', 'int').implementation = function (a, b) {
showStack();
console.log("base64.encodeToString: ", JSON.stringify(a));
var result = this.encodeToString(a, b);
console.log("base64.encodeToString result: ", result)
return result;
}
var base64 = Java.use("android.util.Base64");
base64.encodeToString.overload('[B', 'int', 'int', 'int').implementation = function (a, b,c,d) {
showStack();
console.log("base64.encodeToString: ", JSON.stringify(a));
var result = this.encodeToString(a, b,c,d);
console.log("base64.encodeToString result: ", result)
return result;
}
})
除此之外,还有另几个base64实现方法:
java.net.URLEncoder
java.util.Base64
okio.Base64
okio.ByteString