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

Fix api33 #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix api33 #22

wants to merge 1 commit into from

Conversation

Zeno97
Copy link

@Zeno97 Zeno97 commented Mar 20, 2024

This pull requests fixes conflict issues with api 33

@TheNoiselessNoise
Copy link

TheNoiselessNoise commented May 28, 2024

From SDK 33 (Android 13) registerReceiver needs a flag, otherwise you get a SecurityException.
java.lang.SecurityException: com.package.name: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts.

if (android.os.Build.VERSION.SDK_INT >= 33) {
    registerReceiver(dataWedgeBroadcastReceiver, intentFilter, RECEIVER_EXPORTED)
} else {
    registerReceiver(dataWedgeBroadcastReceiver, intentFilter)
}

@Zeno97
Copy link
Author

Zeno97 commented Nov 3, 2024

From SDK 33 (Android 13) registerReceiver needs a flag, otherwise you get a SecurityException. java.lang.SecurityException: com.package.name: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts.

if (android.os.Build.VERSION.SDK_INT >= 33) {
    registerReceiver(dataWedgeBroadcastReceiver, intentFilter, RECEIVER_EXPORTED)
} else {
    registerReceiver(dataWedgeBroadcastReceiver, intentFilter)
}

Hello, thanks for the advice. In my case I was compiling target api 33 but zebra device was Android 7 and for this this pull request was working.
Actually I don't own anymore a zebra device, so I can't really help in my current situation.
For everyone is looking for a solution for a Zebra with android 11 I would suggest to sub fork my fork and try this snippet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants