frida / frida-gum

Cross-platform instrumentation and introspection library written in C
https://frida.re
Other
734 stars 242 forks source link

frida not hook the function to bypass root detection #684

Closed rezadtech closed 1 year ago

rezadtech commented 1 year ago

I have been trying to bypass root detection and I think the my code is not working properly.

  1. I reversed engineering the apk with jadx and there is a comment like this: "/ renamed from: com.yan.metric.imp.ob.r2 reason: case insensitive filesystem /". The name of 'r2' in jadx is 'C0612r2'
  2. when I write the code to bypass root detection:

    Java.perform(function(){
    var root1 = Java.use("com.yan.metric.imp.ob.r2");
    
    //com.yan.metric.imp.ob.C0612r2
    
    root1.a.overload().implementation = function(){
    console.log("1");
    return false;
    };
    
    root1.b.overload().implementation = function(){
    console.log("2");
        return false;
    };
    root1.c.overload().implementation = function(){
    console.log("3");
    return false;
    };
    });

    I wrote console.log to check if my code work and no '1', '2', or '3' printed and root is not bypassed.