public boolean isRooted(Context context) {
File sufilebin = new File("/data/data/root");
try {
sufilebin.createNewFile();
if (sufilebin.exists()) {
sufilebin.delete();
}
return true;
} catch (IOException e) {
if (getPacakgeInfo(context, "com.noshufou.android.su") != null
|| getPacakgeInfo(context, "com.miui.uac") != null) {
return true;
}
return false;
}
}