更新时间:2023-02-08 19:54:36
为什么在Java中不写?
Why not write in Java?
try{
FileWriter fw = new FileWriter(new File("/sys/devices/enable"));
fw.write('1');
fw.close();
}catch(IOExceprion e){}
如果你真的想调用一个shell,试试这个:
If you really want to invoke a shell, try this:
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(new String[]{"/system/bin/sh", "-c", "echo \"1\" > /sys/devices/enable");
尝试上述任何一种方法之前,可以先
请确保您的设备是植根第一。
Make sure your device is rooted first before trying any of the above mentioned approaches.