예제 #1
0
  private void dexLibs() throws Exception {
    int percent = 20;

    for (File jarLib : S.dirLibs.listFiles()) {

      // skip native libs in sub directories
      if (!jarLib.isFile() || !jarLib.getName().endsWith(".jar")) {
        continue;
      }

      // compare hash of jar contents to name of dexed version
      String md5 = Util.getMD5Checksum(jarLib);

      // check if jar is pre-dexed
      File dexLib = new File(S.dirDexedLibs, jarLib.getName().replace(".jar", "-" + md5 + ".jar"));
      System.out.println(dexLib.getName());
      if (!dexLib.exists()) {
        com.android.dx.command.dexer.Main.main(
            new String[] {"--verbose", "--output=" + dexLib.getPath(), jarLib.getPath()});
      }

      percent += 1;
      if (setProgress(percent)) {
        return;
      }
    }
  }
예제 #2
0
 private void dexClasses() throws Exception {
   com.android.dx.command.dexer.Main.main(
       new String[] {"--verbose", "--output=" + S.dexClasses.getPath(), S.dirClasses.getPath()});
 }