mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-19 19:18:30 +00:00
Fix outdated state
This commit is contained in:
parent
1735a713cb
commit
dd565a11ea
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user