-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: force cast for null args in method invoke (temp fix for #724)
- Loading branch information
Showing
4 changed files
with
76 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
jadx-core/src/test/java/jadx/tests/integration/invoke/TestCastInOverloadedInvoke2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package jadx.tests.integration.invoke; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.core.dex.nodes.ClassNode; | ||
import jadx.tests.api.SmaliTest; | ||
|
||
import static jadx.tests.api.utils.JadxMatchers.containsOne; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
|
||
public class TestCastInOverloadedInvoke2 extends SmaliTest { | ||
|
||
@Test | ||
public void test() { | ||
disableCompilation(); | ||
|
||
ClassNode cls = getClassNodeFromSmali(); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("new Intent().putExtra(\"param\", (Parcelable) null);")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
jadx-core/src/test/smali/invoke/TestCastInOverloadedInvoke2.smali
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.class public Linvoke/TestCastInOverloadedInvoke2; | ||
.super Ljava/lang/Object; | ||
|
||
.method public test()V | ||
.locals 3 | ||
|
||
new-instance v0, Landroid/content/Intent; | ||
|
||
invoke-direct {v0}, Landroid/content/Intent;-><init>()V | ||
|
||
const-string v1, "param" | ||
|
||
const/4 v2, 0x0 | ||
|
||
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent; | ||
|
||
return-void | ||
.end method |