diff --git a/NATIVE_UPGRADE.md b/NATIVE_UPGRADE.md index 351596f..e005e63 100644 --- a/NATIVE_UPGRADE.md +++ b/NATIVE_UPGRADE.md @@ -46,13 +46,13 @@ grep versionCode android/app/build.gradle - 打完核对:`aapt2 dump badging` 的 versionCode、`apksigner verify --print-certs` 的证书, 以及解包 grep 接口地址(内网地址必须为 0 次) - **一条命令出正式包**:`pnpm run android:apk` - = `android:sync:prod` + `assembleRelease` + 用 `twa/android.keystore` 签名 + 复制到 + = `android:sync:prod` + `assembleRelease` + 用根目录 `android.keystore` 签名 + 复制到 `android/app/release/app-release.apk`(已 gitignore),末尾会打印 versionCode、大小、 sha256 和证书指纹 - 签名凭证放在 `android/keystore.properties`(已 gitignore),格式见同目录 `keystore.properties.example`;缺密码时脚本会直接拦住,不会产出 debug 包 - 只重新打包、不重建 web:`pnpm run android:apk -- -SkipSync` -- 仍然可以用 Android Studio 打包,但**签名必须是 `twa/android.keystore`** +- 仍然可以用 Android Studio 打包,但**签名必须是根目录 `android.keystore`** (alias `gao-customer`,`CN=yeyu` / SHA-256 `3E:9C:CC:8A:…`),否则系统拒绝覆盖安装 ### 3. 提高 CI 的兼容基线 diff --git a/android/keystore.properties.example b/android/keystore.properties.example index 20e23c3..3a3f270 100644 --- a/android/keystore.properties.example +++ b/android/keystore.properties.example @@ -1,6 +1,6 @@ # 发版签名凭证(复制为 android/keystore.properties 后填写,该文件已 gitignore) # storeFile 相对于 android/ 目录 -storeFile=../twa/android.keystore +storeFile=../android.keystore keyAlias=gao-customer storePassword= keyPassword= diff --git a/package.json b/package.json index cd419c1..5ec4451 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,6 @@ "dev": "vite --host", "build": "pnpm run type-check:publish && vite build", "build:zip": "pnpm run build && powershell -NoProfile -ExecutionPolicy Bypass -File scripts/build-zip.ps1", - "twa:build": "cd twa && pnpm --config.registry=https://registry.npmjs.org dlx @bubblewrap/cli@1.25.0 build --manifest=./twa-manifest.json", - "twa:update": "cd twa && pnpm --config.registry=https://registry.npmjs.org dlx @bubblewrap/cli@1.25.0 update --skipVersionUpgrade --manifest=./twa-manifest.json", - "twa:validate": "pnpm --config.registry=https://registry.npmjs.org dlx @bubblewrap/cli@1.25.0 validate --url=https://gao.imyeyu.com/", "preview": "vite preview", "lint": "eslint . --ext .ts,.vue", "type-check": "vue-tsc -p tsconfig.app.json --noEmit", diff --git a/public/.well-known/assetlinks.json b/public/.well-known/assetlinks.json deleted file mode 100644 index f483c77..0000000 --- a/public/.well-known/assetlinks.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "relation": [ - "delegate_permission/common.handle_all_urls", - "delegate_permission/common.use_as_origin" - ], - "target": { - "namespace": "android_app", - "package_name": "com.imyeyu.gao.customer", - "sha256_cert_fingerprints": [ - "3E:9C:CC:8A:29:71:18:74:BB:56:AA:88:AD:62:E1:F3:AC:F2:70:07:C4:67:D9:32:B8:A2:4B:B7:E7:8E:06:34" - ] - } - } -] diff --git a/scripts/android-apk.ps1 b/scripts/android-apk.ps1 index ad570ae..be2c2c3 100644 --- a/scripts/android-apk.ps1 +++ b/scripts/android-apk.ps1 @@ -8,7 +8,7 @@ $root = Split-Path -Parent $PSScriptRoot $propertiesPath = Join-Path $root "android\keystore.properties" if (-not (Test-Path $propertiesPath)) { - Write-Host "缺少 android\keystore.properties:发版包必须用 twa\android.keystore 签名" -ForegroundColor Red + Write-Host "缺少 android\keystore.properties:发版包必须用根目录 android.keystore 签名" -ForegroundColor Red Write-Host "照着同目录的 keystore.properties.example 补全后重试" exit 1 } diff --git a/src/components/attachmentSelector/AttachmentSelector.vue b/src/components/attachmentSelector/AttachmentSelector.vue index 822e9d5..14019e0 100644 --- a/src/components/attachmentSelector/AttachmentSelector.vue +++ b/src/components/attachmentSelector/AttachmentSelector.vue @@ -53,7 +53,6 @@ import type { import type { PhotoItem } from "@/types/Photo.ts"; import { getAttachmentReadURL } from "@/utils/attachment.ts"; import { Message } from "@/utils/message.ts"; -import { saveCapturedFilesFromInput } from "@/utils/twaBridge"; defineOptions({ inheritAttrs: false @@ -89,7 +88,6 @@ const isBusy = computed(() => props.busy || isUploading.value); const attachmentItems = computed(() => props.items.map(toAttachmentSelectorItem)); async function handleSelect(selection: AttachmentSelectorSelection): Promise { - saveCapturedFilesFromInput(selection.input, selection.files); if (!props.upload) { emit("select", selection); return; diff --git a/src/main.ts b/src/main.ts index 00f8d0a..3b92eb2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,7 +12,6 @@ import { VCan, VRole } from "timi-web-api/utils/directives/Access"; import type { ApiResponse } from "timi-web-api"; import { Message } from "@/utils/message"; import { runAutoUpdate } from "@/composables/useAppUpdate"; -import { initializeTwaBridge } from "@/utils/twaBridge"; import { VEntranceTransition } from "timi-tdesign-mobile"; import timiWebStyle from "timi-web/src/assets/style/timi-web.less?inline"; import tdesignCustomStyle from "timi-tdesign-mobile/src/assets/style/tdesign-custom.less?inline"; @@ -29,8 +28,6 @@ export const pinia = createPinia(); const apiBaseURL = import.meta.env.VITE_API_BASE_URL as string | undefined; const libraryOverrideStyleId = "library-override-style"; -initializeTwaBridge(); - function mountLibraryOverrideStyle(): void { const oldStyle = document.getElementById(libraryOverrideStyleId); oldStyle?.remove(); diff --git a/src/utils/twaBridge.ts b/src/utils/twaBridge.ts deleted file mode 100644 index 8062d5c..0000000 --- a/src/utils/twaBridge.ts +++ /dev/null @@ -1,330 +0,0 @@ -const TWA_ORIGIN = "https://gao.imyeyu.com"; -const TWA_BRIDGE_TIMEOUT = 10_000; -const MEDIA_CHUNK_SIZE = 64 * 1024; -const LOG_PREFIX = "[TWA 相册]"; - -type CapturedMediaType = "image" | "video"; - -interface TwaMessage { - type: string; - id?: string; - index?: number; - data?: string; - error?: string; - version?: number; -} - -type TwaResponseHandler = (message: TwaMessage) => void; - -let bridgeInitialized = false; -let bridgePort: MessagePort | undefined; -let bridgeWaiterList: Array<(port: MessagePort | undefined) => void> = []; -let transferQueue = Promise.resolve(); -const responseHandlerMap = new Map(); - -/** - * 初始化 TWA 通信监听。 - * - * 普通浏览器不会收到带 MessagePort 的消息,因此初始化失败时不会影响网页功能。 - */ -export function initializeTwaBridge(): void { - if (bridgeInitialized || typeof window === "undefined") { - return; - } - - bridgeInitialized = true; - window.addEventListener("message", handleWindowMessage); - logInfo("已初始化网页侧通信监听"); -} - -/** - * 将直接拍摄得到的媒体保存到 Android 系统相册。 - * - * 非 TWA 环境会直接返回,不会阻塞原有上传流程。 - */ -export function saveCapturedMediaToAlbum(file: File, mediaType: CapturedMediaType): void { - if (!file.size) { - logWarn("跳过相册保存:文件大小为 0", { - fileName: file.name, - mediaType - }); - return; - } - - initializeTwaBridge(); - logInfo("收到相册保存请求", { - fileName: file.name, - fileType: file.type, - fileSize: file.size, - mediaType - }); - transferQueue = transferQueue - .then(async () => { - await transferMedia(file, mediaType); - }) - .catch(error => { - // 相册保存是增强能力,失败时不能影响媒体上传。 - logError("相册保存失败,已忽略并继续原上传流程", error); - }); -} - -/** - * 根据文件输入框判断是否为直接拍摄,并启动相册保存。 - */ -export function saveCapturedFilesFromInput(input: HTMLInputElement, fileList: readonly File[]): void { - if (!input.capture || !fileList.length) { - return; - } - - const mediaType: CapturedMediaType = input.accept.toLowerCase().includes("video") ? "video" : "image"; - logInfo("识别为直接拍摄媒体", { - accept: input.accept, - capture: input.capture, - fileCount: fileList.length, - mediaType - }); - for (const file of fileList) { - saveCapturedMediaToAlbum(file, mediaType); - } -} - -function handleWindowMessage(event: MessageEvent): void { - const message = parseMessage(event.data); - if (message?.type !== "twa-bridge-ready") { - return; - } - if (event.origin !== TWA_ORIGIN || !event.ports.length) { - logWarn("忽略无效的 TWA 桥接就绪消息", { - origin: event.origin, - hasMessagePort: event.ports.length > 0 - }); - return; - } - - logInfo("收到 Android 侧桥接就绪消息", { - origin: event.origin, - version: message.version - }); - bridgePort = event.ports[0]; - bridgePort.onmessage = handlePortMessage; - bridgePort.start(); - bridgePort.postMessage(JSON.stringify({ - type: "twa-bridge-ready-ack", - version: 1 - })); - - const waiterList = bridgeWaiterList; - bridgeWaiterList = []; - for (const waiter of waiterList) { - waiter(bridgePort); - } -} - -function handlePortMessage(event: MessageEvent): void { - const message = parseMessage(event.data); - if (!message?.id) { - return; - } - - responseHandlerMap.get(message.id)?.(message); -} - -async function transferMedia(file: File, mediaType: CapturedMediaType): Promise { - const port = await waitForBridgePort(); - if (!port) { - logWarn("未连接到 TWA,跳过相册保存", { - fileName: file.name, - mediaType - }); - return; - } - - const id = createTransferId(); - let transferFinished = false; - logInfo("开始传输媒体", { - id, - fileName: file.name, - mediaType, - fileSize: file.size, - chunkSize: MEDIA_CHUNK_SIZE - }); - try { - await sendTransferMessage(port, id, { - type: "media-start", - id, - mediaType, - mimeType: file.type || `${mediaType}/*`, - fileName: file.name, - size: file.size - }, "media-started"); - - let offset = 0; - let index = 0; - while (offset < file.size) { - const chunk = await file.slice(offset, offset + MEDIA_CHUNK_SIZE).arrayBuffer(); - if (index === 0 || index % 16 === 0 || offset + chunk.byteLength >= file.size) { - logDebug("发送媒体分块", { - id, - index, - chunkSize: chunk.byteLength, - offset - }); - } - await sendTransferMessage(port, id, { - type: "media-chunk", - id, - index, - data: encodeBase64(chunk) - }, "media-chunk-ack", index); - offset += chunk.byteLength; - index++; - } - - await sendTransferMessage(port, id, { - type: "media-finish", - id - }, "media-saved"); - transferFinished = true; - logInfo("媒体已保存到系统相册", { - id, - fileName: file.name, - fileSize: file.size - }); - } finally { - if (!transferFinished) { - logWarn("媒体传输未完成,发送中止请求", { id }); - port.postMessage(JSON.stringify({ - type: "media-abort", - id - })); - } - } -} - -async function sendTransferMessage( - port: MessagePort, - id: string, - message: Record, - expectedType: string, - expectedIndex?: number -): Promise { - const responsePromise = waitForTransferResponse(id, expectedType, expectedIndex); - logDebug("发送桥接消息", { - id, - type: message.type, - expectedType, - expectedIndex - }); - port.postMessage(JSON.stringify(message)); - await responsePromise; -} - -function waitForBridgePort(): Promise { - if (bridgePort) { - return Promise.resolve(bridgePort); - } - - return new Promise(resolve => { - let settled = false; - const settle = (port?: MessagePort): void => { - if (settled) { - return; - } - settled = true; - resolve(port); - }; - bridgeWaiterList.push(settle); - logDebug("等待 Android 侧桥接就绪"); - window.setTimeout(() => { - bridgeWaiterList = bridgeWaiterList.filter(waiter => waiter !== settle); - logWarn("等待 TWA 桥接超时,当前页面不是已建立通道的 TWA,或 Android 来源校验未通过", { - origin: window.location.origin, - displayMode: getDisplayMode(), - userAgent: navigator.userAgent - }); - settle(); - }, TWA_BRIDGE_TIMEOUT); - }); -} - -function waitForTransferResponse(id: string, expectedType: string, expectedIndex?: number): Promise { - return new Promise((resolve, reject) => { - const timeout = window.setTimeout(() => { - responseHandlerMap.delete(id); - logError("等待桥接响应超时", new Error(`${expectedType}, id=${id}`)); - reject(new Error("TWA 媒体保存响应超时")); - }, 15_000); - - responseHandlerMap.set(id, message => { - if (message.type === "media-error") { - window.clearTimeout(timeout); - responseHandlerMap.delete(id); - logError("Android 侧返回媒体错误", new Error(message.error || "TWA 媒体保存失败")); - reject(new Error(message.error || "TWA 媒体保存失败")); - return; - } - if (message.type !== expectedType || (expectedIndex !== undefined && message.index !== expectedIndex)) { - return; - } - - window.clearTimeout(timeout); - responseHandlerMap.delete(id); - resolve(); - }); - }); -} - -function logInfo(message: string, detail?: unknown): void { - console.warn(LOG_PREFIX, message, detail ?? ""); -} - -function logDebug(message: string, detail?: unknown): void { - console.warn(LOG_PREFIX, message, detail ?? ""); -} - -function logWarn(message: string, detail?: unknown): void { - console.warn(LOG_PREFIX, message, detail ?? ""); -} - -function logError(message: string, error: unknown): void { - console.error(LOG_PREFIX, message, error); -} - -function parseMessage(value: unknown): TwaMessage | undefined { - if (typeof value !== "string") { - return undefined; - } - - try { - const message = JSON.parse(value) as TwaMessage; - return typeof message.type === "string" ? message : undefined; - } catch { - return undefined; - } -} - -function encodeBase64(buffer: ArrayBuffer): string { - const bytes = new Uint8Array(buffer); - let binary = ""; - for (let index = 0; index < bytes.length; index += 0x8000) { - binary += String.fromCharCode(...bytes.subarray(index, index + 0x8000)); - } - return window.btoa(binary); -} - -function createTransferId(): string { - if (typeof crypto !== "undefined" && "randomUUID" in crypto) { - return crypto.randomUUID(); - } - return `${Date.now()}-${Math.random().toString(16).slice(2)}`; -} - -function getDisplayMode(): string { - if (window.matchMedia("(display-mode: standalone)").matches) { - return "standalone"; - } - if (window.matchMedia("(display-mode: fullscreen)").matches) { - return "fullscreen"; - } - return "browser"; -} diff --git a/twa/.gitignore b/twa/.gitignore deleted file mode 100644 index b0326bb..0000000 --- a/twa/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.gradle/ -local.properties -**/build/ -*.apk -*.aab -*.idsig -*.jks -*.keystore - -!gradle/wrapper/gradle-wrapper.jar diff --git a/twa/README.md b/twa/README.md deleted file mode 100644 index 85c67e6..0000000 --- a/twa/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# TWA 构建说明 - -本目录是 `gao.imyeyu.com` 的 Trusted Web Activity 工程。APK 只包含 Android 启动壳,业务页面始终从 `https://gao.imyeyu.com/` 加载,不把前端 `dist` 打进 APK。 - -## 构建环境 - -- JDK 17 -- Android SDK -- Bubblewrap CLI 1.25.0 - -在本机首次使用 Bubblewrap 时执行: - -```powershell -pnpm --config.registry=https://registry.npmjs.org dlx @bubblewrap/cli@1.25.0 doctor -``` - -## 构建 APK - -首次构建正式版本时,先在本目录生成并妥善备份 release keystore: - -```powershell -keytool -genkeypair -v -keystore .\android.keystore -alias gao-customer -keyalg RSA -keysize 2048 -validity 10000 -``` - -```powershell -pnpm --config.registry=https://registry.npmjs.org dlx @bubblewrap/cli@1.25.0 build -``` - -构建前请准备长期保存的 release keystore,并确认 `twa-manifest.json` 中的 `signingKey` 指向它。当前目录的 `signingKey` 是可提交的相对路径模板;本次验证 APK 使用的是本机调试签名,不能作为正式发布签名。 - -构建完成后,用 release keystore 的 SHA-256 证书指纹更新 `../public/.well-known/assetlinks.json`,再发布前端 `dist`。TWA 只有在网站的 `/.well-known/assetlinks.json` 与 APK 包名、签名一致时,才会进入无地址栏的全屏模式。 - -当前 `assetlinks.json` 中登记的是本机调试证书指纹,只能配合本次验证 APK 使用。正式发布前必须替换为 release 证书指纹;如果使用 Google Play,还要把 Play App Signing 证书指纹一并登记。 - -## TWA 媒体桥接 - -TWA 通过 `postMessage` 接收网页直接拍摄的照片和视频,Android 10 及以上使用 `MediaStore` 分块写入系统相册,照片保存到“图片/糕店管理”,视频保存到“视频/糕店管理”。普通浏览器和从相册选择的文件不会触发该桥接。 - -桥接依赖 `assetlinks.json` 中的 `delegate_permission/common.use_as_origin` 关系。发布 APK 前必须使用实际 release 签名证书的 SHA-256 指纹更新该文件,否则来源验证失败,桥接不会启用。 - -## 前端发布顺序 - -1. 先上传新版本 `dist/assets`。 -2. 再上传新的 `index.html`、Manifest 和其他静态文件。 -3. 最后检查 `https://gao.imyeyu.com/`、`/manifest.webmanifest` 和 `/.well-known/assetlinks.json`。 - -`index.html` 不缓存,带哈希的 `/assets/` 长缓存。不要给前端资源增加 Service Worker 缓存,除非同时实现版本更新和回滚,否则会阻止 TWA 获取最新页面。 diff --git a/twa/app/build.gradle b/twa/app/build.gradle deleted file mode 100644 index a78f726..0000000 --- a/twa/app/build.gradle +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright 2019 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import groovy.xml.MarkupBuilder - -plugins { - id 'com.android.application' -} - -def twaManifest = [ - applicationId: 'com.imyeyu.gao.customer', - hostName: 'gao.imyeyu.com', // The domain being opened in the TWA. - launchUrl: '/', // The start path for the TWA. Must be relative to the domain. - name: '糕店客户管理', // The application name. - launcherName: '糕店管理', // The name shown on the Android Launcher. - themeColor: '#FFFFFF', // The color used for the status bar. - themeColorDark: '#000000', // The color used for the dark status bar. - navigationColor: '#000000', // The color used for the navigation bar. - navigationColorDark: '#000000', // The color used for the dark navbar. - navigationDividerColor: '#000000', // The navbar divider color. - navigationDividerColorDark: '#000000', // The dark navbar divider color. - backgroundColor: '#FFFFFF', // The color used for the splash screen background. - enableNotifications: false, // Set to true to enable notification delegation. - // Every shortcut must include the following fields: - // - name: String that will show up in the shortcut. - // - short_name: Shorter string used if |name| is too long. - // - url: Absolute path of the URL to launch the app with (e.g '/create'). - // - icon: Name of the resource in the drawable folder to use as an icon. - shortcuts: [], - // The duration of fade out animation in milliseconds to be played when removing splash screen. - splashScreenFadeOutDuration: 300, - generatorApp: 'bubblewrap-cli', // Application that generated the Android Project - // The fallback strategy for when Trusted Web Activity is not available. Possible values are - // 'customtabs' and 'webview'. - fallbackType: 'customtabs', - enableSiteSettingsShortcut: 'true', - orientation: 'portrait', -] - -android { - compileSdkVersion 36 - namespace "com.imyeyu.gao.customer" - defaultConfig { - applicationId "com.imyeyu.gao.customer" - minSdkVersion 21 - targetSdkVersion 36 - versionCode 1 - versionName "1" - - // The name for the application - resValue "string", "appName", twaManifest.name - - // The name for the application on the Android Launcher - resValue "string", "launcherName", twaManifest.launcherName - - // The URL that will be used when launching the TWA from the Android Launcher - def launchUrl = "https://" + twaManifest.hostName + twaManifest.launchUrl - resValue "string", "launchUrl", launchUrl - - - - - // The URL the Web Manifest for the Progressive Web App that the TWA points to. This - // is used by Chrome OS and Meta Quest to open the Web version of the PWA instead of - // the TWA, as it will probably give a better user experience for non-mobile devices. - resValue "string", "webManifestUrl", 'https://gao.imyeyu.com/manifest.webmanifest' - - - - // This is used by Meta Quest. - resValue "string", "fullScopeUrl", 'https://gao.imyeyu.com/' - - - - - // The hostname is used when building the intent-filter, so the TWA is able to - // handle Intents to open host url of the application. - resValue "string", "hostName", twaManifest.hostName - - // This attribute sets the status bar color for the TWA. It can be either set here or in - // `res/values/colors.xml`. Setting in both places is an error and the app will not - // compile. If not set, the status bar color defaults to #FFFFFF - white. - resValue "color", "colorPrimary", twaManifest.themeColor - - // This attribute sets the dark status bar color for the TWA. It can be either set here or in - // `res/values/colors.xml`. Setting in both places is an error and the app will not - // compile. If not set, the status bar color defaults to #000000 - white. - resValue "color", "colorPrimaryDark", twaManifest.themeColorDark - - // This attribute sets the navigation bar color for the TWA. It can be either set here or - // in `res/values/colors.xml`. Setting in both places is an error and the app will not - // compile. If not set, the navigation bar color defaults to #FFFFFF - white. - resValue "color", "navigationColor", twaManifest.navigationColor - - // This attribute sets the dark navigation bar color for the TWA. It can be either set here - // or in `res/values/colors.xml`. Setting in both places is an error and the app will not - // compile. If not set, the navigation bar color defaults to #000000 - black. - resValue "color", "navigationColorDark", twaManifest.navigationColorDark - - // This attribute sets the navbar divider color for the TWA. It can be either - // set here or in `res/values/colors.xml`. Setting in both places is an error and the app - // will not compile. If not set, the divider color defaults to #00000000 - transparent. - resValue "color", "navigationDividerColor", twaManifest.navigationDividerColor - - // This attribute sets the dark navbar divider color for the TWA. It can be either - // set here or in `res/values/colors.xml`. Setting in both places is an error and the - //app will not compile. If not set, the divider color defaults to #000000 - black. - resValue "color", "navigationDividerColorDark", twaManifest.navigationDividerColorDark - - // Sets the color for the background used for the splash screen when launching the - // Trusted Web Activity. - resValue "color", "backgroundColor", twaManifest.backgroundColor - - // Defines a provider authority for the Splash Screen - resValue "string", "providerAuthority", twaManifest.applicationId + '.fileprovider' - - // The enableNotification resource is used to enable or disable the - // TrustedWebActivityService, by changing the android:enabled and android:exported - // attributes - resValue "bool", "enableNotification", twaManifest.enableNotifications.toString() - - twaManifest.shortcuts.eachWithIndex { shortcut, index -> - resValue "string", "shortcut_name_$index", "$shortcut.name" - resValue "string", "shortcut_short_name_$index", "$shortcut.short_name" - } - - // The splashScreenFadeOutDuration resource is used to set the duration of fade out animation in milliseconds - // to be played when removing splash screen. The default is 0 (no animation). - resValue "integer", "splashScreenFadeOutDuration", twaManifest.splashScreenFadeOutDuration.toString() - - resValue "string", "generatorApp", twaManifest.generatorApp - - resValue "string", "fallbackType", twaManifest.fallbackType - - resValue "bool", "enableSiteSettingsShortcut", twaManifest.enableSiteSettingsShortcut - resValue "string", "orientation", twaManifest.orientation - - - } - buildTypes { - release { - minifyEnabled true - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - lintOptions { - checkReleaseBuilds false - } -} - -task generateShorcutsFile { - assert twaManifest.shortcuts.size() < 5, "You can have at most 4 shortcuts." - twaManifest.shortcuts.eachWithIndex { s, i -> - assert s.name != null, 'Missing `name` in shortcut #' + i - assert s.short_name != null, 'Missing `short_name` in shortcut #' + i - assert s.url != null, 'Missing `icon` in shortcut #' + i - assert s.icon != null, 'Missing `url` in shortcut #' + i - } - - def shortcutsFile = new File("$projectDir/src/main/res/xml", "shortcuts.xml") - - def xmlWriter = new StringWriter() - def xmlMarkup = new MarkupBuilder(new IndentPrinter(xmlWriter, " ", true)) - - xmlMarkup - .'shortcuts'('xmlns:android': 'http://schemas.android.com/apk/res/android') { - twaManifest.shortcuts.eachWithIndex { s, i -> - 'shortcut'( - 'android:shortcutId': 'shortcut' + i, - 'android:enabled': 'true', - 'android:icon': '@drawable/' + s.icon, - 'android:shortcutShortLabel': '@string/shortcut_short_name_' + i, - 'android:shortcutLongLabel': '@string/shortcut_name_' + i) { - 'intent'( - 'android:action': 'android.intent.action.MAIN', - 'android:targetPackage': twaManifest.applicationId, - 'android:targetClass': twaManifest.applicationId + '.LauncherActivity', - 'android:data': s.url) - 'categories'('android:name': 'android.intent.category.LAUNCHER') - } - } - } - shortcutsFile.text = xmlWriter.toString() + '\n' -} - -preBuild.dependsOn(generateShorcutsFile) - -repositories { - -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - - implementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.6.2' - -} diff --git a/twa/app/src/main/AndroidManifest.xml b/twa/app/src/main/AndroidManifest.xml deleted file mode 100644 index 447d2f5..0000000 --- a/twa/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/twa/app/src/main/java/com/imyeyu/gao/customer/Application.java b/twa/app/src/main/java/com/imyeyu/gao/customer/Application.java deleted file mode 100644 index 47dbe27..0000000 --- a/twa/app/src/main/java/com/imyeyu/gao/customer/Application.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2020 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.imyeyu.gao.customer; - - - -public class Application extends android.app.Application { - - - - @Override - public void onCreate() { - super.onCreate(); - - } -} diff --git a/twa/app/src/main/java/com/imyeyu/gao/customer/DelegationService.java b/twa/app/src/main/java/com/imyeyu/gao/customer/DelegationService.java deleted file mode 100644 index 20fbfc2..0000000 --- a/twa/app/src/main/java/com/imyeyu/gao/customer/DelegationService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.imyeyu.gao.customer; - - - -public class DelegationService extends - com.google.androidbrowserhelper.trusted.DelegationService { - @Override - public void onCreate() { - super.onCreate(); - - - } -} - diff --git a/twa/app/src/main/java/com/imyeyu/gao/customer/LauncherActivity.java b/twa/app/src/main/java/com/imyeyu/gao/customer/LauncherActivity.java deleted file mode 100644 index 1e06ebf..0000000 --- a/twa/app/src/main/java/com/imyeyu/gao/customer/LauncherActivity.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright 2020 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.imyeyu.gao.customer; - -import android.content.pm.ActivityInfo; -import android.net.Uri; -import android.os.Build; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import android.util.Base64; -import android.util.Log; - -import org.json.JSONObject; - -import java.lang.reflect.Field; - -import androidx.annotation.Nullable; -import androidx.browser.customtabs.CustomTabsCallback; -import androidx.browser.customtabs.CustomTabsService; -import androidx.browser.customtabs.CustomTabsSession; -import com.google.androidbrowserhelper.trusted.QualityEnforcer; -import com.google.androidbrowserhelper.trusted.TwaLauncher; - - - -public class LauncherActivity - extends com.google.androidbrowserhelper.trusted.LauncherActivity { - private static final String TAG = "GaoTwaBridge"; - private static final Uri WEB_ORIGIN = Uri.parse("https://gao.imyeyu.com"); - private static final long CHANNEL_RETRY_DELAY_MILLIS = 500L; - private static final int MAX_CHANNEL_ATTEMPTS = 20; - - private final Handler mainHandler = new Handler(Looper.getMainLooper()); - private final CustomTabsCallback bridgeCallback = new BridgeCallback(); - private TwaMediaStoreBridge mediaStoreBridge; - private CustomTabsSession postMessageSession; - private boolean originValidationRequested; - private boolean originValidated; - private boolean postMessageChannelRequested; - private boolean postMessageChannelReady; - - - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - mediaStoreBridge = new TwaMediaStoreBridge(this); - Log.i(TAG, "TWA Activity 已创建,开始初始化媒体相册桥接"); - // Setting an orientation crashes the app due to the transparent background on Android 8.0 - // Oreo and below. We only set the orientation on Oreo and above. This only affects the - // splash screen and Chrome will still respect the orientation. - // See https://github.com/GoogleChromeLabs/bubblewrap/issues/496 for details. - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) { - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT); - } else { - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); - } - } - - @Override - protected Uri getLaunchingUrl() { - // Get the original launch Url. - Uri uri = super.getLaunchingUrl(); - - - - return uri; - } - - @Override - protected CustomTabsCallback getCustomTabsCallback() { - return bridgeCallback; - } - - @Override - protected void onDestroy() { - Log.i(TAG, "TWA Activity 销毁,清理未完成的媒体传输"); - if (mediaStoreBridge != null) { - mediaStoreBridge.abortAll(); - } - mainHandler.removeCallbacksAndMessages(null); - super.onDestroy(); - } - - private void scheduleChannelRequest(int attempt) { - if (attempt >= MAX_CHANNEL_ATTEMPTS || postMessageChannelReady) { - return; - } - mainHandler.postDelayed(() -> requestPostMessageChannel(attempt), CHANNEL_RETRY_DELAY_MILLIS); - } - - private void requestPostMessageChannel(int attempt) { - if (isFinishing() || postMessageChannelReady) { - return; - } - - CustomTabsSession session = getCustomTabsSession(); - if (session == null) { - Log.w(TAG, "请求 PostMessage 通道失败:当前没有可用的 CustomTabsSession,attempt=" + attempt); - scheduleChannelRequest(attempt + 1); - return; - } - postMessageSession = session; - - if (!originValidationRequested) { - originValidationRequested = true; - Log.i(TAG, "开始验证 TWA 来源关系:" + WEB_ORIGIN); - session.validateRelationship(CustomTabsService.RELATION_USE_AS_ORIGIN, WEB_ORIGIN, null); - return; - } - if (!originValidated || postMessageChannelRequested) { - return; - } - - postMessageChannelRequested = true; - boolean requested = session.requestPostMessageChannel(WEB_ORIGIN, WEB_ORIGIN, new Bundle()); - Log.i(TAG, "请求 PostMessage 通道,结果=" + requested); - if (!requested) { - postMessageChannelRequested = false; - scheduleChannelRequest(attempt + 1); - } - } - - /** - * 当前 Bubblewrap 生成的 Android Browser Helper 版本没有公开 TWA 会话访问器, - * 这里按字段类型读取会话,不依赖混淆后的私有字段名称。 - */ - @Nullable - private CustomTabsSession getCustomTabsSession() { - try { - Object twaLauncher = findFieldValue(this, TwaLauncher.class); - if (twaLauncher == null) { - Log.w(TAG, "未找到 TwaLauncher 实例"); - return null; - } - CustomTabsSession session = (CustomTabsSession) findFieldValue(twaLauncher, CustomTabsSession.class); - if (session == null) { - Log.w(TAG, "未找到 CustomTabsSession 实例"); - } - return session; - } catch (ReflectiveOperationException | RuntimeException exception) { - Log.w(TAG, "读取 TWA 会话失败", exception); - return null; - } - } - - @Nullable - private static Object findFieldValue(Object target, Class fieldType) throws IllegalAccessException { - Class currentClass = target.getClass(); - while (currentClass != null) { - for (Field field : currentClass.getDeclaredFields()) { - if (!fieldType.isAssignableFrom(field.getType())) { - continue; - } - field.setAccessible(true); - return field.get(target); - } - currentClass = currentClass.getSuperclass(); - } - return null; - } - - private void handleBridgeMessage(String message) { - if (mediaStoreBridge == null || !postMessageChannelReady) { - Log.w(TAG, "忽略媒体消息:桥接尚未就绪"); - return; - } - - try { - JSONObject payload = new JSONObject(message); - String type = payload.optString("type"); - String id = payload.optString("id"); - Log.d(TAG, "收到网页桥接消息,type=" + type + ", id=" + id); - if ("twa-bridge-ready-ack".equals(type)) { - Log.i(TAG, "网页已确认 TWA 桥接就绪"); - return; - } - if (id.length() == 0) { - return; - } - - if ("media-start".equals(type)) { - String error = mediaStoreBridge.start( - id, - payload.optString("mimeType"), - payload.optString("fileName"), - payload.optLong("size", -1L) - ); - Log.i(TAG, "开始保存媒体,id=" + id + ", mimeType=" + payload.optString("mimeType") - + ", fileName=" + payload.optString("fileName") + ", size=" + payload.optLong("size", -1L) - + ", result=" + (error == null ? "success" : error)); - postBridgeResponse(error == null ? "media-started" : "media-error", id, null, error); - return; - } - if ("media-chunk".equals(type)) { - int index = payload.optInt("index", -1); - if (index < 0) { - mediaStoreBridge.abort(id); - postBridgeResponse("media-error", id, null, "媒体分块编号无效"); - return; - } - byte[] chunk = Base64.decode(payload.optString("data"), Base64.NO_WRAP); - String error = mediaStoreBridge.append(id, index, chunk); - if (error != null || index == 0 || index % 16 == 0) { - Log.d(TAG, "写入媒体分块,id=" + id + ", index=" + index + ", bytes=" + chunk.length - + ", result=" + (error == null ? "success" : error)); - } - postBridgeResponse(error == null ? "media-chunk-ack" : "media-error", id, index, error); - return; - } - if ("media-finish".equals(type)) { - String error = mediaStoreBridge.finish(id); - Log.i(TAG, "完成保存媒体,id=" + id + ", result=" + (error == null ? "success" : error)); - postBridgeResponse(error == null ? "media-saved" : "media-error", id, null, error); - return; - } - if ("media-abort".equals(type)) { - Log.w(TAG, "网页主动中止媒体保存,id=" + id); - mediaStoreBridge.abort(id); - } - } catch (Exception exception) { - Log.e(TAG, "解析 TWA 媒体消息失败,原始消息长度=" + message.length(), exception); - } - } - - private void postBridgeResponse(String type, String id, @Nullable Integer index, @Nullable String error) { - JSONObject response = new JSONObject(); - try { - response.put("type", type); - response.put("id", id); - if (index != null) { - response.put("index", index); - } - if (error != null) { - response.put("error", error); - } - } catch (Exception exception) { - return; - } - - mainHandler.post(() -> { - if (!postMessageChannelReady || postMessageSession == null) { - return; - } - int result = postMessageSession.postMessage(response.toString(), null); - Log.d(TAG, "发送桥接响应,type=" + type + ", id=" + id + ", result=" + result); - }); - } - - private final class BridgeCallback extends QualityEnforcer { - @Override - public void onNavigationEvent(int navigationEvent, @Nullable Bundle extras) { - super.onNavigationEvent(navigationEvent, extras); - Log.d(TAG, "TWA 导航事件=" + navigationEvent); - if (navigationEvent == NAVIGATION_FINISHED) { - scheduleChannelRequest(0); - } - } - - @Override - public void onRelationshipValidationResult( - int relation, - @Nullable Uri requestedOrigin, - boolean result, - @Nullable Bundle extras - ) { - super.onRelationshipValidationResult(relation, requestedOrigin, result, extras); - if (relation != CustomTabsService.RELATION_USE_AS_ORIGIN || !WEB_ORIGIN.equals(requestedOrigin)) { - return; - } - originValidated = result; - Log.i(TAG, "TWA 来源验证结果=" + result + ", origin=" + requestedOrigin); - if (result) { - scheduleChannelRequest(0); - } else { - Log.w(TAG, "TWA 来源验证失败,请检查 assetlinks.json"); - } - } - - @Override - public void onMessageChannelReady(@Nullable Bundle extras) { - super.onMessageChannelReady(extras); - postMessageChannelReady = true; - Log.i(TAG, "PostMessage 通道已就绪"); - postMessageSession = getCustomTabsSession(); - if (postMessageSession == null) { - Log.e(TAG, "PostMessage 通道已就绪,但无法获取 CustomTabsSession"); - return; - } - JSONObject readyMessage = new JSONObject(); - try { - readyMessage.put("type", "twa-bridge-ready"); - readyMessage.put("version", 1); - } catch (Exception exception) { - return; - } - int result = postMessageSession.postMessage(readyMessage.toString(), null); - Log.i(TAG, "发送 TWA 桥接就绪消息,result=" + result); - } - - @Override - public void onPostMessage(String message, @Nullable Bundle extras) { - super.onPostMessage(message, extras); - handleBridgeMessage(message); - } - } -} diff --git a/twa/app/src/main/java/com/imyeyu/gao/customer/TwaMediaStoreBridge.java b/twa/app/src/main/java/com/imyeyu/gao/customer/TwaMediaStoreBridge.java deleted file mode 100644 index c8682ab..0000000 --- a/twa/app/src/main/java/com/imyeyu/gao/customer/TwaMediaStoreBridge.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2026 imyeyu.com - * - * MIT License - */ -package com.imyeyu.gao.customer; - -import android.content.ContentResolver; -import android.content.ContentValues; -import android.content.Context; -import android.net.Uri; -import android.os.Build; -import android.os.Environment; -import android.provider.MediaStore; -import android.util.Log; - -import androidx.annotation.Nullable; - -import java.io.BufferedOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -/** - * 将 TWA 传来的媒体分块写入 Android 系统相册。 - */ -final class TwaMediaStoreBridge { - private static final String TAG = "GaoTwaMediaStore"; - private static final long MAX_MEDIA_SIZE = 512L * 1024L * 1024L; - private static final int BUFFER_SIZE = 64 * 1024; - - private final ContentResolver contentResolver; - private final Map pendingMediaMap = new HashMap<>(); - - TwaMediaStoreBridge(Context context) { - contentResolver = context.getContentResolver(); - } - - synchronized String start( - String id, - String mimeType, - String fileName, - long expectedSize - ) { - Log.i(TAG, "准备创建相册媒体,id=" + id + ", mimeType=" + mimeType + ", fileName=" + fileName - + ", expectedSize=" + expectedSize + ", sdk=" + Build.VERSION.SDK_INT); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { - Log.w(TAG, "Android 版本低于 10,无法无权限写入相册"); - return "Android 10 以下系统不支持无权限写入系统相册"; - } - if (id.length() == 0 || id.length() > 128) { - return "媒体标识无效"; - } - if (pendingMediaMap.containsKey(id)) { - return "媒体传输已存在"; - } - if (expectedSize <= 0 || expectedSize > MAX_MEDIA_SIZE) { - return "媒体文件大小超出限制"; - } - - String normalizedMimeType = normalizeMimeType(mimeType); - if (normalizedMimeType == null) { - return "只支持照片和视频"; - } - - Uri mediaUri = null; - try { - ContentValues values = new ContentValues(); - values.put(MediaStore.MediaColumns.DISPLAY_NAME, buildDisplayName(fileName, normalizedMimeType)); - values.put(MediaStore.MediaColumns.MIME_TYPE, normalizedMimeType); - values.put(MediaStore.MediaColumns.RELATIVE_PATH, buildRelativePath(normalizedMimeType)); - values.put(MediaStore.MediaColumns.IS_PENDING, 1); - - mediaUri = contentResolver.insert(getCollectionUri(normalizedMimeType), values); - if (mediaUri == null) { - Log.e(TAG, "MediaStore insert 返回空 Uri,id=" + id); - return "创建相册媒体失败"; - } - - OutputStream outputStream = contentResolver.openOutputStream(mediaUri); - if (outputStream == null) { - deleteQuietly(mediaUri); - Log.e(TAG, "无法打开 MediaStore 输出流,id=" + id + ", uri=" + mediaUri); - return "打开相册媒体失败"; - } - pendingMediaMap.put(id, new PendingMedia(mediaUri, outputStream, expectedSize)); - Log.i(TAG, "相册媒体创建成功,id=" + id + ", uri=" + mediaUri + ", path=" - + buildRelativePath(normalizedMimeType)); - return null; - } catch (Exception exception) { - if (mediaUri != null) { - deleteQuietly(mediaUri); - } - Log.e(TAG, "创建相册媒体异常,id=" + id, exception); - return "创建相册媒体失败"; - } - } - - synchronized String append(String id, int index, byte[] chunk) { - PendingMedia pendingMedia = pendingMediaMap.get(id); - if (pendingMedia == null) { - return "媒体传输不存在"; - } - if (index != pendingMedia.nextChunkIndex) { - abort(id); - return "媒体分块顺序错误"; - } - if (chunk.length == 0 || pendingMedia.receivedSize + chunk.length > pendingMedia.expectedSize) { - abort(id); - return "媒体分块大小错误"; - } - - try { - pendingMedia.outputStream.write(chunk); - pendingMedia.outputStream.flush(); - pendingMedia.receivedSize += chunk.length; - pendingMedia.nextChunkIndex++; - return null; - } catch (IOException exception) { - abort(id); - Log.e(TAG, "写入相册媒体异常,id=" + id + ", index=" + index, exception); - return "写入相册媒体失败"; - } - } - - synchronized String finish(String id) { - PendingMedia pendingMedia = pendingMediaMap.remove(id); - if (pendingMedia == null) { - return "媒体传输不存在"; - } - if (pendingMedia.receivedSize != pendingMedia.expectedSize) { - closeQuietly(pendingMedia.outputStream); - deleteQuietly(pendingMedia.mediaUri); - Log.e(TAG, "媒体内容不完整,id=" + id + ", received=" + pendingMedia.receivedSize - + ", expected=" + pendingMedia.expectedSize); - return "媒体内容不完整"; - } - - try { - pendingMedia.outputStream.flush(); - pendingMedia.outputStream.close(); - ContentValues values = new ContentValues(); - values.put(MediaStore.MediaColumns.IS_PENDING, 0); - if (contentResolver.update(pendingMedia.mediaUri, values, null, null) != 1) { - deleteQuietly(pendingMedia.mediaUri); - Log.e(TAG, "发布相册媒体失败,MediaStore update 返回 0,id=" + id); - return "发布相册媒体失败"; - } - Log.i(TAG, "相册媒体发布成功,id=" + id + ", uri=" + pendingMedia.mediaUri - + ", bytes=" + pendingMedia.receivedSize); - return null; - } catch (Exception exception) { - closeQuietly(pendingMedia.outputStream); - deleteQuietly(pendingMedia.mediaUri); - Log.e(TAG, "保存相册媒体异常,id=" + id, exception); - return "保存相册媒体失败"; - } - } - - synchronized void abort(String id) { - PendingMedia pendingMedia = pendingMediaMap.remove(id); - if (pendingMedia == null) { - return; - } - closeQuietly(pendingMedia.outputStream); - deleteQuietly(pendingMedia.mediaUri); - Log.w(TAG, "已清理中止的相册媒体,id=" + id + ", uri=" + pendingMedia.mediaUri); - } - - synchronized void abortAll() { - for (PendingMedia pendingMedia : pendingMediaMap.values()) { - closeQuietly(pendingMedia.outputStream); - deleteQuietly(pendingMedia.mediaUri); - } - pendingMediaMap.clear(); - Log.i(TAG, "已清理全部未完成的相册媒体"); - } - - @Nullable - private static String normalizeMimeType(String mimeType) { - String normalizedMimeType = mimeType == null ? "" : mimeType.trim().toLowerCase(Locale.ROOT); - if (normalizedMimeType.startsWith("image/")) { - return normalizedMimeType.equals("image/*") ? "image/jpeg" : normalizedMimeType; - } - if (normalizedMimeType.startsWith("video/")) { - return normalizedMimeType.equals("video/*") ? "video/mp4" : normalizedMimeType; - } - return null; - } - - private static Uri getCollectionUri(String mimeType) { - if (mimeType.startsWith("video/")) { - return MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); - } - return MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); - } - - private static String buildRelativePath(String mimeType) { - if (mimeType.startsWith("video/")) { - return Environment.DIRECTORY_MOVIES + "/糕店管理"; - } - return Environment.DIRECTORY_PICTURES + "/糕店管理"; - } - - private static String buildDisplayName(String fileName, String mimeType) { - String safeFileName = fileName == null ? "" : fileName - .replaceAll("[^A-Za-z0-9._-]", "_") - .replaceAll("^\\.+$", ""); - if (safeFileName.length() == 0) { - safeFileName = "capture-" + System.currentTimeMillis(); - } - if (safeFileName.lastIndexOf('.') < 0) { - safeFileName += mimeType.startsWith("video/") ? ".mp4" : ".jpg"; - } - return safeFileName; - } - - private void deleteQuietly(Uri uri) { - try { - contentResolver.delete(uri, null, null); - } catch (Exception ignored) { - // 相册清理失败时不能覆盖原始错误。 - } - } - - private static void closeQuietly(OutputStream outputStream) { - try { - outputStream.close(); - } catch (IOException ignored) { - // 关闭失败时继续清理媒体记录。 - } - } - - private static final class PendingMedia { - private final Uri mediaUri; - private final OutputStream outputStream; - private final long expectedSize; - private long receivedSize; - private int nextChunkIndex; - - private PendingMedia(Uri mediaUri, OutputStream outputStream, long expectedSize) { - this.mediaUri = mediaUri; - this.outputStream = new BufferedOutputStream(outputStream, BUFFER_SIZE); - this.expectedSize = expectedSize; - } - } -} diff --git a/twa/app/src/main/res/drawable-anydpi/shortcut_legacy_background.xml b/twa/app/src/main/res/drawable-anydpi/shortcut_legacy_background.xml deleted file mode 100644 index d53c148..0000000 --- a/twa/app/src/main/res/drawable-anydpi/shortcut_legacy_background.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/twa/app/src/main/res/drawable-hdpi/splash.png b/twa/app/src/main/res/drawable-hdpi/splash.png deleted file mode 100644 index 2be828d..0000000 Binary files a/twa/app/src/main/res/drawable-hdpi/splash.png and /dev/null differ diff --git a/twa/app/src/main/res/drawable-mdpi/splash.png b/twa/app/src/main/res/drawable-mdpi/splash.png deleted file mode 100644 index 322075a..0000000 Binary files a/twa/app/src/main/res/drawable-mdpi/splash.png and /dev/null differ diff --git a/twa/app/src/main/res/drawable-xhdpi/splash.png b/twa/app/src/main/res/drawable-xhdpi/splash.png deleted file mode 100644 index 452d523..0000000 Binary files a/twa/app/src/main/res/drawable-xhdpi/splash.png and /dev/null differ diff --git a/twa/app/src/main/res/drawable-xxhdpi/splash.png b/twa/app/src/main/res/drawable-xxhdpi/splash.png deleted file mode 100644 index 29891c2..0000000 Binary files a/twa/app/src/main/res/drawable-xxhdpi/splash.png and /dev/null differ diff --git a/twa/app/src/main/res/drawable-xxxhdpi/splash.png b/twa/app/src/main/res/drawable-xxxhdpi/splash.png deleted file mode 100644 index 4972524..0000000 Binary files a/twa/app/src/main/res/drawable-xxxhdpi/splash.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/twa/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 0480797..0000000 --- a/twa/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - diff --git a/twa/app/src/main/res/mipmap-hdpi/ic_launcher.png b/twa/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index fce2e63..0000000 Binary files a/twa/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-hdpi/ic_maskable.png b/twa/app/src/main/res/mipmap-hdpi/ic_maskable.png deleted file mode 100644 index 15bd433..0000000 Binary files a/twa/app/src/main/res/mipmap-hdpi/ic_maskable.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-mdpi/ic_launcher.png b/twa/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index a760fa1..0000000 Binary files a/twa/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-mdpi/ic_maskable.png b/twa/app/src/main/res/mipmap-mdpi/ic_maskable.png deleted file mode 100644 index 39e9a17..0000000 Binary files a/twa/app/src/main/res/mipmap-mdpi/ic_maskable.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/twa/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index df0d140..0000000 Binary files a/twa/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-xhdpi/ic_maskable.png b/twa/app/src/main/res/mipmap-xhdpi/ic_maskable.png deleted file mode 100644 index 1b94bdd..0000000 Binary files a/twa/app/src/main/res/mipmap-xhdpi/ic_maskable.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/twa/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index ab29946..0000000 Binary files a/twa/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-xxhdpi/ic_maskable.png b/twa/app/src/main/res/mipmap-xxhdpi/ic_maskable.png deleted file mode 100644 index d8aa8ff..0000000 Binary files a/twa/app/src/main/res/mipmap-xxhdpi/ic_maskable.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/twa/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 57f497d..0000000 Binary files a/twa/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/twa/app/src/main/res/mipmap-xxxhdpi/ic_maskable.png b/twa/app/src/main/res/mipmap-xxxhdpi/ic_maskable.png deleted file mode 100644 index fdca916..0000000 Binary files a/twa/app/src/main/res/mipmap-xxxhdpi/ic_maskable.png and /dev/null differ diff --git a/twa/app/src/main/res/raw/web_app_manifest.json b/twa/app/src/main/res/raw/web_app_manifest.json deleted file mode 100644 index 16cdf94..0000000 --- a/twa/app/src/main/res/raw/web_app_manifest.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "Gao Customer H5", - "short_name": "Gao H5", - "display": "standalone", - "background_color": "#ffffff", - "theme_color": "#ffffff", - "start_url": "/", - "scope": "/", - "icons": [ - { - "src": "/icons/icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/icons/icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "/icons/icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/twa/app/src/main/res/values/colors.xml b/twa/app/src/main/res/values/colors.xml deleted file mode 100644 index e66222d..0000000 --- a/twa/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - #F5F5F5 - diff --git a/twa/app/src/main/res/values/strings.xml b/twa/app/src/main/res/values/strings.xml deleted file mode 100644 index 24dc012..0000000 --- a/twa/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - [{ - \"relation\": [\"delegate_permission/common.handle_all_urls\"], - \"target\": { - \"namespace\": \"web\", - \"site\": \"https://gao.imyeyu.com\" - } - }] - - - diff --git a/twa/app/src/main/res/xml/filepaths.xml b/twa/app/src/main/res/xml/filepaths.xml deleted file mode 100644 index a543485..0000000 --- a/twa/app/src/main/res/xml/filepaths.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/twa/app/src/main/res/xml/shortcuts.xml b/twa/app/src/main/res/xml/shortcuts.xml deleted file mode 100644 index 5effdb1..0000000 --- a/twa/app/src/main/res/xml/shortcuts.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/twa/build.gradle b/twa/build.gradle deleted file mode 100644 index a3d57ce..0000000 --- a/twa/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - - repositories { - google() - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.9.1' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/twa/gradle.properties b/twa/gradle.properties deleted file mode 100644 index 784a1d4..0000000 --- a/twa/gradle.properties +++ /dev/null @@ -1,14 +0,0 @@ -# Project-wide Gradle settings. -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx1536m -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true -android.useAndroidX=true diff --git a/twa/gradle/wrapper/gradle-wrapper.jar b/twa/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 5c2d1cf..0000000 Binary files a/twa/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/twa/gradle/wrapper/gradle-wrapper.properties b/twa/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 719e736..0000000 --- a/twa/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip -networkTimeout=10000 -validateDistributionUrl=true diff --git a/twa/gradlew b/twa/gradlew deleted file mode 100644 index b740cf1..0000000 --- a/twa/gradlew +++ /dev/null @@ -1,249 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/twa/gradlew.bat b/twa/gradlew.bat deleted file mode 100644 index 25da30d..0000000 --- a/twa/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/twa/manifest-checksum.txt b/twa/manifest-checksum.txt deleted file mode 100644 index 2db40d9..0000000 --- a/twa/manifest-checksum.txt +++ /dev/null @@ -1 +0,0 @@ -dff2536399b4ac0116642fb1c752408b59929697 \ No newline at end of file diff --git a/twa/settings.gradle b/twa/settings.gradle deleted file mode 100644 index e7b4def..0000000 --- a/twa/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/twa/store_icon.png b/twa/store_icon.png deleted file mode 100644 index 0684be3..0000000 Binary files a/twa/store_icon.png and /dev/null differ diff --git a/twa/twa-manifest.json b/twa/twa-manifest.json deleted file mode 100644 index 3f41cbc..0000000 --- a/twa/twa-manifest.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "packageId": "com.imyeyu.gao.customer", - "host": "gao.imyeyu.com", - "name": "糕店客户管理", - "launcherName": "糕店管理", - "display": "standalone", - "themeColor": "#FFFFFF", - "themeColorDark": "#000000", - "navigationColor": "#000000", - "navigationColorDark": "#000000", - "navigationDividerColor": "#000000", - "navigationDividerColorDark": "#000000", - "backgroundColor": "#FFFFFF", - "enableNotifications": false, - "startUrl": "/", - "iconUrl": "https://gao.imyeyu.com/icons/icon-512.png", - "maskableIconUrl": "https://gao.imyeyu.com/icons/icon-maskable-512.png", - "splashScreenFadeOutDuration": 300, - "signingKey": { - "path": "./android.keystore", - "alias": "gao-customer" - }, - "appVersionName": "1", - "appVersionCode": 1, - "shortcuts": [], - "generatorApp": "bubblewrap-cli", - "webManifestUrl": "https://gao.imyeyu.com/manifest.webmanifest", - "fallbackType": "customtabs", - "features": {}, - "alphaDependencies": { - "enabled": false - }, - "enableSiteSettingsShortcut": true, - "isChromeOSOnly": false, - "isMetaQuest": false, - "fullScopeUrl": "https://gao.imyeyu.com/", - "minSdkVersion": 21, - "orientation": "portrait", - "fingerprints": [], - "additionalTrustedOrigins": [], - "retainedBundles": [], - "protocolHandlers": [], - "fileHandlers": [], - "launchHandlerClientMode": "", - "displayOverride": [], - "appVersion": "1" -}