bug修复: 移除危险的Looper.loop()全局劫持

This commit is contained in:
fengge 2026-06-01 18:08:28 +08:00
parent 8bddca4996
commit a982e54eeb
1 changed files with 0 additions and 13 deletions

View File

@ -98,19 +98,6 @@ object LogManager {
onCrashDetected(null, thread.name, throwable)
defaultHandler?.uncaughtException(thread, throwable) ?: exitProcess(1)
}
// 2. 捕获主线程 Looper
android.os.Handler(android.os.Looper.getMainLooper()).post {
while (true) {
try {
android.os.Looper.loop()
} catch (e: Throwable) {
onCrashDetected(null, "MainLooper", e)
// 如果是 UnsatisfiedLinkError这种错误无法恢复必须抛出让系统处理
throw e
}
}
}
}
private fun cleanOldLogs(dir: File) {