Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. static int InstallZipFromSD(String path)
  2.     {
  3.         File zip = new File(path);
  4.         String fileName = zip.getName();
  5.        
  6. //      String[] aryPath = zip.getAbsolutePath().split("/");
  7. //      if (aryPath[1] != fileName && aryPath[0] != "sdcard")
  8. //      {
  9.            
  10.             suRun("ln -s " + path + " /cache/recovery/" + fileName);
  11.             zip = new File("/cache/recovery/" + fileName);
  12.            
  13. //      }
  14.         setInstallZip(zip);
  15.         strlist.clear();
  16.         strlist.add("busybox mount -o rw,remount /system");
  17.        
  18.         {
  19.             strlist.add("echo \"#!/system/bin/sh\" > " + fileInit);
  20.            
  21.             strlist.add("echo \"rm " + zip.getAbsolutePath()+ "\" >> " + fileInit);
  22.             strlist.add("echo \"rm " + fileInit + "\" >> " + fileInit);
  23.             strlist.add("chmod 755 " + fileInit);
  24.             strlist.add("reboot recovery");
  25.         }
  26.        
  27.        
  28.         try {
  29.             doCmds(strlist);
  30.         } catch (Exception e) {
  31.             // TODO Auto-generated catch block
  32.             e.printStackTrace();
  33.         }
  34.        
  35.         return 0;
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement