From 988472bdbdd699d53645dac79eb94f0752d94755 Mon Sep 17 00:00:00 2001 From: km2025 Date: Wed, 21 Jan 2026 18:07:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20OTA=20URL=20?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E5=85=81=E8=AE=B8=E5=AE=89=E5=8D=93?= =?UTF-8?q?=E5=9C=A8=20release=20=E6=A8=A1=E5=BC=8F=E4=B8=8B=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=98=8E=E6=96=87=E6=B5=81=E9=87=8F=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20OTA=20=E5=8D=87=E7=BA=A7=E8=BF=87=E7=A8=8B=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.config.js | 2 ++ app/(tabs)/explore.tsx | 6 ++++-- ble/managers/bleManager.ts | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app.config.js b/app.config.js index cdd34d7..329d25d 100644 --- a/app.config.js +++ b/app.config.js @@ -121,6 +121,8 @@ export default ({ config }) => { // 测试环境不压缩,会导致 developmentClient 构建失败 enableProguardInReleaseBuilds: false, enableShrinkResourcesInReleaseBuilds: false, + // 安卓开启http请求,在release模式下允许明文流量 + usesCleartextTraffic: true, // 增加 Java 堆内存 packagingOptions: { diff --git a/app/(tabs)/explore.tsx b/app/(tabs)/explore.tsx index f8e03c4..f0215b6 100644 --- a/app/(tabs)/explore.tsx +++ b/app/(tabs)/explore.tsx @@ -59,11 +59,13 @@ export default observer(function TabTwoScreen() { ) const [userId, setUserId] = useState(user?.id ?? '01duHavK1CMW7pawcgOtB5aUqQeHPeni') const [otaUrl, setOtaUrl] = useState( - userStore.scannedQR ?? 'http://aie-user-data.cdn.bcebos.com/version/HXD201/app.bin', + userStore.scannedQR ?? 'http://aie-user-data.cdn.bcebos.com/version/HXD201/ota_20260121/db_update_data.bin', ) useEffect(() => { - setOtaUrl(userStore.scannedQR ?? '') + if (userStore.scannedQR) { + setOtaUrl(userStore.scannedQR ?? '') + } }, [userStore.scannedQR]) // 查询设备版本 diff --git a/ble/managers/bleManager.ts b/ble/managers/bleManager.ts index 25e738c..ad5e5b4 100644 --- a/ble/managers/bleManager.ts +++ b/ble/managers/bleManager.ts @@ -669,6 +669,7 @@ class BleManager { bleStore.setState((prev) => ({ ...prev, loading: { ...prev.loading, transferring: true } })) const response = await fetch(url) + console.log('performOtaUpgrade----------', response) if (!response.ok) { throw new Error(`Failed to fetch OTA package: ${response.status} ${response.statusText}`) }