Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
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
118fa98c
Commit
118fa98c
authored
Dec 17, 2017
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: fix incorrect settings loading
parent
001fa639
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
3 deletions
+12
-3
JadxCLI.java
jadx-cli/src/main/java/jadx/cli/JadxCLI.java
+1
-1
JadxCLIArgs.java
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
+4
-2
JadxSettings.java
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
+6
-0
JadxSettingsAdapter.java
.../src/main/java/jadx/gui/settings/JadxSettingsAdapter.java
+1
-0
No files found.
jadx-cli/src/main/java/jadx/cli/JadxCLI.java
View file @
118fa98c
...
@@ -11,7 +11,7 @@ import org.slf4j.LoggerFactory;
...
@@ -11,7 +11,7 @@ import org.slf4j.LoggerFactory;
public
class
JadxCLI
{
public
class
JadxCLI
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
JadxCLI
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
JadxCLI
.
class
);
public
static
void
main
(
String
[]
args
)
throws
JadxException
{
public
static
void
main
(
String
[]
args
)
{
try
{
try
{
JadxCLIArgs
jadxArgs
=
new
JadxCLIArgs
();
JadxCLIArgs
jadxArgs
=
new
JadxCLIArgs
();
if
(
processArgs
(
jadxArgs
,
args
))
{
if
(
processArgs
(
jadxArgs
,
args
))
{
...
...
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
View file @
118fa98c
...
@@ -25,6 +25,8 @@ import com.beust.jcommander.ParameterException;
...
@@ -25,6 +25,8 @@ import com.beust.jcommander.ParameterException;
public
class
JadxCLIArgs
implements
IJadxArgs
{
public
class
JadxCLIArgs
implements
IJadxArgs
{
protected
static
final
int
DEFAULT_THREADS_COUNT
=
Math
.
max
(
1
,
Runtime
.
getRuntime
().
availableProcessors
()
/
2
);
@Parameter
(
description
=
"<input file> (.dex, .apk, .jar or .class)"
)
@Parameter
(
description
=
"<input file> (.dex, .apk, .jar or .class)"
)
protected
List
<
String
>
files
;
protected
List
<
String
>
files
;
...
@@ -32,7 +34,7 @@ public class JadxCLIArgs implements IJadxArgs {
...
@@ -32,7 +34,7 @@ public class JadxCLIArgs implements IJadxArgs {
protected
String
outDirName
;
protected
String
outDirName
;
@Parameter
(
names
=
{
"-j"
,
"--threads-count"
},
description
=
"processing threads count"
)
@Parameter
(
names
=
{
"-j"
,
"--threads-count"
},
description
=
"processing threads count"
)
protected
int
threadsCount
=
Math
.
max
(
1
,
Runtime
.
getRuntime
().
availableProcessors
()
/
2
)
;
protected
int
threadsCount
=
DEFAULT_THREADS_COUNT
;
@Parameter
(
names
=
{
"-r"
,
"--no-res"
},
description
=
"do not decode resources"
)
@Parameter
(
names
=
{
"-r"
,
"--no-res"
},
description
=
"do not decode resources"
)
protected
boolean
skipResources
=
false
;
protected
boolean
skipResources
=
false
;
...
@@ -108,7 +110,7 @@ public class JadxCLIArgs implements IJadxArgs {
...
@@ -108,7 +110,7 @@ public class JadxCLIArgs implements IJadxArgs {
}
}
try
{
try
{
if
(
threadsCount
<=
0
)
{
if
(
threadsCount
<=
0
)
{
throw
new
JadxException
(
"Threads count must be positive
"
);
throw
new
JadxException
(
"Threads count must be positive
, got: "
+
threadsCount
);
}
}
if
(
files
!=
null
)
{
if
(
files
!=
null
)
{
for
(
String
fileName
:
files
)
{
for
(
String
fileName
:
files
)
{
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
View file @
118fa98c
...
@@ -43,6 +43,12 @@ public class JadxSettings extends JadxCLIArgs {
...
@@ -43,6 +43,12 @@ public class JadxSettings extends JadxCLIArgs {
JadxSettingsAdapter
.
store
(
this
);
JadxSettingsAdapter
.
store
(
this
);
}
}
public
void
fixOnLoad
()
{
if
(
threadsCount
<=
0
)
{
threadsCount
=
DEFAULT_THREADS_COUNT
;
}
}
public
String
getLastOpenFilePath
()
{
public
String
getLastOpenFilePath
()
{
return
lastOpenFilePath
;
return
lastOpenFilePath
;
}
}
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsAdapter.java
View file @
118fa98c
...
@@ -50,6 +50,7 @@ public class JadxSettingsAdapter {
...
@@ -50,6 +50,7 @@ public class JadxSettingsAdapter {
return
new
JadxSettings
();
return
new
JadxSettings
();
}
}
LOG
.
debug
(
"Loaded settings: {}"
,
makeString
(
settings
));
LOG
.
debug
(
"Loaded settings: {}"
,
makeString
(
settings
));
settings
.
fixOnLoad
();
return
settings
;
return
settings
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Error load settings"
,
e
);
LOG
.
error
(
"Error load settings"
,
e
);
...
...
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