Hide OTA option on Pixel devices
This commit is contained in:
parent
85bef8fa96
commit
0ef92a4866
@ -33,6 +33,7 @@ object Info {
|
|||||||
@JvmStatic var ramdisk = false
|
@JvmStatic var ramdisk = false
|
||||||
@JvmStatic var hasGMS = true
|
@JvmStatic var hasGMS = true
|
||||||
@JvmStatic var crypto = ""
|
@JvmStatic var crypto = ""
|
||||||
|
@JvmStatic var isPixel = false
|
||||||
|
|
||||||
val isConnected by lazy {
|
val isConnected by lazy {
|
||||||
ObservableBoolean(false).also { field ->
|
ObservableBoolean(false).also { field ->
|
||||||
|
@ -38,14 +38,16 @@ class RootInit : Shell.Initializer() {
|
|||||||
add("mm_init")
|
add("mm_init")
|
||||||
}.exec()
|
}.exec()
|
||||||
|
|
||||||
fun getvar(name: String) = ShellUtils.fastCmd(shell, "echo \$$name")
|
fun fastCmd(cmd: String) = ShellUtils.fastCmd(shell, cmd)
|
||||||
fun getBool(name: String) = getvar(name).toBoolean()
|
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.isSAR = getBool("SYSTEM_ROOT")
|
||||||
Info.ramdisk = getBool("RAMDISKEXIST")
|
Info.ramdisk = getBool("RAMDISKEXIST")
|
||||||
Info.isAB = getBool("ISAB")
|
Info.isAB = getBool("ISAB")
|
||||||
Info.crypto = getvar("CRYPTOTYPE")
|
Info.crypto = getVar("CRYPTOTYPE")
|
||||||
|
Info.isPixel = fastCmd("getprop ro.product.brand") == "google"
|
||||||
|
|
||||||
// Default presets
|
// Default presets
|
||||||
Config.recovery = getBool("RECOVERYMODE")
|
Config.recovery = getBool("RECOVERYMODE")
|
||||||
|
@ -213,7 +213,7 @@
|
|||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/method_inactive_slot"
|
android:id="@+id/method_inactive_slot"
|
||||||
style="@style/WidgetFoundation.RadioButton"
|
style="@style/WidgetFoundation.RadioButton"
|
||||||
gone="@{!viewModel.isRooted || !Info.isAB}"
|
gone="@{!viewModel.isRooted || Info.isPixel || !Info.isAB}"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/install_inactive_slot" />
|
android:text="@string/install_inactive_slot" />
|
||||||
|
Loading…
Reference in New Issue
Block a user