-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
14 changed files
with
343 additions
and
2 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
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
30 changes: 30 additions & 0 deletions
30
jadx-core/src/test/java/jadx/tests/integration/conditions/TestBooleanToByte.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,30 @@ | ||
package jadx.tests.integration.conditions; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.core.dex.nodes.ClassNode; | ||
import jadx.tests.api.SmaliTest; | ||
|
||
public class TestBooleanToByte extends SmaliTest { | ||
|
||
/** | ||
private boolean showConsent; | ||
public void write(byte b) { | ||
} | ||
public void writeToParcel(TestBooleanToByte testBooleanToByte) { | ||
testBooleanToByte.write(this.showConsent ? (byte) 1 : 0); | ||
} | ||
*/ | ||
@Test | ||
public void test() { | ||
ClassNode cls = getClassNodeFromSmaliWithPath("conditions", "TestBooleanToByte"); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsString("write(this.showConsent ? (byte) 1 : 0);")); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
jadx-core/src/test/java/jadx/tests/integration/conditions/TestBooleanToChar.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,30 @@ | ||
package jadx.tests.integration.conditions; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.core.dex.nodes.ClassNode; | ||
import jadx.tests.api.SmaliTest; | ||
|
||
public class TestBooleanToChar extends SmaliTest { | ||
|
||
/** | ||
private boolean showConsent; | ||
public void write(char b) { | ||
} | ||
public void writeToParcel(TestBooleanToChar testBooleanToChar) { | ||
testBooleanToChar.write(this.showConsent ? (char) 1 : 0); | ||
} | ||
*/ | ||
@Test | ||
public void test() { | ||
ClassNode cls = getClassNodeFromSmaliWithPath("conditions", "TestBooleanToChar"); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsString("write(this.showConsent ? (char) 1 : 0);")); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
jadx-core/src/test/java/jadx/tests/integration/conditions/TestBooleanToDouble.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,30 @@ | ||
package jadx.tests.integration.conditions; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.core.dex.nodes.ClassNode; | ||
import jadx.tests.api.SmaliTest; | ||
|
||
public class TestBooleanToDouble extends SmaliTest { | ||
|
||
/** | ||
private boolean showConsent; | ||
public void write(double d) { | ||
} | ||
public void writeToParcel(TestBooleanToDouble testBooleanToDouble) { | ||
testBooleanToDouble.write(this.showConsent ? 1 : 0); | ||
} | ||
*/ | ||
@Test | ||
public void test() { | ||
ClassNode cls = getClassNodeFromSmaliWithPath("conditions", "TestBooleanToDouble"); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsString("write(this.showConsent ? 1.0d : 0.0d);")); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
jadx-core/src/test/java/jadx/tests/integration/conditions/TestBooleanToFloat.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,30 @@ | ||
package jadx.tests.integration.conditions; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.core.dex.nodes.ClassNode; | ||
import jadx.tests.api.SmaliTest; | ||
|
||
public class TestBooleanToFloat extends SmaliTest { | ||
|
||
/** | ||
private boolean showConsent; | ||
public void write(float f) { | ||
} | ||
public void writeToParcel(TestBooleanToFloat testBooleanToFloat) { | ||
testBooleanToFloat.write(this.showConsent ? 1 : 0); | ||
} | ||
*/ | ||
@Test | ||
public void test() { | ||
ClassNode cls = getClassNodeFromSmaliWithPath("conditions", "TestBooleanToFloat"); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsString("write(this.showConsent ? 1.0f : 0.0f);")); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
jadx-core/src/test/java/jadx/tests/integration/conditions/TestBooleanToLong.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,30 @@ | ||
package jadx.tests.integration.conditions; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.core.dex.nodes.ClassNode; | ||
import jadx.tests.api.SmaliTest; | ||
|
||
public class TestBooleanToLong extends SmaliTest { | ||
|
||
/** | ||
private boolean showConsent; | ||
public void write(long j) { | ||
} | ||
public void writeToParcel(TestBooleanToLong testBooleanToLong) { | ||
testBooleanToLong.write(this.showConsent ? 1 : 0); | ||
} | ||
*/ | ||
@Test | ||
public void test() { | ||
ClassNode cls = getClassNodeFromSmaliWithPath("conditions", "TestBooleanToLong"); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsString("write(this.showConsent ? 1 : 0);")); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
jadx-core/src/test/java/jadx/tests/integration/conditions/TestBooleanToShort.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,30 @@ | ||
package jadx.tests.integration.conditions; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.core.dex.nodes.ClassNode; | ||
import jadx.tests.api.SmaliTest; | ||
|
||
public class TestBooleanToShort extends SmaliTest { | ||
|
||
/** | ||
private boolean showConsent; | ||
public void write(short b) { | ||
} | ||
public void writeToParcel(TestBooleanToShort testBooleanToShort) { | ||
testBooleanToShort.write(this.showConsent ? (short) 1 : 0); | ||
} | ||
*/ | ||
@Test | ||
public void test() { | ||
ClassNode cls = getClassNodeFromSmaliWithPath("conditions", "TestBooleanToShort"); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsString("write(this.showConsent ? (short) 1 : 0);")); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
jadx-core/src/test/smali/conditions/TestBooleanToByte.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,22 @@ | ||
.class public LTestBooleanToByte; | ||
.super Ljava/lang/Object; | ||
|
||
.field private showConsent:Z | ||
|
||
.method public writeToParcel(LTestBooleanToByte;)V | ||
.locals 0 | ||
|
||
iget-boolean p1, p0, LTestBooleanToByte;->showConsent:Z | ||
|
||
int-to-byte p1, p1 | ||
|
||
invoke-virtual {p0, p1}, LTestBooleanToByte;->write(B)V | ||
|
||
return-void | ||
.end method | ||
|
||
.method public write(B)V | ||
.locals 0 | ||
|
||
return-void | ||
.end method |
22 changes: 22 additions & 0 deletions
22
jadx-core/src/test/smali/conditions/TestBooleanToChar.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,22 @@ | ||
.class public LTestBooleanToChar; | ||
.super Ljava/lang/Object; | ||
|
||
.field private showConsent:Z | ||
|
||
.method public writeToParcel(LTestBooleanToChar;)V | ||
.locals 0 | ||
|
||
iget-boolean p1, p0, LTestBooleanToChar;->showConsent:Z | ||
|
||
int-to-char p1, p1 | ||
|
||
invoke-virtual {p0, p1}, LTestBooleanToChar;->write(C)V | ||
|
||
return-void | ||
.end method | ||
|
||
.method public write(C)V | ||
.locals 0 | ||
|
||
return-void | ||
.end method |
22 changes: 22 additions & 0 deletions
22
jadx-core/src/test/smali/conditions/TestBooleanToDouble.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,22 @@ | ||
.class public LTestBooleanToDouble; | ||
.super Ljava/lang/Object; | ||
|
||
.field private showConsent:Z | ||
|
||
.method public writeToParcel(LTestBooleanToDouble;)V | ||
.locals 0 | ||
|
||
iget-boolean p1, p0, LTestBooleanToDouble;->showConsent:Z | ||
|
||
int-to-double p1, p1 | ||
|
||
invoke-virtual {p0, p1}, LTestBooleanToDouble;->write(D)V | ||
|
||
return-void | ||
.end method | ||
|
||
.method public write(D)V | ||
.locals 0 | ||
|
||
return-void | ||
.end method |
22 changes: 22 additions & 0 deletions
22
jadx-core/src/test/smali/conditions/TestBooleanToFloat.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,22 @@ | ||
.class public LTestBooleanToFloat; | ||
.super Ljava/lang/Object; | ||
|
||
.field private showConsent:Z | ||
|
||
.method public writeToParcel(LTestBooleanToFloat;)V | ||
.locals 0 | ||
|
||
iget-boolean p1, p0, LTestBooleanToFloat;->showConsent:Z | ||
|
||
int-to-float p1, p1 | ||
|
||
invoke-virtual {p0, p1}, LTestBooleanToFloat;->write(F)V | ||
|
||
return-void | ||
.end method | ||
|
||
.method public write(F)V | ||
.locals 0 | ||
|
||
return-void | ||
.end method |
22 changes: 22 additions & 0 deletions
22
jadx-core/src/test/smali/conditions/TestBooleanToLong.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,22 @@ | ||
.class public LTestBooleanToLong; | ||
.super Ljava/lang/Object; | ||
|
||
.field private showConsent:Z | ||
|
||
.method public writeToParcel(LTestBooleanToLong;)V | ||
.locals 0 | ||
|
||
iget-boolean p1, p0, LTestBooleanToLong;->showConsent:Z | ||
|
||
int-to-long p1, p1 | ||
|
||
invoke-virtual {p0, p1}, LTestBooleanToLong;->write(J)V | ||
|
||
return-void | ||
.end method | ||
|
||
.method public write(J)V | ||
.locals 0 | ||
|
||
return-void | ||
.end method |
Oops, something went wrong.