收口移动壳系统深链声明

移动壳源配置门禁锁定唯一 iOS associated domain

Expo public config 烟测锁定唯一 Android App Link 过滤器

宿主壳方案文档补充深链接管范围约束

共享决策日志记录移动壳系统深链声明边界
This commit is contained in:
2026-06-18 13:52:37 +08:00
parent e6de69649b
commit e8bcd3ba88
4 changed files with 63 additions and 20 deletions
+30 -11
View File
@@ -430,9 +430,11 @@ if ('releaseChannel' in appConfig || 'channel' in appConfig) {
throw new Error('mobile shell must not configure an app release channel without a real release process');
}
if (!appConfig.ios?.associatedDomains?.includes('applinks:app.genarrative.world')) {
throw new Error('mobile shell iOS associated domain is missing');
}
assertSameList(
appConfig.ios?.associatedDomains ?? [],
['applinks:app.genarrative.world'],
'mobile shell iOS associated domains',
);
if (appConfig.ios?.bundleIdentifier !== 'world.genarrative.mobile') {
throw new Error('mobile shell iOS bundle identifier must be world.genarrative.mobile');
@@ -495,15 +497,32 @@ if (
throw new Error('mobile shell Android adaptive icon must use the real brand icon and brand background');
}
const androidFilter = appConfig.android?.intentFilters?.find((filter) =>
filter?.data?.some(
(entry) =>
entry?.scheme === 'https' &&
entry?.host === 'app.genarrative.world',
),
const androidFilters = appConfig.android?.intentFilters ?? [];
if (androidFilters.length !== 1) {
throw new Error('mobile shell Android app link filter must be the only intent filter');
}
const [androidFilter] = androidFilters;
if (androidFilter.action !== 'VIEW' || androidFilter.autoVerify !== true) {
throw new Error('mobile shell Android app link filter must be a verified VIEW filter');
}
assertSameList(
androidFilter.category ?? [],
['BROWSABLE', 'DEFAULT'],
'mobile shell Android app link categories',
);
if (!androidFilter) {
throw new Error('mobile shell Android app link filter is missing');
const androidFilterData = androidFilter.data ?? [];
if (
androidFilterData.length !== 1 ||
androidFilterData[0]?.scheme !== 'https' ||
androidFilterData[0]?.host !== 'app.genarrative.world' ||
Object.keys(androidFilterData[0] ?? {}).some(
(key) => key !== 'scheme' && key !== 'host',
)
) {
throw new Error('mobile shell Android app link data must only bind https://app.genarrative.world');
}
if (appConfig.extra?.genarrativeHostBridgeVersion !== 1) {
@@ -115,9 +115,9 @@ assertEqual(
'iOS bundle identifier',
);
assertEqual(expoConfig.ios?.buildNumber, '1', 'iOS build number');
assertIncludes(
assertSameList(
expoConfig.ios?.associatedDomains,
'applinks:app.genarrative.world',
['applinks:app.genarrative.world'],
'iOS associated domains',
);
assertEqual(
@@ -196,14 +196,29 @@ assertEqual(
'Android adaptive icon background',
);
const appLinkFilter = expoConfig.android?.intentFilters?.find((filter) =>
filter?.data?.some(
(entry) =>
entry?.scheme === 'https' && entry?.host === 'app.genarrative.world',
),
const appLinkFilters = expoConfig.android?.intentFilters ?? [];
if (appLinkFilters.length !== 1) {
throw new Error('Expo config Android app link filter must be the only intent filter');
}
const [appLinkFilter] = appLinkFilters;
assertEqual(appLinkFilter.action, 'VIEW', 'Android app link action');
assertEqual(appLinkFilter.autoVerify, true, 'Android app link autoVerify');
assertSameList(
appLinkFilter.category,
['BROWSABLE', 'DEFAULT'],
'Android app link categories',
);
if (!appLinkFilter) {
throw new Error('Expo config Android app link filter is missing');
if (
!Array.isArray(appLinkFilter.data) ||
appLinkFilter.data.length !== 1 ||
appLinkFilter.data[0]?.scheme !== 'https' ||
appLinkFilter.data[0]?.host !== 'app.genarrative.world' ||
Object.keys(appLinkFilter.data[0] ?? {}).some(
(key) => key !== 'scheme' && key !== 'host',
)
) {
throw new Error('Expo config Android app link data must only bind https://app.genarrative.world');
}
const imagePickerPlugin = findPlugin('expo-image-picker');