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
78b39a60
Commit
78b39a60
authored
May 11, 2015
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fixed invoke arguments list (fix #61)
parent
932966b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+3
-1
TestConstructorInvoke.java
.../jadx/tests/integration/invoke/TestConstructorInvoke.java
+37
-0
No files found.
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
View file @
78b39a60
...
...
@@ -640,6 +640,7 @@ public class InsnGen {
}
int
argsCount
=
insn
.
getArgsCount
();
code
.
add
(
'('
);
boolean
firstArg
=
true
;
if
(
k
<
argsCount
)
{
boolean
overloaded
=
callMth
!=
null
&&
callMth
.
isArgsOverload
();
for
(
int
i
=
k
;
i
<
argsCount
;
i
++)
{
...
...
@@ -651,7 +652,7 @@ public class InsnGen {
if
(
callArg
!=
null
&&
callArg
.
contains
(
AFlag
.
SKIP_ARG
))
{
continue
;
}
if
(
i
!=
k
)
{
if
(
!
firstArg
)
{
code
.
add
(
", "
);
}
boolean
cast
=
overloaded
&&
processOverloadedArg
(
code
,
callMth
,
arg
,
i
-
startArgNum
);
...
...
@@ -659,6 +660,7 @@ public class InsnGen {
continue
;
}
addArg
(
code
,
arg
,
false
);
firstArg
=
false
;
}
}
code
.
add
(
')'
);
...
...
jadx-core/src/test/java/jadx/tests/integration/invoke/TestConstructorInvoke.java
0 → 100644
View file @
78b39a60
package
jadx
.
tests
.
integration
.
invoke
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.tests.api.IntegrationTest
;
import
org.junit.Test
;
import
static
org
.
hamcrest
.
Matchers
.
containsString
;
import
static
org
.
junit
.
Assert
.
assertThat
;
public
class
TestConstructorInvoke
extends
IntegrationTest
{
public
class
TestCls
{
void
test
(
String
root
,
String
name
)
{
ViewHolder
viewHolder
=
new
ViewHolder
(
root
,
name
);
}
private
final
class
ViewHolder
{
private
int
mElements
=
0
;
private
final
String
mRoot
;
private
String
mName
;
private
ViewHolder
(
String
root
,
String
name
)
{
this
.
mRoot
=
root
;
this
.
mName
=
name
;
}
}
}
@Test
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestConstructorInvoke
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
containsString
(
"new ViewHolder(root, name);"
));
}
}
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