Add sui support (#6318)

* Update shizuku api version

* SettingsAdvanced Controller: Verify if Sui is available
This commit is contained in:
Carlos Ruiz 2021-12-05 17:19:37 +01:00 committed by GitHub
parent e51a6d332e
commit 0a6160d7cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -271,7 +271,7 @@ dependencies {
implementation("com.mikepenz:aboutlibraries-core:${BuildPluginsVersion.ABOUTLIB_PLUGIN}") implementation("com.mikepenz:aboutlibraries-core:${BuildPluginsVersion.ABOUTLIB_PLUGIN}")
// Shizuku // Shizuku
val shizukuVersion = "12.0.0" val shizukuVersion = "12.1.0"
implementation("dev.rikka.shizuku:api:$shizukuVersion") implementation("dev.rikka.shizuku:api:$shizukuVersion")
implementation("dev.rikka.shizuku:provider:$shizukuVersion") implementation("dev.rikka.shizuku:provider:$shizukuVersion")

View File

@ -39,6 +39,7 @@ import eu.kanade.tachiyomi.util.system.MiuiUtil
import eu.kanade.tachiyomi.util.system.isPackageInstalled import eu.kanade.tachiyomi.util.system.isPackageInstalled
import eu.kanade.tachiyomi.util.system.powerManager import eu.kanade.tachiyomi.util.system.powerManager
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import rikka.sui.Sui
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
@ -222,7 +223,7 @@ class SettingsAdvancedController : SettingsController() {
onChange { onChange {
if (it == PreferenceValues.ExtensionInstaller.SHIZUKU.name && if (it == PreferenceValues.ExtensionInstaller.SHIZUKU.name &&
!context.isPackageInstalled("moe.shizuku.privileged.api") !(context.isPackageInstalled("moe.shizuku.privileged.api") || Sui.isSui())
) { ) {
MaterialAlertDialogBuilder(context) MaterialAlertDialogBuilder(context)
.setTitle(R.string.ext_installer_shizuku) .setTitle(R.string.ext_installer_shizuku)