How to detect rooting and how to request super access in android programatically -


i need know if device rooted or not , want know how l can request super user access. , again want know if have been granted access. plz tell me if possible. grateful...

try this:

    public static boolean isrooted() {     boolean rooted = false;           string binaryname = "su";          string[] places = {"/sbin/", "/system/bin/", "/system/xbin/", "/data/local/xbin/",                 "/data/local/bin/", "/system/sd/xbin/", "/system/bin/failsafe/", "/data/local/"};          (string : places) {             if (new file(where + binaryname).exists()) {                 rooted = true;                 break;             }         }       return rooted; } 

be careful on emulator running, appears rooted device (you can see code above).

if has been useful you, please vote up


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -