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
e915f4fc
Commit
e915f4fc
authored
Jan 31, 2016
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: show missing class references only once
parent
bc9164b9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
JadxDecompiler.java
jadx-core/src/main/java/jadx/api/JadxDecompiler.java
+1
-0
ClspGraph.java
jadx-core/src/main/java/jadx/core/clsp/ClspGraph.java
+20
-2
ErrorsCounter.java
jadx-core/src/main/java/jadx/core/utils/ErrorsCounter.java
+0
-5
No files found.
jadx-core/src/main/java/jadx/api/JadxDecompiler.java
View file @
e915f4fc
...
...
@@ -248,6 +248,7 @@ public final class JadxDecompiler {
if
(
root
==
null
)
{
return
;
}
root
.
getClsp
().
printMissingClasses
();
root
.
getErrorsCounter
().
printReport
();
}
...
...
jadx-core/src/main/java/jadx/core/clsp/ClspGraph.java
View file @
e915f4fc
...
...
@@ -5,6 +5,7 @@ import jadx.core.utils.exceptions.DecodeException;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashSet
;
...
...
@@ -25,6 +26,8 @@ public class ClspGraph {
private
final
Map
<
String
,
Set
<
String
>>
ancestorCache
=
new
WeakHashMap
<
String
,
Set
<
String
>>();
private
Map
<
String
,
NClass
>
nameMap
;
private
final
Set
<
String
>
missingClasses
=
new
HashSet
<
String
>();
public
void
load
()
throws
IOException
,
DecodeException
{
ClsSet
set
=
new
ClsSet
();
set
.
load
();
...
...
@@ -73,7 +76,7 @@ public class ClspGraph {
}
NClass
cls
=
nameMap
.
get
(
implClsName
);
if
(
cls
==
null
)
{
LOG
.
debug
(
"Missing class: {}"
,
implC
lsName
);
missingClasses
.
add
(
c
lsName
);
return
null
;
}
if
(
isImplements
(
clsName
,
implClsName
))
{
...
...
@@ -104,7 +107,7 @@ public class ClspGraph {
}
NClass
cls
=
nameMap
.
get
(
clsName
);
if
(
cls
==
null
)
{
LOG
.
debug
(
"Missing class: {}"
,
clsName
);
missingClasses
.
add
(
clsName
);
return
Collections
.
emptySet
();
}
result
=
new
HashSet
<
String
>();
...
...
@@ -122,4 +125,19 @@ public class ClspGraph {
addAncestorsNames
(
p
,
result
);
}
}
public
void
printMissingClasses
()
{
int
count
=
missingClasses
.
size
();
if
(
count
==
0
)
{
return
;
}
LOG
.
warn
(
"Found {} references to unknown classes"
,
count
);
if
(
LOG
.
isDebugEnabled
())
{
List
<
String
>
clsNames
=
new
ArrayList
<
String
>(
missingClasses
);
Collections
.
sort
(
clsNames
);
for
(
String
cls
:
clsNames
)
{
LOG
.
debug
(
" {}"
,
cls
);
}
}
}
}
jadx-core/src/main/java/jadx/core/utils/ErrorsCounter.java
View file @
e915f4fc
...
...
@@ -27,11 +27,6 @@ public class ErrorsCounter {
return
errorsCount
;
}
public
void
reset
()
{
errorNodes
.
clear
();
errorsCount
=
0
;
}
private
void
addError
(
IAttributeNode
node
,
String
msg
,
Throwable
e
)
{
errorNodes
.
add
(
node
);
errorsCount
++;
...
...
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