android 打开系统权限错误

如题

代码:
if (!device.canRead() || !device.canWrite()) {
try {
Process su;
su = Runtime.getRuntime().exec("/system/bin/su");
String cmd = "chmod 666 " + device.getAbsolutePath() + "\n"
+ "exit\n";
su.getOutputStream().write(cmd.getBytes());
if ((su.waitFor() != 0) || !device.canRead()
|| !device.canWrite()) {
throw new SecurityException();
}
} catch (Exception e) {
e.printStackTrace();
throw new SecurityException();
}
}

    错误:
    01-01 08:04:19.809  4135  4135 W System.err: java.io.IOException: Error running exec(). Command: [/system/bin/su] Working Directory: null Environment: null

01-01 08:04:19.810 4135 4135 W System.err: at java.lang.ProcessManager.exec(ProcessManager.java:211)

求大神指导

没有root的系统,system 是不能访问的

你需要拿到系统的root,才能进行该操作