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
550659d3
Commit
550659d3
authored
Apr 18, 2013
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix generic types for abstract methods
parent
ba1524dc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
+23
-21
MethodNode.java
src/main/java/jadx/dex/nodes/MethodNode.java
+18
-20
TestGenerics.java
src/samples/java/jadx/samples/TestGenerics.java
+5
-1
No files found.
src/main/java/jadx/dex/nodes/MethodNode.java
View file @
550659d3
...
@@ -70,31 +70,22 @@ public class MethodNode extends AttrNode implements ILoadable {
...
@@ -70,31 +70,22 @@ public class MethodNode extends AttrNode implements ILoadable {
this
.
parentClass
=
classNode
;
this
.
parentClass
=
classNode
;
this
.
accFlags
=
new
AccessInfo
(
mth
.
getAccessFlags
(),
AFType
.
METHOD
);
this
.
accFlags
=
new
AccessInfo
(
mth
.
getAccessFlags
(),
AFType
.
METHOD
);
this
.
methodData
=
mth
;
this
.
methodData
=
mth
;
this
.
noCode
=
(
methodData
.
getCodeOffset
()
==
0
);
if
(
methodData
.
getCodeOffset
()
==
0
)
{
noCode
=
true
;
regsCount
=
0
;
retType
=
mthInfo
.
getReturnType
();
initArguments
(
mthInfo
.
getArgumentsTypes
());
}
else
{
noCode
=
false
;
}
}
}
@Override
@Override
public
void
load
()
throws
DecodeException
{
public
void
load
()
throws
DecodeException
{
if
(
noCode
)
try
{
if
(
noCode
)
{
regsCount
=
0
;
initMethodTypes
();
return
;
return
;
}
try
{
DexNode
dex
=
parentClass
.
dex
();
DexNode
dex
=
parentClass
.
dex
();
Code
mthCode
=
dex
.
readCode
(
methodData
);
Code
mthCode
=
dex
.
readCode
(
methodData
);
regsCount
=
mthCode
.
getRegistersSize
();
regsCount
=
mthCode
.
getRegistersSize
();
initMethodTypes
();
if
(!
parseSignature
())
{
retType
=
mthInfo
.
getReturnType
();
initArguments
(
mthInfo
.
getArgumentsTypes
());
}
InsnDecoder
decoder
=
new
InsnDecoder
(
this
,
mthCode
);
InsnDecoder
decoder
=
new
InsnDecoder
(
this
,
mthCode
);
InsnNode
[]
insnByOffset
=
decoder
.
run
();
InsnNode
[]
insnByOffset
=
decoder
.
run
();
...
@@ -117,6 +108,13 @@ public class MethodNode extends AttrNode implements ILoadable {
...
@@ -117,6 +108,13 @@ public class MethodNode extends AttrNode implements ILoadable {
}
}
}
}
private
void
initMethodTypes
()
{
if
(!
parseSignature
())
{
retType
=
mthInfo
.
getReturnType
();
initArguments
(
mthInfo
.
getArgumentsTypes
());
}
}
@Override
@Override
public
void
unload
()
{
public
void
unload
()
{
if
(
noCode
)
if
(
noCode
)
...
@@ -185,12 +183,12 @@ public class MethodNode extends AttrNode implements ILoadable {
...
@@ -185,12 +183,12 @@ public class MethodNode extends AttrNode implements ILoadable {
private
void
initArguments
(
List
<
ArgType
>
args
)
{
private
void
initArguments
(
List
<
ArgType
>
args
)
{
int
pos
;
int
pos
;
if
(!
noCode
)
{
if
(
noCode
)
{
pos
=
1
;
}
else
{
pos
=
regsCount
;
pos
=
regsCount
;
for
(
ArgType
arg
:
args
)
for
(
ArgType
arg
:
args
)
pos
-=
arg
.
getRegCount
();
pos
-=
arg
.
getRegCount
();
}
else
{
pos
=
2
*
args
.
size
()
+
1
;
}
}
if
(
accFlags
.
isStatic
())
{
if
(
accFlags
.
isStatic
())
{
...
...
src/samples/java/jadx/samples/TestGenerics.java
View file @
550659d3
...
@@ -11,7 +11,11 @@ public class TestGenerics extends AbstractTest {
...
@@ -11,7 +11,11 @@ public class TestGenerics extends AbstractTest {
public
Class
<?>[]
classes
;
public
Class
<?>[]
classes
;
public
static
class
GenericClass
implements
Comparable
<
String
>
{
public
interface
MyComparable
<
T
>
{
public
int
compareTo
(
T
o
);
}
public
static
class
GenericClass
implements
MyComparable
<
String
>
{
@Override
@Override
public
int
compareTo
(
String
o
)
{
public
int
compareTo
(
String
o
)
{
return
0
;
return
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