Created
May 16, 2011 17:49
-
-
Save angad/974946 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process p; | |
try { | |
p = Runtime.getRuntime().exec("su"); | |
try { | |
p.waitFor(); | |
if (p.exitValue() != 255) { | |
// TODO Code to run on success | |
Log.v("Sample_LIBPCAP_DEBUGGING", "ROOT"); | |
} | |
else { | |
// TODO Code to run on unsuccessful | |
Log.v("Sample_LIBPCAP_DEBUGGING", "NOT ROOT"); | |
} | |
} catch (InterruptedException e) { | |
// TODO Code to run in interrupted exception | |
Log.v("Sample_LIBPCAP_DEBUGGING", "NOT ROOT"); | |
} | |
} | |
catch (IOException e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment