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
f8acc31b
Commit
f8acc31b
authored
Feb 20, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(gui): remove output directories from persistent settings (#447)
parent
bcadc282
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
19 deletions
+21
-19
JadxArgsValidator.java
jadx-core/src/main/java/jadx/api/JadxArgsValidator.java
+12
-16
JadxWrapper.java
jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
+1
-1
JadxSettings.java
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
+8
-2
No files found.
jadx-core/src/main/java/jadx/api/JadxArgsValidator.java
View file @
f8acc31b
...
@@ -53,13 +53,18 @@ public class JadxArgsValidator {
...
@@ -53,13 +53,18 @@ public class JadxArgsValidator {
}
else
{
}
else
{
outDir
=
makeDirFromInput
(
args
);
outDir
=
makeDirFromInput
(
args
);
}
}
args
.
setOutDir
(
outDir
);
}
if
(
srcDir
==
null
)
{
args
.
setOutDirSrc
(
new
File
(
args
.
getOutDir
(),
JadxArgs
.
DEFAULT_SRC_DIR
));
}
if
(
resDir
==
null
)
{
args
.
setOutDirRes
(
new
File
(
args
.
getOutDir
(),
JadxArgs
.
DEFAULT_RES_DIR
));
}
}
args
.
setOutDir
(
outDir
);
setFromOut
(
args
);
checkDir
(
args
.
getOutDir
());
checkDir
(
args
.
getOutDir
()
,
"Output"
);
checkDir
(
args
.
getOutDirSrc
());
checkDir
(
args
.
getOutDirSrc
()
,
"Source output"
);
checkDir
(
args
.
getOutDirRes
());
checkDir
(
args
.
getOutDirRes
()
,
"Resources output"
);
}
}
@NotNull
@NotNull
...
@@ -79,15 +84,6 @@ public class JadxArgsValidator {
...
@@ -79,15 +84,6 @@ public class JadxArgsValidator {
return
outDir
;
return
outDir
;
}
}
private
static
void
setFromOut
(
JadxArgs
args
)
{
if
(
args
.
getOutDirSrc
()
==
null
)
{
args
.
setOutDirSrc
(
new
File
(
args
.
getOutDir
(),
JadxArgs
.
DEFAULT_SRC_DIR
));
}
if
(
args
.
getOutDirRes
()
==
null
)
{
args
.
setOutDirRes
(
new
File
(
args
.
getOutDir
(),
JadxArgs
.
DEFAULT_RES_DIR
));
}
}
private
static
void
checkFile
(
File
file
)
{
private
static
void
checkFile
(
File
file
)
{
if
(!
file
.
exists
())
{
if
(!
file
.
exists
())
{
throw
new
JadxArgsValidateException
(
"File not found "
+
file
.
getAbsolutePath
());
throw
new
JadxArgsValidateException
(
"File not found "
+
file
.
getAbsolutePath
());
...
@@ -97,9 +93,9 @@ public class JadxArgsValidator {
...
@@ -97,9 +93,9 @@ public class JadxArgsValidator {
}
}
}
}
private
static
void
checkDir
(
File
dir
)
{
private
static
void
checkDir
(
File
dir
,
String
desc
)
{
if
(
dir
!=
null
&&
dir
.
exists
()
&&
!
dir
.
isDirectory
())
{
if
(
dir
!=
null
&&
dir
.
exists
()
&&
!
dir
.
isDirectory
())
{
throw
new
JadxArgsValidateException
(
"Output
directory exists as file "
+
dir
);
throw
new
JadxArgsValidateException
(
desc
+
"
directory exists as file "
+
dir
);
}
}
}
}
...
...
jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
View file @
f8acc31b
...
@@ -35,7 +35,7 @@ public class JadxWrapper {
...
@@ -35,7 +35,7 @@ public class JadxWrapper {
this
.
decompiler
.
getArgs
().
setInputFiles
(
Collections
.
singletonList
(
file
));
this
.
decompiler
.
getArgs
().
setInputFiles
(
Collections
.
singletonList
(
file
));
this
.
decompiler
.
load
();
this
.
decompiler
.
load
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOG
.
error
(
"
Error load file: {}"
,
file
,
e
);
LOG
.
error
(
"
Jadx init error"
,
e
);
}
}
}
}
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
View file @
f8acc31b
...
@@ -26,12 +26,12 @@ public class JadxSettings extends JadxCLIArgs {
...
@@ -26,12 +26,12 @@ 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
=
7
;
private
static
final
int
CURRENT_SETTINGS_VERSION
=
8
;
private
static
final
Font
DEFAULT_FONT
=
new
RSyntaxTextArea
().
getFont
();
private
static
final
Font
DEFAULT_FONT
=
new
RSyntaxTextArea
().
getFont
();
static
final
Set
<
String
>
SKIP_FIELDS
=
new
HashSet
<>(
Arrays
.
asList
(
static
final
Set
<
String
>
SKIP_FIELDS
=
new
HashSet
<>(
Arrays
.
asList
(
"files"
,
"input"
,
"out
putDir"
,
"verbose
"
,
"printHelp"
"files"
,
"input"
,
"out
Dir"
,
"outDirSrc"
,
"outDirRes"
,
"verbose"
,
"printVersion
"
,
"printHelp"
));
));
private
String
lastOpenFilePath
=
USER_HOME
;
private
String
lastOpenFilePath
=
USER_HOME
;
private
String
lastSaveFilePath
=
USER_HOME
;
private
String
lastSaveFilePath
=
USER_HOME
;
...
@@ -323,6 +323,12 @@ public class JadxSettings extends JadxCLIArgs {
...
@@ -323,6 +323,12 @@ public class JadxSettings extends JadxCLIArgs {
if
(
getFont
().
getFontName
().
equals
(
"Hack Regular"
))
{
if
(
getFont
().
getFontName
().
equals
(
"Hack Regular"
))
{
setFont
(
null
);
setFont
(
null
);
}
}
fromVersion
++;
}
if
(
fromVersion
==
7
)
{
outDir
=
null
;
outDirSrc
=
null
;
outDirRes
=
null
;
}
}
settingsVersion
=
CURRENT_SETTINGS_VERSION
;
settingsVersion
=
CURRENT_SETTINGS_VERSION
;
sync
();
sync
();
...
...
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