固定移动壳安装包身份

补齐 Expo 移动壳 iOS bundleIdentifier 与 buildNumber

补齐 Expo 移动壳 Android versionCode

校验移动壳版本、包标识和构建号不漂移

更新原生壳方案和团队决策记录
This commit is contained in:
2026-06-18 08:29:47 +08:00
parent 5bd1fb1a8f
commit 67a52e444f
4 changed files with 30 additions and 0 deletions

View File

@@ -27,6 +27,8 @@
] ]
], ],
"ios": { "ios": {
"bundleIdentifier": "world.genarrative.mobile",
"buildNumber": "1",
"supportsTablet": true, "supportsTablet": true,
"associatedDomains": [ "associatedDomains": [
"applinks:app.genarrative.world" "applinks:app.genarrative.world"
@@ -34,6 +36,7 @@
}, },
"android": { "android": {
"package": "world.genarrative.mobile", "package": "world.genarrative.mobile",
"versionCode": 1,
"intentFilters": [ "intentFilters": [
{ {
"action": "VIEW", "action": "VIEW",

View File

@@ -91,6 +91,14 @@ if (appConfig.scheme !== 'genarrative') {
throw new Error('mobile shell scheme must be genarrative'); throw new Error('mobile shell scheme must be genarrative');
} }
if (appConfig.version !== '0.1.0') {
throw new Error('mobile shell app version must be 0.1.0');
}
if (packageConfig.version !== appConfig.version) {
throw new Error('mobile shell package version must match app.json version');
}
if (appConfig.icon !== './assets/icon.png') { if (appConfig.icon !== './assets/icon.png') {
throw new Error('mobile shell must use the real brand icon asset'); throw new Error('mobile shell must use the real brand icon asset');
} }
@@ -103,6 +111,22 @@ if (!appConfig.ios?.associatedDomains?.includes('applinks:app.genarrative.world'
throw new Error('mobile shell iOS associated domain is missing'); throw new Error('mobile shell iOS associated domain is missing');
} }
if (appConfig.ios?.bundleIdentifier !== 'world.genarrative.mobile') {
throw new Error('mobile shell iOS bundle identifier must be world.genarrative.mobile');
}
if (appConfig.ios?.buildNumber !== '1') {
throw new Error('mobile shell iOS build number must start at 1');
}
if (appConfig.android?.package !== 'world.genarrative.mobile') {
throw new Error('mobile shell Android package must be world.genarrative.mobile');
}
if (appConfig.android?.versionCode !== 1) {
throw new Error('mobile shell Android versionCode must start at 1');
}
const androidFilter = appConfig.android?.intentFilters?.find((filter) => const androidFilter = appConfig.android?.intentFilters?.find((filter) =>
filter?.data?.some( filter?.data?.some(
(entry) => (entry) =>

View File

@@ -41,6 +41,7 @@
- 2026-06-18 移动壳安全区Expo 壳根布局使用 `react-native-safe-area-context``SafeAreaProvider` 与四边 `SafeAreaView` 保护 WebView避免 H5 主站内容贴进 iOS 刘海、底部 Home Indicator、Android 状态栏或横屏边缘;该能力属于宿主壳布局保护,不新增 H5 占位 UI不改变玩法 runtime 或 HostBridge capability。 - 2026-06-18 移动壳安全区Expo 壳根布局使用 `react-native-safe-area-context``SafeAreaProvider` 与四边 `SafeAreaView` 保护 WebView避免 H5 主站内容贴进 iOS 刘海、底部 Home Indicator、Android 状态栏或横屏边缘;该能力属于宿主壳布局保护,不新增 H5 占位 UI不改变玩法 runtime 或 HostBridge capability。
- 2026-06-18 移动壳启动 URL 归一Expo 壳的 `EXPO_PUBLIC_GENARRATIVE_WEB_URL` 和 deep link 基准地址只接受 `http:` / `https:` 绝对 URL空值、相对路径、`file:``javascript:` 等非法配置回退到默认 H5 地址后再附加 `native_app` 宿主上下文deep link 仍只映射同源 H5 路径,禁止把外域或危险协议页面装进带完整 HostBridge 的 WebView。 - 2026-06-18 移动壳启动 URL 归一Expo 壳的 `EXPO_PUBLIC_GENARRATIVE_WEB_URL` 和 deep link 基准地址只接受 `http:` / `https:` 绝对 URL空值、相对路径、`file:``javascript:` 等非法配置回退到默认 H5 地址后再附加 `native_app` 宿主上下文deep link 仍只映射同源 H5 路径,禁止把外域或危险协议页面装进带完整 HostBridge 的 WebView。
- 2026-06-18 移动壳默认入口Expo 壳默认 H5 地址固定为 `https://app.genarrative.world/`,开发联调本机 Vite 必须显式设置 `EXPO_PUBLIC_GENARRATIVE_WEB_URL=http://127.0.0.1:3000/` 或其它允许的 `http:` / `https:` 地址;生产包不得在未配置环境变量时加载设备本机 localhost。 - 2026-06-18 移动壳默认入口Expo 壳默认 H5 地址固定为 `https://app.genarrative.world/`,开发联调本机 Vite 必须显式设置 `EXPO_PUBLIC_GENARRATIVE_WEB_URL=http://127.0.0.1:3000/` 或其它允许的 `http:` / `https:` 地址;生产包不得在未配置环境变量时加载设备本机 localhost。
- 2026-06-18 移动壳安装包身份Expo 移动壳的 iOS bundle identifier 与 Android package 统一固定为 `world.genarrative.mobile`,应用版本固定为 `0.1.0`iOS `buildNumber` 从字符串 `"1"` 起步Android `versionCode` 从整数 `1` 起步;后续分发安装包时递增构建号 / versionCode产品版本号按发布节奏调整。移动壳配置检查会校验 `app.json``package.json` 版本一致,并拒绝缺失或漂移的包标识,当前不写入假商店元数据、假更新端点或占位渠道 SDK 配置。
- 2026-06-18 桌面图片拖入接入主图槽位:`CreativeImageInputPanel` 在桌面壳声明 `file.imageDropped` 时订阅宿主拖入事件,只在拖入坐标命中当前主图卡片且未被上层元素遮挡时消费事件,避免窗口级拖入被多个创作面板同时接收;成功后仍转换为现有 `File` 上传回调。 - 2026-06-18 桌面图片拖入接入主图槽位:`CreativeImageInputPanel` 在桌面壳声明 `file.imageDropped` 时订阅宿主拖入事件,只在拖入坐标命中当前主图卡片且未被上层元素遮挡时消费事件,避免窗口级拖入被多个创作面板同时接收;成功后仍转换为现有 `File` 上传回调。
- 2026-06-18 H5 背景音乐接入宿主生命周期:`useBackgroundMusic` 通过 `useHostLifecycleActive()` 消费 `subscribeHostAppLifecycle()` 的归一结果宿主进入后台、inactive 或桌面窗口失焦时降低音量并暂停音频循环,同时 `suspend` WebAudio context回到 `active + focused` 且用户原本开启音乐时再恢复播放,不改变用户音量设置。 - 2026-06-18 H5 背景音乐接入宿主生命周期:`useBackgroundMusic` 通过 `useHostLifecycleActive()` 消费 `subscribeHostAppLifecycle()` 的归一结果宿主进入后台、inactive 或桌面窗口失焦时降低音量并暂停音频循环,同时 `suspend` WebAudio context回到 `active + focused` 且用户原本开启音乐时再恢复播放,不改变用户音量设置。
- 2026-06-18 固定玩法音频接入宿主生命周期:前端新增 `useHostLifecycleActive()` 统一消费 `subscribeHostAppLifecycle()``useBackgroundMusic`、拼图运行态和抓大鹅运行态都只依赖该归一状态判断音频可播放性;宿主 inactive、background 或窗口失焦时暂停 `<audio>` / WebAudio回到 `active + focused` 后仅在运行态仍在播放、音源存在且用户音乐音量大于 0 时恢复,不改变用户音量设置。 - 2026-06-18 固定玩法音频接入宿主生命周期:前端新增 `useHostLifecycleActive()` 统一消费 `subscribeHostAppLifecycle()``useBackgroundMusic`、拼图运行态和抓大鹅运行态都只依赖该归一状态判断音频可播放性;宿主 inactive、background 或窗口失焦时暂停 `<audio>` / WebAudio回到 `active + focused` 后仅在运行态仍在播放、音源存在且用户音乐音量大于 0 时恢复,不改变用户音量设置。

View File

@@ -276,6 +276,8 @@ GameBridge 禁止:
2026-06-18 追加:移动壳默认 H5 地址固定为 `https://app.genarrative.world/`。开发联调如需加载本机 Vite必须显式设置 `EXPO_PUBLIC_GENARRATIVE_WEB_URL=http://127.0.0.1:3000/` 或其它允许的 `http:` / `https:` 地址;生产包不得在未配置环境变量时默认加载设备本机 localhost。 2026-06-18 追加:移动壳默认 H5 地址固定为 `https://app.genarrative.world/`。开发联调如需加载本机 Vite必须显式设置 `EXPO_PUBLIC_GENARRATIVE_WEB_URL=http://127.0.0.1:3000/` 或其它允许的 `http:` / `https:` 地址;生产包不得在未配置环境变量时默认加载设备本机 localhost。
2026-06-18 追加:移动壳安装包身份固定为 `world.genarrative.mobile`。Expo `app.json` 中的 `ios.bundleIdentifier``android.package` 使用同一包标识,应用版本为 `0.1.0`iOS `buildNumber` 从字符串 `"1"` 起步Android `versionCode` 从整数 `1` 起步;后续每次生成可分发安装包时只递增构建号 / versionCode产品版本号按发布节奏单独调整。`apps/mobile-shell/scripts/check-config.mjs` 会校验这些字段与 `package.json` 版本一致,避免 iOS、Android 和 H5 HostBridge `hostVersion` 发生静默漂移。当前仍不写入假商店上架信息、假更新端点或占位渠道 SDK 配置。
### Phase 3Tauri 桌面壳 MVP ### Phase 3Tauri 桌面壳 MVP
- 新增 `apps/desktop-shell/` - 新增 `apps/desktop-shell/`