-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolve inherited method to use correct alias (#1582)
- Loading branch information
Showing
4 changed files
with
47 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
41 changes: 41 additions & 0 deletions
41
jadx-core/src/test/java/jadx/tests/integration/deobf/TestInheritedMethodRename.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,41 @@ | ||
package jadx.tests.integration.deobf; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.tests.api.IntegrationTest; | ||
|
||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat; | ||
|
||
public class TestInheritedMethodRename extends IntegrationTest { | ||
|
||
public static class TestCls { | ||
|
||
public static class A extends B { | ||
} | ||
|
||
public static class B { | ||
public void call() { | ||
System.out.println("call"); | ||
} | ||
} | ||
|
||
public void test(A a) { | ||
// reference to A.call() not renamed, | ||
// should be resolved to B.call() and use alias | ||
a.call(); | ||
} | ||
} | ||
|
||
@Test | ||
public void test() { | ||
noDebugInfo(); | ||
enableDeobfuscation(); | ||
getArgs().setDeobfuscationMinLength(99); | ||
|
||
assertThat(getClassNode(TestCls.class)) | ||
.code() | ||
.containsOne("public void m0call() {") | ||
.doesNotContain(".call();") | ||
.containsOne(".m0call();"); | ||
} | ||
} |
2 changes: 0 additions & 2 deletions
2
jadx-core/src/test/java/jadx/tests/integration/names/TestClassNamesCollision2.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