You need the superuser binary ( su) to run your application as the root user. To run as root, do the following:
Process p = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(p.getOutputStream());
os.writeBytes("yourCommand\n");
os.writeBytes("exit\n");
os.flush();
os.close();
try { p.waitFor(); } catch (InterruptedException e) {}
- su: uid xxxx not allowed, SuperSU.
. fooobar.com/questions/49043/..., . :
. ( stdout), :