23 lines
533 B
Java
23 lines
533 B
Java
package at.sprinternet.mvnoroaming;
|
|
|
|
import java.io.IOException;
|
|
|
|
import android.util.Log;
|
|
|
|
public class ExecuteAsRoot {
|
|
public static boolean exec(String command) {
|
|
try {
|
|
Process process = Runtime.getRuntime().exec(
|
|
new String[] { "su", "-c", command });
|
|
process.waitFor();
|
|
} catch (IOException ex) {
|
|
Log.w("ROOT", "Can't get root access", ex);
|
|
return false;
|
|
} catch (InterruptedException ex) {
|
|
Log.w("ROOT", "Can't get root access", ex);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|