From e8f2c3f9886e08e452a66cc12feed0123d69d9d5 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 26 Oct 2026 00:28:56 +0600 Subject: [PATCH] Fix Sui not being detected as a Shizuku provider Closes #3785 (cherry picked from commit bd2ada2e82acdbbc02d294dd91336346b7e26782) --- CHANGELOG.md | 1 + .../tachiyomi/util/system/ContextExtensions.kt | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 127fc372f7..6ad75193f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - Fixed WebView sending source headers to other sites ([@AntsyLich](https://github.com/AntsyLich)) - Fixed downloads not showing for entries of a source sharing its name with another source ([@AntsyLich](https://github.com/AntsyLich)) - Fixed the More tab icon pausing and then bouncing back when leaving the tab ([@AntsyLich](https://github.com/AntsyLich)) +- Fixed Shizuku extension installer being unavailable with Sui ([@AntsyLich](https://github.com/AntsyLich)) ## [v0.21.2] - 2026-10-13 ### Fixed diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt index 29f4a81f8b..fe5cbd7b08 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt @@ -22,6 +22,7 @@ import eu.kanade.tachiyomi.util.lang.truncateCenter import logcat.LogPriority import mihon.app.di.appGraph import rikka.shizuku.ShizukuProvider +import rikka.sui.Sui import tachiyomi.core.common.i18n.stringResource import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR @@ -168,12 +169,13 @@ fun Context.isPackageInstalled(packageName: String): Boolean { val Context.hasMiuiPackageInstaller get() = isPackageInstalled("com.miui.packageinstaller") val Context.isShizukuInstalled: Boolean - get() = try { - packageManager.getPermissionInfo(ShizukuProvider.PERMISSION, 0) - true - } catch (e: PackageManager.NameNotFoundException) { - false - } + get() = Sui.isSui() || + try { + packageManager.getPermissionInfo(ShizukuProvider.PERMISSION, 0) + true + } catch (e: PackageManager.NameNotFoundException) { + false + } fun Context.launchRequestPackageInstallsPermission() { Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES).apply {