From 08e17e6372c8e1818455964450f2bba0c9494296 Mon Sep 17 00:00:00 2001 From: Rayllll Date: Sun, 27 Apr 2025 16:24:03 +0800 Subject: [PATCH 1/3] Signed-off-by: Rayllll modify process package --- services/updater_main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/updater_main.cpp b/services/updater_main.cpp index 95a21988..da443fa8 100644 --- a/services/updater_main.cpp +++ b/services/updater_main.cpp @@ -360,6 +360,11 @@ static UpdaterStatus VerifyBinfiles(UpdaterParams &upParams) static UpdaterStatus VerifyPackages(UpdaterParams &upParams) { UPDATER_INIT_RECORD; + UpdaterStatus status = UPDATE_SUCCESS; + if (NotifyActionResult(upParams, status, {PROCESS_PACKAGE}) != UPDATE_SUCCESS) { + LOG(ERROR) << "pkg abnormal"; + return UPDATE_CORRUPT; + } LOG(INFO) << "Verify packages start..."; UPDATER_UI_INSTANCE.ShowProgressPage(); UPDATER_UI_INSTANCE.ShowUpdInfo(TR(UPD_VERIFYPKG)); @@ -998,8 +1003,7 @@ UpdaterStatus UpdaterFromSdcard(UpdaterParams &upParams) status = CheckSdcardPkgs(upParams); if (status != UPDATE_SUCCESS) { LOG(ERROR) << "can not find sdcard packages"; - if (NotifyActionResult(upParams, status, {SET_INSTALL_STATUS, - SET_UPDATE_STATUS, GET_UPDATE_STATUS}) != UPDATE_SUCCESS) { + if (NotifyActionResult(upParams, status, {SET_UPDATE_STATUS, GET_UPDATE_STATUS}) != UPDATE_SUCCESS) { LOG(ERROR) << "notify action fail"; } return UPDATE_ERROR; -- Gitee From ed6067e35ba6b39198d3955e680401fd085d0d5f Mon Sep 17 00:00:00 2001 From: Rayllll Date: Sun, 27 Apr 2025 16:24:03 +0800 Subject: [PATCH 2/3] Signed-off-by: Rayllll modify process package Signed-off-by: Rayllll --- services/updater_main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/services/updater_main.cpp b/services/updater_main.cpp index 95a21988..71dda8b0 100644 --- a/services/updater_main.cpp +++ b/services/updater_main.cpp @@ -360,10 +360,14 @@ static UpdaterStatus VerifyBinfiles(UpdaterParams &upParams) static UpdaterStatus VerifyPackages(UpdaterParams &upParams) { UPDATER_INIT_RECORD; + UpdaterStatus status = UPDATE_SUCCESS; + if (NotifyActionResult(upParams, status, {PROCESS_PACKAGE}) != UPDATE_SUCCESS) { + LOG(ERROR) << "pkg abnormal"; + return UPDATE_CORRUPT; + } LOG(INFO) << "Verify packages start..."; UPDATER_UI_INSTANCE.ShowProgressPage(); UPDATER_UI_INSTANCE.ShowUpdInfo(TR(UPD_VERIFYPKG)); - if (upParams.callbackProgress == nullptr) { UPDATER_UI_INSTANCE.ShowUpdInfo(TR(UPD_VERIFYPKGFAIL), true); UPDATER_LAST_WORD(UPDATE_CORRUPT, "upParams.callbackProgress is null"); @@ -385,7 +389,6 @@ static UpdaterStatus VerifyPackages(UpdaterParams &upParams) if (verifyret == UPDATE_SUCCESS) { verifyret = UpdatePreCheck(upParams, upParams.updatePackage[i]); } - if (verifyret != UPDATE_SUCCESS) { UpdaterVerifyFailEntry((verifyret == PKG_INVALID_DIGEST) && (upParams.updateMode == HOTA_UPDATE)); upParams.pkgLocation = i; @@ -998,8 +1001,7 @@ UpdaterStatus UpdaterFromSdcard(UpdaterParams &upParams) status = CheckSdcardPkgs(upParams); if (status != UPDATE_SUCCESS) { LOG(ERROR) << "can not find sdcard packages"; - if (NotifyActionResult(upParams, status, {SET_INSTALL_STATUS, - SET_UPDATE_STATUS, GET_UPDATE_STATUS}) != UPDATE_SUCCESS) { + if (NotifyActionResult(upParams, status, {SET_UPDATE_STATUS, GET_UPDATE_STATUS}) != UPDATE_SUCCESS) { LOG(ERROR) << "notify action fail"; } return UPDATE_ERROR; -- Gitee From d3a726915484338dff2881324cef0a584fbb0d1f Mon Sep 17 00:00:00 2001 From: Rayllll Date: Sun, 27 Apr 2025 09:30:39 +0000 Subject: [PATCH 3/3] update services/updater_main.cpp. Signed-off-by: Rayllll --- services/updater_main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/services/updater_main.cpp b/services/updater_main.cpp index 71dda8b0..55d61b3b 100644 --- a/services/updater_main.cpp +++ b/services/updater_main.cpp @@ -362,7 +362,6 @@ static UpdaterStatus VerifyPackages(UpdaterParams &upParams) UPDATER_INIT_RECORD; UpdaterStatus status = UPDATE_SUCCESS; if (NotifyActionResult(upParams, status, {PROCESS_PACKAGE}) != UPDATE_SUCCESS) { - LOG(ERROR) << "pkg abnormal"; return UPDATE_CORRUPT; } LOG(INFO) << "Verify packages start..."; -- Gitee