mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-27 07:37:42 +00:00
Check command result
This commit is contained in:
parent
a6950b8aca
commit
fa3865e962
@ -226,10 +226,10 @@ object MagiskHide : BaseSettingsItem.Toggle() {
|
|||||||
override val description = R.string.settings_magiskhide_summary.asTransitive()
|
override val description = R.string.settings_magiskhide_summary.asTransitive()
|
||||||
override var value = Config.magiskHide
|
override var value = Config.magiskHide
|
||||||
set(value) = setV(value, field, { field = it }) {
|
set(value) = setV(value, field, { field = it }) {
|
||||||
Config.magiskHide = it
|
val cmd = if (it) "enable" else "disable"
|
||||||
when {
|
Shell.su("magiskhide --$cmd").submit { cb ->
|
||||||
it -> Shell.su("magiskhide --enable").submit()
|
if (cb.isSuccess) Config.magiskHide = it
|
||||||
else -> Shell.su("magiskhide --disable").submit()
|
else field = !it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user