Android 判斷有無ROOT程式碼


資料來源:https://github.com/zhouguangfu09/Screenshot-non-root-

public boolean isRoot(){
boolean bool = false;

try{
if ((!new File(“/system/bin/su”).exists()) && (!new File(“/system/xbin/su”).exists())){
bool = false;
} else {
bool = true;
}
} catch (Exception e) {
e.printStackTrace();
return bool;
}


 


相關文章