android - Determine phone is rooted -
i trying create app check phone rooted or not, have follow few example, still cant work, please 1 me , or maybe give more example. wondering if there better achieve in recent releases?
import java.io.file; import android.app.alertdialog; import android.content.dialoginterface; import android.support.v7.app.actionbaractivity; public class mainactivity extends actionbaractivity { public boolean isphonerooted() { // check if /system/app/superuser.apk present try { file file = new file("/system/app/superuser.apk"); if (file.exists()) { new alertdialog.builder(this) .seticon(r.drawable.ic_launcher) .settitle("phone rooted") .setpositivebutton("ok", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { // todo auto-generated method stub } }).show(); } else{ new alertdialog.builder(this) .seticon(r.drawable.ic_launcher) .settitle("phone no rooted") .setpositivebutton("ok", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { // todo auto-generated method stub } }).show(); } } catch (throwable e1) { // ignore } return false; } }
Comments
Post a Comment