Skip to content

Commit

Permalink
add flag FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for PendingIntent and use …
Browse files Browse the repository at this point in the history
…RECEIVER_EXPORTED
  • Loading branch information
MikhailSuendukov committed Oct 11, 2023
1 parent cb4ec7c commit 8e533b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ static IntentSender getInstallStatusIntentSender(Context context, int requestCod
int broadcastFlags = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
broadcastFlags = PendingIntent.FLAG_MUTABLE;
if (Build.VERSION.SDK_INT >= 34) {
broadcastFlags |= PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT;
}
}
PendingIntent pendingIntent = PendingIntent.getBroadcast(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ private synchronized void registerListeners() {
AppCenterLog.debug(LOG_TAG, "Register receiver for installing a new release.");
mInstallStatusReceiver = new InstallStatusReceiver(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
mContext.registerReceiver(mInstallStatusReceiver, InstallStatusReceiver.getInstallerReceiverFilter(), Context.RECEIVER_NOT_EXPORTED);
mContext.registerReceiver(mInstallStatusReceiver, InstallStatusReceiver.getInstallerReceiverFilter(), Context.RECEIVER_EXPORTED);
} else {
mContext.registerReceiver(mInstallStatusReceiver, InstallStatusReceiver.getInstallerReceiverFilter());
}
Expand Down
2 changes: 1 addition & 1 deletion versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ext {
versionCode = 72
versionName = '5.0.3'
minSdkVersion = 21
compileSdkVersion = 33
compileSdkVersion = 34
targetSdkVersion = 34
annotationVersion = '1.2.0'
}

0 comments on commit 8e533b5

Please sign in to comment.