Support Cuttlefish

This commit is contained in:
topjohnwu 2024-07-19 22:08:35 -07:00
parent 659dd09723
commit bbb8efe92c
3 changed files with 6 additions and 4 deletions

View File

@ -19,7 +19,6 @@ import com.topjohnwu.magisk.core.utils.NetworkObserver
import com.topjohnwu.magisk.core.utils.ProcessLifecycle
import com.topjohnwu.magisk.core.utils.RootUtils
import com.topjohnwu.magisk.core.utils.ShellInit
import com.topjohnwu.magisk.view.Notifications
import com.topjohnwu.superuser.Shell
import com.topjohnwu.superuser.internal.UiThreadHandler
import com.topjohnwu.superuser.ipc.RootService
@ -103,7 +102,6 @@ object AppContext : ContextWrapper(null),
val lm = getSystemService(LocaleManager::class.java)
lm.overrideLocaleConfig = LocaleSetting.localeConfig
}
Notifications.setup()
ProcessLifecycle.init(this)
NetworkObserver.init(this)
if (!BuildConfig.DEBUG && !isRunningAsStub) {

View File

@ -1,6 +1,7 @@
package com.topjohnwu.magisk.core
import android.app.KeyguardManager
import android.os.Build
import androidx.lifecycle.MutableLiveData
import com.topjohnwu.magisk.StubApk
import com.topjohnwu.magisk.core.ktx.getProperty
@ -48,8 +49,9 @@ object Info {
var hasGMS = true
val isEmulator =
getProperty("ro.kernel.qemu", "0") == "1" ||
getProperty("ro.boot.qemu", "0") == "1"
Build.DEVICE.contains("vsoc")
|| getProperty("ro.kernel.qemu", "0") == "1"
|| getProperty("ro.boot.qemu", "0") == "1"
val isConnected = MutableLiveData(false)

View File

@ -19,6 +19,7 @@ import com.topjohnwu.magisk.core.isRunningAsStub
import com.topjohnwu.magisk.core.ktx.writeTo
import com.topjohnwu.magisk.core.tasks.AppMigration
import com.topjohnwu.magisk.core.utils.RootUtils
import com.topjohnwu.magisk.view.Notifications
import com.topjohnwu.magisk.view.Shortcuts
import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.launch
@ -147,6 +148,7 @@ class SplashController<T>(private val activity: T)
return
}
Notifications.setup()
JobService.schedule(this)
Shortcuts.setupDynamic(this)