mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Safer init
This commit is contained in:
parent
549eb87c9d
commit
855f806f56
1 changed files with 11 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package com.lagradost.cloudstream3
|
package com.lagradost.cloudstream3
|
||||||
|
|
||||||
import com.lagradost.cloudstream3.MainActivity.Companion.lastError
|
import com.lagradost.cloudstream3.MainActivity.Companion.lastError
|
||||||
|
import com.lagradost.cloudstream3.mvvm.logError
|
||||||
import com.lagradost.cloudstream3.plugins.PluginManager.checkSafeModeFile
|
import com.lagradost.cloudstream3.plugins.PluginManager.checkSafeModeFile
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
@ -28,8 +29,16 @@ object NativeCrashHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun initCrashHandler() {
|
fun initCrashHandler() {
|
||||||
|
try {
|
||||||
System.loadLibrary("native-lib")
|
System.loadLibrary("native-lib")
|
||||||
initNativeCrashHandler()
|
initNativeCrashHandler()
|
||||||
|
} catch (t: Throwable) {
|
||||||
|
// Make debug crash.
|
||||||
|
if (BuildConfig.DEBUG) throw t
|
||||||
|
logError(t)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
initSignalPolling()
|
initSignalPolling()
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue