diff --git a/yukihookapi/src/main/java/com/highcapable/yukihookapi/hook/xposed/channel/YukiHookDataChannel.kt b/yukihookapi/src/main/java/com/highcapable/yukihookapi/hook/xposed/channel/YukiHookDataChannel.kt index 611f77c4..62f1cf81 100644 --- a/yukihookapi/src/main/java/com/highcapable/yukihookapi/hook/xposed/channel/YukiHookDataChannel.kt +++ b/yukihookapi/src/main/java/com/highcapable/yukihookapi/hook/xposed/channel/YukiHookDataChannel.kt @@ -208,15 +208,17 @@ class YukiHookDataChannel private constructor() { internal fun register(context: Context?, packageName: String = context?.packageName ?: "") { if (YukiHookAPI.Configs.isEnableDataChannel.not() || context == null) return receiverContext = context - - val filter = IntentFilter().apply { + IntentFilter().apply { addAction(if (isXposedEnvironment) hostActionName(packageName) else moduleActionName(context)) + }.also { filter -> + /** + * 从 Android 14 (及预览版) 开始 + * 外部广播必须声明 [Context.RECEIVER_EXPORTED] + */ + if (Build.VERSION.SDK_INT >= 33) + context.registerReceiver(handlerReceiver, filter, Context.RECEIVER_EXPORTED) + else context.registerReceiver(handlerReceiver, filter) } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - context.registerReceiver(handlerReceiver, filter, Context.RECEIVER_EXPORTED) - - } else context.registerReceiver(handlerReceiver, filter) - /** 排除模块环境下模块注册自身广播 */ if (isXposedEnvironment.not()) return nameSpace(context, packageName).with {