Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
56798e71
Commit
56798e71
authored
Aug 19, 2018
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: min and max deobf lengths must be positive
parent
904f0a11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
JadxSettings.java
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
+8
-2
JadxSettingsWindow.java
...i/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
+12
-12
No files found.
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
View file @
56798e71
...
@@ -9,8 +9,6 @@ import java.util.List;
...
@@ -9,8 +9,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
import
jadx.gui.utils.LangLocale
;
import
jadx.gui.utils.NLS
;
import
org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
;
import
org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -18,6 +16,8 @@ import org.slf4j.LoggerFactory;
...
@@ -18,6 +16,8 @@ import org.slf4j.LoggerFactory;
import
jadx.api.JadxArgs
;
import
jadx.api.JadxArgs
;
import
jadx.cli.JadxCLIArgs
;
import
jadx.cli.JadxCLIArgs
;
import
jadx.gui.ui.CodeArea
;
import
jadx.gui.ui.CodeArea
;
import
jadx.gui.utils.LangLocale
;
import
jadx.gui.utils.NLS
;
import
static
jadx
.
gui
.
utils
.
Utils
.
FONT_HACK
;
import
static
jadx
.
gui
.
utils
.
Utils
.
FONT_HACK
;
...
@@ -58,6 +58,12 @@ public class JadxSettings extends JadxCLIArgs {
...
@@ -58,6 +58,12 @@ public class JadxSettings extends JadxCLIArgs {
if
(
threadsCount
<=
0
)
{
if
(
threadsCount
<=
0
)
{
threadsCount
=
JadxArgs
.
DEFAULT_THREADS_COUNT
;
threadsCount
=
JadxArgs
.
DEFAULT_THREADS_COUNT
;
}
}
if
(
deobfuscationMinLength
<
0
)
{
deobfuscationMinLength
=
0
;
}
if
(
deobfuscationMaxLength
<
0
)
{
deobfuscationMaxLength
=
0
;
}
if
(
settingsVersion
!=
CURRENT_SETTINGS_VERSION
)
{
if
(
settingsVersion
!=
CURRENT_SETTINGS_VERSION
)
{
upgradeSettings
(
settingsVersion
);
upgradeSettings
(
settingsVersion
);
}
}
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
View file @
56798e71
...
@@ -8,7 +8,6 @@ import java.awt.event.MouseEvent;
...
@@ -8,7 +8,6 @@ import java.awt.event.MouseEvent;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collection
;
import
jadx.gui.utils.LangLocale
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
say.swing.JFontChooser
;
import
say.swing.JFontChooser
;
...
@@ -16,6 +15,7 @@ import say.swing.JFontChooser;
...
@@ -16,6 +15,7 @@ import say.swing.JFontChooser;
import
jadx.gui.ui.CodeArea
;
import
jadx.gui.ui.CodeArea
;
import
jadx.gui.ui.CodeArea.EditorTheme
;
import
jadx.gui.ui.CodeArea.EditorTheme
;
import
jadx.gui.ui.MainWindow
;
import
jadx.gui.ui.MainWindow
;
import
jadx.gui.utils.LangLocale
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.NLS
;
import
static
jadx
.
gui
.
utils
.
Utils
.
FONT_HACK
;
import
static
jadx
.
gui
.
utils
.
Utils
.
FONT_HACK
;
...
@@ -135,17 +135,17 @@ public class JadxSettingsWindow extends JDialog {
...
@@ -135,17 +135,17 @@ public class JadxSettingsWindow extends JDialog {
needReload
();
needReload
();
});
});
JSpinner
minLen
=
new
JSpinner
(
);
SpinnerNumberModel
minLenModel
=
new
SpinnerNumberModel
(
settings
.
getDeobfuscationMinLength
(),
0
,
Integer
.
MAX_VALUE
,
1
);
minLen
.
setValue
(
settings
.
getDeobfuscationMinLength
()
);
JSpinner
minLenSpinner
=
new
JSpinner
(
minLenModel
);
minLen
.
addChangeListener
(
e
->
{
minLen
Spinner
.
addChangeListener
(
e
->
{
settings
.
setDeobfuscationMinLength
((
Integer
)
minLen
.
getValue
());
settings
.
setDeobfuscationMinLength
((
Integer
)
minLen
Spinner
.
getValue
());
needReload
();
needReload
();
});
});
JSpinner
maxLen
=
new
JSpinner
(
);
SpinnerNumberModel
maxLenModel
=
new
SpinnerNumberModel
(
settings
.
getDeobfuscationMaxLength
(),
0
,
Integer
.
MAX_VALUE
,
1
);
maxLen
.
setValue
(
settings
.
getDeobfuscationMaxLength
()
);
JSpinner
maxLenSpinner
=
new
JSpinner
(
maxLenModel
);
maxLen
.
addChangeListener
(
e
->
{
maxLen
Spinner
.
addChangeListener
(
e
->
{
settings
.
setDeobfuscationMaxLength
((
Integer
)
maxLen
.
getValue
());
settings
.
setDeobfuscationMaxLength
((
Integer
)
maxLen
Spinner
.
getValue
());
needReload
();
needReload
();
});
});
...
@@ -159,12 +159,12 @@ public class JadxSettingsWindow extends JDialog {
...
@@ -159,12 +159,12 @@ public class JadxSettingsWindow extends JDialog {
SettingsGroup
deobfGroup
=
new
SettingsGroup
(
NLS
.
str
(
"preferences.deobfuscation"
));
SettingsGroup
deobfGroup
=
new
SettingsGroup
(
NLS
.
str
(
"preferences.deobfuscation"
));
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_on"
),
deobfOn
);
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_on"
),
deobfOn
);
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_force"
),
deobfForce
);
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_force"
),
deobfForce
);
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_min_len"
),
minLen
);
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_min_len"
),
minLen
Spinner
);
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_max_len"
),
maxLen
);
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_max_len"
),
maxLen
Spinner
);
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_source_alias"
),
deobfSourceAlias
);
deobfGroup
.
addRow
(
NLS
.
str
(
"preferences.deobfuscation_source_alias"
),
deobfSourceAlias
);
deobfGroup
.
end
();
deobfGroup
.
end
();
Collection
<
JComponent
>
connectedComponents
=
Arrays
.
asList
(
deobfForce
,
minLen
,
maxLen
,
deobfSourceAlias
);
Collection
<
JComponent
>
connectedComponents
=
Arrays
.
asList
(
deobfForce
,
minLen
Spinner
,
maxLenSpinner
,
deobfSourceAlias
);
deobfOn
.
addItemListener
(
e
->
enableComponentList
(
connectedComponents
,
e
.
getStateChange
()
==
ItemEvent
.
SELECTED
));
deobfOn
.
addItemListener
(
e
->
enableComponentList
(
connectedComponents
,
e
.
getStateChange
()
==
ItemEvent
.
SELECTED
));
enableComponentList
(
connectedComponents
,
settings
.
isDeobfuscationOn
());
enableComponentList
(
connectedComponents
,
settings
.
isDeobfuscationOn
());
return
deobfGroup
;
return
deobfGroup
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment