From 8768e95178b79aeb46b39f04f396be294f5ad7b6 Mon Sep 17 00:00:00 2001 From: sky121113 Date: Fri, 29 May 2026 17:20:41 +0800 Subject: [PATCH] =?UTF-8?q?[FEAT]=20=E5=84=AA=E5=8C=96=20OTA=20=E9=9D=9C?= =?UTF-8?q?=E9=BB=98=E5=AE=89=E8=A3=9D=E9=82=8F=E8=BC=AF=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8F=B4=E9=99=8D=E7=89=88=E6=9C=AC=E8=A6=86=E8=93=8B=E5=AE=89?= =?UTF-8?q?=E8=A3=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 於 OtaManager.java 中執行 pm install 時新增 -d 參數,允許降級 (downgrade) 安裝,以因應測試與緊急回滾情境。 2. 遞增 app/build.gradle 中的修補版號 verPatch 至 38。 --- app/build.gradle | 2 +- .../main/java/com/unibuy/smartdevice/tools/OtaManager.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 35eef07..c0a409a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ plugins { // 避免不同尺寸機台間版本號產生衝突。 // ========================================================================= def verMinor = 1 -def verPatch = 37 +def verPatch = 38 android { diff --git a/app/src/main/java/com/unibuy/smartdevice/tools/OtaManager.java b/app/src/main/java/com/unibuy/smartdevice/tools/OtaManager.java index a6c19d2..f40d825 100644 --- a/app/src/main/java/com/unibuy/smartdevice/tools/OtaManager.java +++ b/app/src/main/java/com/unibuy/smartdevice/tools/OtaManager.java @@ -108,10 +108,10 @@ public class OtaManager { Process process = null; DataOutputStream os = null; try { - logs.info("Executing silent install command via su: pm install -r " + apkPath); + logs.info("Executing silent install command via su: pm install -r -d " + apkPath); process = Runtime.getRuntime().exec("su"); os = new DataOutputStream(process.getOutputStream()); - os.writeBytes("pm install -r " + apkPath + "\n"); + os.writeBytes("pm install -r -d " + apkPath + "\n"); os.writeBytes("exit\n"); os.flush();