android: 用 after_prepare hook 替代 edit-config 注入 xmlns:tools

避免多插件场景下 edit-config 修改同一 <manifest> 节点时产生冲突,
改为在 prepare 后由 hooks/androidManifestToolsNs.js 按需幂等注入。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
weiry
2026-04-28 10:38:13 +08:00
parent 8f866944ee
commit 7a3406511f
2 changed files with 43 additions and 4 deletions
+2 -4
View File
@@ -78,10 +78,8 @@
</platform>
<platform name="android">
<!-- aar 合并时与 cn.jiguang.sdk:jpush 的 meta-data 冲突,需声明 tools 并用 tools:replace 覆盖 -->
<edit-config file="AndroidManifest.xml" target="/manifest" mode="merge">
<manifest xmlns:tools="http://schemas.android.com/tools" />
</edit-config>
<!-- xmlns:tools 由 hooks/androidManifestToolsNs.js 在 prepare 后按需注入,避免与其它插件/工程 edit-config 冲突 -->
<hook type="after_prepare" src="hooks/androidManifestToolsNs.js" />
<config-file target="res/xml/config.xml" parent="/*">
<feature name="JPushPlugin">