From ff4cea229a39c0765b2b74631d7fbe143a31c2b6 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Tue, 1 Dec 2020 01:21:36 +0800 Subject: [PATCH] Check environment on emulator We need to test modules on emulator. --- .../com/topjohnwu/magisk/ui/home/HomeViewModel.kt | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt index 6fe01794a..7432b013b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt @@ -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) {