Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何从应用程序闪存ROM?_Android_Flash_Recovery_Rom - Fatal编程技术网

Android 如何从应用程序闪存ROM?

Android 如何从应用程序闪存ROM?,android,flash,recovery,rom,Android,Flash,Recovery,Rom,我正在尝试为自定义rom制作更新程序。 我可以通过以下方式从我的应用程序恢复: 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());

我正在尝试为自定义rom制作更新程序。 我可以通过以下方式从我的应用程序恢复:

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();
若我添加下一行,设备将加载到恢复,清除缓存并引导到系统

os.write("echo '--whipe-cache' >>/cache/recovery/command\n".getBytes());
os.write("echo 'reboot' >> /cache/recovery/command\n".getBytes());
是否有执行闪烁的命令?

您可以添加此行:

os.write("echo '--update_package=/sdcard/update.zip' >>/cache/recovery/command\n".getBytes());
以前

 os.write("reboot recovery\n".getBytes());
 os.flush();

如果我添加
os.write(“echo'-whipe cache'>>/cache/recovery/command\n”.getBytes())
重新启动之前,恢复
缓存将被清除,可能有类似的闪烁命令?请尝试以下命令:'--update_package=/sdcard/update.zip',并通知我,如果它有效,我将编辑我的答案!这样就行了,添加该评论作为答案。你能把这些命令列表的链接贴出来吗?