Magisk/app/src/main/java/com/topjohnwu/magisk/Info.kt
Viktor De Pasquale e595937740 Added versions to home screen
To overview (when updatable)
  - It is very hard to spot a difference in versions so versions are now regarded as commit messages (after dash [-]) when applicable
      - This will result in more clear, understandable text
      - Bleeding edge (canary) user would see:

        ffed229 > ffe02ed or 19.4 > ffe02ed

        as opposed to:

        19.4-ffed229 (19404)
        19.5-ffe02ed (19501)
      - Regular beta+ user would see:

        19.4 > 19.5
To bottom of the screen
  - This change is with respect to regular user. They don't care which version they run as long as they know that "up-to-date" is a gold standard
  - It takes tons of real-estate on the screen which takes away the glance-ability from the overview.
2019-10-07 20:09:12 +02:00

29 lines
691 B
Kotlin

package com.topjohnwu.magisk
import com.topjohnwu.magisk.model.entity.UpdateInfo
import com.topjohnwu.superuser.Shell
import com.topjohnwu.superuser.ShellUtils
object Info {
@JvmStatic
var magiskVersionCode = -1
@JvmStatic
var magiskVersionString = ""
var remote = UpdateInfo()
var keepVerity = false
var keepEnc = false
var recovery = false
fun loadMagiskInfo() {
runCatching {
magiskVersionString = ShellUtils.fastCmd("magisk -v").split(":".toRegex())[0]
magiskVersionCode = ShellUtils.fastCmd("magisk -V").toInt()
Config.magiskHide = Shell.su("magiskhide --status").exec().isSuccess
}
}
}