Java tutorial
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static String isRoot() { int isRoot = 0; try { if (new File("/system/bin/su").exists() || new File("/system/xbin/su").exists()) { isRoot = 1; } else { isRoot = 0; } } catch (Exception e) { e.printStackTrace(); } return String.valueOf(isRoot); } }