You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Make emulator direct install env fix
This commit is contained in:
@@ -12,6 +12,7 @@ import com.topjohnwu.magisk.arch.BaseViewModel
|
||||
import com.topjohnwu.magisk.arch.diffListOf
|
||||
import com.topjohnwu.magisk.arch.itemBindingOf
|
||||
import com.topjohnwu.magisk.core.Const
|
||||
import com.topjohnwu.magisk.core.Info
|
||||
import com.topjohnwu.magisk.core.tasks.FlashZip
|
||||
import com.topjohnwu.magisk.core.tasks.MagiskInstaller
|
||||
import com.topjohnwu.magisk.core.utils.MediaStoreUtils
|
||||
@@ -69,7 +70,10 @@ class FlashViewModel(
|
||||
FlashZip.Uninstall(installer, outItems, logItems).exec()
|
||||
}
|
||||
Const.Value.FLASH_MAGISK -> {
|
||||
MagiskInstaller.Direct(installer, outItems, logItems).exec()
|
||||
if (Info.isEmulator)
|
||||
MagiskInstaller.Emulator(installer, outItems, logItems).exec()
|
||||
else
|
||||
MagiskInstaller.Direct(installer, outItems, logItems).exec()
|
||||
}
|
||||
Const.Value.FLASH_INACTIVE_SLOT -> {
|
||||
MagiskInstaller.SecondSlot(installer, outItems, logItems).exec()
|
||||
|
||||
@@ -27,7 +27,8 @@ class InstallViewModel(
|
||||
) : BaseViewModel(State.LOADED) {
|
||||
|
||||
val isRooted = Shell.rootAccess()
|
||||
val skipOptions = Info.ramdisk && !Info.isFDE && Info.isSAR
|
||||
val skipOptions = Info.isEmulator || (Info.ramdisk && !Info.isFDE && Info.isSAR)
|
||||
val noSecondSlot = !isRooted || Info.isPixel || !Info.isAB || Info.isEmulator
|
||||
|
||||
@get:Bindable
|
||||
var step = if (skipOptions) 1 else 0
|
||||
|
||||
Reference in New Issue
Block a user