修复FCM在coloros16上无法唤醒已停止应用(failed to broadcast to stopped app) - #276
Open
mooncake8355 wants to merge 1 commit into
Open
mooncake8355 wants to merge 1 commit into
mooncake8355 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
修复勾选应用无法被 FCM 唤醒、FCM Diagnostics 显示
Failed to broadcast to stopped app的问题。根因:在部分 ROM(实测 ColorOS 16 / Android 16)上,
BroadcastController.broadcastIntentLocked是薄包装层,会被调用方内联,原有 hook 从不触发,
FLAG_INCLUDE_STOPPED_PACKAGES从未被加上;同时现代 Xposed API 移植后,system_server 的上下文获取时机与配置加载
也存在可靠性问题。
修改内容
broadcastIntentLockedTraced、ActivityManagerService.broadcastIntentLocked /
broadcastIntentLockedTraced)+ deoptimize 反内联 + 参数按类型/名称自动定位;
FLAG_INCLUDE_STOPPED_PACKAGES(双保险,需 GMS 作用域);失败回退原路径)、带重试的初始化线程、开机即加载配置;
(ContentProvider 直读模块应用 config.json);MainActivity 勾选时双写本地
与远程配置;
各 hook 模块初始化异常隔离、空值防护等。
验证
设备:OnePlus 15 / ColorOS 16.1 / Android 16 / GMS 26.32.34 / LSPosed 7847。
A/B 对照(两个应用均为 stopped=true):
Start proc ... for broadcast {FirebaseInstanceIdReceiver},stopped由 true 变 false,唤醒成功;筛选语义正确,排除自启动设置干扰。
真实推送(FCM Diagnostics / 实际消息)自测通过。
兼容性
参数自动定位替代硬编码索引;