-
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: remove invalid chars from class names (#488)
- Loading branch information
Showing
5 changed files
with
45 additions
and
4 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
36 changes: 36 additions & 0 deletions
36
jadx-core/src/test/java/jadx/tests/integration/names/TestClassNameWithInvalidChar.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,36 @@ | ||
package jadx.tests.integration.names; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.api.JadxDecompiler; | ||
import jadx.api.JadxInternalAccess; | ||
import jadx.core.dex.nodes.ClassNode; | ||
import jadx.core.dex.nodes.RootNode; | ||
import jadx.tests.api.SmaliTest; | ||
|
||
public class TestClassNameWithInvalidChar extends SmaliTest { | ||
/* | ||
public class do- {} | ||
public class i-f {} | ||
*/ | ||
|
||
@Test | ||
public void test() { | ||
JadxDecompiler d = loadSmaliFiles("names", "TestClassNameWithInvalidChar"); | ||
RootNode root = JadxInternalAccess.getRoot(d); | ||
for (ClassNode cls : root.getClasses(false)) { | ||
decompileAndCheckCls(d, cls); | ||
} | ||
} | ||
|
||
@Test | ||
public void testWithDeobfuscation() { | ||
enableDeobfuscation(); | ||
|
||
JadxDecompiler d = loadSmaliFiles("names", "TestClassNameWithInvalidChar"); | ||
RootNode root = JadxInternalAccess.getRoot(d); | ||
for (ClassNode cls : root.getClasses(false)) { | ||
decompileAndCheckCls(d, cls); | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
jadx-core/src/test/smali/names/TestClassNameWithInvalidChar/a.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,2 @@ | ||
.class public Ldo-; | ||
.super Ljava/lang/Object; |
2 changes: 2 additions & 0 deletions
2
jadx-core/src/test/smali/names/TestClassNameWithInvalidChar/b.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,2 @@ | ||
.class public Li-f; | ||
.super Ljava/lang/Object; |