Skip to content

Fixed ProGuard rules for obfuscation to work correctly #2983

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

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

shanshin
Copy link
Contributor

The current rules only apply if the companion class is called Companion. If obfuscation is triggered, the rule does not work and the static Companion field is not kept, which breaks the lookup of a companion.

A rule has also been added that preserves the named companion class name and field, as they must match to correctly search for the named companion in runtime.

Fixes #2976

The current rules only apply if the companion class is called `Companion`. If obfuscation is triggered, the rule does not work and the static `Companion` field is not kept, which breaks the lookup of a companion.

A rule has also been added that preserves the named companion class name and field, as they must match to correctly search for the named companion in runtime.

Fixes #2976
@shanshin shanshin requested a review from sandwwraith April 14, 2025 13:07
@shanshin shanshin merged commit 4667a18 into master Apr 15, 2025
4 checks passed
@shanshin shanshin deleted the r8-obfuscation branch April 15, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing R8 rule for library obfuscation
2 participants