From 5c54a2c008911714deb4006d6b9f8cc2a17a2078 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 25 Jan 2022 01:10:17 -0800 Subject: [PATCH] Update version check logic --- app/src/main/java/com/topjohnwu/magisk/core/Const.kt | 1 + .../java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/Const.kt b/app/src/main/java/com/topjohnwu/magisk/core/Const.kt index 20530469e..984a46a7b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/Const.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/Const.kt @@ -29,6 +29,7 @@ object Const { const val MIN_VERCODE = 21000 fun atLeast_21_2() = Info.env.versionCode >= 21200 || isCanary() + fun atLeast_24_0() = Info.env.versionCode >= 24000 || isCanary() fun isCanary() = isCanary(Info.env.versionCode) fun isCanary(ver: Int) = ver > 0 && ver % 100 != 0 diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt index ed533e5c8..6b1ea3813 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt @@ -67,7 +67,7 @@ class SettingsViewModel : BaseViewModel(), BaseSettingsItem.Handler { Magisk, SystemlessHosts )) - if (Const.Version.isCanary()) { + if (Const.Version.atLeast_24_0()) { list.addAll(listOf(Zygisk, DenyList, DenyListConfig)) } }