已开启
Want::Marshalling 在 broker 进程不应启用 UTF8 扩展格式 #1227
m0_65533854创建于 8 天前
openharmony_ci
8 天前 评论:
8 天前 评论:
感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@jayleehw](https://gitcode.com/jayleehw) [@uniquexch](https://gitcode.com/uniquexch) [@littlejerry1](https://gitcode.com/littlejerry1) [@ccllee1](https://gitcode.com/ccllee1) [@yangxuguang-huawei](https://gitcode.com/yangxuguang-huawei) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。
Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.


8 天前 添加了label:waiting_for_assign
8 天前 关联了pull request:Skip utf8 trans format expansion in Want::Marshalling for broker process
8 天前 关联了pull request:Skip utf8 trans format expansion in Want::Marshalling for broker process
问题描述
Want::Marshalling(interfaces/kits/native/want/src/want.cpp)中,当 Want 参数设置了PARAM_STRING_TRANS_FORMAT_UTF8时,会无条件给 action 附加PARAM_WANT_EXPANSION_TAG前缀并对 parameters 设置扩容标志(512K 扩展格式)。broker 进程(Anco 跨端代理,uid=5557)作为新旧版本交互的边界,其对端无法识别该扩展格式标记,导致解析异常。
期望行为
broker 进程(selfUID == BROKER_UID, 5557)Marshalling 时不启用 UTF8 扩展格式,回落到旧序列化格式;非 broker 进程行为保持不变。
参考实现:ability_runtime
uri_permission_manager_client.cpp中CheckUseRawData()(broker can't use raw data)的同类 uid 判断模式,BROKER_UID = 5557与 ability_runtime/huks 现有常量同源。修复方案
在
Want::Marshalling的PARAM_STRING_TRANS_FORMAT_UTF8分支条件上追加selfUID != BROKER_UID(selfUID = getuid())。