From 6ee7465788af5a4783c0a8873951ab1d90719404 Mon Sep 17 00:00:00 2001 From: chensihan Date: Fri, 1 Nov 2024 09:31:55 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5=20Sign?= =?UTF-8?q?ed-off-by:=20chensihan=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle.json | 6 ++--- .../native/backup_ext/src/untar_file.cpp | 8 +++---- .../include/module_ipc/svc_session_manager.h | 2 +- .../src/module_external/bms_adapter.cpp | 4 ++-- .../src/module_ipc/service_incremental.cpp | 1 + .../module_ipc/svc_restore_deps_manager.cpp | 2 +- utils/include/b_jsonutil/b_jsonutil.h | 24 +++++++++---------- 7 files changed, 22 insertions(+), 25 deletions(-) diff --git a/bundle.json b/bundle.json index d81e5f73a..e3b274cd9 100644 --- a/bundle.json +++ b/bundle.json @@ -37,6 +37,7 @@ "ipc", "init", "napi", + "os_account", "safwk", "samgr", "storage_service", @@ -49,10 +50,7 @@ "openssl" ] }, - "adapted_system_type": [ - "small", - "standard" - ], + "adapted_system_type": [ "small", "standard" ], "rom": "1024KB", "ram": "1024KB", "hisysevent_config": [ diff --git a/frameworks/native/backup_ext/src/untar_file.cpp b/frameworks/native/backup_ext/src/untar_file.cpp index 0eceb7765..b78a17d26 100644 --- a/frameworks/native/backup_ext/src/untar_file.cpp +++ b/frameworks/native/backup_ext/src/untar_file.cpp @@ -516,7 +516,7 @@ bool UntarFile::IsValidTarBlock(TarHeader &header) if (strncmp(header.magic, TMAGIC.c_str(), TMAGIC_LEN - 1) == 0 && VerifyChecksum(header)) { return true; } - HILOGW("Invalid tar block"); + HILOGE("Invalid tar block"); return false; } @@ -548,7 +548,7 @@ ErrFileInfo UntarFile::CreateDir(string &path, mode_t mode) path[len - 1] = '\0'; } if (access(path.c_str(), F_OK) != 0) { - HILOGW("directory does not exist, path:%{public}s, err = %{public}d", path.c_str(), errno); + HILOGE("directory does not exist, path:%{public}s, err = %{public}d", path.c_str(), errno); if (!ForceCreateDirectoryWithMode(path, mode)) { HILOGE("Failed to force create directory %{public}s, err = %{public}d", path.c_str(), errno); errFileInfo[path].push_back(errno); @@ -570,7 +570,7 @@ FILE *UntarFile::CreateFile(string &filePath) } uint32_t len = filePath.length(); - HILOGW("Failed to open file %{public}d, %{public}s, err = %{public}d", len, + HILOGE("Failed to open file %{public}d, %{public}s, err = %{public}d", len, GetAnonyPath(filePath).c_str(), errno); size_t pos = filePath.rfind('/'); if (pos == string::npos) { @@ -585,7 +585,7 @@ FILE *UntarFile::CreateFile(string &filePath) } f = fopen(filePath.c_str(), "wb+"); if (f == nullptr) { - HILOGE("Failed to create file %{public}s, err = %{public}d", GetAnonyPath(filePath).c_str(), errno); + HILOGE("Failed to open file %{public}s, err = %{public}d", GetAnonyPath(filePath).c_str(), errno); } } diff --git a/services/backup_sa/include/module_ipc/svc_session_manager.h b/services/backup_sa/include/module_ipc/svc_session_manager.h index fd8aaf4d3..26cee6610 100644 --- a/services/backup_sa/include/module_ipc/svc_session_manager.h +++ b/services/backup_sa/include/module_ipc/svc_session_manager.h @@ -60,7 +60,7 @@ struct BackupExtInfo { /* Timer Status: true is start & false is stop */ bool extTimerStatus {false}; bool fwkTimerStatus {false}; - uint32_t timeout; + uint32_t timeout = BConstants::TIMEOUT_INVALID; uint32_t startTime; int64_t dataSize; int64_t lastIncrementalTime; diff --git a/services/backup_sa/src/module_external/bms_adapter.cpp b/services/backup_sa/src/module_external/bms_adapter.cpp index e1f415e89..8a7f95baa 100644 --- a/services/backup_sa/src/module_external/bms_adapter.cpp +++ b/services/backup_sa/src/module_external/bms_adapter.cpp @@ -353,8 +353,8 @@ vector BundleMgrAdapter::GetBundleInfosForIncrement GetAllowAndExtName(installedBundle.extensionInfos); if (!allToBackup) { bundleInfos.emplace_back(BJsonEntityCaps::BundleInfo {installedBundle.name, installedBundle.appIndex, - installedBundle.versionCode, installedBundle.versionName, 0, 0, allToBackup, fullBackupOnly, extName, - restoreDeps, supportScene, extraInfo}); + installedBundle.versionCode, installedBundle.versionName, 0, 0, allToBackup, fullBackupOnly, + extName, restoreDeps, supportScene, extraInfo}); continue; } auto it = std::find_if(extraIncreData.begin(), extraIncreData.end(), diff --git a/services/backup_sa/src/module_ipc/service_incremental.cpp b/services/backup_sa/src/module_ipc/service_incremental.cpp index 0d643218c..414d8eea3 100644 --- a/services/backup_sa/src/module_ipc/service_incremental.cpp +++ b/services/backup_sa/src/module_ipc/service_incremental.cpp @@ -560,6 +560,7 @@ ErrCode Service::GetIncrementalFileHandle(const std::string &bundleName, const s { HITRACE_METER_NAME(HITRACE_TAG_FILEMANAGEMENT, __PRETTY_FUNCTION__); try { + HILOGI("Begin get incrementalFileHandle"); VerifyCaller(IServiceReverse::Scenario::RESTORE); auto action = session_->GetServiceSchedAction(bundleName); if (action == BConstants::ServiceSchedAction::RUNNING) { diff --git a/services/backup_sa/src/module_ipc/svc_restore_deps_manager.cpp b/services/backup_sa/src/module_ipc/svc_restore_deps_manager.cpp index 70879196a..682b0a2b4 100644 --- a/services/backup_sa/src/module_ipc/svc_restore_deps_manager.cpp +++ b/services/backup_sa/src/module_ipc/svc_restore_deps_manager.cpp @@ -33,7 +33,7 @@ vector SvcRestoreDepsManager::GetRestoreBundleNames(const vector> errFileInfo); - /** + /* * * @brief 组建App进度返回的信息 - * * @param jsonStr 组建结果 * @param onProcessRet onProcess接口返回值 * @@ -128,6 +117,15 @@ public: */ static bool BuildOnProcessRetInfo(std::string &jsonStr, std::string onProcessRet); + /* * + * @brief 拼接包名和分身对应的索引 + * + * @param bundleName 包名 + * @param bundleIndex 索引 + * + * @return 拼接结果 + */ + static std::string BuildBundleNameIndexInfo(const std::string &bundleName, int bundleIndex); /** * @brief 组建App进度返回的信息 * -- Gitee From fd92dc0b9219a9c923c916db0cd5e06bdd1c62fe Mon Sep 17 00:00:00 2001 From: chensihan Date: Fri, 1 Nov 2024 02:59:27 +0000 Subject: [PATCH 2/6] update services/backup_sa/src/module_external/bms_adapter.cpp. Signed-off-by: chensihan --- services/backup_sa/src/module_external/bms_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/backup_sa/src/module_external/bms_adapter.cpp b/services/backup_sa/src/module_external/bms_adapter.cpp index 8a7f95baa..f01d20757 100644 --- a/services/backup_sa/src/module_external/bms_adapter.cpp +++ b/services/backup_sa/src/module_external/bms_adapter.cpp @@ -353,7 +353,7 @@ vector BundleMgrAdapter::GetBundleInfosForIncrement GetAllowAndExtName(installedBundle.extensionInfos); if (!allToBackup) { bundleInfos.emplace_back(BJsonEntityCaps::BundleInfo {installedBundle.name, installedBundle.appIndex, - installedBundle.versionCode, installedBundle.versionName, 0, 0, allToBackup, fullBackupOnly, + installedBundle.versionCode, installedBundle.versionName, 0, 0, allToBackup, fullBackupOnly, extName, restoreDeps, supportScene, extraInfo}); continue; } -- Gitee From 517a26e7e88ec4bf72f262351ebf066573f4b887 Mon Sep 17 00:00:00 2001 From: chensihan Date: Fri, 1 Nov 2024 06:29:06 +0000 Subject: [PATCH 3/6] update bundle.json. Signed-off-by: chensihan --- bundle.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundle.json b/bundle.json index e3b274cd9..ceaec5e96 100644 --- a/bundle.json +++ b/bundle.json @@ -50,7 +50,10 @@ "openssl" ] }, - "adapted_system_type": [ "small", "standard" ], + "adapted_system_type": [ + "small", + "standard" + ], "rom": "1024KB", "ram": "1024KB", "hisysevent_config": [ -- Gitee From 653329e7164c63a9fcc1afc2fe601f714f1d5f52 Mon Sep 17 00:00:00 2001 From: chensihan Date: Fri, 1 Nov 2024 06:29:46 +0000 Subject: [PATCH 4/6] update bundle.json. Signed-off-by: chensihan --- bundle.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundle.json b/bundle.json index ceaec5e96..b4deffdf2 100644 --- a/bundle.json +++ b/bundle.json @@ -50,9 +50,9 @@ "openssl" ] }, - "adapted_system_type": [ - "small", - "standard" + "adapted_system_type": [ + "small", + "standard" ], "rom": "1024KB", "ram": "1024KB", -- Gitee From 25483ce21e2405996d8b5c20f81c408dcdc6c065 Mon Sep 17 00:00:00 2001 From: chensihan Date: Mon, 4 Nov 2024 02:55:07 +0000 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chensihan --- services/backup_sa/src/module_ipc/svc_restore_deps_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/backup_sa/src/module_ipc/svc_restore_deps_manager.cpp b/services/backup_sa/src/module_ipc/svc_restore_deps_manager.cpp index 682b0a2b4..70879196a 100644 --- a/services/backup_sa/src/module_ipc/svc_restore_deps_manager.cpp +++ b/services/backup_sa/src/module_ipc/svc_restore_deps_manager.cpp @@ -33,7 +33,7 @@ vector SvcRestoreDepsManager::GetRestoreBundleNames(const vector Date: Mon, 4 Nov 2024 06:54:53 +0000 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chensihan --- frameworks/native/backup_ext/src/untar_file.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frameworks/native/backup_ext/src/untar_file.cpp b/frameworks/native/backup_ext/src/untar_file.cpp index b78a17d26..0eceb7765 100644 --- a/frameworks/native/backup_ext/src/untar_file.cpp +++ b/frameworks/native/backup_ext/src/untar_file.cpp @@ -516,7 +516,7 @@ bool UntarFile::IsValidTarBlock(TarHeader &header) if (strncmp(header.magic, TMAGIC.c_str(), TMAGIC_LEN - 1) == 0 && VerifyChecksum(header)) { return true; } - HILOGE("Invalid tar block"); + HILOGW("Invalid tar block"); return false; } @@ -548,7 +548,7 @@ ErrFileInfo UntarFile::CreateDir(string &path, mode_t mode) path[len - 1] = '\0'; } if (access(path.c_str(), F_OK) != 0) { - HILOGE("directory does not exist, path:%{public}s, err = %{public}d", path.c_str(), errno); + HILOGW("directory does not exist, path:%{public}s, err = %{public}d", path.c_str(), errno); if (!ForceCreateDirectoryWithMode(path, mode)) { HILOGE("Failed to force create directory %{public}s, err = %{public}d", path.c_str(), errno); errFileInfo[path].push_back(errno); @@ -570,7 +570,7 @@ FILE *UntarFile::CreateFile(string &filePath) } uint32_t len = filePath.length(); - HILOGE("Failed to open file %{public}d, %{public}s, err = %{public}d", len, + HILOGW("Failed to open file %{public}d, %{public}s, err = %{public}d", len, GetAnonyPath(filePath).c_str(), errno); size_t pos = filePath.rfind('/'); if (pos == string::npos) { @@ -585,7 +585,7 @@ FILE *UntarFile::CreateFile(string &filePath) } f = fopen(filePath.c_str(), "wb+"); if (f == nullptr) { - HILOGE("Failed to open file %{public}s, err = %{public}d", GetAnonyPath(filePath).c_str(), errno); + HILOGE("Failed to create file %{public}s, err = %{public}d", GetAnonyPath(filePath).c_str(), errno); } } -- Gitee