diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt index 3a2ac5140..ffb07682e 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt @@ -83,7 +83,7 @@ class SettingsViewModel : BaseViewModel(), BaseSettingsItem.Handler { // Can hide overlay windows on 12.0+ list.remove(Tapjack) } - if (Const.Version.isCanary()) { + if (Const.Version.atLeast_30_1()) { list.add(Restrict) } } diff --git a/app/core/src/main/java/com/topjohnwu/magisk/core/Const.kt b/app/core/src/main/java/com/topjohnwu/magisk/core/Const.kt index 55814b407..e6f432d29 100644 --- a/app/core/src/main/java/com/topjohnwu/magisk/core/Const.kt +++ b/app/core/src/main/java/com/topjohnwu/magisk/core/Const.kt @@ -26,9 +26,11 @@ object Const { const val MIN_VERSION = "v22.0" const val MIN_VERCODE = 22000 - fun atLeast_24_0() = Info.env.versionCode >= 24000 - fun atLeast_25_0() = Info.env.versionCode >= 25000 - fun atLeast_28_0() = Info.env.versionCode >= 28000 + private fun isCanary() = (Info.env.versionCode % 100) != 0 + fun atLeast_24_0() = Info.env.versionCode >= 24000 || isCanary() + fun atLeast_25_0() = Info.env.versionCode >= 25000 || isCanary() + fun atLeast_28_0() = Info.env.versionCode >= 28000 || isCanary() + fun atLeast_30_1() = Info.env.versionCode >= 30100 || isCanary() } object ID { diff --git a/app/gradle.properties b/app/gradle.properties index e3f24f83e..5ae76e9dc 100644 --- a/app/gradle.properties +++ b/app/gradle.properties @@ -30,4 +30,4 @@ android.nonFinalResIds=false # Magisk magisk.stubVersion=40 -magisk.versionCode=30000 +magisk.versionCode=30001