feat(script): add options support
This commit is contained in:
+8
@@ -22,4 +22,12 @@ public interface OptionDescription {
|
||||
*/
|
||||
@Nullable
|
||||
String defaultValue();
|
||||
|
||||
enum OptionType {
|
||||
STRING, NUMBER, BOOLEAN
|
||||
}
|
||||
|
||||
default OptionType getType() {
|
||||
return OptionType.STRING;
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -12,12 +12,18 @@ public class JadxOptionDescription implements OptionDescription {
|
||||
private final String desc;
|
||||
private final String defaultValue;
|
||||
private final List<String> values;
|
||||
private final OptionType type;
|
||||
|
||||
public JadxOptionDescription(String name, String desc, @Nullable String defaultValue, List<String> values) {
|
||||
this(name, desc, defaultValue, values, OptionType.STRING);
|
||||
}
|
||||
|
||||
public JadxOptionDescription(String name, String desc, @Nullable String defaultValue, List<String> values, OptionType type) {
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
this.defaultValue = defaultValue;
|
||||
this.values = values;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,6 +46,11 @@ public class JadxOptionDescription implements OptionDescription {
|
||||
return values;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptionType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OptionDescription{" + desc + ", values=" + values + '}';
|
||||
|
||||
Reference in New Issue
Block a user