Commit ba31c6b6 authored by topjohnwu's avatar topjohnwu

Use coroutines instead of raw executors

parent cad189d2
...@@ -12,6 +12,9 @@ import com.topjohnwu.magisk.data.network.GithubRawServices ...@@ -12,6 +12,9 @@ import com.topjohnwu.magisk.data.network.GithubRawServices
import com.topjohnwu.magisk.ktx.get import com.topjohnwu.magisk.ktx.get
import com.topjohnwu.magisk.model.navigation.Navigation import com.topjohnwu.magisk.model.navigation.Navigation
import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
open class SplashActivity : Activity() { open class SplashActivity : Activity() {
...@@ -22,7 +25,9 @@ open class SplashActivity : Activity() { ...@@ -22,7 +25,9 @@ open class SplashActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.SplashTheme) setTheme(R.style.SplashTheme)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
Shell.getShell { Shell.EXECUTOR.execute(this::initAndStart) } GlobalScope.launch(Dispatchers.IO) {
initAndStart()
}
} }
private fun handleRepackage() { private fun handleRepackage() {
...@@ -41,6 +46,9 @@ open class SplashActivity : Activity() { ...@@ -41,6 +46,9 @@ open class SplashActivity : Activity() {
} }
private fun initAndStart() { private fun initAndStart() {
// Pre-initialize root shell
Shell.getShell()
Config.initialize() Config.initialize()
handleRepackage() handleRepackage()
Notifications.setup(this) Notifications.setup(this)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment