Skip to content
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

[Offline Plugin] Miss security flags when registering the broadcast receiver in Android 14 #76

Open
harrydabeeo opened this issue Nov 26, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@harrydabeeo
Copy link

I implemented the offline plugin and ran it on Android 14. The app met a crash due to missing security flags for the broadcast receiver.
Hope be fixed soon.

Caused by: java.lang.SecurityException:  One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
                                                                                                    	at android.os.Parcel.createExceptionOrNull(Parcel.java:3069)
                                                                                                    	at android.os.Parcel.createException(Parcel.java:3053)
                                                                                                    	at android.os.Parcel.readException(Parcel.java:3036)
                                                                                                    	at android.os.Parcel.readException(Parcel.java:2978)
                                                                                                    	at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6157)
                                                                                                    	at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913)
                                                                                                    	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1853)
                                                                                                    	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1841)
                                                                                                    	at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772)
                                                                                                    	at org.maplibre.android.plugins.offline.offline.OfflineDownloadService.onCreate(OfflineDownloadService.java:65)
                                                                                                    	at android.app.ActivityThread.handleCreateService(ActivityThread.java:5098)
                                                                                                    	at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0) 
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2506) 
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:230) 
                                                                                                    	at android.os.Looper.loop(Looper.java:319) 
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8919) 
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) 
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) 
@louwers louwers added the help wanted Extra attention is needed label Nov 26, 2024
@tr4n
Copy link
Contributor

tr4n commented Dec 16, 2024

@louwers I created a pull request to fix this issue. It works from my side.
Could you review it?
#78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants