Skip to content

Commit

Permalink
fix: better package-info support
Browse files Browse the repository at this point in the history
  • Loading branch information
nitram84 committed Dec 14, 2024
1 parent 17695ba commit 560a615
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ public void updateGenericClsData(List<ArgType> generics, ArgType superClass, Lis

private static void processSpecialClasses(ClassNode cls) {
AccessInfo flags = cls.getAccessFlags();
if (flags.isSynthetic() && flags.isInterface() && flags.isAbstract()
&& cls.getName().equals("package-info")) {
if (flags.isInterface() && cls.getName().equals("package-info")) {
cls.add(AFlag.PACKAGE_INFO);
cls.add(AFlag.DONT_RENAME);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ public void test() {
"package special.pkg2;",
"",
"import org.jetbrains.annotations.ApiStatus;");
assertThat(searchCls(classes, "special.pkg3.package-info"))
.code().isEqualTo("\npackage special.pkg3;\n");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.class interface Lspecial/pkg3/package-info;
.super Ljava/lang/Object;

0 comments on commit 560a615

Please sign in to comment.