Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions android/capacitor/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@

-keep public class * extends com.getcapacitor.Plugin { *; }

# The annotation types are read at runtime via reflection. If they are not kept, R8 full mode
# treats them as never instantiated and optimizes the annotation cached in PluginHandle to null,
# even with -keepattributes *Annotation*.
-keep @interface com.getcapacitor.annotation.** { *; }
-keep @interface com.getcapacitor.PluginMethod { *; }

# Rules for Capacitor v2 plugins and annotations
# These are deprecated but can still be used with Capacitor for now
-keep @com.getcapacitor.NativePlugin public class * {
@com.getcapacitor.PluginMethod public <methods>;
}
-keep @interface com.getcapacitor.NativePlugin { *; }

# Rules for Cordova plugins
-keep public class * extends org.apache.cordova.* {
Expand Down