Commit 9a4e8bdb authored by Skylot's avatar Skylot

set default deobfuscation min length to 3 (#332)

parent fad0091d
...@@ -64,7 +64,7 @@ public class JadxCLIArgs { ...@@ -64,7 +64,7 @@ public class JadxCLIArgs {
protected boolean deobfuscationOn = false; protected boolean deobfuscationOn = false;
@Parameter(names = {"--deobf-min"}, description = "min length of name, renamed if shorter") @Parameter(names = {"--deobf-min"}, description = "min length of name, renamed if shorter")
protected int deobfuscationMinLength = 4; protected int deobfuscationMinLength = 3;
@Parameter(names = {"--deobf-max"}, description = "max length of name, renamed if longer") @Parameter(names = {"--deobf-max"}, description = "max length of name, renamed if longer")
protected int deobfuscationMaxLength = 64; protected int deobfuscationMaxLength = 64;
......
...@@ -24,7 +24,7 @@ public class JadxSettings extends JadxCLIArgs { ...@@ -24,7 +24,7 @@ public class JadxSettings extends JadxCLIArgs {
private static final String USER_HOME = System.getProperty("user.home"); private static final String USER_HOME = System.getProperty("user.home");
private static final int RECENT_FILES_COUNT = 15; private static final int RECENT_FILES_COUNT = 15;
private static final int CURRENT_SETTINGS_VERSION = 2; private static final int CURRENT_SETTINGS_VERSION = 3;
private static final Font DEFAULT_FONT = FONT_HACK != null ? FONT_HACK : new RSyntaxTextArea().getFont(); private static final Font DEFAULT_FONT = FONT_HACK != null ? FONT_HACK : new RSyntaxTextArea().getFont();
...@@ -236,7 +236,7 @@ public class JadxSettings extends JadxCLIArgs { ...@@ -236,7 +236,7 @@ public class JadxSettings extends JadxCLIArgs {
private void upgradeSettings(int fromVersion) { private void upgradeSettings(int fromVersion) {
LOG.debug("upgrade settings from version: {} to {}", fromVersion, CURRENT_SETTINGS_VERSION); LOG.debug("upgrade settings from version: {} to {}", fromVersion, CURRENT_SETTINGS_VERSION);
if (fromVersion == 0) { if (fromVersion == 0) {
setDeobfuscationMinLength(4); setDeobfuscationMinLength(3);
setDeobfuscationUseSourceNameAsAlias(true); setDeobfuscationUseSourceNameAsAlias(true);
setDeobfuscationForceSave(true); setDeobfuscationForceSave(true);
setThreadsCount(1); setThreadsCount(1);
...@@ -247,6 +247,12 @@ public class JadxSettings extends JadxCLIArgs { ...@@ -247,6 +247,12 @@ public class JadxSettings extends JadxCLIArgs {
} }
if (fromVersion == 1) { if (fromVersion == 1) {
setEditorThemePath(CodeArea.getAllThemes()[0].getPath()); setEditorThemePath(CodeArea.getAllThemes()[0].getPath());
fromVersion++;
}
if (fromVersion == 2) {
if (getDeobfuscationMinLength() == 4) {
setDeobfuscationMinLength(3);
}
} }
settingsVersion = CURRENT_SETTINGS_VERSION; settingsVersion = CURRENT_SETTINGS_VERSION;
sync(); sync();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment