diff --git a/jadx-core/src/main/java/jadx/api/JadxDecompiler.java b/jadx-core/src/main/java/jadx/api/JadxDecompiler.java index 10d455181be3c9c2011304e08e6926aaa30229fc..e28931887b86ce3f249c9785849ce83d01985ac2 100644 --- a/jadx-core/src/main/java/jadx/api/JadxDecompiler.java +++ b/jadx-core/src/main/java/jadx/api/JadxDecompiler.java @@ -123,13 +123,16 @@ public final class JadxDecompiler implements Closeable { loadedInputs.clear(); List inputPaths = Utils.collectionMap(args.getInputFiles(), File::toPath); List inputFiles = FileUtils.expandDirs(inputPaths); + long start = System.currentTimeMillis(); for (JadxInputPlugin inputPlugin : pluginManager.getInputPlugins()) { ILoadResult loadResult = inputPlugin.loadFiles(inputFiles); if (loadResult != null && !loadResult.isEmpty()) { loadedInputs.add(loadResult); } } - LOG.debug("Loaded using {} inputs plugin", loadedInputs.size()); + if (LOG.isDebugEnabled()) { + LOG.debug("Loaded using {} inputs plugin in {} ms", loadedInputs.size(), System.currentTimeMillis() - start); + } } private void reset() { diff --git a/jadx-plugins/jadx-java-convert/src/main/java/jadx/plugins/input/javaconvert/JavaConvertLoader.java b/jadx-plugins/jadx-java-convert/src/main/java/jadx/plugins/input/javaconvert/JavaConvertLoader.java index 14dfbdbc4eb7d53b72658ff2da99d63766a48d44..678a12421f146ae78fff70e1ac3f28ce6ba77d12 100644 --- a/jadx-plugins/jadx-java-convert/src/main/java/jadx/plugins/input/javaconvert/JavaConvertLoader.java +++ b/jadx-plugins/jadx-java-convert/src/main/java/jadx/plugins/input/javaconvert/JavaConvertLoader.java @@ -53,6 +53,7 @@ public class JavaConvertLoader { return; } try { + LOG.debug("Converting class files ..."); Path jarFile = Files.createTempFile("jadx-", ".jar"); try (JarOutputStream jo = new JarOutputStream(Files.newOutputStream(jarFile))) { for (Path file : clsFiles) { @@ -64,7 +65,7 @@ public class JavaConvertLoader { } } result.addTempPath(jarFile); - LOG.debug("Packed class files {} into jar {}", clsFiles, jarFile); + LOG.debug("Packed class files {} into jar {}", clsFiles.size(), jarFile); convertJar(result, jarFile); } catch (Exception e) { LOG.error("Error process class files", e); @@ -120,7 +121,7 @@ public class JavaConvertLoader { if (!Objects.equals(repackNeeded, Boolean.TRUE)) { return false; } - + LOG.debug("Repacking jar file: {} ...", path.toAbsolutePath()); Path jarFile = Files.createTempFile("jadx-classes-", ".jar"); result.addTempPath(jarFile); try (JarOutputStream jo = new JarOutputStream(Files.newOutputStream(jarFile))) { @@ -130,6 +131,7 @@ public class JavaConvertLoader { if (entryName.endsWith(".class")) { if (entryName.endsWith("module-info.class") || entryName.startsWith("META-INF/versions/")) { + LOG.debug(" exclude: {}", entryName); return; } byte[] clsFileContent = CommonFileUtils.loadBytes(in); @@ -155,7 +157,7 @@ public class JavaConvertLoader { private static void convertSimpleJar(ConvertResult result, Path path) throws Exception { Path tempDirectory = Files.createTempDirectory("jadx-"); result.addTempPath(tempDirectory); - + LOG.debug("Converting to dex ..."); try { DxConverter.run(path, tempDirectory); } catch (Throwable e) { @@ -166,9 +168,9 @@ public class JavaConvertLoader { LOG.error("D8 convert failed: {}", ex.getMessage()); } } - - LOG.debug("Converted to dex: {}", path.toAbsolutePath()); - result.addConvertedFiles(collectFilesInDir(tempDirectory)); + List dexFiles = collectFilesInDir(tempDirectory); + LOG.debug("Converted {} to dex files: {}", path.toAbsolutePath(), dexFiles.size()); + result.addConvertedFiles(dexFiles); } private static List collectFilesInDir(Path tempDirectory) throws IOException {