mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-19 19:58:29 +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.model.navigation.Navigation
|
||||
import com.topjohnwu.superuser.Shell
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
open class SplashActivity : Activity() {
|
||||
|
||||
@ -22,7 +25,9 @@ open class SplashActivity : Activity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
setTheme(R.style.SplashTheme)
|
||||
super.onCreate(savedInstanceState)
|
||||
Shell.getShell { Shell.EXECUTOR.execute(this::initAndStart) }
|
||||
GlobalScope.launch(Dispatchers.IO) {
|
||||
initAndStart()
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleRepackage() {
|
||||
@ -41,6 +46,9 @@ open class SplashActivity : Activity() {
|
||||
}
|
||||
|
||||
private fun initAndStart() {
|
||||
// Pre-initialize root shell
|
||||
Shell.getShell()
|
||||
|
||||
Config.initialize()
|
||||
handleRepackage()
|
||||
Notifications.setup(this)
|
||||
|
Loading…
x
Reference in New Issue
Block a user