diff --git a/app/src/gitHub/java/me/magnum/melonds/github/services/GitHubUpdateInstallManager.kt b/app/src/gitHub/java/me/magnum/melonds/github/services/GitHubUpdateInstallManager.kt index b7e60d7b..257ef7f1 100644 --- a/app/src/gitHub/java/me/magnum/melonds/github/services/GitHubUpdateInstallManager.kt +++ b/app/src/gitHub/java/me/magnum/melonds/github/services/GitHubUpdateInstallManager.kt @@ -7,6 +7,7 @@ import android.content.Intent import android.content.IntentFilter import android.database.ContentObserver import android.net.Uri +import android.os.Build import androidx.core.content.getSystemService import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow @@ -32,7 +33,18 @@ class GitHubUpdateInstallManager(private val context: Context) : UpdateInstallMa private var pendingDownloadId: Long? = null init { - context.registerReceiver(downloadCompleteReceiver, IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + context.registerReceiver( + downloadCompleteReceiver, + IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), + Context.RECEIVER_EXPORTED, + ) + } else { + context.registerReceiver( + downloadCompleteReceiver, + IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), + ) + } } override fun downloadAndInstallUpdate(update: AppUpdate): Flow = flow {