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
18a1788d
Commit
18a1788d
authored
Mar 25, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: fix class members expand
parent
d0aa1911
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
19 deletions
+47
-19
Decompiler.java
jadx-core/src/main/java/jadx/api/Decompiler.java
+30
-11
JavaClass.java
jadx-core/src/main/java/jadx/api/JavaClass.java
+15
-7
JadxWrapper.java
jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
+1
-0
JClass.java
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
+1
-1
No files found.
jadx-core/src/main/java/jadx/api/Decompiler.java
View file @
18a1788d
...
...
@@ -54,6 +54,7 @@ public final class Decompiler {
private
RootNode
root
;
private
List
<
IDexTreeVisitor
>
passes
;
private
List
<
JavaClass
>
classes
;
public
Decompiler
()
{
this
.
args
=
new
DefaultJadxArgs
();
...
...
@@ -95,6 +96,7 @@ public final class Decompiler {
public
void
save
()
{
try
{
ExecutorService
ex
=
getSaveExecutor
();
ex
.
shutdown
();
ex
.
awaitTermination
(
1
,
TimeUnit
.
DAYS
);
}
catch
(
InterruptedException
e
)
{
LOG
.
error
(
"Save interrupted"
,
e
);
...
...
@@ -122,23 +124,24 @@ public final class Decompiler {
}
});
}
executor
.
shutdown
();
return
executor
;
}
public
List
<
JavaClass
>
getClasses
()
{
List
<
ClassNode
>
classNodeList
=
root
.
getClasses
(
false
);
List
<
JavaClass
>
classes
=
new
ArrayList
<
JavaClass
>(
classNodeList
.
size
());
for
(
ClassNode
classNode
:
classNodeList
)
{
classes
.
add
(
new
JavaClass
(
this
,
classNode
));
if
(
classes
==
null
)
{
List
<
ClassNode
>
classNodeList
=
root
.
getClasses
(
false
);
List
<
JavaClass
>
clsList
=
new
ArrayList
<
JavaClass
>(
classNodeList
.
size
());
for
(
ClassNode
classNode
:
classNodeList
)
{
clsList
.
add
(
new
JavaClass
(
this
,
classNode
));
}
classes
=
Collections
.
unmodifiableList
(
clsList
);
}
return
Collections
.
unmodifiableList
(
classes
)
;
return
classes
;
}
public
List
<
JavaPackage
>
getPackages
()
{
List
<
JavaClass
>
classes
=
getClasses
();
Map
<
String
,
List
<
JavaClass
>>
map
=
new
HashMap
<
String
,
List
<
JavaClass
>>();
for
(
JavaClass
javaClass
:
classes
)
{
for
(
JavaClass
javaClass
:
getClasses
()
)
{
String
pkg
=
javaClass
.
getPackage
();
List
<
JavaClass
>
clsList
=
map
.
get
(
pkg
);
if
(
clsList
==
null
)
{
...
...
@@ -168,14 +171,18 @@ public final class Decompiler {
}
void
parse
()
throws
DecodeException
{
ClassInfo
.
clearCache
();
ErrorsCounter
.
reset
();
reset
();
root
=
new
RootNode
();
LOG
.
info
(
"loading ..."
);
root
.
load
(
inputFiles
);
}
private
void
reset
()
{
ClassInfo
.
clearCache
();
ErrorsCounter
.
reset
();
classes
=
null
;
}
void
processClass
(
ClassNode
cls
)
{
LOG
.
info
(
"processing class {} ..."
,
cls
);
ProcessClass
.
process
(
cls
,
passes
);
...
...
@@ -184,4 +191,16 @@ public final class Decompiler {
RootNode
getRoot
()
{
return
root
;
}
JavaClass
findJavaClass
(
ClassNode
cls
)
{
if
(
cls
==
null
)
{
return
null
;
}
for
(
JavaClass
javaClass
:
getClasses
())
{
if
(
javaClass
.
getClassNode
().
equals
(
cls
))
{
return
javaClass
;
}
}
return
null
;
}
}
jadx-core/src/main/java/jadx/api/JavaClass.java
View file @
18a1788d
...
...
@@ -48,6 +48,10 @@ public final class JavaClass {
}
}
ClassNode
getClassNode
()
{
return
cls
;
}
private
void
load
()
{
int
inClsCount
=
cls
.
getInnerClasses
().
size
();
if
(
inClsCount
!=
0
)
{
...
...
@@ -92,7 +96,7 @@ public final class JavaClass {
}
private
Map
<
CodePosition
,
Object
>
getCodeAnnotations
()
{
getCod
e
();
decompil
e
();
return
cls
.
getCode
().
getAnnotations
();
}
...
...
@@ -108,13 +112,17 @@ public final class JavaClass {
}
else
if
(
obj
instanceof
FieldNode
)
{
clsNode
=
((
FieldNode
)
obj
).
getParentClass
();
}
if
(
clsNode
!=
null
)
{
clsNode
=
clsNode
.
getParentClass
();
JavaClass
jCls
=
new
JavaClass
(
decompiler
,
clsNode
);
jCls
.
decompile
();
int
defLine
=
((
LineAttrNode
)
obj
).
getDecompiledLine
();
return
new
CodePosition
(
jCls
,
defLine
,
0
);
if
(
clsNode
==
null
)
{
return
null
;
}
clsNode
=
clsNode
.
getParentClass
();
JavaClass
jCls
=
decompiler
.
findJavaClass
(
clsNode
);
if
(
jCls
==
null
)
{
return
null
;
}
jCls
.
decompile
();
int
defLine
=
((
LineAttrNode
)
obj
).
getDecompiledLine
();
return
new
CodePosition
(
jCls
,
defLine
,
0
);
}
return
null
;
}
...
...
jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
View file @
18a1788d
...
...
@@ -43,6 +43,7 @@ public class JadxWrapper {
try
{
decompiler
.
setOutputDir
(
dir
);
ThreadPoolExecutor
ex
=
decompiler
.
getSaveExecutor
();
ex
.
shutdown
();
while
(
ex
.
isTerminating
())
{
long
total
=
ex
.
getTaskCount
();
long
done
=
ex
.
getCompletedTaskCount
();
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
View file @
18a1788d
...
...
@@ -45,8 +45,8 @@ public class JClass extends JNode {
if
(!
loaded
)
{
cls
.
decompile
();
loaded
=
true
;
update
();
}
update
();
}
public
synchronized
void
update
()
{
...
...
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