Android 如何使用代码在/system文件中构建目录和文件
我的应用程序具有root权限,我想使用代码在设备的/system或其他目录中构建目录或文件 我知道常见的java构建文件是:Android 如何使用代码在/system文件中构建目录和文件,android,Android,我的应用程序具有root权限,我想使用代码在设备的/system或其他目录中构建目录或文件 我知道常见的java构建文件是: File file = new File(destFileName); if (file.exists()) { return false; } 如果我可以像上面的代码一样在系统中生成dir?如果我需要在生成文件dir之前使用su命令 Process p = null; p = Runtime.getRuntime().exec("su"); 编辑:我已阅读,但
File file = new File(destFileName);
if (file.exists()) {
return false;
}
如果我可以像上面的代码一样在系统中生成dir?如果我需要在生成文件dir之前使用su命令
Process p = null;
p = Runtime.getRuntime().exec("su");
编辑:我已阅读,但无法使用代码写入:
" hint: use the "adb shell" and check if the upper steps can lead to success (su && remount -o remount,rw /system && touch /system/test)"
mount-oremount、rw/system的命令
mkdir
命令创建dirchown
命令更改所有者用户@pengwang您应该将这些命令传递给
su
binary以作为root用户运行它们