cordova-plugin-music-controls2 icon indicating copy to clipboard operation
cordova-plugin-music-controls2 copied to clipboard

Android 14 (SDK 34) new security requirements

Open EltonFaust opened this issue 1 year ago • 1 comments

Android 14 had some security changes when register an broadcast receiver and when is created an mutable PendingIntent, this is throwing and exception preventing this plugin to work.

System.err: java.lang.SecurityException: net.my.cordova.app: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

Note: android.content.Context#registerReceiver only received a flags param on android SDK 26, so I split the registration of the broadcast receivers, only passing the flag to the affected version.

EltonFaust avatar Jul 02 '24 20:07 EltonFaust

@EltonFaust , thanks for this change! I cherry picked it in my fork of this repo. I hope @ghenry22 will choose to merge it. Apps that target SDK 34 (now required by the play store) crash without the change.

ddurham2 avatar Jul 30 '24 09:07 ddurham2