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
89c7b9a8
Commit
89c7b9a8
authored
Sep 21, 2013
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix ArgType.equals
parent
1358a05a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
10 deletions
+38
-10
RegionGen.java
jadx-core/src/main/java/jadx/core/codegen/RegionGen.java
+7
-2
ArgType.java
...rc/main/java/jadx/core/dex/instructions/args/ArgType.java
+30
-7
IfCondition.java
...core/src/main/java/jadx/core/dex/regions/IfCondition.java
+1
-1
No files found.
jadx-core/src/main/java/jadx/core/codegen/RegionGen.java
View file @
89c7b9a8
...
...
@@ -173,7 +173,12 @@ public class RegionGen extends InsnGen {
if
(
sb
.
length
()
!=
0
)
{
sb
.
append
(
mode
);
}
sb
.
append
(
'('
).
append
(
makeCondition
(
arg
)).
append
(
')'
);
String
s
=
makeCondition
(
arg
);
if
(
arg
.
isCompare
())
{
sb
.
append
(
s
);
}
else
{
sb
.
append
(
'('
).
append
(
s
).
append
(
')'
);
}
}
return
sb
.
toString
();
default
:
...
...
@@ -209,7 +214,7 @@ public class RegionGen extends InsnGen {
return
false
;
}
InsnNode
insn
=
((
InsnWrapArg
)
arg
).
getWrapInsn
();
if
(
insn
.
getType
()
==
InsnType
.
ARITH
)
{
if
(
insn
.
getType
()
==
InsnType
.
ARITH
)
{
ArithNode
arith
=
((
ArithNode
)
insn
);
switch
(
arith
.
getOp
())
{
case
ADD:
...
...
jadx-core/src/main/java/jadx/core/dex/instructions/args/ArgType.java
View file @
89c7b9a8
...
...
@@ -46,10 +46,6 @@ public abstract class ArgType {
private
static
ClspGraph
clsp
;
public
static
ClspGraph
getClsp
()
{
return
clsp
;
}
public
static
void
setClsp
(
ClspGraph
clsp
)
{
ArgType
.
clsp
=
clsp
;
}
...
...
@@ -108,6 +104,11 @@ public abstract class ArgType {
}
@Override
boolean
internalEquals
(
Object
obj
)
{
return
type
==
((
PrimitiveArg
)
obj
).
type
;
}
@Override
public
String
toString
()
{
return
type
.
toString
();
}
...
...
@@ -118,7 +119,7 @@ public abstract class ArgType {
public
ObjectArg
(
String
obj
)
{
this
.
object
=
Utils
.
cleanObjectName
(
obj
);
this
.
hash
=
obj
.
hashCode
();
this
.
hash
=
obj
ect
.
hashCode
();
}
@Override
...
...
@@ -137,6 +138,11 @@ public abstract class ArgType {
}
@Override
boolean
internalEquals
(
Object
obj
)
{
return
object
.
equals
(((
ObjectArg
)
obj
).
object
);
}
@Override
public
String
toString
()
{
return
object
;
}
...
...
@@ -168,6 +174,12 @@ public abstract class ArgType {
}
@Override
boolean
internalEquals
(
Object
obj
)
{
return
super
.
internalEquals
(
obj
)
&&
Arrays
.
equals
(
generics
,
((
GenericObjectArg
)
obj
).
generics
);
}
@Override
public
String
toString
()
{
return
super
.
toString
()
+
"<"
+
Utils
.
arrayToString
(
generics
)
+
">"
;
}
...
...
@@ -207,6 +219,11 @@ public abstract class ArgType {
}
@Override
boolean
internalEquals
(
Object
obj
)
{
return
arrayElement
.
equals
(((
ArrayArg
)
obj
).
arrayElement
);
}
@Override
public
String
toString
()
{
return
arrayElement
.
toString
()
+
"[]"
;
}
...
...
@@ -248,6 +265,11 @@ public abstract class ArgType {
}
@Override
boolean
internalEquals
(
Object
obj
)
{
return
Arrays
.
equals
(
possibleTypes
,
((
UnknownArg
)
obj
).
possibleTypes
);
}
@Override
public
String
toString
()
{
if
(
possibleTypes
.
length
==
PrimitiveType
.
values
().
length
)
return
"?"
;
...
...
@@ -591,13 +613,14 @@ public abstract class ArgType {
return
hash
;
}
abstract
boolean
internalEquals
(
Object
obj
);
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
return
true
;
if
(
obj
==
null
)
return
false
;
if
(
hash
!=
obj
.
hashCode
())
return
false
;
if
(
getClass
()
!=
obj
.
getClass
())
return
false
;
// TODO: don't use toString
return
toString
().
equals
(
obj
.
toString
());
return
internalEquals
(
obj
);
}
}
jadx-core/src/main/java/jadx/core/dex/regions/IfCondition.java
View file @
89c7b9a8
...
...
@@ -107,7 +107,7 @@ public final class IfCondition {
case
AND:
return
"&& "
+
args
;
case
OR:
return
"||"
+
args
;
return
"||
"
+
args
;
}
return
"??"
;
}
...
...
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