js
复制代码
function HookBase64(){
var base64 = Java.use("android.util.Base64");
base64.decode.overload('java.lang.String', 'int').implementation = function (arg1, arg2){
console.log("Base64 decode('java.lang.String', 'int') 参数--->", bytesToString(arg1), arg2);
var result = this.decode(arg1, arg2);
console.log("Base64 decode('java.lang.String', 'int') return : ", bytesToHex(result));
return result;
}
base64.decode.overload('[B', 'int').implementation = function (arg1, arg2){
console.log("Base64 decode('[B', 'int') 参数--->", bytesToHex(arg1), arg2);
var result = this.decode(arg1, arg2);
console.log("Base64 decode('[B', 'int') return : ", bytesToHex(result));
return result;
}
base64.decode.overload('[B', 'int', 'int', 'int').implementation = function (arg1, arg2, arg3, arg4){
console.log("Base64 decode('[B', 'int', 'int', 'int') 参数--->", bytesToString(arg1), arg2, arg3, arg4);
var result = this.decode(arg1, arg2, arg3, arg4);
console.log("Base64 decode('[B', 'int', 'int', 'int') return : ", bytesToHex(result));
return result;
}
// base64.encode.overload('[B', 'int').implementation = function (arg1, arg2){
// console.log("Base64 encode('[B', 'int') 参数--->", bytesToHex(arg1), arg2);
// var result = this.encode(arg1, arg2);
// console.log("Base64 encode('[B', 'int') return : ", bytesToHex(result));
// return result;
// }
// base64.encode.overload('[B', 'int', 'int', 'int').implementation = function (arg1, arg2, arg3, arg4){
// console.log("Base64 encode('[B', 'int', 'int', 'int') 参数--->", bytesToHex(arg1), arg2, arg3, arg4);
// var result = this.encode(arg1, arg2, arg3, arg4);
// console.log("Base64 encode('[B', 'int', 'int', 'int') return : ", bytesToHex(result));
// return result;
// }
base64.encodeToString.overload('[B', 'int').implementation = function (arg1, arg2) {
console.log("Base64 encodeToString('[B', 'int') 参数--->", bytesToHex(arg1), arg2);
var result = this.encodeToString(arg1, arg2);
console.log("Base64 encodeToString('[B', 'int') return : ", bytesToHex(result));
return result;
}
base64.encodeToString.overload('[B', 'int', 'int', 'int').implementation = function (arg1, arg2) {
console.log("Base64 encodeToString('[B', 'int', 'int', 'int') 参数--->", bytesToHex(arg1), arg2, arg3, arg4);
var result = this.encodeToString(arg1, arg2, arg3, arg4);
console.log("Base64 encodeToString('[B', 'int', 'int', 'int') return : ", bytesToHex(result));
return result;
}
}