Hello I'm trying to hook a function that stores variables in some interface, but when I do, nothing happens, there no error, no log.
Function I'm trying to hook looks like this:
package somepackagename.a;
public interface a {
c a(String str, String str2, String str3, String str4);
}
a is the function I'm hooking, and c is an interface, looking something like this:
package somepackagename.b;
public class c extends a {
public String b;
public String c;
public String d;
public String e;
public String f;
}
a here is some random class, looking like this:
package somepackagename.b;
public class a {
public String a;
public a() {
}
public a(String str) {
this.a = str;
}
}
I'm running my standard frida snippet for hooking functions, but for some reason it doesn't get hooked? Just, nothing happens at all, app is working normal, no errors in frida log, no crashes. My frida script:
Java.perform(function () {
let a = Java.use("somepackagename.a.a"); //a.a because it's an interface
//"a" is function name here
a["a"].overload('java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String').implementation = function (str, str2, str3, str4) {
console.log('a is called' + ', ' + 'str: ' + str + ', ' + 'str2: ' + str2 + ', ' + 'str3: ' + str3 + ', ' + 'str4: ' + str4);
let ret = this.a(str, str2, str3, str4);
console.log('a ret value is ' + ret);
return ret;
};
});
By the way, I tried disabling Java optimizations with Java.deoptimizeEverything(); but it didn't help. I also tried hooking this functions on multiple devices and emulators, from Android 5.1 to Android 11.0 and with various frida server versions, but nothing worked. Please help and explain what am I doing wrong here. Thanks!