OpenEUICC/app-unpriv/src/main/java/im/angry/openeuicc/UnprivilegedOpenEuiccApplication.kt
Peter Cai 1ac683f9ab
All checks were successful
/ build-debug (push) Successful in 4m13s
refactor: Reconnecting channels is a EuiccChannelManager responsibility
Reconnecting did not work properly for OMAPI, because in that case we
have to reconnect SEService as well.
2024-03-21 22:21:24 -04:00

29 lines
894 B
Kotlin

package im.angry.openeuicc
import android.content.Intent
import im.angry.openeuicc.di.UnprivilegedAppContainer
import im.angry.openeuicc.ui.LogsActivity
import im.angry.openeuicc.util.*
import kotlinx.coroutines.runBlocking
import kotlin.system.exitProcess
class UnprivilegedOpenEuiccApplication : OpenEuiccApplication() {
override val appContainer by lazy {
UnprivilegedAppContainer(this)
}
override fun onCreate() {
super.onCreate()
Thread.setDefaultUncaughtExceptionHandler { _, e ->
e.printStackTrace()
Intent(this, LogsActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra("log", runBlocking { readSelfLog() })
startActivity(this)
exitProcess(-1)
}
}
}
}