fix(android): add R8 keep rules to core

Closed
IT
1mo ago
+12-0

Description

Adds keep rules to core's proguard-rules.pro, which reaches every app through consumerProguardFiles:

  • the annotation types core reads at runtime, forwarded from #8646 without the NativePlugin line
  • @ActivityCallback and @PermissionCallback methods on any Plugin subclass, including non-public base classes

Tested on 9.0.0-alpha.8 with R8 on. With the current rules, an @ActivityCallback on a package-private base class is lost. With these rules it matches R8 off.

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

https://outsystemsrd.atlassian.net/browse/RMET-5521

Platforms Affected

  • Android
  • iOS
  • Web

Notes

The Room and Firebase rules from the first version now ship in the plugins that need them, per review. Capacitor 8 gets the callback rule in #8657.