public void execute(
        int id, final ArrayList<String> files, final String FILE2, final boolean move) {
      if (utils.checkFolder((FILE2), c) == 1) {
        totalBytes = getTotalBytes(files, false);
        for (int i = 0; i < files.size(); i++) {
          HFile f1 = new HFile(files.get(i));

          try {

            if (hash.get(id))
              copyFiles((f1), new HFile(FILE2, f1.getName(), f1.isDirectory()), id, move);
            else {
              stopSelf(id);
            }
          } catch (Exception e) {
            System.out.println("amaze " + e);
            publishResults("" + e, 0, 0, id, 0, 0, false, move);
            stopSelf(id);
          }
        }
        if (move) {
          boolean b = hash.get(id);
          if (b)
            for (String a : files) {
              new HFile(a).delete(c);
            }
        }
        Intent intent = new Intent("loadlist");
        sendBroadcast(intent);
      } else if (rootmode) {
        boolean m = true;
        for (int i = 0; i < files.size(); i++) {
          boolean b =
              RootTools.copyFile(
                  getCommandLineString(files.get(i)), getCommandLineString(FILE2), true, true);
          if (!b && files.get(i).contains("/0/"))
            b =
                RootTools.copyFile(
                    getCommandLineString(files.get(i).replace("/0/", "/legacy/")),
                    getCommandLineString(FILE2),
                    true,
                    true);
          if (!b) m = false;
          utils.scanFile(FILE2 + "/" + new File(files.get(i)).getName(), c);
        }
        if (move && m) {
          new DeleteTask(getContentResolver(), c).execute((files));
        }

        Intent intent = new Intent("loadlist");
        sendBroadcast(intent);

      } else {
        System.out.println("Not Allowed");
      }
    }
示例#2
0
 public void Install_Prev()
     throws InterruptedException, IOException, TimeoutException, RootDeniedException {
   Delete_File();
   RootTools.remount("/system/", "rw");
   RootTools.copyFile(
       this.getExternalFilesDir(null) + "/prev_set.sh", "/system/etc/dreamnarae.sh", true, false);
   CommandCapture command = new CommandCapture(0, "chmod 755 /system/etc/dreamnarae.sh");
   RootTools.getShell(true).add(command).waitForFinish();
   installcomplete();
 }