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
4a39af7c
Commit
4a39af7c
authored
Apr 30, 2019
by
Jan S
Committed by
skylot
Apr 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(gui): make search bar usable for smali code (PR #652)
parent
c7890f24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
5 deletions
+16
-5
JadxDecompiler.java
jadx-core/src/main/java/jadx/api/JadxDecompiler.java
+1
-3
CodePanel.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
+6
-1
SearchBar.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/SearchBar.java
+8
-1
SmaliArea.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/SmaliArea.java
+1
-0
No files found.
jadx-core/src/main/java/jadx/api/JadxDecompiler.java
View file @
4a39af7c
...
...
@@ -2,9 +2,7 @@ package jadx.api;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.StringWriter
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
import
java.util.Collections
;
...
...
@@ -312,7 +310,7 @@ public final class JadxDecompiler {
Path
path
=
cls
.
dex
().
getDexFile
().
getPath
();
String
className
=
cls
.
getAlias
().
makeRawFullName
();
className
=
'L'
+
className
.
replace
(
'.'
,
'/'
)
+
';'
;
try
(
InputStream
in
=
Files
.
newInputStream
(
path
))
{
try
{
DexBackedDexFile
dexFile
=
DexFileFactory
.
loadDexFile
(
path
.
toFile
(),
Opcodes
.
getDefault
());
boolean
decompiled
=
false
;
for
(
DexBackedClassDef
classDef
:
dexFile
.
getClasses
())
{
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
View file @
4a39af7c
...
...
@@ -45,11 +45,16 @@ public final class CodePanel extends ContentPanel {
add
(
areaTabbedPane
);
KeyStroke
key
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_F
,
Utils
.
ctrlButton
());
Utils
.
addKeyBinding
(
codeArea
,
key
,
"SearchAction"
,
new
SearchAction
());
SearchAction
searchAction
=
new
SearchAction
();
Utils
.
addKeyBinding
(
codeArea
,
key
,
"SearchAction"
,
searchAction
);
Utils
.
addKeyBinding
(
smaliArea
,
key
,
"SearchAction"
,
searchAction
);
areaTabbedPane
.
addChangeListener
(
e
->
{
if
(
areaTabbedPane
.
getSelectedComponent
()
==
smaliScrollPane
)
{
smaliArea
.
load
();
searchBar
.
setRTextArea
(
smaliArea
);
}
else
if
(
areaTabbedPane
.
getSelectedComponent
()
==
codeScrollPane
)
{
searchBar
.
setRTextArea
(
codeArea
);
}
});
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/SearchBar.java
View file @
4a39af7c
...
...
@@ -32,7 +32,7 @@ class SearchBar extends JToolBar {
private
static
final
Icon
ICON_DOWN
=
Utils
.
openIcon
(
"arrow_down"
);
private
static
final
Icon
ICON_CLOSE
=
Utils
.
openIcon
(
"cross"
);
private
final
RSyntaxTextArea
rTextArea
;
private
RSyntaxTextArea
rTextArea
;
private
final
JTextField
searchField
;
private
final
JCheckBox
markAllCB
;
...
...
@@ -168,4 +168,11 @@ class SearchBar extends JToolBar {
searchField
.
setBackground
(
COLOR_BG_NORMAL
);
}
}
public
void
setRTextArea
(
RSyntaxTextArea
rTextArea
)
{
this
.
rTextArea
=
rTextArea
;
if
(
isVisible
())
{
this
.
search
(
0
);
}
}
}
jadx-gui/src/main/java/jadx/gui/ui/codearea/SmaliArea.java
View file @
4a39af7c
...
...
@@ -18,6 +18,7 @@ public final class SmaliArea extends RSyntaxTextArea {
void
load
()
{
if
(
getText
().
isEmpty
())
{
setText
(
node
.
getSmali
());
setCaretPosition
(
0
);
}
}
}
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