[FEAT] 優化 OTA 靜默安裝邏輯,支援降版本覆蓋安裝

1. 於 OtaManager.java 中執行 pm install 時新增 -d 參數,允許降級 (downgrade) 安裝,以因應測試與緊急回滾情境。
2. 遞增 app/build.gradle 中的修補版號 verPatch 至 38。
This commit is contained in:
sky121113 2026-05-29 17:20:41 +08:00
parent 2ea55b9fbb
commit 8768e95178
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ plugins {
//
// =========================================================================
def verMinor = 1
def verPatch = 37
def verPatch = 38
android {

View File

@ -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();