use of jadx.api.plugins.options.OptionDescription in project jadx by skylot.
the class DexInputOptions method buildOptionsDescriptions.
public List<OptionDescription> buildOptionsDescriptions() {
List<OptionDescription> list = new ArrayList<>(1);
list.add(new JadxOptionDescription(VERIFY_CHECKSUM_OPT, "Verify dex file checksum before load", "yes", Arrays.asList("yes", "no")));
return list;
}
use of jadx.api.plugins.options.OptionDescription in project jadx by skylot.
the class JadxSettingsWindow method makePluginOptionsGroup.
private SettingsGroup makePluginOptionsGroup() {
SettingsGroup pluginsGroup = new SettingsGroup(NLS.str("preferences.plugins"));
JadxPluginManager pluginManager = mainWindow.getWrapper().getDecompiler().getPluginManager();
for (JadxPlugin plugin : pluginManager.getAllPlugins()) {
if (!(plugin instanceof JadxPluginOptions)) {
continue;
}
JadxPluginInfo pluginInfo = plugin.getPluginInfo();
JadxPluginOptions optPlugin = (JadxPluginOptions) plugin;
for (OptionDescription opt : optPlugin.getOptionsDescriptions()) {
String title = "[" + pluginInfo.getPluginId() + "] " + opt.description();
if (opt.values().isEmpty()) {
JTextField textField = new JTextField();
textField.getDocument().addDocumentListener(new DocumentUpdateListener(event -> {
settings.getPluginOptions().put(opt.name(), textField.getText());
needReload();
}));
pluginsGroup.addRow(title, textField);
} else {
String curValue = settings.getPluginOptions().get(opt.name());
JComboBox<String> combo = new JComboBox<>(opt.values().toArray(new String[0]));
combo.setSelectedItem(curValue != null ? curValue : opt.defaultValue());
combo.addActionListener(e -> {
settings.getPluginOptions().put(opt.name(), ((String) combo.getSelectedItem()));
needReload();
});
pluginsGroup.addRow(title, combo);
}
}
}
return pluginsGroup;
}
use of jadx.api.plugins.options.OptionDescription in project jadx by skylot.
the class JCommanderWrapper method appendPlugin.
private boolean appendPlugin(JadxPluginOptions plugin, StringBuilder out, int maxNamesLen, int k) {
List<OptionDescription> descs = plugin.getOptionsDescriptions();
if (descs.isEmpty()) {
return false;
}
JadxPluginInfo pluginInfo = plugin.getPluginInfo();
out.append("\n ").append(k).append(") ");
out.append(pluginInfo.getPluginId()).append(" (").append(pluginInfo.getDescription()).append(") ");
for (OptionDescription desc : descs) {
StringBuilder opt = new StringBuilder();
opt.append(" -P").append(desc.name());
addSpaces(opt, maxNamesLen - opt.length());
opt.append("- ").append(desc.description());
if (!desc.values().isEmpty()) {
opt.append(", values: ").append(desc.values());
}
if (desc.defaultValue() != null) {
opt.append(", default: ").append(desc.defaultValue());
}
out.append("\n").append(opt);
}
return true;
}
Aggregations