Search in sources :

Example 1 with SignatureProcessor

use of jadx.core.dex.visitors.SignatureProcessor in project jadx by skylot.

the class Jadx method getPreDecompilePassesList.

public static List<IDexTreeVisitor> getPreDecompilePassesList() {
    List<IDexTreeVisitor> passes = new ArrayList<>();
    passes.add(new SignatureProcessor());
    passes.add(new OverrideMethodVisitor());
    passes.add(new RenameVisitor());
    passes.add(new UsageInfoVisitor());
    passes.add(new ProcessAnonymous());
    passes.add(new ProcessMethodsForInline());
    return passes;
}
Also used : IDexTreeVisitor(jadx.core.dex.visitors.IDexTreeVisitor) SignatureProcessor(jadx.core.dex.visitors.SignatureProcessor) UsageInfoVisitor(jadx.core.dex.visitors.usage.UsageInfoVisitor) ProcessMethodsForInline(jadx.core.dex.visitors.ProcessMethodsForInline) ArrayList(java.util.ArrayList) ProcessAnonymous(jadx.core.dex.visitors.ProcessAnonymous) CodeRenameVisitor(jadx.core.dex.visitors.rename.CodeRenameVisitor) RenameVisitor(jadx.core.dex.visitors.rename.RenameVisitor) OverrideMethodVisitor(jadx.core.dex.visitors.OverrideMethodVisitor)

Example 2 with SignatureProcessor

use of jadx.core.dex.visitors.SignatureProcessor in project jadx by skylot.

the class ConvertToClsSet method main.

public static void main(String[] args) throws Exception {
    if (args.length < 2) {
        usage();
        System.exit(1);
    }
    List<Path> inputPaths = Stream.of(args).map(Paths::get).collect(Collectors.toList());
    Path output = inputPaths.remove(0);
    JadxPluginManager pluginManager = new JadxPluginManager();
    pluginManager.load();
    List<ILoadResult> loadedInputs = new ArrayList<>();
    for (JadxInputPlugin inputPlugin : pluginManager.getInputPlugins()) {
        loadedInputs.add(inputPlugin.loadFiles(inputPaths));
    }
    JadxArgs jadxArgs = new JadxArgs();
    jadxArgs.setRenameFlags(EnumSet.noneOf(JadxArgs.RenameEnum.class));
    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);
    LOG.info("Output: {}", output);
    LOG.info("done");
}
Also used : Path(java.nio.file.Path) RootNode(jadx.core.dex.nodes.RootNode) ClassNode(jadx.core.dex.nodes.ClassNode) ClsSet(jadx.core.clsp.ClsSet) ILoadResult(jadx.api.plugins.input.data.ILoadResult) ArrayList(java.util.ArrayList) SignatureProcessor(jadx.core.dex.visitors.SignatureProcessor) JadxPluginManager(jadx.api.plugins.JadxPluginManager) JadxArgs(jadx.api.JadxArgs) JadxInputPlugin(jadx.api.plugins.input.JadxInputPlugin)

Aggregations

SignatureProcessor (jadx.core.dex.visitors.SignatureProcessor)2 ArrayList (java.util.ArrayList)2 JadxArgs (jadx.api.JadxArgs)1 JadxPluginManager (jadx.api.plugins.JadxPluginManager)1 JadxInputPlugin (jadx.api.plugins.input.JadxInputPlugin)1 ILoadResult (jadx.api.plugins.input.data.ILoadResult)1 ClsSet (jadx.core.clsp.ClsSet)1 ClassNode (jadx.core.dex.nodes.ClassNode)1 RootNode (jadx.core.dex.nodes.RootNode)1 IDexTreeVisitor (jadx.core.dex.visitors.IDexTreeVisitor)1 OverrideMethodVisitor (jadx.core.dex.visitors.OverrideMethodVisitor)1 ProcessAnonymous (jadx.core.dex.visitors.ProcessAnonymous)1 ProcessMethodsForInline (jadx.core.dex.visitors.ProcessMethodsForInline)1 CodeRenameVisitor (jadx.core.dex.visitors.rename.CodeRenameVisitor)1 RenameVisitor (jadx.core.dex.visitors.rename.RenameVisitor)1 UsageInfoVisitor (jadx.core.dex.visitors.usage.UsageInfoVisitor)1 Path (java.nio.file.Path)1