Update version check logic

This commit is contained in:
topjohnwu 2022-01-25 01:10:17 -08:00
parent 2fe3082518
commit 5c54a2c008
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ object Const {
const val MIN_VERCODE = 21000 const val MIN_VERCODE = 21000
fun atLeast_21_2() = Info.env.versionCode >= 21200 || isCanary() 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() = isCanary(Info.env.versionCode)
fun isCanary(ver: Int) = ver > 0 && ver % 100 != 0 fun isCanary(ver: Int) = ver > 0 && ver % 100 != 0

View File

@ -67,7 +67,7 @@ class SettingsViewModel : BaseViewModel(), BaseSettingsItem.Handler {
Magisk, Magisk,
SystemlessHosts SystemlessHosts
)) ))
if (Const.Version.isCanary()) { if (Const.Version.atLeast_24_0()) {
list.addAll(listOf(Zygisk, DenyList, DenyListConfig)) list.addAll(listOf(Zygisk, DenyList, DenyListConfig))
} }
} }