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
e9439653
Commit
e9439653
authored
Aug 10, 2013
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: open file selection dialog on start
parent
cc1be673
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
JadxGUI.java
jadx-gui/src/main/java/jadx/gui/JadxGUI.java
+3
-1
MainWindow.java
jadx-gui/src/main/java/jadx/gui/MainWindow.java
+17
-7
Messages_en_US.properties
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
+1
-0
No files found.
jadx-gui/src/main/java/jadx/gui/JadxGUI.java
View file @
e9439653
...
@@ -26,7 +26,9 @@ public class JadxGUI {
...
@@ -26,7 +26,9 @@ public class JadxGUI {
mainWindow
.
setLocationRelativeTo
(
null
);
mainWindow
.
setLocationRelativeTo
(
null
);
mainWindow
.
setDefaultCloseOperation
(
WindowConstants
.
EXIT_ON_CLOSE
);
mainWindow
.
setDefaultCloseOperation
(
WindowConstants
.
EXIT_ON_CLOSE
);
if
(!
jadxArgs
.
getInput
().
isEmpty
())
{
if
(
jadxArgs
.
getInput
().
isEmpty
())
{
mainWindow
.
openFile
();
}
else
{
mainWindow
.
openFile
(
jadxArgs
.
getInput
().
get
(
0
));
mainWindow
.
openFile
(
jadxArgs
.
getInput
().
get
(
0
));
}
}
}
}
...
...
jadx-gui/src/main/java/jadx/gui/MainWindow.java
View file @
e9439653
...
@@ -62,6 +62,8 @@ public class MainWindow extends JFrame {
...
@@ -62,6 +62,8 @@ public class MainWindow extends JFrame {
private
static
final
ImageIcon
ICON_FLAT_PKG
=
Utils
.
openIcon
(
"empty_logical_package_obj"
);
private
static
final
ImageIcon
ICON_FLAT_PKG
=
Utils
.
openIcon
(
"empty_logical_package_obj"
);
private
static
final
ImageIcon
ICON_SEARCH
=
Utils
.
openIcon
(
"magnifier"
);
private
static
final
ImageIcon
ICON_SEARCH
=
Utils
.
openIcon
(
"magnifier"
);
private
static
final
File
WORK_DIR
=
new
File
(
System
.
getProperty
(
"user.dir"
));
private
final
JadxWrapper
wrapper
;
private
final
JadxWrapper
wrapper
;
private
JPanel
mainPanel
;
private
JPanel
mainPanel
;
private
JTree
tree
;
private
JTree
tree
;
...
@@ -77,6 +79,18 @@ public class MainWindow extends JFrame {
...
@@ -77,6 +79,18 @@ public class MainWindow extends JFrame {
initMenuAndToolbar
();
initMenuAndToolbar
();
}
}
public
void
openFile
()
{
JFileChooser
fileChooser
=
new
JFileChooser
();
fileChooser
.
setAcceptAllFileFilterUsed
(
true
);
fileChooser
.
setFileFilter
(
new
FileNameExtensionFilter
(
"supported files"
,
"dex"
,
"apk"
,
"jar"
));
fileChooser
.
setToolTipText
(
NLS
.
str
(
"file.open"
));
// fileChooser.setCurrentDirectory(WORK_DIR);
int
ret
=
fileChooser
.
showDialog
(
mainPanel
,
NLS
.
str
(
"file.open"
));
if
(
ret
==
JFileChooser
.
APPROVE_OPTION
)
{
openFile
(
fileChooser
.
getSelectedFile
());
}
}
public
void
openFile
(
File
file
)
{
public
void
openFile
(
File
file
)
{
wrapper
.
openFile
(
file
);
wrapper
.
openFile
(
file
);
initTree
();
initTree
();
...
@@ -86,7 +100,8 @@ public class MainWindow extends JFrame {
...
@@ -86,7 +100,8 @@ public class MainWindow extends JFrame {
private
void
saveAllAction
()
{
private
void
saveAllAction
()
{
JFileChooser
fileChooser
=
new
JFileChooser
();
JFileChooser
fileChooser
=
new
JFileChooser
();
fileChooser
.
setFileSelectionMode
(
JFileChooser
.
DIRECTORIES_ONLY
);
fileChooser
.
setFileSelectionMode
(
JFileChooser
.
DIRECTORIES_ONLY
);
int
ret
=
fileChooser
.
showDialog
(
mainPanel
,
NLS
.
str
(
"file.save_all_msg"
));
fileChooser
.
setToolTipText
(
NLS
.
str
(
"file.save_all_msg"
));
int
ret
=
fileChooser
.
showDialog
(
mainPanel
,
NLS
.
str
(
"file.select"
));
if
(
ret
==
JFileChooser
.
APPROVE_OPTION
)
{
if
(
ret
==
JFileChooser
.
APPROVE_OPTION
)
{
ProgressMonitor
progressMonitor
=
new
ProgressMonitor
(
mainPanel
,
"Saving sources"
,
""
,
0
,
100
);
ProgressMonitor
progressMonitor
=
new
ProgressMonitor
(
mainPanel
,
"Saving sources"
,
""
,
0
,
100
);
...
@@ -298,12 +313,7 @@ public class MainWindow extends JFrame {
...
@@ -298,12 +313,7 @@ public class MainWindow extends JFrame {
private
class
OpenListener
implements
ActionListener
{
private
class
OpenListener
implements
ActionListener
{
public
void
actionPerformed
(
ActionEvent
event
)
{
public
void
actionPerformed
(
ActionEvent
event
)
{
JFileChooser
fileChooser
=
new
JFileChooser
();
openFile
();
fileChooser
.
addChoosableFileFilter
(
new
FileNameExtensionFilter
(
"dex files"
,
"dex"
,
"apk"
,
"jar"
));
int
ret
=
fileChooser
.
showDialog
(
mainPanel
,
"Open file"
);
if
(
ret
==
JFileChooser
.
APPROVE_OPTION
)
{
openFile
(
fileChooser
.
getSelectedFile
());
}
}
}
}
}
}
}
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
View file @
e9439653
...
@@ -2,6 +2,7 @@ file.open=Open file
...
@@ -2,6 +2,7 @@ file.open=Open file
file.save
=
Save file
file.save
=
Save file
file.save_all
=
Save all
file.save_all
=
Save all
file.save_all_msg
=
Select directory for save decompiled sources
file.save_all_msg
=
Select directory for save decompiled sources
file.select
=
Select
file.exit
=
Exit
file.exit
=
Exit
tree.flatten
=
Flatten packages
tree.flatten
=
Flatten packages
...
...
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