mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 18:57:39 +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
|
||||
|
||||
import android.os.Build
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.topjohnwu.magisk.BuildConfig
|
||||
@ -152,17 +151,7 @@ class HomeViewModel(
|
||||
MagiskState.NOT_INSTALLED,
|
||||
MagiskState.LOADING
|
||||
)
|
||||
|
||||
// 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
|
||||
}
|
||||
if (invalidStates.any { it == stateMagisk } || shownDialog) return
|
||||
|
||||
val result = Shell.su("env_check").await()
|
||||
if (!result.isSuccess) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user