【发布时间】:2011-06-29 09:07:46
【问题描述】:
所以在我的应用程序中,我试图使用它在发条恢复中闪烁一个 .zip
Runtime run = Runtime.getRuntime();
Process p = null;
DataOutputStream out = null;
try{
p = run.exec("su");
out = new DataOutputStream(p.getOutputStream());
out.writeBytes("echo install_zip SDCARD:" +clickedFile.toString() +" > /cache/recovery/extendedcommand\n");
out.writeBytes("reboot recovery\n"); // testing
out.flush();
}catch(Exception e){
Log.e("FLASH", "Unable to reboot into recovery mode:", e);
e.printStackTrace();
}
它会启动恢复,但不会刷新 .zip.. 有什么问题.. 哦,如果您需要整个 .java 文件,它是:
【问题讨论】:
-
我会尝试用分号将 echo 和 reboot 写在一行上,例如:
echo ... ; reboot ...。这应该保证序列化。