Skip to content

Commit 8629e4c

Browse files
committed
tests(cli): use provided plugin loader to not use global plugins in tests
1 parent bd5c6b6 commit 8629e4c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

jadx-cli/src/main/java/jadx/cli/JCommanderWrapper.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import jadx.core.plugins.JadxPluginManager;
2626
import jadx.core.plugins.PluginContext;
2727
import jadx.core.utils.Utils;
28-
import jadx.plugins.tools.JadxExternalPluginsLoader;
2928

3029
public class JCommanderWrapper {
3130
private final JCommander jc;
@@ -275,19 +274,16 @@ private static void addSpaces(StringBuilder str, int count) {
275274

276275
private String appendPluginOptions(int maxNamesLen) {
277276
StringBuilder sb = new StringBuilder();
278-
int k = 1;
279277
// load and init all options plugins to print all options
280278
try (JadxDecompiler decompiler = new JadxDecompiler(argsObj.toJadxArgs())) {
281279
JadxPluginManager pluginManager = decompiler.getPluginManager();
282-
pluginManager.load(new JadxExternalPluginsLoader());
280+
pluginManager.load(decompiler.getArgs().getPluginLoader());
283281
pluginManager.initAll();
284282
try {
285283
for (PluginContext context : pluginManager.getAllPluginContexts()) {
286284
JadxPluginOptions options = context.getOptions();
287285
if (options != null) {
288-
if (appendPlugin(context.getPluginInfo(), context.getOptions(), sb, maxNamesLen)) {
289-
k++;
290-
}
286+
appendPlugin(context.getPluginInfo(), context.getOptions(), sb, maxNamesLen);
291287
}
292288
}
293289
} finally {

0 commit comments

Comments
 (0)