mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 10:15:18 +08:00
Fix receiver crash bug in FrameworkTool
This commit is contained in:
@@ -29,6 +29,7 @@ import android.content.Intent
|
|||||||
import android.content.IntentFilter
|
import android.content.IntentFilter
|
||||||
import com.fankes.apperrorstracking.bean.AppErrorsInfoBean
|
import com.fankes.apperrorstracking.bean.AppErrorsInfoBean
|
||||||
import com.fankes.apperrorstracking.const.Const
|
import com.fankes.apperrorstracking.const.Const
|
||||||
|
import com.highcapable.yukihookapi.hook.log.loggerE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统框架控制工具
|
* 系统框架控制工具
|
||||||
@@ -46,17 +47,19 @@ object FrameworkTool {
|
|||||||
object : BroadcastReceiver() {
|
object : BroadcastReceiver() {
|
||||||
override fun onReceive(context: Context?, intent: Intent?) {
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
if (intent == null) return
|
if (intent == null) return
|
||||||
intent.getStringExtra(Const.KEY_MODULE_HOST_FETCH)?.also {
|
runCatching {
|
||||||
if (it.isNotBlank()) when (it) {
|
intent.getStringExtra(Const.KEY_MODULE_HOST_FETCH)?.also {
|
||||||
Const.TYPE_APP_ERRORS_DATA_GET -> runCatching {
|
if (it.isNotBlank()) when (it) {
|
||||||
onAppErrorsInfoDataCallback?.invoke(
|
Const.TYPE_APP_ERRORS_DATA_GET -> runCatching {
|
||||||
intent.getSerializableExtra(Const.TAG_APP_ERRORS_DATA_CONTENT) as ArrayList<AppErrorsInfoBean>
|
onAppErrorsInfoDataCallback?.invoke(
|
||||||
)
|
intent.getSerializableExtra(Const.TAG_APP_ERRORS_DATA_CONTENT) as ArrayList<AppErrorsInfoBean>
|
||||||
}.onFailure { onAppErrorsInfoDataCallback?.invoke(arrayListOf()) }
|
)
|
||||||
Const.TYPE_APP_ERRORS_DATA_CLEAR -> onClearAppErrorsInfoDataCallback?.invoke()
|
}.onFailure { onAppErrorsInfoDataCallback?.invoke(arrayListOf()) }
|
||||||
else -> {}
|
Const.TYPE_APP_ERRORS_DATA_CLEAR -> onClearAppErrorsInfoDataCallback?.invoke()
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}.onFailure { loggerE(msg = "Cannot receiver message, please restart system", e = it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user