Fix app errors record's current Context may not has INTERACT_ACROSS_USERS permission problem

This commit is contained in:
2022-10-03 04:40:46 +08:00
parent 1fc9f07b9f
commit 33ee056ed9

View File

@@ -198,7 +198,7 @@ object FrameworkHooker : YukiBaseHooker() {
}
afterHook {
/** 当前实例 */
val context = field { name = "mContext" }.get(instance).cast<Context>() ?: return@afterHook
val context = appContext ?: field { name = "mContext" }.get(instance).cast<Context>() ?: return@afterHook
/** 错误数据 */
val errData = args().first().cast<Message>()?.obj