修改文件夹权限

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;
}

你可能感兴趣的:(修改文件夹权限)