I updated my app to API 34 but an exception occurs for some of the users as “java.lang.SecurityException” When I search for it I found that Since Android 14 there is a requirement to specify the export flag when registering context-registered receivers as written here
Well I am confused that when I only change to API to 33 there is no problem in my published app. But With API 34 something is needed on the KODULAR I think. Is there anyone understand this problem?
Extentions I used as below;
Two of them yours actually Taifun Battery Optimization and TaifunFile
but I think the problem is related with ASDDownloader by @bodymindpower but I changed it with another ASDDownloader written by @The_K_Studio but problem on the google console I keep getting errors like below:
Runtime-registered broadcasts receivers must specify export behavior
Apps and services that target Android 14 (API level 34) or higher and use context-registered receivers are required to specify a flag to indicate whether or not the receiver should be exported to all other apps on the device: either RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED, respectively. This requirement helps protect apps from security vulnerabilities by leveraging the features for these receivers introduced in Android 13.
Can’t provide a bug report but in some phones it gives this error message after installing from google play in starting “Something went wrong with APP. APP closed because this app has a bug. Try updating this app after its developer provides a fix for this error” and immediately closes the app. But all I do it was in manifest file I manually changed the API version to 34. But when I downgrade it to API 33 everything works fine. On the console I see the error related to your extension is below:
I assume that some flag or permission for WRITE needs to be changed according to API 34 as google wants in your extension. Maybe lang related exception or something?
an Android 14 device is not required to test this, only a builder which targets sdk 34, which is for example available here https://ai2-test.appinventor.mit.edu/
I tried your last version (number 6 I think) I want to publish as a beta. But google play console says this:
One problem has been detected
We’ve spotted some common issues that prevent your app from being submitted for review. Please resolve these issues before submitting your changes for review.
Technical quality
The broadcast receiver is registered incorrectly
Applications targeting Android version 13 or later must specify export behavior when registerReceiver() is executed. If the export behavior is not specified, your application may crash.
Your app targets Android version 13 or later and registers non-system broadcast receivers without specifying export behavior in the following places:
com.thekstudio.asddownloader.ASDDownloader
Please update your application to specify export behavior for registered broadcast receivers.
Well I downgrade my app because I want lots of my users to use it! I think nobody really know that to do about their working apps at API 33 without problems. So what is it now?
I am seeing like these errors everywhere :
“Fatal Exception: 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”
I think google wants us a big think that couldn’t everyone to handle. Because I can not evet publish a new beta version for try, google refuses it because of the same issue… But all the codes are same, everything is same… But I am asking from all. What should we be do?
I started a beta test with your extension mentioned here. But I figured out that only changing manifest to API34 is useless. Then I used Enhancer given here Enhancer : A powerful tool to change API level, inject assets, dex, manifest, resources & native (.so) libraries and sign the APK
But this doesn’t work. Google sees it as targeted SDK is API33 even I did all the things written in Enhancer. So I did a different thing. After using enhancer, I decompiled the apk with apkeasytool. Although after decompilng it shows as API34. I manually opened the manifest file and changed small things related to my app usage and recompiled it agin with apkeasy. After that I send the file to my phone and used APK to AAB converter but this time I used different keystore file and build the AAB. Then I send it to google then booom. It says your app is OK now, it is API 34! But I don’t know if it really worked. I am waiting for the bug reports from the different kinds of anroid phones to say that this work like a charm. But I want to thank you again for the effort to help me. I ıhope everthings gonna be fine
edit: 1 bug report came now:
Exception java.lang.RuntimeException: Error while disconnecting UiAutomation@34526e8[id=-1, displayId=0, flags=0]
at android.app.UiAutomation.disconnect (UiAutomation.java:451)
at android.app.Instrumentation.finish (Instrumentation.java:272)
at androidx.test.runner.MonitoringInstrumentation.finish (MonitoringInstrumentation.java:9)
at androidx.test.runner.AndroidJUnitRunner.onStart (AndroidJUnitRunner.java:20)
at android.app.Instrumentation$InstrumentationThread.run (Instrumentation.java:2402)
Caused by android.os.DeadObjectException:
at android.os.BinderProxy.transactNative
at android.os.BinderProxy.transact (BinderProxy.java:584)
at android.app.IUiAutomationConnection$Stub$Proxy.disconnect (IUiAutomationConnection.java:471)
at android.app.UiAutomation.disconnect (UiAutomation.java:449)
I don’t know what is wrong but I think this is not extension related thing…