find Super User - Android Android OS

Android examples for Android OS:Root

Description

find Super User

Demo Code


//package com.java2s;

import java.io.File;

public class Main {
    private static final String APP_PATH = "/system/app/";

    private static boolean findSuperUser() {
        File apps = new File(APP_PATH);
        String[] apks = apps.list();
        boolean hasSuperUser = false;
        if (apks != null) {
            if (apks.length > 0) {
                for (String apk : apks) {
                    if (apk.toLowerCase().contains("superuser.apk")) {
                        hasSuperUser = true;
                        break;
                    }/*from  w  ww .j  av a2  s. c  o m*/
                }
            }
        }
        return hasSuperUser;
    }
}

Related Tutorials