mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-21 09:31:27 +00:00
Use coroutines instead of raw executors
This commit is contained in:
parent
cad189d2dc
commit
ba31c6b625
@ -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() {
|
|||||||
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() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun initAndStart() {
|
private fun initAndStart() {
|
||||||
|
// Pre-initialize root shell
|
||||||
|
Shell.getShell()
|
||||||
|
|
||||||
Config.initialize()
|
Config.initialize()
|
||||||
handleRepackage()
|
handleRepackage()
|
||||||
Notifications.setup(this)
|
Notifications.setup(this)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user