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
Post a Comment