feat(cli): install and manage plugins from command line

This commit is contained in:
Skylot
2023-05-23 17:53:48 +01:00
parent 67054bda3d
commit 8a67c39279
32 changed files with 1162 additions and 25 deletions
@@ -36,6 +36,7 @@ import jadx.gui.settings.JadxProject;
import jadx.gui.settings.JadxSettings;
import jadx.gui.ui.MainWindow;
import jadx.gui.utils.CacheObject;
import jadx.plugins.tools.JadxExternalPluginsLoader;
import static jadx.core.dex.nodes.ProcessState.GENERATED_AND_UNLOADED;
import static jadx.core.dex.nodes.ProcessState.NOT_LOADED;
@@ -61,6 +62,7 @@ public class JadxWrapper {
synchronized (DECOMPILER_UPDATE_SYNC) {
JadxProject project = getProject();
JadxArgs jadxArgs = getSettings().toJadxArgs();
jadxArgs.setPluginLoader(new JadxExternalPluginsLoader());
project.fillJadxArgs(jadxArgs);
decompiler = new JadxDecompiler(jadxArgs);
@@ -10,6 +10,7 @@ import jadx.api.JadxDecompiler;
import jadx.core.plugins.JadxPluginManager;
import jadx.core.plugins.PluginContext;
import jadx.gui.JadxWrapper;
import jadx.plugins.tools.JadxExternalPluginsLoader;
/**
* Collect options from all plugins.
@@ -32,7 +33,7 @@ public class CollectPluginOptions {
// collect and init not loaded plugins in new context
try (JadxDecompiler decompiler = new JadxDecompiler(new JadxArgs())) {
JadxPluginManager pluginManager = decompiler.getPluginManager();
pluginManager.load();
pluginManager.load(new JadxExternalPluginsLoader());
SortedSet<PluginContext> missingPlugins = new TreeSet<>();
for (PluginContext context : pluginManager.getAllPluginContexts()) {
if (!allPlugins.contains(context)) {