A class looks like:
class x {
double f = 200.0d;
public void f() {...}
}
A variable and a function, both called 'f'. In hook function, all this.f is actually pointing to the function, how to access the variable?
Try this._f(). Useful reading Overcoming some gotchas in frida
From the docs https://www.frida.re/docs/examples/android/
Note we use this.m.value = 0 instead of this.m = 0 to set the field鈥檚 value. If there is also a method in this class called m, we need to use this._m.value = 0 to set the value of field m. In general, when looking at the properties of objects it will be necessary to use .value to access the values those fields refer to.
Thanks. this._f works :)
Most helpful comment
From the docs https://www.frida.re/docs/examples/android/