find SU - Android Android OS

Android examples for Android OS:Root

Description

find SU

Demo Code


//package com.java2s;

import java.io.File;

public class Main {
    private static final String SU_PATH = "/system/bin/su";
    private static final String SU_PATH_X = "/system/xbin/su";

    private static boolean findSU() {
        boolean ret = openFile(SU_PATH).exists();
        if (!ret) {
            ret = openFile(SU_PATH_X).exists();
        }/*from  w ww.  j ava2 s . c o m*/
        return ret;
    }

    private static File openFile(String path) {
        return new File(path);
    }
}

Related Tutorials