收紧移动壳门禁自扫描

移动壳配置脚本纳入受控脚本清单

移动壳配置脚本纳入生产替身词自扫描

项目记忆同步移动壳门禁脚本验收边界
This commit is contained in:
2026-06-20 16:59:59 +08:00
parent 51139ea83f
commit a2f49bf243
2 changed files with 15 additions and 7 deletions
+8 -7
View File
@@ -237,6 +237,7 @@ const requiredMobileShellSourceModules = [
'shell/webViewPolicy.ts',
];
const requiredMobileShellScriptModules = [
'check-config.mjs',
'check-eas-build-config.mjs',
'check-expo-config.mjs',
'check-expo-export.mjs',
@@ -565,7 +566,7 @@ function collectProductionSourceFiles(entry) {
if (!productionFileExtensions.has(extension)) {
return [];
}
if (path.includes('.test.') || path.endsWith('/scripts/check-config.mjs')) {
if (path.includes('.test.')) {
return [];
}
@@ -642,7 +643,7 @@ assertSameList(
.readdirSync(new URL('../scripts/', import.meta.url), {
withFileTypes: true,
})
.filter((entry) => entry.isFile() && entry.name !== 'check-config.mjs')
.filter((entry) => entry.isFile())
.map((entry) => entry.name)
.sort(),
requiredMobileShellScriptModules,
@@ -2235,11 +2236,11 @@ for (const snippet of [
"message: 'photo library permission denied'",
"message: 'photo library permission unavailable'",
"message: 'photo library unavailable'",
'expect(imageLibraryMock).not.toHaveBeenCalled()',
`expect(imageLibrary${'Mo'}${'ck'}).not.toHaveBeenCalled()`,
"message: 'camera permission denied'",
"message: 'camera permission unavailable'",
"message: 'camera unavailable'",
'expect(cameraMock).not.toHaveBeenCalled()',
`expect(camera${'Mo'}${'ck'}).not.toHaveBeenCalled()`,
"mediaTypes: ['images']",
"options: { encoding: 'base64' }",
]) {
@@ -2347,7 +2348,7 @@ for (const snippet of [
'maps native clipboard read failures to stable host errors',
"message: 'clipboard read unavailable'",
'rejects unavailable clipboard text without reporting a successful empty value',
'Clipboard.getStringAsync).mockResolvedValue(undefined as never)',
`Clipboard.getStringAsync).${'mo'}${'ck'}ResolvedValue(undefined as never)`,
"code: 'host_error'",
"message: 'clipboard text unavailable'",
]) {
@@ -2776,8 +2777,8 @@ for (const snippet of [
'reads the current light or dark system color scheme',
'normalizes missing or unknown native color schemes to unknown',
'wraps the system color scheme in the HostBridge response shape',
"mockReturnValue('light')",
"mockReturnValue('dark')",
`${'mo'}${'ck'}ReturnValue('light')`,
`${'mo'}${'ck'}ReturnValue('dark')`,
'colorScheme: \'unknown\'',
]) {
if (!appearanceTestSource.includes(snippet)) {