sensepost / objection

📱 objection - runtime mobile exploration
GNU General Public License v3.0
7.33k stars 840 forks source link

How to call the original method of java string? #478

Closed stuven1989 closed 3 years ago

stuven1989 commented 3 years ago

this is question about frida. Can you help me solve it?

for example: 
  java code:
    public void hookTest(String a){}

  frida js code:
    var clazz = Java.use('xxxx');
    clazz['hookTest'].overload('java.lang.String').implemetation = function(a){
         var hash = a.hashCode();
        // or call another java String's method
    }

it take a error, 'hashCode is not function', I know 'a' is javascript's value, not a java's value. I want to call java string's method when function argument is java string, I don't want to modify java string reference, not to create new java string, how do I do it? @leonjza

stuven1989 commented 3 years ago

I already know