Fix outdated state

This commit is contained in:
vvb2060 2022-08-08 23:45:22 +08:00 committed by John Wu
parent 1735a713cb
commit dd565a11ea
2 changed files with 4 additions and 2 deletions

View File

@ -67,9 +67,10 @@ object Info {
) {
val versionCode = when {
code < Const.Version.MIN_VERCODE -> -1
else -> if (isRooted) code else -1
isRooted -> code
else -> -1
}
val isUnsupported = code > 0 && code < Const.Version.MIN_VERCODE
val isActive = versionCode >= 0
val isActive = versionCode > 0
}
}

View File

@ -43,6 +43,7 @@ class HomeViewModel(
val magiskState
get() = when {
Info.isRooted && Info.env.isUnsupported -> State.OUTDATED
!Info.env.isActive -> State.INVALID
Info.env.versionCode < BuildConfig.VERSION_CODE -> State.OUTDATED
else -> State.UP_TO_DATE