收口移动壳权限文档口径

修正移动壳图片拍摄与麦克风权限的协议文档口径

修正移动壳 Android 权限清单方案说明

增加原生壳门禁拦截旧权限描述
This commit is contained in:
2026-06-19 13:12:37 +08:00
parent d4bc8fcddf
commit 3439250419
3 changed files with 16 additions and 2 deletions
@@ -370,7 +370,7 @@ GameBridge 禁止:
2026-06-18 追加:移动壳默认显式关闭 Expo OTA 更新,直到存在真实发布通道、更新端点、签名 / 回滚策略和团队发布流程后再接入。`app.json` 只允许 `updates.enabled=false`,不得配置 `runtimeVersion`、release channel、EAS channel、`expo-updates` 插件或移动端 crash / analytics / CodePush 依赖;`apps/mobile-shell/scripts/check-config.mjs` 和 Expo public config smoke 会共同拒绝这些发布通道能力被提前打开,移动壳生产入口、HostBridge 和 URL/runtime 配置也不得提前初始化 Sentry、Firebase Analytics、PostHog、Amplitude、Segment、CodePush 或 Expo Updates。由于移动壳运行依赖会从根安装树解析,根 H5 `package.json` 也不得直接安装这些移动端发布通道、崩溃上报、analytics 或 CodePush SDK;根 `package-lock.json` 也不得解析 `expo-updates`、Sentry、Firebase Analytics、PostHog、Amplitude、Segment、CodePush 等真实发布 / 观测 SDK。`expo-application` 可能由 Expo 自身传递解析,但项目不得把它作为 direct dependency 主动用于渠道逻辑。
2026-06-18 追加:移动壳可分发身份、外观和默认权限进入配置门禁。Expo `name` 固定为 `Genarrative``slug` 固定为 `genarrative-mobile-shell``userInterfaceStyle` 固定为 `automatic``assetBundlePatterns` 固定为 `["**/*"]``extra.genarrativeHostBridgeVersion` 固定为 `1`;源 `app.json` 的 Android `permissions` 不手写显式权限,最终 Expo public config 只允许扫码能力由 `expo-camera` plugin 带入 `android.permission.CAMERA`,所有当前不需要的高风险权限只能通过 `blockedPermissions` 阻断。后续新增权限必须先有真实宿主能力、系统权限说明和 H5 fallback 方案,再补配置与检查。`apps/mobile-shell/scripts/check-config.mjs` 会检查源 `app.json``apps/mobile-shell/scripts/check-expo-config.mjs` 会检查 Expo CLI 最终解析出的 public config,避免 config plugin 或 Expo 解析阶段引入身份、资源或权限漂移。
2026-06-18 追加:移动壳可分发身份、外观和默认权限进入配置门禁。Expo `name` 固定为 `Genarrative``slug` 固定为 `genarrative-mobile-shell``userInterfaceStyle` 固定为 `automatic``assetBundlePatterns` 固定为 `["**/*"]``extra.genarrativeHostBridgeVersion` 固定为 `1`;源 `app.json` 的 Android `permissions` 只允许显式声明 `android.permission.RECORD_AUDIO`,用于同源 H5 实时声音玩法,最终 Expo public config 只允许 `android.permission.CAMERA``android.permission.RECORD_AUDIO` 两类权限,其中相机来自扫码 / 拍摄能力,麦克风来自同源 H5 实时玩法。所有其它当前不需要的高风险权限只能通过 `blockedPermissions` 阻断。后续新增权限必须先有真实宿主能力、系统权限说明和 H5 fallback 方案,再补配置与检查。`apps/mobile-shell/scripts/check-config.mjs` 会检查源 `app.json``apps/mobile-shell/scripts/check-expo-config.mjs` 会检查 Expo CLI 最终解析出的 public config,避免 config plugin 或 Expo 解析阶段引入身份、资源或权限漂移。
2026-06-18 追加:移动壳命令入口进入配置门禁。`apps/mobile-shell/package.json``dev``android``ios``test``config:smoke``export:smoke``typecheck` 以及根 `package.json``mobile-shell:*` 入口必须保持指向真实 Expo / RN / Vitest / Expo config / Metro export / 配置检查流程,不能替换成只跑静态脚本或绕过生产 bundler 的快捷命令。
File diff suppressed because one or more lines are too long
+14
View File
@@ -1032,6 +1032,20 @@ function assertNativeShellCapabilityPlan() {
'native shell plan must document the minimal desktop capability permission',
);
}
for (const staleMobilePermissionText of [
'Android `permissions` 不手写显式权限',
'最终 Expo public config 只允许扫码能力由 `expo-camera` plugin 带入 `android.permission.CAMERA`',
'移动拍摄不请求麦克风权限',
]) {
if (
planSource.includes(staleMobilePermissionText) ||
hostBridgeProtocolDocSource.includes(staleMobilePermissionText)
) {
throw new Error(
`native shell docs must not keep stale mobile permission wording: ${staleMobilePermissionText}`,
);
}
}
assertNativeShellScaffoldScanWording(planSource, 'native shell plan');
assertNativeShellScaffoldScanWording(
hostBridgeProtocolDocSource,