Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module and ModulePackages attributes are not obfuscated consistently #122

Open
mrjameshamilton opened this issue Feb 3, 2021 · 1 comment
Labels
bug Potential bug in ProGuard. confirmed java obfuscation

Comments

@mrjameshamilton
Copy link
Collaborator

mrjameshamilton commented Feb 3, 2021

Originally reported on SourceForge, confirmed to be still a problem in ProGuard 7.0.1

From SourceForge issue

With ProGuard 6.1.1 and JDK 11, a proguard output jar has a module-info.class whose Module attribute is obfuscated but whose ModulePackages attribute is not. This causes a failure when trying to create a JMOD file from the obfuscated jar:

> jmod create --class-path=obfuscated-mlib/demo.jar obfuscated-mlib/demo.jmod
Error: Package com.a missing from ModulePackages class file attribute
java.lang.module.InvalidModuleDescriptorException: Package com.a missing from ModulePackages class file attribute
    at java.base/jdk.internal.module.ModuleInfo.invalidModuleDescriptor(ModuleInfo.java:1092)
    at java.base/jdk.internal.module.ModuleInfo.doRead(ModuleInfo.java:325)
    at java.base/jdk.internal.module.ModuleInfo.read(ModuleInfo.java:132)
    at java.base/java.lang.module.ModuleDescriptor.read(ModuleDescriptor.java:2508)
    at jdk.jlink/jdk.tools.jmod.JmodTask$JmodFileWriter.writeModuleInfo(JmodTask.java:548)
    at jdk.jlink/jdk.tools.jmod.JmodTask$JmodFileWriter.write(JmodTask.java:481)
    at jdk.jlink/jdk.tools.jmod.JmodTask.create(JmodTask.java:438)
    at jdk.jlink/jdk.tools.jmod.JmodTask.run(JmodTask.java:208)
    at jdk.jlink/jdk.tools.jmod.Main.main(Main.java:34)

The above error message is from the small reproducer at https://github.com/dougxc/proguard-demo

Workaround

Use -keeppackagenames **

@asdfjkluiop
Copy link

This appears to still be an issue in 7.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Potential bug in ProGuard. confirmed java obfuscation
Projects
None yet
Development

No branches or pull requests

2 participants