[FEAT] 優化 OTA 靜默安裝邏輯,支援降版本覆蓋安裝
1. 於 OtaManager.java 中執行 pm install 時新增 -d 參數,允許降級 (downgrade) 安裝,以因應測試與緊急回滾情境。 2. 遞增 app/build.gradle 中的修補版號 verPatch 至 38。
This commit is contained in:
parent
2ea55b9fbb
commit
8768e95178
@ -9,7 +9,7 @@ plugins {
|
||||
// 避免不同尺寸機台間版本號產生衝突。
|
||||
// =========================================================================
|
||||
def verMinor = 1
|
||||
def verPatch = 37
|
||||
def verPatch = 38
|
||||
|
||||
|
||||
android {
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user