在发条从应用程序安装的.zip?发条、应用程序、zip

2023-09-04 06:23:21 作者:?二才叫范、

所以,在我的应用程序,我试着让它使用发条恢复闪存的.zip这种

 运行运行=调用Runtime.getRuntime();
                      进程p = NULL;
                      DataOutputStream类OUT = NULL;
                      尝试{
                          P = run.exec(素);
                          OUT =新DataOutputStream类(p.getOutputStream());
                          out.writeBytes(回声install_zip SD卡:+ clickedFile.toString()+> /缓存/恢复/ extendedcommand \ N);
                          out.writeBytes(重新启动恢复的\ n); //测试
                          了out.flush();

                      }赶上(例外五){
                          Log.e(FLASH,无法重新启动进入恢复模式:,E);
                          e.printStackTrace();

                      }
 

将开机进入恢复但不会闪烁的.zip ..请告诉我错了......哦,如果你在这里需要整个.java文件是:

http://pastebin.com/NpiSLz90

解决方案

  out.writeBytes(回声install_zip(\+ SD卡:+ clickedFile.toString()+ \);+> /缓存/恢复/ extendedcommand \ N);
 
PTPSync下载 PTPSync v1.1.2 官方版

亚洲开发银行命令将如下所示:

  ADB壳
回声install_zip(/ SD卡/ update.zip); > /缓存/恢复/ extendedcommand
 

So in my app Im trying to make it flash a .zip in clockwork recovery using this

 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();

                      }

It will boot into recovery but it will not flash the .zip.. Whats wrong.. oh, and if you need the whole .java file here it is:

http://pastebin.com/NpiSLz90

解决方案

out.writeBytes("echo 'install_zip(\""+ SDCARD:" +clickedFile.toString()+"\");'" +" > /cache/recovery/extendedcommand\n");

adb commands would look like:

adb shell
echo 'install_zip("/sdcard/update.zip");' > /cache/recovery/extendedcommand