Commit 5c54a2c0 authored by topjohnwu's avatar topjohnwu

Update version check logic

parent 2fe30825
...@@ -29,6 +29,7 @@ object Const { ...@@ -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
......
...@@ -67,7 +67,7 @@ class SettingsViewModel : BaseViewModel(), BaseSettingsItem.Handler { ...@@ -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))
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment