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
d553157b
Commit
d553157b
authored
Dec 03, 2018
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: hide debug type inference logs
parent
95f9ab03
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
TypeInferenceVisitor.java
...core/dex/visitors/typeinference/TypeInferenceVisitor.java
+3
-2
TypeUpdate.java
...java/jadx/core/dex/visitors/typeinference/TypeUpdate.java
+3
-6
No files found.
jadx-core/src/main/java/jadx/core/dex/visitors/typeinference/TypeInferenceVisitor.java
View file @
d553157b
...
...
@@ -10,6 +10,7 @@ import org.jetbrains.annotations.Nullable;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
jadx.core.Consts
;
import
jadx.core.dex.instructions.IndexInsnNode
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.dex.instructions.args.LiteralArg
;
...
...
@@ -67,7 +68,7 @@ public final class TypeInferenceVisitor extends AbstractVisitor {
if
(
assignArg
.
isTypeImmutable
())
{
ArgType
initType
=
assignArg
.
getInitType
();
TypeUpdateResult
result
=
typeUpdate
.
apply
(
ssaVar
,
initType
);
if
(
result
==
TypeUpdateResult
.
REJECT
&&
LOG
.
isDebugEnabled
())
{
if
(
Consts
.
DEBUG
&&
result
==
TypeUpdateResult
.
REJECT
&&
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Initial immutable type set rejected: {} -> {}"
,
ssaVar
,
initType
);
}
}
else
{
...
...
@@ -85,7 +86,7 @@ public final class TypeInferenceVisitor extends AbstractVisitor {
if
(
bestTypeOpt
.
isPresent
())
{
ArgType
candidateType
=
bestTypeOpt
.
get
();
TypeUpdateResult
result
=
typeUpdate
.
apply
(
ssaVar
,
candidateType
);
if
(
result
==
TypeUpdateResult
.
REJECT
&&
LOG
.
isDebugEnabled
())
{
if
(
Consts
.
DEBUG
&&
result
==
TypeUpdateResult
.
REJECT
&&
LOG
.
isDebugEnabled
())
{
if
(
ssaVar
.
getTypeInfo
().
getType
().
equals
(
candidateType
))
{
LOG
.
warn
(
"Same type rejected: {} -> {}, bounds: {}"
,
ssaVar
,
candidateType
,
bounds
);
}
else
{
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/typeinference/TypeUpdate.java
View file @
d553157b
...
...
@@ -7,10 +7,10 @@ import java.util.Objects;
import
java.util.Set
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
jadx.core.Consts
;
import
jadx.core.dex.instructions.InsnType
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.dex.instructions.args.InsnArg
;
...
...
@@ -81,7 +81,7 @@ public final class TypeUpdate {
private
TypeUpdateResult
updateTypeForSsaVar
(
TypeUpdateInfo
updateInfo
,
SSAVar
ssaVar
,
ArgType
candidateType
)
{
TypeInfo
typeInfo
=
ssaVar
.
getTypeInfo
();
if
(!
inBounds
(
typeInfo
.
getBounds
(),
candidateType
))
{
if
(
LOG
.
isDebugEnabled
())
{
if
(
Consts
.
DEBUG
&&
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Reject type '{}' for {} by bounds: {}"
,
candidateType
,
ssaVar
,
typeInfo
.
getBounds
());
}
return
REJECT
;
...
...
@@ -153,7 +153,6 @@ public final class TypeUpdate {
return
true
;
}
@Nullable
private
boolean
checkBound
(
ArgType
candidateType
,
ITypeBound
bound
,
ArgType
boundType
)
{
TypeCompareEnum
compareResult
=
comparator
.
compareTypes
(
candidateType
,
boundType
);
switch
(
compareResult
)
{
...
...
@@ -166,9 +165,7 @@ public final class TypeUpdate {
case
NARROW:
if
(
bound
.
getBound
()
==
BoundEnum
.
ASSIGN
)
{
if
(
boundType
.
isTypeKnown
()
||
!
checkAssignForUnknown
(
boundType
,
candidateType
))
{
return
false
;
}
return
!
boundType
.
isTypeKnown
()
&&
checkAssignForUnknown
(
boundType
,
candidateType
);
}
return
true
;
...
...
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