我有以下功能:
public final int getState(@NotNull String str, int i) {
Intrinsics.checkParameterIsNotNull(str, "key");
return PreferenceManager.getDefaultSharedPreferences(this).getInt(str, i);
}
我不知道int
重载时该使用谁的参数。这是我尝试过的:
var myapp= Java.use('com.myapp.AppActivity');
myapp.cleanUi.overload().implementation = function () {
console.log('! Intercepted cleanUi');
}
它抛出一个异常:
{'type': 'error', 'description': "Error: getState(): specified argument types do not match any of:
.overload('java.lang.String', 'java.lang.String')
.overload('java.lang.String', 'float')
.overload('java.lang.String', 'int')", 'stack': "Error: getState(): specified argument types do not match any of:
.overload('java.lang.String', 'java.lang.String')
.overload('java.lang.String', 'float')
.overload('java.lang.String', 'int')
at throwOverloadError (frida/node_modules/frida-java/lib/class-factory.js:2233)
at frida/node_modules/frida-java/lib/class-factory.js:1422
at [anon] (/script1.js:25)
at frida/node_modules/frida-java/lib/vm.js:42
at M (frida/node_modules/frida-java/index.js:347)
at frida/node_modules/frida-java/index.js:299
at frida/node_modules/frida-java/lib/vm.js:42
at frida/node_modules/frida-java/index.js:279
at /script1.js:82", 'fileName': 'frida/node_modules/frida-java/lib/class-factory.js', 'lineNumber': 2233, 'columnNumber': 1}