Hide OTA option on Pixel devices

This commit is contained in:
topjohnwu
2020-09-23 04:49:18 -07:00
parent 85bef8fa96
commit 0ef92a4866
3 changed files with 8 additions and 5 deletions

View File

@@ -33,6 +33,7 @@ object Info {
@JvmStatic var ramdisk = false
@JvmStatic var hasGMS = true
@JvmStatic var crypto = ""
@JvmStatic var isPixel = false
val isConnected by lazy {
ObservableBoolean(false).also { field ->

View File

@@ -38,14 +38,16 @@ class RootInit : Shell.Initializer() {
add("mm_init")
}.exec()
fun getvar(name: String) = ShellUtils.fastCmd(shell, "echo \$$name")
fun getBool(name: String) = getvar(name).toBoolean()
fun fastCmd(cmd: String) = ShellUtils.fastCmd(shell, cmd)
fun getVar(name: String) = fastCmd("echo \$$name")
fun getBool(name: String) = getVar(name).toBoolean()
Const.MAGISKTMP = getvar("MAGISKTMP")
Const.MAGISKTMP = getVar("MAGISKTMP")
Info.isSAR = getBool("SYSTEM_ROOT")
Info.ramdisk = getBool("RAMDISKEXIST")
Info.isAB = getBool("ISAB")
Info.crypto = getvar("CRYPTOTYPE")
Info.crypto = getVar("CRYPTOTYPE")
Info.isPixel = fastCmd("getprop ro.product.brand") == "google"
// Default presets
Config.recovery = getBool("RECOVERYMODE")