Skip to content

fix(proguard): update rules to preserve enum constants and collection interfaces for Moshi#10698

Merged
rafaeltonholo merged 1 commit into
thunderbird:mainfrom
rafaeltonholo:fix/10697/update-proguard-rules
Mar 17, 2026
Merged

fix(proguard): update rules to preserve enum constants and collection interfaces for Moshi#10698
rafaeltonholo merged 1 commit into
thunderbird:mainfrom
rafaeltonholo:fix/10697/update-proguard-rules

Conversation

@rafaeltonholo
Copy link
Copy Markdown
Member

Fix #10697.

This pull request updates the ProGuard rules for both the K-9 Mail and Thunderbird Android apps to ensure compatibility with Moshi's JSON serialization/deserialization, especially when using R8 optimizations. The changes prevent R8 from stripping necessary enum constants and class structures that Moshi relies on for reflective access.

Changes

  • Added a rule to keep all fields in the net.thunderbird.core.common.mail.Flag enum, preventing R8 from stripping enum constants required by Moshi's EnumJsonAdapter for JSON deserialization.
  • Added a rule to keep all inner classes and fields of com.fsck.k9.controller.MessagingControllerCommands, ensuring Moshi can access collection types via reflection and is not broken by R8's class rewriting.

Testing

  • The test must be performed on release variants: K-9 fossRelease, Thunderbird foss/fullDaily, foss/fullBeta, foss/fullRelease
  • Test both adding a new account and importing accounts on both the K-9 and Thunderbird apps.

@rafaeltonholo rafaeltonholo requested a review from a team as a code owner March 17, 2026 12:07
@github-actions github-actions Bot added the tb-team Tasks and features handled by project maintainers label Mar 17, 2026
@rafaeltonholo rafaeltonholo requested a review from wmontwe March 17, 2026 12:08
@rafaeltonholo rafaeltonholo removed the request for review from jbott-tbird March 17, 2026 12:08
@rafaeltonholo rafaeltonholo assigned wmontwe and unassigned jbott-tbird Mar 17, 2026
Copy link
Copy Markdown
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rafaeltonholo rafaeltonholo merged commit 5e69a2b into thunderbird:main Mar 17, 2026
18 checks passed
@rafaeltonholo rafaeltonholo deleted the fix/10697/update-proguard-rules branch March 17, 2026 12:40
@thunderbird-botmobile thunderbird-botmobile Bot added this to the Thunderbird 19 milestone Mar 17, 2026
rafaeltonholo added a commit to rafaeltonholo/thunderbird-android that referenced this pull request Mar 17, 2026
coreycb added a commit that referenced this pull request Mar 17, 2026
@wmontwe wmontwe added the report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). tb-team Tasks and features handled by project maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CRASH] R8 stripping net.thunderbird.core.common.mail.Flag, used by Moshi

3 participants