'Frida. Pass different agrument type in class method. Error "argument types do not match any of"
I use frida to hook class. In my case HmacBuilder. It has method hmacSha256Hex()
Here what method wants..
hmacSha256Hex('java.lang.String', 'java.lang.String', 'java.lang.String', 'okhttp3.RequestBody', 'java.lang.String')
If i call it and just pass strings for all of them.. like
instance.hmacSha256Hex("none","none","none","none","none"))
frida gives error
argument types do not match any of:\n\t.overload('java.lang.String', 'java.lang.String', 'java.lang.String', 'okhttp3.RequestBody', 'java.lang.String')"
Please advise, how should i call this method properly?(Preferably passing string as okhttp3.RequestBody?
My full inject_code.js
console.log("Script loaded successfully ");
Java.perform(function x() {
//Find an instance of the class and call function.
Java.choose("com.testapp.HmacBuilder", {
onMatch: function (instance) {
console.log("Found instance: " + instance);
console.log("Result of HMAC func: " + instance.hmacSha256Hex("none","none","none","none","none"));
},
onComplete: function () { }
});
});
console.log("Script finished ");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
