mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-26 19:57:38 +00:00
Check environment on emulator
We need to test modules on emulator.
This commit is contained in:
parent
3f81f9371f
commit
ff4cea229a
@ -1,6 +1,5 @@
|
|||||||
package com.topjohnwu.magisk.ui.home
|
package com.topjohnwu.magisk.ui.home
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import androidx.databinding.Bindable
|
import androidx.databinding.Bindable
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.topjohnwu.magisk.BuildConfig
|
import com.topjohnwu.magisk.BuildConfig
|
||||||
@ -152,17 +151,7 @@ class HomeViewModel(
|
|||||||
MagiskState.NOT_INSTALLED,
|
MagiskState.NOT_INSTALLED,
|
||||||
MagiskState.LOADING
|
MagiskState.LOADING
|
||||||
)
|
)
|
||||||
|
if (invalidStates.any { it == stateMagisk } || shownDialog) return
|
||||||
// Don't bother checking env when magisk is not installed, loading or already has been shown
|
|
||||||
if (
|
|
||||||
invalidStates.any { it == stateMagisk } ||
|
|
||||||
shownDialog ||
|
|
||||||
// don't care for emulators either
|
|
||||||
Build.DEVICE.orEmpty().contains("generic") ||
|
|
||||||
Build.PRODUCT.orEmpty().contains("generic")
|
|
||||||
) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
val result = Shell.su("env_check").await()
|
val result = Shell.su("env_check").await()
|
||||||
if (!result.isSuccess) {
|
if (!result.isSuccess) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user