我试着为我的定制光盘做更新器。
有我用来闪存更新的代码wihch
private void flashRom() throws IOException {
Process p = Runtime.getRuntime().exec("su");
OutputStream os = p.getOutputStream();
os.write("mkdir -p /cache/recovery/\n".getBytes());
os.write("echo 'boot-recovery' >/cache/recovery/command\n".getBytes());
os.write("reboot recovery\n".getBytes());
os.flush();
}一般说来,效果很好。我的问题发生在一些设备上,其中/sdcard/被引用到/mnt/media/,而getExternalStorageDir()返回相同设备的/storage/emulated/0/..,我用下载管理器将文件保存到request.setDestinationInExternalPublicDir("rom", "update.zip");,在那里我必须保存下载的更新,或者如何确保getExternalStorageDir() (或更多的apporiate方法)返回与/sdcard/在快速引导中相同的路径?
发布于 2015-06-23 10:18:11
我使用了TWRP恢复而不是CWN,它正确地识别路径。
https://stackoverflow.com/questions/30990319
复制相似问题