禁用移动壳麦克风权限
移动壳 Android 包配置通过 blockedPermissions 移除 RECORD_AUDIO 移动壳检查脚本拒绝麦克风权限缺失拦截或被重新声明 宿主壳方案和共享决策记录移动端权限边界
This commit is contained in:
@@ -49,6 +49,9 @@
|
|||||||
"package": "world.genarrative.mobile",
|
"package": "world.genarrative.mobile",
|
||||||
"versionCode": 1,
|
"versionCode": 1,
|
||||||
"usesCleartextTraffic": false,
|
"usesCleartextTraffic": false,
|
||||||
|
"blockedPermissions": [
|
||||||
|
"android.permission.RECORD_AUDIO"
|
||||||
|
],
|
||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
"foregroundImage": "./assets/icon.png",
|
"foregroundImage": "./assets/icon.png",
|
||||||
"backgroundColor": "#fffdf9"
|
"backgroundColor": "#fffdf9"
|
||||||
|
|||||||
@@ -243,6 +243,20 @@ if (appConfig.android?.usesCleartextTraffic !== false) {
|
|||||||
throw new Error('mobile shell Android package must disable cleartext traffic');
|
throw new Error('mobile shell Android package must disable cleartext traffic');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!appConfig.android?.blockedPermissions?.includes(
|
||||||
|
'android.permission.RECORD_AUDIO',
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
throw new Error('mobile shell Android package must block microphone permission');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
appConfig.android?.permissions?.includes('android.permission.RECORD_AUDIO')
|
||||||
|
) {
|
||||||
|
throw new Error('mobile shell Android package must not request microphone');
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
appConfig.android?.adaptiveIcon?.foregroundImage !== './assets/icon.png' ||
|
appConfig.android?.adaptiveIcon?.foregroundImage !== './assets/icon.png' ||
|
||||||
appConfig.android?.adaptiveIcon?.backgroundColor !== brandBackgroundColor
|
appConfig.android?.adaptiveIcon?.backgroundColor !== brandBackgroundColor
|
||||||
|
|||||||
@@ -57,6 +57,7 @@
|
|||||||
- 2026-06-18 移动壳启动页与 adaptive icon:Expo 移动壳启动页和 Android adaptive icon 复用现有真实品牌图标 `apps/mobile-shell/assets/icon.png`,背景色固定为 H5 壳根背景 `#fffdf9`。该 PNG 是 1024x1024 RGBA 透明前景品牌资产,不新增占位图;配置检查会校验图标尺寸、透明像素、splash 和 adaptive icon 指向,避免后续换成非品牌或占位素材。
|
- 2026-06-18 移动壳启动页与 adaptive icon:Expo 移动壳启动页和 Android adaptive icon 复用现有真实品牌图标 `apps/mobile-shell/assets/icon.png`,背景色固定为 H5 壳根背景 `#fffdf9`。该 PNG 是 1024x1024 RGBA 透明前景品牌资产,不新增占位图;配置检查会校验图标尺寸、透明像素、splash 和 adaptive icon 指向,避免后续换成非品牌或占位素材。
|
||||||
- 2026-06-18 桌面壳 bundle 图标集:Tauri 桌面壳从现有真实品牌 PNG `apps/desktop-shell/src-tauri/icons/icon.png` 派生 `32x32.png`、`128x128.png`、`128x128@2x.png`、`icon.ico` 和 `icon.icns`,并在 `bundle.icon` 中同时声明这些平台图标。检查脚本会校验 PNG 尺寸、ICO 多尺寸头部、ICNS 容器长度和 bundle 图标列表,避免后续退回单图标或替换为非品牌 / 占位素材。
|
- 2026-06-18 桌面壳 bundle 图标集:Tauri 桌面壳从现有真实品牌 PNG `apps/desktop-shell/src-tauri/icons/icon.png` 派生 `32x32.png`、`128x128.png`、`128x128@2x.png`、`icon.ico` 和 `icon.icns`,并在 `bundle.icon` 中同时声明这些平台图标。检查脚本会校验 PNG 尺寸、ICO 多尺寸头部、ICNS 容器长度和 bundle 图标列表,避免后续退回单图标或替换为非品牌 / 占位素材。
|
||||||
- 2026-06-18 移动壳网络安全元数据:Expo 移动壳默认包配置显式禁用 Android 明文流量 `usesCleartextTraffic=false`,iOS ATS 禁用任意加载 `NSAllowsArbitraryLoads=false`,并设置 `ITSAppUsesNonExemptEncryption=false` 作为当前未接入自定义加密能力的出口合规声明;本地 Vite 联调只通过 development build 显式环境变量进入,不把任意明文流量开关带进默认包配置。
|
- 2026-06-18 移动壳网络安全元数据:Expo 移动壳默认包配置显式禁用 Android 明文流量 `usesCleartextTraffic=false`,iOS ATS 禁用任意加载 `NSAllowsArbitraryLoads=false`,并设置 `ITSAppUsesNonExemptEncryption=false` 作为当前未接入自定义加密能力的出口合规声明;本地 Vite 联调只通过 development build 显式环境变量进入,不把任意明文流量开关带进默认包配置。
|
||||||
|
- 2026-06-18 移动壳麦克风权限禁用:Expo 移动壳的 `expo-image-picker` 插件必须保持 `microphonePermission=false`,Android 包配置必须通过 `android.blockedPermissions` 显式移除 `android.permission.RECORD_AUDIO`,且不得在 `android.permissions` 中重新声明;移动壳现阶段没有录音、后台音频采集或远程语音 SDK,音频导入只走系统文档选择器。配置检查会拒绝麦克风权限拦截缺失或被反向加入。
|
||||||
- 影响范围:`src/services/host-bridge/`、未来 `apps/mobile-shell/`、未来 `apps/desktop-shell/`、移动端支付 / 分享 / 深链 / 推送、桌面端系统能力、AI H5 sandbox 的 GameBridge 边界。
|
- 影响范围:`src/services/host-bridge/`、未来 `apps/mobile-shell/`、未来 `apps/desktop-shell/`、移动端支付 / 分享 / 深链 / 推送、桌面端系统能力、AI H5 sandbox 的 GameBridge 边界。
|
||||||
- 验证方式:普通浏览器、小程序、Expo 壳、Tauri 壳都能返回正确 `getHostRuntime()`;未支持能力能回退 H5;固定玩法在各宿主中读取同一作品数据和运行态 snapshot;AI sandbox 无法直接调用 HostBridge;Tauri release 不允许任意远端页面调用桌面命令。
|
- 验证方式:普通浏览器、小程序、Expo 壳、Tauri 壳都能返回正确 `getHostRuntime()`;未支持能力能回退 H5;固定玩法在各宿主中读取同一作品数据和运行态 snapshot;AI sandbox 无法直接调用 HostBridge;Tauri release 不允许任意远端页面调用桌面命令。
|
||||||
- 关联文档:`docs/【前端架构】ExpoReactNative与Tauri宿主壳方案-2026-06-17.md`、`docs/【前端架构】宿主壳能力统一协议-2026-06-17.md`。
|
- 关联文档:`docs/【前端架构】ExpoReactNative与Tauri宿主壳方案-2026-06-17.md`、`docs/【前端架构】宿主壳能力统一协议-2026-06-17.md`。
|
||||||
|
|||||||
@@ -317,6 +317,8 @@ GameBridge 禁止:
|
|||||||
|
|
||||||
2026-06-18 追加:移动壳生产包网络安全元数据显式收紧。Android `usesCleartextTraffic=false`,iOS `NSAppTransportSecurity.NSAllowsArbitraryLoads=false`,并设置 `ITSAppUsesNonExemptEncryption=false` 作为当前未接入自定义加密能力的出口合规声明;开发联调本机 Vite 仍通过显式 `EXPO_PUBLIC_GENARRATIVE_WEB_URL=http://127.0.0.1:3000/` 进入 development build,不把任意明文流量开关带进默认包配置。`apps/mobile-shell/scripts/check-config.mjs` 会校验这些网络安全字段。
|
2026-06-18 追加:移动壳生产包网络安全元数据显式收紧。Android `usesCleartextTraffic=false`,iOS `NSAppTransportSecurity.NSAllowsArbitraryLoads=false`,并设置 `ITSAppUsesNonExemptEncryption=false` 作为当前未接入自定义加密能力的出口合规声明;开发联调本机 Vite 仍通过显式 `EXPO_PUBLIC_GENARRATIVE_WEB_URL=http://127.0.0.1:3000/` 进入 development build,不把任意明文流量开关带进默认包配置。`apps/mobile-shell/scripts/check-config.mjs` 会校验这些网络安全字段。
|
||||||
|
|
||||||
|
2026-06-18 追加:移动壳 Android 包级权限显式移除麦克风。`expo-image-picker` 插件继续设置 `microphonePermission=false`,同时 Expo `android.blockedPermissions` 固定包含 `android.permission.RECORD_AUDIO`,防止后续插件或 manifest 合并把录音权限带入最终包;`android.permissions` 也不得重新声明该权限。移动壳拍照只请求相机,相册只请求媒体读取,本地通知只请求即时通知权限,音频导入走系统文档选择器,不申请麦克风或后台录音能力。`apps/mobile-shell/scripts/check-config.mjs` 会拒绝麦克风权限缺失拦截或被重新声明。
|
||||||
|
|
||||||
### Phase 4:宿主能力扩展
|
### Phase 4:宿主能力扩展
|
||||||
|
|
||||||
- 移动端接入系统分享、推送、原生登录和渠道支付。
|
- 移动端接入系统分享、推送、原生登录和渠道支付。
|
||||||
|
|||||||
Reference in New Issue
Block a user