private boolean skipEntry( @NonNull ZipEntry entry, @NonNull String path) { if (entry.isDirectory() || JarFile.MANIFEST_NAME.equals(path) || !validator.validateJarPath(path)) { return true; } // split the path into segments. String[] segments = path.split("/"); // empty path? skip to next entry. if (segments.length == 0) { return true; } return !PackagingUtils.checkFileForApkPackaging(path, false /*allowClassFiles*/); }
/** * Provides an {@link Action} for the archive entry. * @param archivePath the archive entry path in the archive. * @param extractCode whether to extract class files * @return the action to implement. */ @NonNull public static Action getAction(@NonNull String archivePath, boolean extractCode) { // Manifest files are never merged. if (JarFile.MANIFEST_NAME.equals(archivePath)) { return Action.IGNORE; } // split the path into segments. String[] segments = archivePath.split("/"); // empty path? skip to next entry. if (segments.length == 0) { return Action.IGNORE; } return PackagingUtils.checkFileForApkPackaging(archivePath, extractCode) ? Action.COPY : Action.IGNORE; }