Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

feat(mobile): 支持 Android 应用内更新与安装权限引导 (#4561)

Chris Zhang957d19d851fd
diff --git a/apps/mobile/app.config.js b/apps/mobile/app.config.js
index 69833b80d6..d4bab3d716 100644
--- a/apps/mobile/app.config.js
+++ b/apps/mobile/app.config.js
@@ -356,6 +356,11 @@ module.exports = (context = {}) => {
...next,
android: {
...next.android,
+ // Only APK self-distribution requests permission to install updates.
+ permissions: [...new Set([
+ ...(next.android.permissions || []),
+ 'android.permission.REQUEST_INSTALL_PACKAGES',
+ ])],
...(Number.isInteger(versionCode) && versionCode > 0 ? { versionCode } : {}),
},
updates: {
diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx
index 9c65c9b446..edb8d5e802 100644
--- a/apps/mobile/app/_layout.tsx
+++ b/apps/mobile/app/_layout.tsx
@@ -1,3 +1,4 @@
+import { AndroidUpdateSheet } from '@/update/AndroidUpdateSheet';
import { PeerFileTransport } from '@/device-link/peerFileTransport';
import { startLocalDiagnostics } from '@/debug/localDiagnostics';
import {
@@ -432,6 +433,7 @@ function RootLayout() {
hidden={endpointGate.status === 'error' || forcedUpdate !== null}
>
<ConnectionNoticeProvider>{body}</ConnectionNoticeProvider>
+ <AndroidUpdateSheet />
</StartupSplashOverlay>
</MobileLoginHandoffProvider>
</LocaleProvider>
diff --git a/apps/mobile/modules/cindy-app-installer/android/build.gradle b/apps/mobile/modules/cindy-app-installer/android/build.gradle
new file mode 100644
index 0000000000..3d6199923c
--- /dev/null
+++ b/apps/mobile/modules/cindy-app-installer/android/build.gradle
@@ -0,0 +1,15 @@
+plugins {
+ id 'com.android.library'
+ id 'expo-module-gradle-plugin'
+}
+
+group = 'expo.modules.cindyappinstaller'
+version = '0.1.0'
+
+android {
+ namespace "expo.modules.cindyappinstaller"
+ defaultConfig {
+ versionCode 1
+ versionName "0.1.0"
+ }
+}
diff --git a/apps/mobile/modules/cindy-app-installer/android/src/main/AndroidManifest.xml b/apps/mobile/modules/cindy-app-installer/android/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..4eb441acfb
--- /dev/null
+++ b/apps/mobile/modules/cindy-app-installer/android/src/main/AndroidManifest.xml
@@ -0,0 +1,12 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- REQUEST_INSTALL_PACKAGES is added only by the self-host build config. -->
+ <application>
+ <provider
+ android:name="expo.modules.cindyappinstaller.UpdateFileProvider"
+ android:authorities="${applicationId}.cindy.updates"
+ android:exported="false"
+ android:grantUriPermissions="true">
+ <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/cindy_update_paths" />
+ </provider>
+ </application>
+</manifest>
diff --git a/apps/mobile/modules/cindy-app-installer/android/src/main/java/expo/modules/cindyappinstaller/CindyAppInstallerModule.kt b/apps/mobile/modules/cindy-app-installer/android/src/main/java/expo/modules/cindyappinstaller/CindyAppInstallerModule.kt
new file mode 100644
index 0000000000..dfe99e6c84
--- /dev/null
+++ b/apps/mobile/modules/cindy-app-installer/android/src/main/java/expo/modules/cindyappinstaller/CindyAppInstallerModule.kt
@@ -0,0 +1,111 @@
+package expo.modules.cindyappinstaller
+
+import android.Manifest
+import android.content.ClipData
+import android.content.Intent
+import android.content.pm.PackageManager
+import android.net.Uri
+import android.os.Build
+import android.provider.Settings
+import androidx.core.content.FileProvider
+import expo.modules.kotlin.Promise
+import expo.modules.kotlin.functions.Queues
+import expo.modules.kotlin.modules.Module
+import expo.modules.kotlin.modules.ModuleDefinition
+import java.io.File
+
+class UpdateFileProvider : FileProvider()
+
+class CindyAppInstallerModule : Module() {
+ private var permissionPromise: Promise? = null
+ private val permissionRequestCode = 48173
+
+ override fun definition() = ModuleDefinition {
+ Name("CindyAppInstaller")
+
+ // Check the installed manifest, never a mutable OTA extra or JS flag.
+ Function("isSupported") {
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && declaresInstallPermission()
+ }
+ AsyncFunction("hasPermission") { declaresInstallPermission() && canInstall() }
+ AsyncFunction("requestPermission") { promise: Promise ->
+ when {
+ !declaresInstallPermission() -> promise.resolve(false)
+ canInstall() -> promise.resolve(true)
+ permissionPromise != null -> promise.reject("ERR_INSTALL_BUSY", "Permission request already open", null)
+ else -> {
+ try {
+ val activity = requireNotNull(appContext.currentActivity)
+ permissionPromise = promise
+ activity.startActivityForResult(
+ Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, Uri.parse("package:${activity.packageName}")),
+ permissionRequestCode,
+ )
+ } catch (error: Exception) {
+ permissionPromise = null
+ promise.reject("ERR_INSTALL_PERMISSION", "Unable to open install settings", error)
+ }
+ }
+ }
+ }.runOnQueue(Queues.MAIN)
+
+ OnActivityResult { _, result ->
+ if (result.requestCode == permissionRequestCode) {
+ val pending = permissionPromise
+ permissionPromise = null
+ // RESULT_OK is not reliable for settings activities; read the actual permission.
+ pending?.resolve(canInstall())
+ }
+ }
+ OnDestroy {
+ permissionPromise?.reject("ERR_INSTALL_CLOSED", "Installer was closed", null)
+ permissionPromise = null
+ }
+
+ AsyncFunction("install") { fileUri: String, expectedVersion: String ->
+ val context = requireNotNull(appContext.reactContext)
+ require(declaresInstallPermission() && canInstall()) { "Install permission not granted" }
+ val uri = Uri.parse(fileUri)
+ require(uri.scheme == "file") { "Expected a local APK" }
+ val file = File(requireNotNull(uri.path)).canonicalFile
+ val directory = File(context.cacheDir, "cindy-updates").canonicalFile
+ require(file.parentFile == directory && file.extension == "apk" && file.isFile) { "Invalid update path" }
+ val pm = context.packageManager
+ @Suppress("DEPRECATION")
+ val archive = requireNotNull(pm.getPackageArchiveInfo(file.path, 0)) { "Invalid APK" }
+ require(archive.packageName == context.packageName) { "APK belongs to another app" }
+ require(archive.versionName == expectedVersion) { "APK does not match the selected update" }
+ @Suppress("DEPRECATION")
+ val installed = pm.getPackageInfo(context.packageName, 0)
+ val newer = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+ archive.longVersionCode > installed.longVersionCode
+ } else {
+ @Suppress("DEPRECATION")
+ (archive.versionCode > installed.versionCode)
+ }
+ require(newer) { "APK is not a newer build" }
+ // Android's package installer verifies the APK signature against the installed app,
+ // including signing-key rotation. It owns the final user confirmation and replacement.
+ val contentUri = FileProvider.getUriForFile(context, "${context.packageName}.cindy.updates", file)
+ val intent = Intent(Intent.ACTION_VIEW).apply {
+ setDataAndType(contentUri, "application/vnd.android.package-archive")
+ clipData = ClipData.newRawUri("update", contentUri)
+ addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_ACTIVITY_NEW_TASK)
+ }
+ context.startActivity(intent)
+ // Do not delete the file here: the system installer still needs to read it.
+ }
+ }
+
+ private fun canInstall(): Boolean {
+ val context = appContext.reactContext ?: return false
+ return Build.VERSION.SDK_INT < Build.VERSION_CODES.O || context.packageManager.canRequestPackageInstalls()
+ }
+
+ @Suppress("DEPRECATION")
+ private fun declaresInstallPermission(): Boolean {
+ val context = appContext.reactContext ?: return false
+ return context.packageManager.getPackageInfo(context.packageName, PackageManager.GET_PERMISSIONS)
+ .requestedPermissions?.contains(Manifest.permission.REQUEST_INSTALL_PACKAGES) == true
+ }
+}
diff --git a/apps/mobile/modules/cindy-app-installer/android/src/main/res/xml/cindy_update_paths.xml b/apps/mobile/modules/cindy-app-installer/android/src/main/res/xml/cindy_update_paths.xml
new file mode 100644
index 0000000000..619c910ea5
--- /dev/null
+++ b/apps/mobile/modules/cindy-app-installer/android/src/main/res/xml/cindy_update_paths.xml
@@ -0,0 +1,3 @@
+<paths xmlns:android="http://schemas.android.com/apk/res/android">
+ <cache-path name="updates" path="cindy-updates/" />
+</paths>
diff --git a/apps/mobile/modules/cindy-app-installer/expo-module.config.json b/apps/mobile/modules/cindy-app-installer/expo-module.config.json
new file mode 100644
index 0000000000..8568cbefc6
--- /dev/null
+++ b/apps/mobile/modules/cindy-app-installer/expo-module.config.json
@@ -0,0 +1,4 @@
+{
+ "platforms": ["android"],
+ "android": { "modules": ["expo.modules.cindyappinstaller.CindyAppInstallerModule"] }
+}
diff --git a/apps/mobile/src/__tests__/nativeAppConfig.test.ts b/apps/mobile/src/__tests__/nativeAppConfig.test.ts
index 1c252fa85f..a73475fe40 100644
--- a/apps/mobile/src/__tests__/nativeAppConfig.test.ts
+++ b/apps/mobile/src/__tests__/nativeAppConfig.test.ts
@@ -185,6 +185,7 @@ describe('mobile native app config', () => {
const regular = buildConfig({ config: appJson.expo });
// 账号绑定改为 env 注入后,app.json 不再带 updates;env 未设 → 无 OTA 配置。
expect(regular.updates).toBeUndefined();
+ expect(regular.android.permissions).not.toContain('android.permission.REQUEST_INSTALL_PACKAGES');
const configDir = mkdtempSync(join(tmpdir(), 'cindy-selfhost-regions-'));
temporaryDirs.push(configDir);
@@ -225,6 +226,7 @@ describe('mobile native app config', () => {
// 自建 app 身份按 region 从 self-host-regions.json(.example 回落)取,而非写死。
expect(selfHosted.ios.bundleIdentifier).toBe('com.xd.cindycn');
expect(selfHosted.android.package).toBe('com.xd.cindycn');
+ expect(selfHosted.android.permissions).toContain('android.permission.REQUEST_INSTALL_PACKAGES');
expect(selfHosted.extra.cindy.tapdb).toEqual({
clientId: 'json-id',
clientToken: 'json-token',
@@ -239,6 +241,7 @@ describe('mobile native app config', () => {
const selfHostedGlobal = buildConfig({ config: appJson.expo });
expect(selfHostedGlobal.ios.bundleIdentifier).toBe('com.xd.cindy');
expect(selfHostedGlobal.android.package).toBe('com.xd.cindy');
+ expect(selfHostedGlobal.android.permissions).toContain('android.permission.REQUEST_INSTALL_PACKAGES');
expect(selfHostedGlobal.extra.cindy.tapdb.region).toBe('global');
expect(selfHostedGlobal.extra.cindy.google).toEqual({
webClientId: 'web.apps.googleusercontent.com',
diff --git a/apps/mobile/src/i18n/locales/en/update.json b/apps/mobile/src/i18n/locales/en/update.json
index 65b1a6e947..0639a7c1a7 100644
--- a/apps/mobile/src/i18n/locales/en/update.json
+++ b/apps/mobile/src/i18n/locales/en/update.json
@@ -13,5 +13,21 @@
"upToDateBody": "You already have the latest app package.",
"checkFailedTitle": "Check Failed",
"checkFailedBody": "Couldn't reach the update server. Try again later.",
- "latestRequestFailed": "latest request failed: HTTP {{status}}"
+ "latestRequestFailed": "latest request failed: HTTP {{status}}",
+ "android": {
+ "permissionRequired": "Cindy needs permission to install this update. You can allow installation in system settings or download with your browser.",
+ "permissionPending": "Checking installation permission…",
+ "permissionDenied": "Installation permission is off. Allow installation or download with your browser.",
+ "grantPermission": "Allow Installation",
+ "browser": "Download in Browser",
+ "downloading": "Downloading update…",
+ "downloadProgress": "Downloading update… {{percent}}%",
+ "failed": "The update could not be downloaded or opened. Retry or download with your browser.",
+ "ready": "The update is downloaded. If you cancelled installation, you can open the installer again.",
+ "installing": "Opening installer…",
+ "install": "Install Update",
+ "retry": "Retry Update",
+ "cancel": "Cancel Update",
+ "browserFailed": "Could not open the download link. Try again later."
+ }
}
diff --git a/apps/mobile/src/i18n/locales/ja/update.json b/apps/mobile/src/i18n/locales/ja/update.json
index d833b66205..a940f78552 100644
--- a/apps/mobile/src/i18n/locales/ja/update.json
+++ b/apps/mobile/src/i18n/locales/ja/update.json
@@ -13,5 +13,21 @@
"upToDateBody": "すでに最新のパッケージです。",
"checkFailedTitle": "確認に失敗しました",
"checkFailedBody": "更新サーバーに接続できません。しばらくしてからもう一度お試しください。",
- "latestRequestFailed": "latest リクエスト失敗: HTTP {{status}}"
+ "latestRequestFailed": "latest リクエスト失敗: HTTP {{status}}",
+ "android": {
+ "permissionRequired": "更新するには、Cindy にアプリのインストールを許可する必要があります。システム設定で許可するか、ブラウザーでダウンロードできます。",
+ "permissionPending": "インストールの許可を確認中…",
+ "permissionDenied": "アプリのインストールが許可されていません。許可するか、ブラウザーでダウンロードしてください。",
+ "grantPermission": "インストールを許可",
+ "browser": "ブラウザーでダウンロード",
+ "downloading": "更新をダウンロード中…",
+ "downloadProgress": "更新をダウンロード中… {{percent}}%",
+ "failed": "更新をダウンロードまたは開くことができませんでした。再試行するか、ブラウザーでダウンロードしてください。",
+ "ready": "更新をダウンロードしました。インストールをキャンセルした場合は、インストーラーをもう一度開けます。",
+ "installing": "インストーラーを起動中…",
+ "install": "更新をインストール",
+ "retry": "更新を再試行",
+ "cancel": "更新をキャンセル",
+ "browserFailed": "ダウンロードリンクを開けませんでした。しばらくしてからもう一度お試しください。"
+ }
}
diff --git a/apps/mobile/src/i18n/locales/ko/update.json b/apps/mobile/src/i18n/locales/ko/update.json
index 75ac2e46ed..f2eac37df5 100644
--- a/apps/mobile/src/i18n/locales/ko/update.json
+++ b/apps/mobile/src/i18n/locales/ko/update.json
@@ -13,5 +13,21 @@
"upToDateBody": "이미 최신 패키지입니다.",
"checkFailedTitle": "확인 실패",
"checkFailedBody": "업데이트 서버에 연결할 수 없습니다. 나중에 다시 시도하세요.",
- "latestRequestFailed": "latest 요청 실패: HTTP {{status}}"
+ "latestRequestFailed": "latest 요청 실패: HTTP {{status}}",
+ "android": {
+ "permissionRequired": "업데이트하려면 Cindy에 앱 설치 권한이 필요합니다. 시스템 설정에서 허용하거나 브라우저에서 다운로드할 수 있습니다.",
+ "permissionPending": "설치 권한 확인 중…",
+ "permissionDenied": "앱 설치 권한이 없습니다. 설치를 허용하거나 브라우저에서 다운로드하세요.",
+ "grantPermission": "설치 허용",
+ "browser": "브라우저에서 다운로드",
+ "downloading": "업데이트 다운로드 중…",
+ "downloadProgress": "업데이트 다운로드 중… {{percent}}%",
+ "failed": "업데이트를 다운로드하거나 열 수 없습니다. 다시 시도하거나 브라우저에서 다운로드하세요.",
+ "ready": "업데이트를 다운로드했습니다. 설치를 취소했다면 설치 프로그램을 다시 열 수 있습니다.",
+ "installing": "설치 프로그램 여는 중…",
+ "install": "업데이트 설치",
+ "retry": "업데이트 재시도",
+ "cancel": "업데이트 취소",
+ "browserFailed": "다운로드 링크를 열 수 없습니다. 나중에 다시 시도하세요."
+ }
}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/update.json b/apps/mobile/src/i18n/locales/zh-CN/update.json
index 6e17f0c8ba..23e0af31df 100644
--- a/apps/mobile/src/i18n/locales/zh-CN/update.json
+++ b/apps/mobile/src/i18n/locales/zh-CN/update.json
@@ -13,5 +13,21 @@
"upToDateBody": "当前已是最新整包版本。",
"checkFailedTitle": "检查失败",
"checkFailedBody": "无法连接更新服务器,请稍后重试。",
- "latestRequestFailed": "latest 请求失败:HTTP {{status}}"
+ "latestRequestFailed": "latest 请求失败:HTTP {{status}}",
+ "android": {
+ "permissionRequired": "Cindy 需要安装应用权限才能更新。你可以前往系统设置授权,也可以用浏览器下载。",
+ "permissionPending": "正在检查安装权限…",
+ "permissionDenied": "尚未获得安装应用权限。你可以重新授权,也可以用浏览器下载。",
+ "grantPermission": "去授权",
+ "browser": "浏览器下载",
+ "downloading": "正在下载更新…",
+ "downloadProgress": "正在下载更新… {{percent}}%",
+ "failed": "无法下载或打开更新,请重试或用浏览器下载。",
+ "ready": "更新已下载。如果刚才取消了安装,可以重新打开安装器。",
+ "installing": "正在打开安装器…",
+ "install": "安装更新",
+ "retry": "重试更新",
+ "cancel": "取消更新",
+ "browserFailed": "无法打开下载链接,请稍后重试。"
+ }
}
diff --git a/apps/mobile/src/i18n/locales/zh-TW/update.json b/apps/mobile/src/i18n/locales/zh-TW/update.json
index 7b521d3c25..8d415c7a76 100644
--- a/apps/mobile/src/i18n/locales/zh-TW/update.json
+++ b/apps/mobile/src/i18n/locales/zh-TW/update.json
@@ -13,5 +13,21 @@
"upToDateBody": "當前已是最新整包版本。",
"checkFailedTitle": "檢查失敗",
"checkFailedBody": "無法連線更新伺服器,請稍後重試。",
- "latestRequestFailed": "latest 請求失敗:HTTP {{status}}"
+ "latestRequestFailed": "latest 請求失敗:HTTP {{status}}",
+ "android": {
+ "permissionRequired": "Cindy 需要安裝應用程式的權限才能更新。你可以前往系統設定授權,也可以用瀏覽器下載。",
+ "permissionPending": "正在檢查安裝權限…",
+ "permissionDenied": "尚未取得安裝應用程式的權限。你可以重新授權,也可以用瀏覽器下載。",
+ "grantPermission": "前往授權",
+ "browser": "瀏覽器下載",
+ "downloading": "正在下載更新…",
+ "downloadProgress": "正在下載更新… {{percent}}%",
+ "failed": "無法下載或開啟更新,請重試或用瀏覽器下載。",
+ "ready": "更新已下載。如果剛才取消了安裝,可以重新開啟安裝程式。",
+ "installing": "正在開啟安裝程式…",
+ "install": "安裝更新",
+ "retry": "重試更新",
+ "cancel": "取消更新",
+ "browserFailed": "無法開啟下載連結,請稍後重試。"
+ }
}
diff --git a/apps/mobile/src/update/AndroidUpdateSheet.tsx b/apps/mobile/src/update/AndroidUpdateSheet.tsx
new file mode 100644
index 0000000000..aa072f9897
--- /dev/null
+++ b/apps/mobile/src/update/AndroidUpdateSheet.tsx
@@ -0,0 +1,65 @@
+import { useSyncExternalStore } from 'react';
+import { useTranslation } from 'react-i18next';
+import { ActivityIndicator, StyleSheet, View } from 'react-native';
+import { Text } from '@/components/AppText';
+import { MainWindowActionButton } from '@/components/MobilePrimitives';
+import { ContextSheet } from '@/session/ContextSheet';
+import { spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';
+import { androidInstaller } from './androidInstaller';
+
+/** Mounted outside the business tree so forced updates have the same working installer. */
+export function AndroidUpdateSheet() {
+ const state = useSyncExternalStore(androidInstaller.subscribe, androidInstaller.getSnapshot);
+ const { t } = useTranslation();
+ const { colors } = useTheme();
+ const styles = useThemedStyles(makeStyles);
+ const busy = state.phase === 'permission' || state.phase === 'downloading' || state.phase === 'installing';
+ const status = state.phase === 'permission' ? t('update.android.permissionPending')
+ : state.phase === 'permission-required' ? t('update.android.permissionRequired')
+ : state.phase === 'permission-denied' ? t('update.android.permissionDenied')
+ : state.phase === 'error' ? t('update.android.failed')
+ : state.phase === 'installing' ? t('update.android.installing')
+ : state.phase === 'ready' ? t('update.android.ready')
+ : state.progress === null ? t('update.android.downloading')
+ : t('update.android.downloadProgress', { percent: Math.floor(state.progress * 100) });
+ const permissionNeeded = state.phase === 'permission-required' || state.phase === 'permission-denied';
+ const actionLabel = permissionNeeded ? t('update.android.grantPermission')
+ : state.phase === 'ready' ? t('update.android.install') : t('update.android.retry');
+ return (
+ <ContextSheet
+ visible={state.phase !== 'idle'}
+ title={t('update.newVersionTitle')}
+ onClose={androidInstaller.close}
+ keyboardAvoidingBehavior={undefined}
+ testID="update.android"
+ >
+ <View style={styles.content}>
+ <Text style={styles.status} accessibilityLiveRegion="polite">{status}</Text>
+ {busy ? <ActivityIndicator color={colors.textSecondary} /> : (
+ <>
+ <MainWindowActionButton action={{
+ label: actionLabel,
+ onPress: androidInstaller.retry,
+ tone: 'primary',
+ testID: 'update.android.retry',
+ }} />
+ <MainWindowActionButton action={{
+ label: t('update.android.browser'),
+ onPress: () => { void androidInstaller.browser(); },
+ testID: 'update.android.browser',
+ }} />
+ </>
+ )}
+ <MainWindowActionButton action={{
+ label: busy ? t('update.android.cancel') : t('update.later'),
+ onPress: androidInstaller.close,
+ testID: 'update.android.cancel',
+ }} />
+ </View>
+ </ContextSheet>
+ );
+}
+const makeStyles = (colors: ThemeColors) => StyleSheet.create({
+ content: { gap: spacing.lg, padding: spacing.lg },
+ status: { color: colors.textPrimary, fontSize: typeScale.body },
+});
diff --git a/apps/mobile/src/update/androidInstallController.test.ts b/apps/mobile/src/update/androidInstallController.test.ts
new file mode 100644
index 0000000000..8d5e3469ac
--- /dev/null
+++ b/apps/mobile/src/update/androidInstallController.test.ts
@@ -0,0 +1,197 @@
+import { describe, expect, it, vi } from 'vitest';
+import { AndroidInstallController, isDirectApkUrl, type AndroidInstallIO } from './androidInstallController';
+
+const target = { version: '1.2.3', installUrl: 'https://updates.example.invalid/app.apk' };
+const file = 'file:///cache/cindy-updates/update-1-abc.apk';
+const settle = async () => { for (let i = 0; i < 20; i++) await Promise.resolve(); };
+function deferred<T>() {
+ let resolve!: (value: T) => void;
+ let reject!: (error: Error) => void;
+ const promise = new Promise<T>((yes, no) => { resolve = yes; reject = no; });
+ return { promise, resolve, reject };
+}
+function setup(overrides: Partial<AndroidInstallIO> = {}) {
+ const io = {
+ supported: vi.fn(() => true),
+ hasPermission: vi.fn(async () => false),
+ requestPermission: vi.fn(async () => true),
+ download: vi.fn(async () => file),
+ install: vi.fn(async () => undefined),
+ remove: vi.fn(async () => undefined),
+ openBrowser: vi.fn(async () => undefined),
+ ...overrides,
+ };
+ return { io, controller: new AndroidInstallController(io) };
+}
+
+describe('Android in-app installation', () => {
+ it('explains the permission before opening settings; only the explicit action requests it', async () => {
+ const { controller, io } = setup();
+ expect(controller.start(target)).toBe(true);
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('permission-required');
+ expect(io.requestPermission).not.toHaveBeenCalled();
+ expect(io.download).not.toHaveBeenCalled();
+ controller.retry();
+ await settle();
+ expect(io.requestPermission).toHaveBeenCalledOnce();
+ expect(io.install).toHaveBeenCalledWith(file, target.version, expect.any(AbortSignal));
+ expect(controller.getSnapshot().phase).toBe('ready');
+ controller.close();
+ expect(io.remove).not.toHaveBeenCalled(); // Android still owns the handoff.
+ });
+
+ it('already-authorized users download directly and installer cancellation can reuse the APK', async () => {
+ const { controller, io } = setup({ hasPermission: vi.fn(async () => true) });
+ controller.start(target);
+ await settle();
+ expect(io.requestPermission).not.toHaveBeenCalled();
+ expect(controller.getSnapshot().phase).toBe('ready');
+ controller.retry();
+ await settle();
+ expect(io.download).toHaveBeenCalledOnce();
+ expect(io.install).toHaveBeenCalledTimes(2);
+ });
+
+ it('denial never downloads or reopens settings automatically, and the browser remains usable', async () => {
+ const { controller, io } = setup({ requestPermission: vi.fn(async () => false) });
+ controller.start(target);
+ await settle();
+ controller.retry();
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('permission-denied');
+ expect(io.download).not.toHaveBeenCalled();
+ expect(io.openBrowser).not.toHaveBeenCalled();
+ await controller.browser();
+ expect(io.openBrowser).toHaveBeenCalledWith(target.installUrl);
+ expect(controller.getSnapshot().phase).toBe('idle');
+ });
+
+ it('allows browser download before granting permission', async () => {
+ const { controller, io } = setup();
+ controller.start(target);
+ await settle();
+ await controller.browser();
+ expect(io.requestPermission).not.toHaveBeenCalled();
+ expect(io.openBrowser).toHaveBeenCalledOnce();
+ });
+
+ it('closing while settings are open prevents a late grant from starting a download', async () => {
+ const permission = deferred<boolean>();
+ const { controller, io } = setup({ requestPermission: vi.fn(() => permission.promise) });
+ controller.start(target);
+ await settle();
+ controller.retry();
+ await settle();
+ controller.close();
+ permission.resolve(true);
+ await settle();
+ expect(io.download).not.toHaveBeenCalled();
+ expect(controller.getSnapshot().phase).toBe('idle');
+ controller.start(target);
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('permission-required');
+ });
+
+ it('deduplicates startup/settings/forced-gate clicks and ignores cancelled download callbacks', async () => {
+ const downloaded = deferred<string>();
+ let signal!: AbortSignal;
+ let progress!: (value: number | null) => void;
+ const { controller, io } = setup({
+ hasPermission: vi.fn(async () => true),
+ download: vi.fn((_url, s, p) => { signal = s; progress = p; return downloaded.promise; }),
+ });
+ controller.start(target);
+ controller.start(target);
+ await settle();
+ controller.retry();
+ expect(io.download).toHaveBeenCalledOnce();
+ progress(0.4);
+ expect(controller.getSnapshot().progress).toBe(0.4);
+ controller.close();
+ expect(signal.aborted).toBe(true);
+ progress(0.8);
+ downloaded.resolve(file);
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('idle');
+ expect(io.install).not.toHaveBeenCalled();
+ expect(io.remove).toHaveBeenCalledWith(file);
+ });
+
+ it('an immediate restart after cancellation is not swallowed or overwritten by the old download', async () => {
+ const old = deferred<string>();
+ const download = vi.fn().mockImplementationOnce(() => old.promise).mockResolvedValue(file);
+ const { controller, io } = setup({ hasPermission: vi.fn(async () => true), download });
+ controller.start(target);
+ await settle();
+ controller.close();
+ controller.start(target);
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('ready');
+ old.resolve('file:///cache/cindy-updates/old.apk');
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('ready');
+ expect(io.install).toHaveBeenCalledOnce();
+ expect(io.remove).toHaveBeenCalledWith('file:///cache/cindy-updates/old.apk');
+ });
+
+ it('a download failure offers retry and browser fallback without unhandled rejections', async () => {
+ const download = vi.fn().mockRejectedValueOnce(new Error('offline')).mockResolvedValue(file);
+ const { controller, io } = setup({ hasPermission: vi.fn(async () => true), download });
+ controller.start(target);
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('error');
+ controller.retry();
+ await settle();
+ expect(io.install).toHaveBeenCalledOnce();
+ expect(controller.getSnapshot().phase).toBe('ready');
+ });
+
+ it('a rejected APK handoff removes the unusable file and retries with a new download', async () => {
+ const install = vi.fn().mockRejectedValueOnce(new Error('invalid APK')).mockResolvedValue(undefined);
+ const { controller, io } = setup({ hasPermission: vi.fn(async () => true), install });
+ controller.start(target);
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('error');
+ expect(io.remove).toHaveBeenCalledWith(file);
+ controller.retry();
+ await settle();
+ expect(io.download).toHaveBeenCalledTimes(2);
+ expect(controller.getSnapshot().phase).toBe('ready');
+ });
+
+ it('settings and browser launch failures leave a retryable state', async () => {
+ const { controller } = setup({
+ requestPermission: vi.fn(async () => { throw new Error('settings unavailable'); }),
+ openBrowser: vi.fn(async () => { throw new Error('browser unavailable'); }),
+ });
+ controller.start(target);
+ await settle();
+ controller.retry();
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('error');
+ await controller.browser();
+ expect(controller.getSnapshot().phase).toBe('error');
+ });
+
+ it('a revoked permission is explained again before retrying installation', async () => {
+ const hasPermission = vi.fn().mockResolvedValueOnce(true).mockResolvedValue(false);
+ const { controller, io } = setup({ hasPermission });
+ controller.start(target);
+ await settle();
+ controller.retry();
+ await settle();
+ expect(controller.getSnapshot().phase).toBe('permission-required');
+ expect(io.requestPermission).not.toHaveBeenCalled();
+ expect(io.install).toHaveBeenCalledOnce();
+ });
+
+ it('old binaries and non-APK links retain the original browser route', () => {
+ expect(setup({ supported: () => false }).controller.start(target)).toBe(false);
+ for (const installUrl of ['https://example.invalid/install', 'http://example.invalid/app.apk', 'file:///app.apk']) {
+ expect(setup().controller.start({ ...target, installUrl })).toBe(false);
+ }
+ expect(isDirectApkUrl('https://example.invalid/app.apk?token=example')).toBe(true);
+ expect(isDirectApkUrl('https://user:[email protected]/app.apk')).toBe(false);
+ });
+});
diff --git a/apps/mobile/src/update/androidInstallController.ts b/apps/mobile/src/update/androidInstallController.ts
new file mode 100644
index 0000000000..c69eafddd8
--- /dev/null
+++ b/apps/mobile/src/update/androidInstallController.ts
@@ -0,0 +1,134 @@
+/** One installer shared by startup, Settings and the forced-update gate. No React/native imports. */
+export interface AndroidInstallTarget { installUrl: string; version: string }
+export type AndroidInstallPhase = 'idle' | 'permission-required' | 'permission' | 'permission-denied' | 'downloading' | 'installing' | 'ready' | 'error';
+export interface AndroidInstallState {
+ phase: AndroidInstallPhase;
+ target: AndroidInstallTarget | null;
+ progress: number | null;
+}
+export interface AndroidInstallIO {
+ supported(): boolean;
+ hasPermission(): Promise<boolean>;
+ requestPermission(): Promise<boolean>;
+ download(url: string, signal: AbortSignal, progress: (value: number | null) => void): Promise<string>;
+ install(uri: string, version: string, signal: AbortSignal): Promise<void>;
+ remove(uri: string): Promise<void>;
+ openBrowser(url: string): Promise<void>;
+}
+const IDLE: AndroidInstallState = { phase: 'idle', target: null, progress: null };
+
+export function isDirectApkUrl(value: string): boolean {
+ try {
+ const url = new URL(value);
+ return url.protocol === 'https:' && !url.username && !url.password && /\.apk$/i.test(url.pathname);
+ } catch { return false; }
+}
+
+export class AndroidInstallController {
+ private state = IDLE;
+ private listeners = new Set<() => void>();
+ private operation: AbortController | null = null;
+ private file: string | null = null;
+ // Files passed to Android must survive dialog dismissal and installation cancellation.
+ private handedToInstaller = false;
+ constructor(private io: AndroidInstallIO) {}
+ getSnapshot = (): AndroidInstallState => this.state;
+ subscribe = (listener: () => void): (() => void) => {
+ this.listeners.add(listener);
+ return () => { this.listeners.delete(listener); };
+ };
+ private update(state: AndroidInstallState): void {
+ this.state = state;
+ for (const listener of this.listeners) listener();
+ }
+
+ /** false means an old native build or a web landing page: keep the original browser path. */
+ start(target: AndroidInstallTarget): boolean {
+ try {
+ if (!this.io.supported() || !isDirectApkUrl(target.installUrl)) return false;
+ } catch { return false; }
+ if (this.state.phase !== 'idle' || this.operation) return true;
+ this.update({ phase: 'permission', target, progress: null });
+ void this.run();
+ return true;
+ }
+ retry = (): void => {
+ if (!this.operation && this.state.target) {
+ const grant = this.state.phase === 'permission-required' || this.state.phase === 'permission-denied';
+ void this.run(grant);
+ }
+ };
+
+ private async run(grant = false): Promise<void> {
+ const target = this.state.target;
+ if (!target || this.operation) return;
+ const operation = new AbortController();
+ this.operation = operation;
+ const current = () => !operation.signal.aborted;
+ try {
+ this.update({ phase: 'permission', target, progress: null });
+ let allowed = await this.io.hasPermission();
+ if (!current()) return;
+ if (!allowed && !grant) {
+ this.update({ phase: 'permission-required', target, progress: null });
+ return;
+ }
+ if (!allowed) allowed = await this.io.requestPermission();
+ if (!current()) return;
+ if (!allowed) {
+ this.update({ phase: 'permission-denied', target, progress: null });
+ return;
+ }
+ if (!this.file) {
+ this.update({ phase: 'downloading', target, progress: null });
+ const file = await this.io.download(target.installUrl, operation.signal, (progress) => {
+ if (current()) this.update({ phase: 'downloading', target, progress });
+ });
+ if (!current()) { await this.io.remove(file).catch(() => undefined); return; }
+ this.file = file;
+ this.handedToInstaller = false;
+ }
+ this.update({ phase: 'installing', target, progress: 1 });
+ this.handedToInstaller = true;
+ await this.io.install(this.file, target.version, operation.signal);
+ if (current()) this.update({ phase: 'ready', target, progress: 1 });
+ // Launching Android's installer is not proof that the update was installed.
+ } catch {
+ if (current()) {
+ // A rejected handoff (invalid APK, missing installer, revoked permission) owns no file.
+ const failedFile = this.file;
+ this.file = null;
+ this.handedToInstaller = false;
+ if (failedFile) await this.io.remove(failedFile).catch(() => undefined);
+ if (current()) this.update({ phase: 'error', target, progress: null });
+ }
+ } finally {
+ if (this.operation === operation) this.operation = null;
+ }
+ }
+
+ close = (): void => {
+ this.operation?.abort();
+ this.operation = null;
+ const file = this.file;
+ this.file = null;
+ if (file && !this.handedToInstaller) void this.io.remove(file).catch(() => undefined);
+ this.handedToInstaller = false;
+ this.update(IDLE);
+ };
+
+ browser = async (): Promise<void> => {
+ const target = this.state.target;
+ if (!target || this.operation) return;
+ const operation = new AbortController();
+ this.operation = operation;
+ try {
+ await this.io.openBrowser(target.installUrl);
+ if (!operation.signal.aborted) this.close();
+ } catch {
+ if (!operation.signal.aborted) this.update({ phase: 'error', target, progress: null });
+ } finally {
+ if (this.operation === operation) this.operation = null;
+ }
+ };
+}
diff --git a/apps/mobile/src/update/androidInstaller.test.ts b/apps/mobile/src/update/androidInstaller.test.ts
new file mode 100644
index 0000000000..03f1c3d3c6
--- /dev/null
+++ b/apps/mobile/src/update/androidInstaller.test.ts
@@ -0,0 +1,138 @@
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+
+const mocks = vi.hoisted(() => {
+ const native = {
+ isSupported: vi.fn(() => true),
+ hasPermission: vi.fn(async () => true),
+ requestPermission: vi.fn(async () => true),
+ install: vi.fn(async () => undefined),
+ };
+ return {
+ native,
+ state: { currentState: 'active' },
+ appStateListener: undefined as ((state: string) => void) | undefined,
+ onProgress: undefined as ((data: { totalBytesWritten: number; totalBytesExpectedToWrite: number }) => void) | undefined,
+ file: '',
+ download: vi.fn<() => Promise<{ status: number } | undefined>>(),
+ cancel: vi.fn(async () => undefined),
+ remove: vi.fn(async () => undefined),
+ unsubscribe: vi.fn(),
+ browser: vi.fn(async () => undefined),
+ };
+});
+vi.mock('react-native', () => ({
+ Platform: { OS: 'android' },
+ AppState: {
+ get currentState() { return mocks.state.currentState; },
+ addEventListener: (_name: string, callback: (state: string) => void) => {
+ mocks.appStateListener = callback;
+ return { remove: mocks.unsubscribe };
+ },
+ },
+ Linking: { openURL: mocks.browser },
+}));
+vi.mock('expo-modules-core', () => ({ requireOptionalNativeModule: () => mocks.native }));
+vi.mock('expo-file-system/legacy', () => ({
+ cacheDirectory: 'file:///cache/',
+ makeDirectoryAsync: vi.fn(async () => undefined),
+ readDirectoryAsync: vi.fn(async () => []),
+ getInfoAsync: vi.fn(),
+ deleteAsync: mocks.remove,
+ createDownloadResumable: (_url: string, file: string, _options: object, onProgress: typeof mocks.onProgress) => {
+ mocks.file = file;
+ mocks.onProgress = onProgress;
+ return { downloadAsync: mocks.download, cancelAsync: mocks.cancel };
+ },
+}));
+import { androidInstaller } from './androidInstaller';
+const target = { installUrl: 'https://updates.example.invalid/app.apk', version: '1.2.3' };
+const settle = async () => { for (let i = 0; i < 40; i++) await Promise.resolve(); };
+
+beforeEach(() => {
+ vi.useFakeTimers();
+ vi.clearAllMocks();
+ mocks.state.currentState = 'active';
+ mocks.download.mockResolvedValue({ status: 200 });
+});
+afterEach(async () => {
+ androidInstaller.close();
+ await settle();
+ vi.useRealTimers();
+});
+
+describe('Android installer IO', () => {
+ it('downloads to the private update cache and retains the APK for the system installer', async () => {
+ androidInstaller.start(target);
+ await settle();
+ expect(mocks.file).toMatch(/^file:\/\/\/cache\/cindy-updates\/update-.*\.apk$/);
+ expect(mocks.native.install).toHaveBeenCalledWith(mocks.file, target.version);
+ expect(mocks.remove).not.toHaveBeenCalled();
+ expect(androidInstaller.getSnapshot().phase).toBe('ready');
+ mocks.onProgress!({ totalBytesWritten: 100, totalBytesExpectedToWrite: 100 });
+ expect(vi.getTimerCount()).toBe(0);
+ androidInstaller.close();
+ expect(mocks.remove).not.toHaveBeenCalled();
+ });
+
+ it('HTTP failures never launch installation and remove partial bytes', async () => {
+ mocks.download.mockResolvedValue({ status: 503 });
+ androidInstaller.start(target);
+ await settle();
+ expect(mocks.native.install).not.toHaveBeenCalled();
+ expect(mocks.remove).toHaveBeenCalledWith(mocks.file, { idempotent: true });
+ expect(androidInstaller.getSnapshot().phase).toBe('error');
+ });
+
+ it('stalled downloads time out, cancel the native transfer and expose browser fallback', async () => {
+ mocks.download.mockImplementation(() => new Promise(() => undefined));
+ androidInstaller.start(target);
+ await settle();
+ expect(androidInstaller.getSnapshot().phase).toBe('downloading');
+ await vi.advanceTimersByTimeAsync(90_000);
+ expect(mocks.cancel).toHaveBeenCalled();
+ expect(mocks.remove).toHaveBeenCalledWith(mocks.file, { idempotent: true });
+ expect(androidInstaller.getSnapshot().phase).toBe('error');
+ await androidInstaller.browser();
+ expect(mocks.browser).toHaveBeenCalledWith(target.installUrl);
+ });
+
+ it('reports unknown length without fake percentages; progress keeps a live download running', async () => {
+ mocks.download.mockImplementation(() => new Promise(() => undefined));
+ androidInstaller.start(target);
+ await settle();
+ mocks.onProgress!({ totalBytesWritten: 20, totalBytesExpectedToWrite: -1 });
+ expect(androidInstaller.getSnapshot().progress).toBeNull();
+ await vi.advanceTimersByTimeAsync(60_000);
+ mocks.onProgress!({ totalBytesWritten: 50, totalBytesExpectedToWrite: 100 });
+ expect(androidInstaller.getSnapshot().progress).toBe(0.5);
+ await vi.advanceTimersByTimeAsync(60_000);
+ expect(androidInstaller.getSnapshot().phase).toBe('downloading');
+ androidInstaller.close();
+ await settle();
+ expect(mocks.native.install).not.toHaveBeenCalled();
+ expect(mocks.remove).toHaveBeenCalledWith(mocks.file, { idempotent: true });
+ });
+
+ it('does not open installation over another app; resuming launches the downloaded update', async () => {
+ mocks.state.currentState = 'background';
+ androidInstaller.start(target);
+ await settle();
+ expect(mocks.native.install).not.toHaveBeenCalled();
+ mocks.state.currentState = 'active';
+ mocks.appStateListener!('active');
+ await settle();
+ expect(mocks.native.install).toHaveBeenCalledOnce();
+ expect(mocks.unsubscribe).toHaveBeenCalledOnce();
+ });
+
+ it('cancelling a background handoff removes the listener and prevents later installation', async () => {
+ mocks.state.currentState = 'background';
+ androidInstaller.start(target);
+ await settle();
+ androidInstaller.close();
+ await settle();
+ expect(mocks.unsubscribe).toHaveBeenCalledOnce();
+ expect(mocks.native.install).not.toHaveBeenCalled();
+ expect(androidInstaller.getSnapshot().phase).toBe('idle');
+ });
+});
diff --git a/apps/mobile/src/update/androidInstaller.ts b/apps/mobile/src/update/androidInstaller.ts
new file mode 100644
index 0000000000..37c4dac6f6
--- /dev/null
+++ b/apps/mobile/src/update/androidInstaller.ts
@@ -0,0 +1,99 @@
+import { AppState, Linking, Platform } from 'react-native';
+import { requireOptionalNativeModule } from 'expo-modules-core';
+import * as FileSystem from 'expo-file-system/legacy';
+import { AndroidInstallController } from './androidInstallController';
+
+interface NativeInstaller {
+ isSupported(): boolean;
+ hasPermission(): Promise<boolean>;
+ requestPermission(): Promise<boolean>;
+ install(file: string, version: string): Promise<void>;
+}
+const native = Platform.OS === 'android'
+ ? requireOptionalNativeModule<NativeInstaller>('CindyAppInstaller') : null;
+
+function abortError(): Error { return new Error('Update download cancelled'); }
+
+/** Never raise an installer over another app when a download finishes in the background. */
+async function waitForForeground(signal: AbortSignal): Promise<void> {
+ if (signal.aborted) throw abortError();
+ if (AppState.currentState === 'active') return;
+ await new Promise<void>((resolve, reject) => {
+ const cleanup = () => { subscription.remove(); signal.removeEventListener('abort', abort); };
+ const abort = () => { cleanup(); reject(abortError()); };
+ const subscription = AppState.addEventListener('change', (state) => {
+ if (state === 'active') { cleanup(); resolve(); }
+ });
+ signal.addEventListener('abort', abort, { once: true });
+ if (signal.aborted) abort();
+ });
+}
+
+async function downloadApk(
+ url: string, signal: AbortSignal, progress: (value: number | null) => void,
+): Promise<string> {
+ if (!FileSystem.cacheDirectory) throw new Error('Cache unavailable');
+ const directory = `${FileSystem.cacheDirectory}cindy-updates/`;
+ await FileSystem.makeDirectoryAsync(directory, { intermediates: true });
+ // Android may still read the most recent handoff. Reap only our own old cache files.
+ for (const name of await FileSystem.readDirectoryAsync(directory)) {
+ if (!/^update-[0-9]+-[a-z0-9]+\.apk$/.test(name)) continue;
+ const file = `${directory}${name}`;
+ const info = await FileSystem.getInfoAsync(file);
+ if (info.exists && !info.isDirectory && Date.now() / 1000 - info.modificationTime > 86400) {
+ await FileSystem.deleteAsync(file, { idempotent: true }).catch(() => undefined);
+ }
+ }
+ if (signal.aborted) throw abortError();
+ const file = `${directory}update-${Date.now()}-${Math.random().toString(36).slice(2)}.apk`;
+ let finished = false;
+ let timer: ReturnType<typeof setTimeout> | undefined;
+ let rejectStopped: (reason: Error) => void = () => undefined;
+ const stopped = new Promise<never>((_, reject) => { rejectStopped = reject; });
+ const task = FileSystem.createDownloadResumable(url, file, {}, (event) => {
+ if (finished) return;
+ armTimeout();
+ progress(event.totalBytesExpectedToWrite > 0
+ ? Math.min(1, Math.max(0, event.totalBytesWritten / event.totalBytesExpectedToWrite)) : null);
+ });
+ const stop = () => {
+ rejectStopped(abortError());
+ void task.cancelAsync().catch(() => undefined);
+ };
+ const armTimeout = () => {
+ clearTimeout(timer);
+ timer = setTimeout(stop, 90_000);
+ };
+ signal.addEventListener('abort', stop, { once: true });
+ armTimeout();
+ try {
+ if (signal.aborted) throw abortError();
+ const result = await Promise.race([task.downloadAsync(), stopped]);
+ if (signal.aborted || !result || result.status !== 200) throw new Error('APK download failed');
+ return file;
+ } catch (error) {
+ await task.cancelAsync().catch(() => undefined);
+ await FileSystem.deleteAsync(file, { idempotent: true }).catch(() => undefined);
+ throw error;
+ } finally {
+ finished = true;
+ clearTimeout(timer);
+ signal.removeEventListener('abort', stop);
+ // Release expo-file-system's progress subscription after completion as well.
+ void task.cancelAsync().catch(() => undefined);
+ }
+}
+
+export const androidInstaller = new AndroidInstallController({
+ supported: () => native?.isSupported() === true,
+ hasPermission: () => native!.hasPermission(),
+ requestPermission: () => native!.requestPermission(),
+ download: downloadApk,
+ install: async (file, version, signal) => {
+ await waitForForeground(signal);
+ if (signal.aborted) throw abortError();
+ await native!.install(file, version);
+ },
+ remove: (file) => FileSystem.deleteAsync(file, { idempotent: true }),
+ openBrowser: (url) => Linking.openURL(url),
+});
diff --git a/apps/mobile/src/update/bundleInstallRouting.test.ts b/apps/mobile/src/update/bundleInstallRouting.test.ts
new file mode 100644
index 0000000000..6fc7667904
--- /dev/null
+++ b/apps/mobile/src/update/bundleInstallRouting.test.ts
@@ -0,0 +1,48 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+const mocks = vi.hoisted(() => ({
+ platform: { OS: 'android' },
+ alert: vi.fn(),
+ openURL: vi.fn(async () => undefined),
+ start: vi.fn(() => true),
+ forced: vi.fn(),
+}));
+vi.mock('react-native', () => ({ Alert: { alert: mocks.alert }, Linking: { openURL: mocks.openURL }, Platform: mocks.platform }));
+vi.mock('expo-updates', () => ({}));
+vi.mock('@/i18n', () => ({ i18n: { t: (key: string) => key } }));
+vi.mock('@/config/env', () => ({ APP_BINARY_VERSION: '1.0.0', IS_OTA_SELFHOST: true, IS_TESTFLIGHT_BUILD: false, REVIEW_MODE: false }));
+vi.mock('./androidInstaller', () => ({ androidInstaller: { start: mocks.start } }));
+vi.mock('./forcedUpdateStore', () => ({ enterForcedUpdate: mocks.forced }));
+vi.mock('./canaryChannelStore', () => ({ resolveUpdateChannelForDevice: () => 'release' }));
+import { openBundleInstall, promptBundleUpdate } from './useBundleUpdatePrompt';
+const target = { version: '1.2.3', runtimeVersion: 'new', installUrl: 'https://updates.example.invalid/app.apk', itmsUrl: '' };
+beforeEach(() => { vi.clearAllMocks(); mocks.platform.OS = 'android'; mocks.start.mockReturnValue(true); });
+
+describe('shared bundle install routing', () => {
+ it('ordinary update confirmation starts the same native path as the forced gate', () => {
+ promptBundleUpdate({ needsUpdate: true, forced: false, target });
+ expect(mocks.start).not.toHaveBeenCalled();
+ const buttons = mocks.alert.mock.calls[0][2];
+ buttons[1].onPress();
+ expect(mocks.start).toHaveBeenCalledWith({ version: target.version, installUrl: target.installUrl });
+ expect(mocks.openURL).not.toHaveBeenCalled();
+ openBundleInstall(target);
+ expect(mocks.start).toHaveBeenCalledTimes(2);
+ });
+ it('strong updates retain the blocking gate and never begin installation without a click', () => {
+ promptBundleUpdate({ needsUpdate: true, forced: true, target });
+ expect(mocks.forced).toHaveBeenCalledWith(target);
+ expect(mocks.start).not.toHaveBeenCalled();
+ expect(mocks.alert).not.toHaveBeenCalled();
+ });
+ it('older Android binaries fall back to the existing download URL', () => {
+ mocks.start.mockReturnValue(false);
+ openBundleInstall(target);
+ expect(mocks.openURL).toHaveBeenCalledWith(target.installUrl);
+ });
+ it('iOS continues to use its original installation scheme', () => {
+ mocks.platform.OS = 'ios';
+ openBundleInstall({ ...target, itmsUrl: 'itms-services://?action=download-manifest' });
+ expect(mocks.start).not.toHaveBeenCalled();
+ expect(mocks.openURL).toHaveBeenCalledWith('itms-services://?action=download-manifest');
+ });
+});
diff --git a/apps/mobile/src/update/useBundleUpdatePrompt.ts b/apps/mobile/src/update/useBundleUpdatePrompt.ts
index e6e3313068..6b38898d73 100644
--- a/apps/mobile/src/update/useBundleUpdatePrompt.ts
+++ b/apps/mobile/src/update/useBundleUpdatePrompt.ts
@@ -16,6 +16,7 @@ import {
REVIEW_MODE,
} from '@/config/env';
import { fetchLatestRelease } from './fetchLatestRelease';
+import { androidInstaller } from './androidInstaller';
import {
evaluateBundleUpdate,
preferredInstallUrl,
@@ -42,19 +43,23 @@ async function openInstall(url: string): Promise<void> {
await Linking.openURL(url);
// itms-services 安装全程由 iOS 系统接管:App 内没有任何回调/进度 UI,唯一反馈是
// 桌面图标上的进度环。不提示的话用户点完"安装"会以为没反应(平台限制,无法在
- // App 内展示进度),所以这里补一句引导;Android 走 APK 下载页,不需要这条提示。
+ // App 内展示进度),所以这里补一句引导;Android 的浏览器回退不需要这条提示。
// 注意 openURL 在系统接下 URL 时即 resolve,早于用户在系统弹框里点「安装/取消」,
// 无法得知用户的选择,措辞必须是条件引导式,不能断言"安装已开始"。
if (url.startsWith('itms-services://')) {
Alert.alert(i18n.t('update.installHintTitle'), i18n.t('update.installHintBody'));
}
} catch {
- Alert.alert(i18n.t('update.openInstallFailedTitle'), i18n.t('update.openInstallFailedBody'));
+ Alert.alert(i18n.t('update.openInstallFailedTitle'), i18n.t(
+ Platform.OS === 'android' ? 'update.android.browserFailed' : 'update.openInstallFailedBody',
+ ));
}
}
-/** 阻断屏的「去更新」出口:解析安装地址并交给系统。无可用地址则 no-op。 */
-export function openBundleInstall(target: { itmsUrl?: string; installUrl?: string }): void {
+/** 普通更新与强更共用的安装出口;旧 Android 包及网页地址保留浏览器回退。 */
+export function openBundleInstall(target: { version?: string; itmsUrl?: string; installUrl?: string }): void {
+ if (Platform.OS === 'android' && target.version && target.installUrl
+ && androidInstaller.start({ version: target.version, installUrl: target.installUrl })) return;
const url = preferredInstallUrl(target);
if (url) void openInstall(url);
}
@@ -85,7 +90,7 @@ export function promptBundleUpdate(evaluation: ReturnType<typeof evaluateBundleU
].join('');
Alert.alert(i18n.t('update.newVersionTitle'), message, [
{ text: i18n.t('update.later'), style: 'cancel' },
- { text: i18n.t('update.goUpdate'), onPress: () => void openInstall(url) },
+ { text: i18n.t('update.goUpdate'), onPress: () => openBundleInstall(evaluation.target!) },
]);
}
diff --git a/docs/design-rules/design-inventory.md b/docs/design-rules/design-inventory.md
index 4f57fb8b82..09b9d4fd62 100644
--- a/docs/design-rules/design-inventory.md
+++ b/docs/design-rules/design-inventory.md
@@ -51,20 +51,20 @@
| `desktop.window.sidebar` | desktop | 右侧栏独立窗口 | `?sidebarWindow=1` → renderer/sidebar-window-entry.tsx;hash `/sidebar-window` | RightSidebar, RightSidebarShell, SidebarWindowLayout | apps/desktop/src/main/right-sidebar-window/controller.ts, apps/desktop/src/main/right-sidebar-window/ipc.ts, apps/desktop/src/main/right-sidebar-window/registry.ts, apps/desktop/src/main/right-sidebar-window/resolveHostContext.ts, apps/desktop/src/main/right-sidebar-window/settings-store.ts, apps/desktop/src/main/right-sidebar-window/window.ts, apps/desktop/src/renderer/components/layout/SidebarWindowLayout.tsx, apps/desktop/src/renderer/features/right-sidebar/AddTabDropdown.tsx, apps/desktop/src/renderer/features/right-sidebar/EmptyState.tsx, apps/desktop/src/renderer/features/right-sidebar/RightSidebarShell.tsx, apps/desktop/src/renderer/features/right-sidebar/TabBar.tsx, apps/desktop/src/renderer/features/right-sidebar/TabBodyErrorBoundary.tsx, apps/desktop/src/renderer/features/right-sidebar/hooks/useBrowserWebview.ts, apps/desktop/src/renderer/features/right-sidebar/hooks/useNativePopupSurface.ts, apps/desktop/src/renderer/features/right-sidebar/iosSimulatorPluginAvailability.ts, apps/desktop/src/renderer/features/right-sidebar/lib/browserPartition.ts, apps/desktop/src/renderer/features/right-sidebar/lib/browserWebviewPool.ts, apps/desktop/src/renderer/features/right-sidebar/lib/detachedSidebarRouting.ts, apps/desktop/src/renderer/features/right-sidebar/lib/executeSidebarCommand.ts, apps/desktop/src/renderer/features/right-sidebar/lib/iosSimulatorFocusBridge.ts, apps/desktop/src/renderer/features/right-sidebar/lib/lastTurnChangedFiles.ts, apps/desktop/src/renderer/features/right-sidebar/lib/nativePopupTabs.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openBackgroundTasksTab.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openInSidebarBrowser.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openInSidebarFileBrowser.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openRoutinesTab.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openSubagentsTab.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openTerminalShortcut.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openTurnReview.ts, apps/desktop/src/renderer/features/right-sidebar/lib/popupRouter.ts, apps/desktop/src/renderer/features/right-sidebar/lib/popupTabs.ts, apps/desktop/src/renderer/features/right-sidebar/lib/rsbBrowserBridge.ts, apps/desktop/src/renderer/features/right-sidebar/lib/sidebarCommands.ts, apps/desktop/src/renderer/features/right-sidebar/lib/sidebarHostSession.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/BackgroundTasksBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/WorkflowAgentStrip.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/WorkflowProgressTree.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/chatTaskFocusIntent.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/listSessionTasks.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/workflowProgressModel.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/cindy-make/CindyMakeTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/cindy-make/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/FileBrowserBody.css, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/FileBrowserBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/dropExternalFile.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/fileTreeImagePreview.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/useSessionScopedTreeWidth.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/index.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorInstanceGrid.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/iosSimulatorH264Decoder.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/OrcaWorkersAttentionIcon.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/OrcaWorkersTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/actions.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/closeDecision.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/ResourceUsageBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/resource-usage.css, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/subscription.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/ImageDiffPreview.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/MarkdownDiffPreview.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/PlainUnifiedDiff.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/diffRows.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/highlight.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/inlineDiff.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/useDiffHighlights.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/ReviewTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/diffExpansionPreference.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/fileTree.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/gitApplyCommand.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/markdownPreview.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/useLastTurnFilter.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/useReviewGitState.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/useReviewSource.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/routines/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/ConversationStream.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/DetailView.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/RunList.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/SubagentChrome.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/SubagentToolCard.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/SubagentsBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/subagentChangeFence.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/subagentConversation.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/subagentFormat.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/terminal/TerminalTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/terminal/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/terminal/lib/xtermPool.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/BrowserChrome.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/BrowserCommentPopover.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/BrowserTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/browserCommentEditorDraft.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/lib/parseOmnibox.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/useBrowserComment.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/useLocalHtmlAutoReload.ts, apps/desktop/src/renderer/features/right-sidebar/registry.ts, apps/desktop/src/renderer/features/right-sidebar/store.ts, apps/desktop/src/renderer/features/right-sidebar/types.ts, apps/desktop/src/renderer/sidebar-window-entry.tsx, apps/desktop/src/renderer/styles/generated/tokens.css, apps/desktop/src/renderer/styles/globals.css | 102 | 57 | 198 |
| `desktop.window.voice-dictionary-toast` | desktop | 语音词典 Toast 窗 | `?view=voice-input-dictionary-toast` → main-entry.tsx → VoiceInputDictionaryToast | VoiceInputDictionaryToast | apps/desktop/src/renderer/voice-input/VoiceInputDictionaryToast.tsx | 6 | 0 | 2 |
| `desktop.window.voice-overlay` | desktop | 语音输入浮窗 | `?view=voice-input-overlay` → main-entry.tsx → VoiceInputOverlay | VoiceInputOverlay, VoiceInputStatusNotice | apps/desktop/src/main/voice-input/global.ts, apps/desktop/src/renderer/styles/generated/tokens.css, apps/desktop/src/renderer/styles/globals.css, apps/desktop/src/renderer/voice-input/VoiceInputOverlay.tsx, apps/desktop/src/renderer/voice-input/VoiceInputStatusNotice.tsx | 67 | 50 | 25 |
-| `mobile.account-deletion` | mobile | 账号注销 | app/account-deletion.tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, account-deletion, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/account-deletion.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 19 |
-| `mobile.auth` | mobile | 登录与添加账号 | app/(auth)/login.tsx / app/add-account.tsx | AccountSwitcherSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, IncomingShareBridge, LoginCaptchaWebView, LoginSkinControls, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, StartupSplashOverlay, ThemeProvider, _layout, add-account, gestureHandler, login, peerFileTransport, useLocale | apps/mobile/app/(auth)/login.tsx, apps/mobile/app/_layout.tsx, apps/mobile/app/add-account.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/LoginCaptchaWebView.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/LoginSkinControls.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 177 | 43 |
-| `mobile.automations` | mobile | 自动化 | app/automations/[deviceId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/automations/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 35 |
-| `mobile.chat.new` | mobile | 新建任务 | app/sessions/new.tsx | AnnotationBurnInWebView, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerAttachmentTray, ComposerKeyboardAvoidingView, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheetGoalView, ContextSheetMediaViews, DeviceLinkContext, HomeNativeStackHeader, ImageLightbox, IncomingShareBridge, MobileAgentMark, MobileAgentSwitcher, MobileChoicePickerList, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobilePermissionPickerList, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModelOptionsSheetView, ModelPickerSheet, NativePullDownMenu, NativeSwitch, PaperPlaneIcon, PlanModeChip, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, ThemeProvider, VoiceRecordingPill, _layout, gestureHandler, new, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/new.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 202 | 72 |
-| `mobile.chat.session` | mobile | 任务内容与输入 | app/sessions/[sessionId].tsx | AnnotationBurnInWebView, AppText, AuthContext, AuthorizationMessageCard, BlurBackdrop, CenteredScreen, ChatFileChipMenuSheet, CompanionMessageCard, ComposerAttachmentTray, ComposerKeyboardAvoidingView, ComposerRichInput, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheetGoalView, ContextSheetMediaViews, ConversationSearchFilterSheet, ConversationShareSvg, ConversationShareWebView, DeviceLinkContext, FailedScheduleNotice, HomeGlassMenuPanel, HomeNativeStackHeader, HomeSearchBar, ImageLightbox, IncomingShareBridge, InlineQueueSection, InlineQuoteChip, InlineReferenceChip, InteractionPanel, MarkdownBlockContent, MessageActionSheet, MessageRenderer, MobileAgentMark, MobileAgentSwitcher, MobileBoundaryNotice, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobilePermissionPickerList, MobilePrimitives, MobileProviderMark, ModelOptionsSheetView, ModelPickerSheet, NativePullDownMenu, NativeSwitch, PaperPlaneIcon, PendingSendBubble, PiSessionTreeSheet, PlanModeChip, PushNotificationsBridge, QuietSyncIndicator, QuoteCapsule, RewindPreviewPanel, SentInlineAtomBody, SessionListDrawer, SessionMenuSheet, SessionTailBanner, SessionUsageSummary, ShareMessageCheckbox, ShareSelectAllButton, ShareSelectionBar, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, StreamingStatusText, ThemeProvider, VoiceRecordingPill, [sessionId], _layout, gestureHandler, mathWebView, mediaPlayerWebView, mermaidWebView, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/AuthorizationMessageCard.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ChatFileChipMenuSheet.tsx, apps/mobile/src/session/CompanionMessageCard.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerRichInput.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/ConversationShareSvg.tsx, apps/mobile/src/session/ConversationShareWebView.tsx, apps/mobile/src/session/FailedScheduleNotice.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/InlineQueueSection.tsx, apps/mobile/src/session/InlineQuoteChip.tsx, apps/mobile/src/session/InlineReferenceChip.tsx, apps/mobile/src/session/InteractionPanel.tsx, apps/mobile/src/session/MarkdownBlockContent.tsx, apps/mobile/src/session/MessageActionSheet.tsx, apps/mobile/src/session/MessageRenderer.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileBoundaryNotice.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/PendingSendBubble.tsx, apps/mobile/src/session/PiSessionTreeSheet.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/QuoteCapsule.tsx, apps/mobile/src/session/RewindPreviewPanel.tsx, apps/mobile/src/session/SentInlineAtomBody.tsx, apps/mobile/src/session/SessionListDrawer.tsx, apps/mobile/src/session/SessionMenuSheet.tsx, apps/mobile/src/session/SessionTailBanner.tsx, apps/mobile/src/session/SessionUsageSummary.tsx, apps/mobile/src/session/ShareMessageCheckbox.tsx, apps/mobile/src/session/ShareSelectAllButton.tsx, apps/mobile/src/session/ShareSelectionBar.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/StreamingStatusText.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/session/composerRichInputHtml.ts, apps/mobile/src/session/conversationShareWebViewHtml.ts, apps/mobile/src/session/mathWebView.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/mermaidWebView.tsx, apps/mobile/src/session/mermaidWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 7 | 203 | 188 |
-| `mobile.companions.direct` | mobile | 伙伴私聊回看 | app/companions/direct/[threadId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [threadId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/companions/direct/[threadId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 14 |
-| `mobile.device-management` | mobile | 设备管理 | app/devices/manage.tsx / app/devices/manage/[deviceId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceInformationFields, DeviceInformationFields.ios, DeviceLinkContext, DeviceManagementDialogs, DeviceManagementList, DeviceManagementList.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RenameDeviceModal, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, manage, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/manage.tsx, apps/mobile/app/devices/manage/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceInformationFields.ios.tsx, apps/mobile/src/device-link/DeviceInformationFields.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/DeviceManagementDialogs.tsx, apps/mobile/src/device-link/DeviceManagementList.ios.tsx, apps/mobile/src/device-link/DeviceManagementList.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/RenameDeviceModal.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 17 |
-| `mobile.devices` | mobile | 主机详情 | app/devices/[deviceId].tsx | AccountSwitcherSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ConversationSearchFilterSheet, DeviceLinkContext, HomeChromeDrawer, HomeChromeFrost, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeNativeStackHeader, HomeProjectMachineLabel, HomeSearchBar, IncomingShareBridge, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, MobileVendorIcon, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteAccessGuide, RemoteTaskSuggestions, RenameSessionModal, SessionActionSheet, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, ThemeProvider, [deviceId], _layout, gestureHandler, index, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/[deviceId].tsx, apps/mobile/app/devices/index.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 60 |
-| `mobile.files` | mobile | 任务文件与预览 | app/files/[sessionId].tsx / app/files/preview/[sessionId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, HtmlFileReader, ImageLightbox, IncomingShareBridge, MarkdownFileReader, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, PushNotificationsBridge, QuietSyncIndicator, StartupSplashOverlay, ThemeProvider, [sessionId], _layout, gestureHandler, mediaPlayerWebView, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/files/[sessionId].tsx, apps/mobile/app/files/preview/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/HtmlFileReader.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MarkdownFileReader.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 202 | 36 |
-| `mobile.home` | mobile | 主机与资源首页 | app/index.tsx / app/devices/index.tsx | AccountSwitcherSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ConversationSearchFilterSheet, DeviceLinkContext, HomeChromeDrawer, HomeChromeFrost, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeNativeStackHeader, HomeProjectMachineLabel, HomeSearchBar, IncomingShareBridge, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, MobileVendorIcon, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteAccessGuide, RemoteTaskSuggestions, RenameSessionModal, SessionActionSheet, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, ThemeProvider, _layout, gestureHandler, index, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/index.tsx, apps/mobile/app/index.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 56 |
-| `mobile.overlay.connection-startup` | mobile | 根布局挂载的启动与连接反馈 | app/_layout.tsx → StartupSplashOverlay / ConnectionNoticeProvider;各页面 ConnectionBanner | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ConnectionNoticeProvider, DeviceLinkContext, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, PushNotificationsBridge, QuietSyncIndicator, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 13 |
-| `mobile.remote-desktop` | mobile | 远程桌面 | app/devices/desktop/[deviceId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/desktop/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 42 |
-| `mobile.resources` | mobile | 远程资源列表与详情 | app/resources/[collectionId].tsx / app/resources/[collectionId]/[resourceId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteCompanionAvatar, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [collectionId], [resourceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/resources/[collectionId].tsx, apps/mobile/app/resources/[collectionId]/[resourceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 18 |
-| `mobile.settings` | mobile | 设置(含调试与日志上传可见入口) | app/settings.tsx | AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileChoicePickerList, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, settings, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/settings.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 22 |
+| `mobile.account-deletion` | mobile | 账号注销 | app/account-deletion.tsx | AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, account-deletion, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/account-deletion.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 22 |
+| `mobile.auth` | mobile | 登录与添加账号 | app/(auth)/login.tsx / app/add-account.tsx | AccountSwitcherSheet, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, DeviceLinkContext, IncomingShareBridge, LoginCaptchaWebView, LoginSkinControls, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, StartupSplashOverlay, ThemeProvider, _layout, add-account, gestureHandler, login, peerFileTransport, useLocale | apps/mobile/app/(auth)/login.tsx, apps/mobile/app/_layout.tsx, apps/mobile/app/add-account.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/LoginCaptchaWebView.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/LoginSkinControls.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 177 | 44 |
+| `mobile.automations` | mobile | 自动化 | app/automations/[deviceId].tsx | AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/automations/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 38 |
+| `mobile.chat.new` | mobile | 新建任务 | app/sessions/new.tsx | AndroidUpdateSheet, AnnotationBurnInWebView, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerAttachmentTray, ComposerKeyboardAvoidingView, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheetGoalView, ContextSheetMediaViews, DeviceLinkContext, HomeNativeStackHeader, ImageLightbox, IncomingShareBridge, MobileAgentMark, MobileAgentSwitcher, MobileChoicePickerList, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobilePermissionPickerList, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModelOptionsSheetView, ModelPickerSheet, NativePullDownMenu, NativeSwitch, PaperPlaneIcon, PlanModeChip, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, ThemeProvider, VoiceRecordingPill, _layout, gestureHandler, new, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/new.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 202 | 72 |
+| `mobile.chat.session` | mobile | 任务内容与输入 | app/sessions/[sessionId].tsx | AndroidUpdateSheet, AnnotationBurnInWebView, AppText, AuthContext, AuthorizationMessageCard, BlurBackdrop, CenteredScreen, ChatFileChipMenuSheet, CompanionMessageCard, ComposerAttachmentTray, ComposerKeyboardAvoidingView, ComposerRichInput, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheetGoalView, ContextSheetMediaViews, ConversationSearchFilterSheet, ConversationShareSvg, ConversationShareWebView, DeviceLinkContext, FailedScheduleNotice, HomeGlassMenuPanel, HomeNativeStackHeader, HomeSearchBar, ImageLightbox, IncomingShareBridge, InlineQueueSection, InlineQuoteChip, InlineReferenceChip, InteractionPanel, MarkdownBlockContent, MessageActionSheet, MessageRenderer, MobileAgentMark, MobileAgentSwitcher, MobileBoundaryNotice, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobilePermissionPickerList, MobilePrimitives, MobileProviderMark, ModelOptionsSheetView, ModelPickerSheet, NativePullDownMenu, NativeSwitch, PaperPlaneIcon, PendingSendBubble, PiSessionTreeSheet, PlanModeChip, PushNotificationsBridge, QuietSyncIndicator, QuoteCapsule, RewindPreviewPanel, SentInlineAtomBody, SessionListDrawer, SessionMenuSheet, SessionTailBanner, SessionUsageSummary, ShareMessageCheckbox, ShareSelectAllButton, ShareSelectionBar, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, StreamingStatusText, ThemeProvider, VoiceRecordingPill, [sessionId], _layout, gestureHandler, mathWebView, mediaPlayerWebView, mermaidWebView, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/AuthorizationMessageCard.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ChatFileChipMenuSheet.tsx, apps/mobile/src/session/CompanionMessageCard.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerRichInput.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/ConversationShareSvg.tsx, apps/mobile/src/session/ConversationShareWebView.tsx, apps/mobile/src/session/FailedScheduleNotice.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/InlineQueueSection.tsx, apps/mobile/src/session/InlineQuoteChip.tsx, apps/mobile/src/session/InlineReferenceChip.tsx, apps/mobile/src/session/InteractionPanel.tsx, apps/mobile/src/session/MarkdownBlockContent.tsx, apps/mobile/src/session/MessageActionSheet.tsx, apps/mobile/src/session/MessageRenderer.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileBoundaryNotice.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/PendingSendBubble.tsx, apps/mobile/src/session/PiSessionTreeSheet.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/QuoteCapsule.tsx, apps/mobile/src/session/RewindPreviewPanel.tsx, apps/mobile/src/session/SentInlineAtomBody.tsx, apps/mobile/src/session/SessionListDrawer.tsx, apps/mobile/src/session/SessionMenuSheet.tsx, apps/mobile/src/session/SessionTailBanner.tsx, apps/mobile/src/session/SessionUsageSummary.tsx, apps/mobile/src/session/ShareMessageCheckbox.tsx, apps/mobile/src/session/ShareSelectAllButton.tsx, apps/mobile/src/session/ShareSelectionBar.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/StreamingStatusText.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/session/composerRichInputHtml.ts, apps/mobile/src/session/conversationShareWebViewHtml.ts, apps/mobile/src/session/mathWebView.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/mermaidWebView.tsx, apps/mobile/src/session/mermaidWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 7 | 203 | 188 |
+| `mobile.companions.direct` | mobile | 伙伴私聊回看 | app/companions/direct/[threadId].tsx | AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [threadId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/companions/direct/[threadId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 17 |
+| `mobile.device-management` | mobile | 设备管理 | app/devices/manage.tsx / app/devices/manage/[deviceId].tsx | AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, DeviceInformationFields, DeviceInformationFields.ios, DeviceLinkContext, DeviceManagementDialogs, DeviceManagementList, DeviceManagementList.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RenameDeviceModal, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, manage, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/manage.tsx, apps/mobile/app/devices/manage/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceInformationFields.ios.tsx, apps/mobile/src/device-link/DeviceInformationFields.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/DeviceManagementDialogs.tsx, apps/mobile/src/device-link/DeviceManagementList.ios.tsx, apps/mobile/src/device-link/DeviceManagementList.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/RenameDeviceModal.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 20 |
+| `mobile.devices` | mobile | 主机详情 | app/devices/[deviceId].tsx | AccountSwitcherSheet, AndroidUpdateSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ConversationSearchFilterSheet, DeviceLinkContext, HomeChromeDrawer, HomeChromeFrost, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeNativeStackHeader, HomeProjectMachineLabel, HomeSearchBar, IncomingShareBridge, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, MobileVendorIcon, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteAccessGuide, RemoteTaskSuggestions, RenameSessionModal, SessionActionSheet, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, ThemeProvider, [deviceId], _layout, gestureHandler, index, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/[deviceId].tsx, apps/mobile/app/devices/index.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 61 |
+| `mobile.files` | mobile | 任务文件与预览 | app/files/[sessionId].tsx / app/files/preview/[sessionId].tsx | AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, DeviceLinkContext, HtmlFileReader, ImageLightbox, IncomingShareBridge, MarkdownFileReader, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, StartupSplashOverlay, ThemeProvider, [sessionId], _layout, gestureHandler, mediaPlayerWebView, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/files/[sessionId].tsx, apps/mobile/app/files/preview/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HtmlFileReader.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MarkdownFileReader.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 202 | 39 |
+| `mobile.home` | mobile | 主机与资源首页 | app/index.tsx / app/devices/index.tsx | AccountSwitcherSheet, AndroidUpdateSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ConversationSearchFilterSheet, DeviceLinkContext, HomeChromeDrawer, HomeChromeFrost, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeNativeStackHeader, HomeProjectMachineLabel, HomeSearchBar, IncomingShareBridge, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, MobileVendorIcon, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteAccessGuide, RemoteTaskSuggestions, RenameSessionModal, SessionActionSheet, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, ThemeProvider, _layout, gestureHandler, index, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/index.tsx, apps/mobile/app/index.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 57 |
+| `mobile.overlay.connection-startup` | mobile | 根布局挂载的启动与连接反馈 | app/_layout.tsx → StartupSplashOverlay / ConnectionNoticeProvider;各页面 ConnectionBanner | AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ConnectionNoticeProvider, ContextSheet, DeviceLinkContext, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 16 |
+| `mobile.remote-desktop` | mobile | 远程桌面 | app/devices/desktop/[deviceId].tsx | AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, DeviceLinkContext, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, SheetModal, SheetSurface, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/desktop/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 45 |
+| `mobile.resources` | mobile | 远程资源列表与详情 | app/resources/[collectionId].tsx / app/resources/[collectionId]/[resourceId].tsx | AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteCompanionAvatar, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [collectionId], [resourceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/resources/[collectionId].tsx, apps/mobile/app/resources/[collectionId]/[resourceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 21 |
+| `mobile.settings` | mobile | 设置(含调试与日志上传可见入口) | app/settings.tsx | AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, DeviceLinkContext, HomeNativeStackHeader, IncomingShareBridge, MobileChoicePickerList, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, settings, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/settings.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 170 | 23 |
### 生产路由覆盖
diff --git a/docs/dev-rules/mobile-development.md b/docs/dev-rules/mobile-development.md
index 10e2d7d3f7..56188d1496 100644
--- a/docs/dev-rules/mobile-development.md
+++ b/docs/dev-rules/mobile-development.md
@@ -109,3 +109,24 @@ Mobile 用 `runtimeVersion.policy: "fingerprint"`:OTA 热更只在**指纹一致
本文只覆盖本地开发、调试和验证。商业发布、版本分发、签名与渠道运维属于维护者内部
流程,不在公开仓库文档或 Agent 手册中维护。
+
+## Android 自建安装包的应用内更新
+
+启动检查、设置页与强制更新屏共用 `src/update/useBundleUpdatePrompt.ts` 的安装出口。
+Android 8 及以上的新原生包优先应用内下载 HTTPS APK;Android 7、旧包缺少
+`CindyAppInstaller`,或安装地址是网页时,继续使用浏览器。权限只由自建构建的 `app.config.js` 声明,商店构建不声明。
+
+- 已授权直接下载;未授权先显示说明与「去授权 / 浏览器下载 / 稍后」,用户点「去授权」
+ 才打开系统设置。返回后读取实际权限;拒绝不会循环申请,可选择浏览器下载。
+- 下载显示进度并支持取消;网络停滞会结束并提供重试。下载在后台完成时,等回到前台
+ 再打开安装器。关闭下载面板不会解除原有强制更新闸门。
+- APK 只写入 app 私有 `cache/cindy-updates/`。原生桥只接受该目录内的 APK,校验包名、
+ 目标版本与递增的 versionCode;最终签名校验、安装确认和覆盖安装由 Android 负责。
+- 安装器已打开不代表安装完成。取消系统安装后可再次安装已下载的文件;交接后的文件
+ 不立即删除,后续下载时清理超过 24 小时的本功能缓存。
+
+实现:`modules/cindy-app-installer/`、`src/update/androidInstallController.ts`、
+`src/update/androidInstaller.ts`、`src/update/AndroidUpdateSheet.tsx`。
+定向测试为对应的 `androidInstallController.test.ts` 与 `androidInstaller.test.ts`,构建配置
+边界由 `src/__tests__/nativeAppConfig.test.ts` 验证。原生验证还应检查授权/拒绝返回、系统
+安装取消、签名不匹配拒绝与同签名覆盖安装;不能把 JS 单测当作这些原生路径的实测。