diff --git a/jadx-cli/src/main/java/jadx/cli/clst/ConvertToClsSet.java b/jadx-cli/src/main/java/jadx/cli/clst/ConvertToClsSet.java index d8a021a07..d627e2920 100644 --- a/jadx-cli/src/main/java/jadx/cli/clst/ConvertToClsSet.java +++ b/jadx-cli/src/main/java/jadx/cli/clst/ConvertToClsSet.java @@ -1,6 +1,5 @@ package jadx.cli.clst; -import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -17,7 +16,9 @@ import jadx.api.plugins.JadxPluginManager; import jadx.api.plugins.input.JadxInputPlugin; import jadx.api.plugins.input.data.ILoadResult; import jadx.core.clsp.ClsSet; +import jadx.core.dex.nodes.ClassNode; import jadx.core.dex.nodes.RootNode; +import jadx.core.dex.visitors.SignatureProcessor; /** * Utility class for convert dex or jar to jadx classes set (.jcst) @@ -29,7 +30,7 @@ public class ConvertToClsSet { LOG.info(" "); } - public static void main(String[] args) throws IOException { + public static void main(String[] args) throws Exception { if (args.length < 2) { usage(); System.exit(1); @@ -48,6 +49,13 @@ public class ConvertToClsSet { RootNode root = new RootNode(jadxArgs); root.loadClasses(loadedInputs); + // from pre-decompilation stage run only SignatureProcessor + SignatureProcessor signatureProcessor = new SignatureProcessor(); + signatureProcessor.init(root); + for (ClassNode classNode : root.getClasses()) { + signatureProcessor.visit(classNode); + } + ClsSet set = new ClsSet(root); set.loadFrom(root); set.save(output); diff --git a/jadx-core/build.gradle b/jadx-core/build.gradle index e0cd7f8ef..4bb43839b 100644 --- a/jadx-core/build.gradle +++ b/jadx-core/build.gradle @@ -3,8 +3,6 @@ plugins { } dependencies { - runtimeOnly files('clsp-data/android-29-clst.jar') - api(project(':jadx-plugins:jadx-plugins-api')) implementation 'com.google.code.gson:gson:2.8.6' diff --git a/jadx-core/clsp-data/android-29-clst.jar b/jadx-core/clsp-data/android-29-clst.jar deleted file mode 100644 index 4b29188b1..000000000 Binary files a/jadx-core/clsp-data/android-29-clst.jar and /dev/null differ diff --git a/jadx-core/src/main/java/jadx/core/clsp/ClsSet.java b/jadx-core/src/main/java/jadx/core/clsp/ClsSet.java index ff0363349..9d03fdf90 100644 --- a/jadx-core/src/main/java/jadx/core/clsp/ClsSet.java +++ b/jadx-core/src/main/java/jadx/core/clsp/ClsSet.java @@ -49,7 +49,7 @@ public class ClsSet { private static final String CLST_EXTENSION = ".jcst"; private static final String CLST_FILENAME = "core" + CLST_EXTENSION; - private static final String CLST_PKG_PATH = ClsSet.class.getPackage().getName().replace('.', '/'); + private static final String CLST_PATH = "/clst/" + CLST_FILENAME; private static final String JADX_CLS_SET_HEADER = "jadx-cst"; private static final int VERSION = 3; @@ -78,9 +78,9 @@ public class ClsSet { public void loadFromClstFile() throws IOException, DecodeException { long startTime = System.currentTimeMillis(); - try (InputStream input = getClass().getResourceAsStream(CLST_FILENAME)) { + try (InputStream input = ClsSet.class.getResourceAsStream(CLST_PATH)) { if (input == null) { - throw new JadxRuntimeException("Can't load classpath file: " + CLST_FILENAME); + throw new JadxRuntimeException("Can't load classpath file: " + CLST_PATH); } load(input); } @@ -197,7 +197,7 @@ public class ClsSet { try (ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(path)); ZipInputStream in = new ZipInputStream(Files.newInputStream(temp))) { - String clst = CLST_PKG_PATH + '/' + CLST_FILENAME; + String clst = CLST_PATH; boolean clstReplaced = false; ZipEntry entry = in.getNextEntry(); while (entry != null) { diff --git a/jadx-core/src/main/resources/clst/core.jcst b/jadx-core/src/main/resources/clst/core.jcst new file mode 100644 index 000000000..ac42c5c67 Binary files /dev/null and b/jadx-core/src/main/resources/clst/core.jcst differ