0

today i installed the WSO2 EMM Server as alternative to our existing mdm software. My company is building her own Android Smartphones an Tablet-PCs with Stock Android 4.x.x. I installed the Android EMM-Agent and got the information that my device is rooted.

You are not allowed to enroll because your device is rooted

But there is no root on the phone.

So how can i say the agent that the device is not rooted? Or should i talk to the developers?

Community
  • 1
  • 1
edv
  • 1
  • 2

2 Answers2

1

I have the same issue ...

You can workaround the problem by modifying the source of the agent in order to bypass the root test !

This is on the file Root.java, function isDeviceRooted(), just comment the three lines of test :

public boolean isDeviceRooted() { 
    // if (checkRootMethod3()){return true;}
    // if (checkRootMethod2()){return true;}
    // if (checkRootMethod1()){return true;}
    return false;
}
jpcordeiro
  • 21
  • 1
1

An another way is to analyze the way the agent find that your device is rooted ...

The code is the following :

/**
*Returns true if the OS build tags contains "test-keys"
*/
public boolean checkRootMethod1(){
    String buildTags = android.os.Build.TAGS;

    if (buildTags != null && buildTags.contains("test-keys")) {
        Log.e("ROOT CHECKER", "ROOT METHOD 1");
        return true;
    }
    return false;
}
/**
*Returns true if the device contains SuperUser.apk which is stored into the device in the rooting process
*/
public boolean checkRootMethod2(){
    try {
        File file = new File("/system/app/Superuser.apk");
        if (file.exists()) {
            Log.e("ROOT CHECKER", "ROOT METHOD 2");
            return true;

        }
    } catch (Exception e) { }

    return false;
}
/**
*Executes a shell command (superuser access with su binary) and returns true if the command succeeds
*/
public boolean checkRootMethod3() {
    if (new ExecShell().executeCommand(ExecShell.SHELL_CMD.check_su_binary) != null){
        Log.e("ROOT CHECKER", "ROOT METHOD 3");
        return true;
    }else{
        return false;
    }
}

So, there're 3 checks :

  1. you have the chain "test-keys" on your Android buildTags !
  2. you have the Superuser.apk on your device !
  3. your device is really rooted because you can execute a shell command with superuser access !!!
jpcordeiro
  • 21
  • 1