代码中判断是否是root过的手机

    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;

        }

    }

猜你喜欢

转载自chriszeng87.iteye.com/blog/1872083