private boolean rootCommand(String command)
{
Process process = null;
DataOutputStream os = null;
try
{
process = Runtime.getRuntime().exec("su");
os = new DataOutputStream(process.getOutputStream());
os.writeBytes(command + "\n");
os.writeBytes("exit\n");
os.flush();
process.waitFor();
} catch (Exception e)
{
return false;
}
try
{
if (os != null)
{
os.close();
}
process.destroy();
} catch (Exception e)
{
System.out.println("e-->" + e.getMessage());
return false;
}
return true;
}
执行私有命令利用su
2217

被折叠的 条评论
为什么被折叠?



