From e47f4cc177485b36cde7f97c54a35ca6540c62ec Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 7 Oct 2023 10:03:45 -0400 Subject: [PATCH] Specify broadcast receiver export flags Really only useful once we target Android 14, but doesn't hurt to do it now. --- .../tachiyomi/extension/installer/PackageInstallerInstaller.kt | 3 ++- .../eu/kanade/tachiyomi/extension/util/ExtensionInstaller.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt index 0b6b3e724..fc8d0f46c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt @@ -8,6 +8,7 @@ import android.content.Intent import android.content.IntentFilter import android.content.pm.PackageInstaller import android.os.Build +import androidx.core.content.ContextCompat import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.util.lang.use import eu.kanade.tachiyomi.util.system.getParcelableExtraCompat @@ -100,7 +101,7 @@ class PackageInstallerInstaller(private val service: Service) : Installer(servic } init { - service.registerReceiver(packageActionReceiver, IntentFilter(INSTALL_ACTION)) + ContextCompat.registerReceiver(service, packageActionReceiver, IntentFilter(INSTALL_ACTION), ContextCompat.RECEIVER_EXPORTED) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstaller.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstaller.kt index 5ea3a3ee6..01f212d8e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstaller.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstaller.kt @@ -264,7 +264,7 @@ internal class ExtensionInstaller(private val context: Context) { isRegistered = true val filter = IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE) - context.registerReceiver(this, filter) + ContextCompat.registerReceiver(context, this, filter, ContextCompat.RECEIVER_EXPORTED) } /**