Exemplo n.º 1
0
  public void writeOriginalFiles(ExtFile apkFile, File outDir) throws AndrolibException {
    LOGGER.info("Copying original files...");
    File originalDir = new File(outDir, "original");
    if (!originalDir.exists()) {
      originalDir.mkdirs();
    }

    try {
      Directory in = apkFile.getDirectory();
      if (in.containsFile("AndroidManifest.xml")) {
        in.copyToDir(originalDir, "AndroidManifest.xml");
      }
      if (in.containsDir("META-INF")) {
        in.copyToDir(originalDir, "META-INF");
      }
    } catch (DirectoryException ex) {
      throw new AndrolibException(ex);
    }
  }
Exemplo n.º 2
0
 public void buildCopyOriginalFiles(File appDir) throws AndrolibException {
   if (apkOptions.copyOriginalFiles) {
     File originalDir = new File(appDir, "original");
     if (originalDir.exists()) {
       try {
         LOGGER.info("Copy original files...");
         Directory in = (new ExtFile(originalDir)).getDirectory();
         if (in.containsFile("AndroidManifest.xml")) {
           LOGGER.info("Copy AndroidManifest.xml...");
           in.copyToDir(new File(appDir, APK_DIRNAME), "AndroidManifest.xml");
         }
         if (in.containsDir("META-INF")) {
           LOGGER.info("Copy META-INF...");
           in.copyToDir(new File(appDir, APK_DIRNAME), "META-INF");
         }
       } catch (DirectoryException ex) {
         throw new AndrolibException(ex);
       }
     }
   }
 }