diff --git a/services/bundlemgr/include/inner_bundle_info.h b/services/bundlemgr/include/inner_bundle_info.h index fba78bfc3783ddd04830575cf36bed6a14765203..d7c5998624848cc81f7db1ebe6c7fe9599a75b98 100644 --- a/services/bundlemgr/include/inner_bundle_info.h +++ b/services/bundlemgr/include/inner_bundle_info.h @@ -81,9 +81,9 @@ struct InnerModuleInfo { uint32_t labelId = 0; uint32_t descriptionId = 0; uint32_t iconId = 0; + uint32_t versionCode = 0; int32_t upgradeFlag = 0; int32_t targetPriority; - uint32_t versionCode = 0; BundleType bundleType = BundleType::SHARED; AOTCompileStatus aotCompileStatus = AOTCompileStatus::NOT_COMPILED; ModuleColorMode colorMode = ModuleColorMode::AUTO; @@ -118,6 +118,7 @@ struct InnerModuleInfo { std::string routerMap; std::string packageName; std::string appStartup; + Distro distro; // all user's value of isRemovable // key:userId // value:isRemovable true or flase @@ -141,7 +142,6 @@ struct InnerModuleInfo { std::vector appEnvironments; std::map isRemovable; MetaData metaData; - Distro distro; }; struct ExtendResourceInfo { @@ -2251,23 +2251,51 @@ private: void PrintSetEnabledInfo(bool isEnabled, int32_t userId, int32_t appIndex, const std::string &bundleName, const std::string &caller) const; + bool isSandboxApp_ = false; + // Auxiliary property, which is used when the application + // has been installed when the user is created. + bool onlyCreateBundleUser_ = false; + // new version fields + bool isNewVersion_ = false; + + // use to control uninstalling + bool uninstallState_ = true; + + // need to send a notification when uninstallState_ change + bool isNeedSendNotify_ = false; + BundleStatus bundleStatus_ = BundleStatus::ENABLED; + int32_t appIndex_ = Constants::INITIAL_APP_INDEX; + // apply quick fix frequency + int32_t applyQuickFixFrequency_ = 0; + int32_t overlayType_ = NON_OVERLAY_TYPE; // using for get Constants::AppType appType_ = Constants::AppType::THIRD_PARTY_APP; int userId_ = Constants::DEFAULT_USERID; - BundleStatus bundleStatus_ = BundleStatus::ENABLED; - std::shared_ptr baseApplicationInfo_; - std::shared_ptr baseBundleInfo_; // applicationInfo and abilityInfo empty std::string appFeature_; - std::vector allowedAcls_; - InstallMark mark_; - int32_t appIndex_ = Constants::INITIAL_APP_INDEX; - bool isSandboxApp_ = false; // only using for install or update progress, doesn't need to save to database std::string currentPackage_; - // Auxiliary property, which is used when the application - // has been installed when the user is created. - bool onlyCreateBundleUser_ = false; + // curDynamicIconModule only in ExtendResourceInfos + std::string curDynamicIconModule_; + + // for odid + std::string developerId_; + std::string odid_; + std::shared_ptr baseApplicationInfo_; + std::shared_ptr baseBundleInfo_; // applicationInfo and abilityInfo empty + + std::shared_ptr bundlePackInfo_; + InstallMark mark_; + std::vector allowedAcls_; + + // quick fix hqf info + std::vector hqfInfos_; + + // overlay bundleInfo + std::vector overlayBundleInfo_; + + // provision metadata + std::vector provisionMetadatas_; std::map innerModuleInfos_; @@ -2279,45 +2307,17 @@ private: std::map> skillInfos_; std::map innerBundleUserInfos_; - - std::shared_ptr bundlePackInfo_; - // new version fields - bool isNewVersion_ = false; std::map baseExtensionInfos_; std::map> extensionSkillInfos_; - // quick fix hqf info - std::vector hqfInfos_; - // apply quick fix frequency - int32_t applyQuickFixFrequency_ = 0; - - // overlay bundleInfo - std::vector overlayBundleInfo_; - int32_t overlayType_ = NON_OVERLAY_TYPE; - - // provision metadata - std::vector provisionMetadatas_; - // shared module info std::map> innerSharedModuleInfos_ ; - // data group info - std::unordered_map> dataGroupInfos_; - // key:moduleName value:ExtendResourceInfo std::map extendResourceInfos_; - // curDynamicIconModule only in ExtendResourceInfos - std::string curDynamicIconModule_; - // for odid - std::string developerId_; - std::string odid_; - - // use to control uninstalling - bool uninstallState_ = true; - - // need to send a notification when uninstallState_ change - bool isNeedSendNotify_ = false; + // data group info + std::unordered_map> dataGroupInfos_; }; void from_json(const nlohmann::json &jsonObject, InnerModuleInfo &info); diff --git a/services/bundlemgr/include/inner_bundle_user_info.h b/services/bundlemgr/include/inner_bundle_user_info.h index 5dad0465cd6ebce2c3ebb7bc690701c686f75e16..77377ff96606cd362ee8c71bbfa05f9112d595f6 100644 --- a/services/bundlemgr/include/inner_bundle_user_info.h +++ b/services/bundlemgr/include/inner_bundle_user_info.h @@ -23,12 +23,12 @@ namespace OHOS { namespace AppExecFwk { struct InnerBundleUserInfo { - BundleUserInfo bundleUserInfo; - std::vector gids; + // app install control + bool isRemovable = true; + int32_t uid = Constants::INVALID_UID; uint32_t accessTokenId = 0; uint64_t accessTokenIdEx = 0; - std::string bundleName; // The time(unix time) will be recalculated // if the application is reinstalled after being uninstalled. @@ -37,15 +37,15 @@ struct InnerBundleUserInfo { // The time(unix time) will be recalculated // if the application is uninstalled after being installed. int64_t updateTime = 0; - - // app install control - bool isRemovable = true; + std::string bundleName; // encryption key id std::string keyId; + std::vector gids; // appIndex -> cloneInfo std::map cloneInfos; + BundleUserInfo bundleUserInfo; bool operator() (const InnerBundleUserInfo& info) const { diff --git a/services/bundlemgr/include/ipc/check_encryption_param.h b/services/bundlemgr/include/ipc/check_encryption_param.h index 8a99490e76f2ca30fab0884d027974d007a58563..717fed67fb1269effdec11a2bb00acd623ea37b9 100644 --- a/services/bundlemgr/include/ipc/check_encryption_param.h +++ b/services/bundlemgr/include/ipc/check_encryption_param.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -29,12 +29,12 @@ enum class InstallBundleType : uint8_t { }; struct CheckEncryptionParam : public Parcelable { + bool isCompressNativeLibrary = false; + InstallBundleType installBundleType = InstallBundleType::HAP; std::string modulePath; std::string cpuAbi; std::string targetSoPath; - bool isCompressNativeLibrary = false; int32_t bundleId = -1; - InstallBundleType installBundleType = InstallBundleType::HAP; bool ReadFromParcel(Parcel &parcel); virtual bool Marshalling(Parcel &parcel) const override; diff --git a/services/bundlemgr/include/ipc/create_dir_param.h b/services/bundlemgr/include/ipc/create_dir_param.h index 710b9a9f75b583dfdb9901bf52640cd2b10f61c8..f15003c1ba06bfdeabca3daf26bf439d8162d5f9 100644 --- a/services/bundlemgr/include/ipc/create_dir_param.h +++ b/services/bundlemgr/include/ipc/create_dir_param.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -33,13 +33,13 @@ struct CreateDirParam : public Parcelable { bool isPreInstallApp = false; bool debug = false; bool isDlpSandbox = false; + CreateDirFlag createDirFlag = CreateDirFlag::CREATE_DIR_ALL; int32_t userId; int32_t uid; int32_t gid; std::string bundleName; - std::vector extensionDirs; std::string apl; - CreateDirFlag createDirFlag = CreateDirFlag::CREATE_DIR_ALL; + std::vector extensionDirs; bool ReadFromParcel(Parcel &parcel); virtual bool Marshalling(Parcel &parcel) const override; diff --git a/services/bundlemgr/include/ipc/file_stat.h b/services/bundlemgr/include/ipc/file_stat.h index 99e6abfad819ae29d6e125359f1ae4c548e887cf..9c74c486210aa1c62a2a896e7bd0129430cbf8e7 100755 --- a/services/bundlemgr/include/ipc/file_stat.h +++ b/services/bundlemgr/include/ipc/file_stat.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,11 +21,11 @@ namespace OHOS { namespace AppExecFwk { struct FileStat : public Parcelable { + bool isDir = false; int32_t uid = -1; int32_t gid = -1; - int64_t lastModifyTime = -1; - bool isDir = false; int32_t mode = -1; + int64_t lastModifyTime = -1; bool ReadFromParcel(Parcel &parcel); virtual bool Marshalling(Parcel &parcel) const override; diff --git a/services/bundlemgr/include/module_profile.h b/services/bundlemgr/include/module_profile.h index b8146b312c7381efe2a93ef96c93c408d00c5c97..ed26a2ea0eb25b565d70cd28aea42279b43e2f12 100644 --- a/services/bundlemgr/include/module_profile.h +++ b/services/bundlemgr/include/module_profile.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -24,9 +24,9 @@ namespace OHOS { namespace AppExecFwk { struct OverlayMsg { - OverlayType type = NON_OVERLAY_TYPE; bool isAppPriorityExisted = false; bool isModulePriorityExisted = false; + OverlayType type = NON_OVERLAY_TYPE; }; class ModuleProfile { diff --git a/services/bundlemgr/include/navigation/sem_ver.h b/services/bundlemgr/include/navigation/sem_ver.h index c611f915d571cd50e4564bc6748c68f0a6eec573..4571668f989559ec425990985a3633b058d07efd 100644 --- a/services/bundlemgr/include/navigation/sem_ver.h +++ b/services/bundlemgr/include/navigation/sem_ver.h @@ -29,9 +29,9 @@ public: std::string major; std::string minor; std::string patch; + std::string raw; std::vector prerelease; std::vector buildMeta; - std::string raw; explicit SemVer(std::string versionString); }; diff --git a/services/bundlemgr/include/pre_install_bundle_info.h b/services/bundlemgr/include/pre_install_bundle_info.h index e0fc8593f2a7eaa95247c35ba3b2cee6edce2391..43570e13d01b86e48bc37daa0abf09a0f36abe2b 100644 --- a/services/bundlemgr/include/pre_install_bundle_info.h +++ b/services/bundlemgr/include/pre_install_bundle_info.h @@ -275,20 +275,20 @@ public: } private: - std::string bundleName_; - std::string moduleName_; - int64_t hapTotalSize_ = 0; - uint32_t versionCode_; - uint32_t labelId_ = 0; - uint32_t iconId_ = 0; - std::vector bundlePaths_; bool removable_ = true; bool isUninstalled_ = false; - Constants::AppType appType_ = Constants::AppType::SYSTEM_APP; bool systemApp_ = false; - BundleType bundleType_ = BundleType::APP; // non pre-installed driver app also need to be pre-installed for new user bool isNonPreDriverApp_ = false; + uint32_t versionCode_; + uint32_t labelId_ = 0; + uint32_t iconId_ = 0; + Constants::AppType appType_ = Constants::AppType::SYSTEM_APP; + std::string bundleName_; + std::string moduleName_; + int64_t hapTotalSize_ = 0; + BundleType bundleType_ = BundleType::APP; + std::vector bundlePaths_; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/include/pre_install_exception_mgr.h b/services/bundlemgr/include/pre_install_exception_mgr.h index b4c951c971f0250ebf0f2992491da61f6bc7b694..5f72837960606f2d0c4ce806e174b66fa20b0ef4 100644 --- a/services/bundlemgr/include/pre_install_exception_mgr.h +++ b/services/bundlemgr/include/pre_install_exception_mgr.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -45,12 +45,12 @@ private: void SavePreInstallExceptionInfosToDb(); void DeletePreInstallExceptionInfosFromDb(); + bool hasInit_ = false; std::mutex preInstallExceptionMutex_; std::set exceptionPaths_; std::set exceptionBundleNames_; std::set exceptionAppServicePaths_; std::set exceptionAppServiceBundleNames_; - bool hasInit_ = false; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/include/pre_scan_info.h b/services/bundlemgr/include/pre_scan_info.h index f283e96f14619957e8dff9274642552f68e222c2..1ead1ee3d738101ba506443106e5cc909dc35910 100644 --- a/services/bundlemgr/include/pre_scan_info.h +++ b/services/bundlemgr/include/pre_scan_info.h @@ -27,7 +27,6 @@ namespace { } } struct PreBundleConfigInfo { - std::string bundleName; bool keepAlive = false; bool singleton = false; bool runningResourcesApply = false; @@ -43,6 +42,7 @@ struct PreBundleConfigInfo { bool appShareLibrary = false; bool allowEnableNotification = false; bool allowAppRunWhenDeviceFirstLocked = false; + std::string bundleName; std::vector allowCommonEvent; std::vector appSignature; std::vector existInJsonFile; @@ -99,11 +99,11 @@ struct PreBundleConfigInfo { }; struct PreScanInfo { - std::string bundleDir; bool removable = true; + bool isDataPreloadHap = false; int32_t priority = 0; + std::string bundleDir; std::string appIdentifier; - bool isDataPreloadHap = false; bool operator < (const PreScanInfo &preScanInfo) const { diff --git a/services/bundlemgr/include/quick_fix/inner_app_quick_fix.h b/services/bundlemgr/include/quick_fix/inner_app_quick_fix.h index 936257c35c91aa8423fd48b520dea44a42e495e2..eeab7e0f3656651d1e84b5b1a00a9d88e6716067 100644 --- a/services/bundlemgr/include/quick_fix/inner_app_quick_fix.h +++ b/services/bundlemgr/include/quick_fix/inner_app_quick_fix.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -39,8 +39,8 @@ enum QuickFixStatus : uint8_t { }; struct QuickFixMark { - std::string bundleName; int32_t status = QuickFixStatus::DEFAULT_STATUS; + std::string bundleName; }; class InnerAppQuickFix { diff --git a/services/bundlemgr/include/quick_fix/quick_fix_deleter.h b/services/bundlemgr/include/quick_fix/quick_fix_deleter.h index 172420603590cfb28c84ecdbfe3b8afff011e3f1..a1cad41c7525b164ef33160757b74c78516686ab 100755 --- a/services/bundlemgr/include/quick_fix/quick_fix_deleter.h +++ b/services/bundlemgr/include/quick_fix/quick_fix_deleter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -37,9 +37,9 @@ private: ErrCode GetDataMgr(); ErrCode RemoveDeployingInfo(const std::string &bundleName); + std::string bundleName_; std::shared_ptr quickFixDataMgr_ = nullptr; std::shared_ptr dataMgr_ = nullptr; - std::string bundleName_; }; } // AppExecFwk } // OHOS diff --git a/services/bundlemgr/include/quick_fix/quick_fix_deployer.h b/services/bundlemgr/include/quick_fix/quick_fix_deployer.h index 28e6e970c73287400f13de37199b916129fae386..8337633625a4c0e4b9e5a63381bc2abb95d7147b 100755 --- a/services/bundlemgr/include/quick_fix/quick_fix_deployer.h +++ b/services/bundlemgr/include/quick_fix/quick_fix_deployer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -126,11 +126,11 @@ private: ErrCode ExtractQuickFixResFile(const AppQuickFix &appQuickFix, const BundleInfo &bundleInfo); std::vector patchPaths_; - std::shared_ptr quickFixDataMgr_ = nullptr; - DeployQuickFixResult deployQuickFixResult_; - std::string appDistributionType_ = Constants::APP_DISTRIBUTION_TYPE_NONE; bool isDebug_ = false; + std::string appDistributionType_ = Constants::APP_DISTRIBUTION_TYPE_NONE; std::string targetPath_ = ""; + std::shared_ptr quickFixDataMgr_ = nullptr; + DeployQuickFixResult deployQuickFixResult_; #define CHECK_QUICK_FIX_RESULT_RETURN_IF_FAIL(errcode) \ do { \ diff --git a/services/bundlemgr/include/quick_fix/quick_fix_manager_host_impl.h b/services/bundlemgr/include/quick_fix/quick_fix_manager_host_impl.h index c0ccb6e5a56ca8a088d25cb395a0b8cada9bc3f1..4a765de16941fb0a9888967b92fe0100e4b35732 100644 --- a/services/bundlemgr/include/quick_fix/quick_fix_manager_host_impl.h +++ b/services/bundlemgr/include/quick_fix/quick_fix_manager_host_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -46,8 +46,8 @@ private: ErrCode CopyHqfToSecurityDir(const std::vector &bundleFilePaths, std::vector &securityFilePaths) const; - std::shared_ptr quickFixMgr_ = nullptr; std::atomic id_ = 0; + std::shared_ptr quickFixMgr_ = nullptr; }; } // AppExecFwk } // OHOS diff --git a/services/bundlemgr/include/rdb/bms_rdb_config.h b/services/bundlemgr/include/rdb/bms_rdb_config.h index 3e6e81a3bbff32aad0665fa7a7c5f558d0883f5f..16a40241c87cfbd15cf9e0aab5867526b21c846f 100644 --- a/services/bundlemgr/include/rdb/bms_rdb_config.h +++ b/services/bundlemgr/include/rdb/bms_rdb_config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -25,12 +25,12 @@ namespace OHOS { namespace AppExecFwk { struct BmsRdbConfig { + int32_t version { ServiceConstants::BUNDLE_RDB_VERSION }; std::string dbPath { ServiceConstants::BUNDLE_MANAGER_SERVICE_PATH }; std::string dbName; std::string tableName; std::string createTableSql; std::vector insertColumnSql; - int32_t version { ServiceConstants::BUNDLE_RDB_VERSION }; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/include/rdb/rdb_data_manager.h b/services/bundlemgr/include/rdb/rdb_data_manager.h index da85cdb63bdb89ac361110aab3f4bf87e150e2d5..060c4d52c91a063938f1e71f31693e89e60230e4 100644 --- a/services/bundlemgr/include/rdb/rdb_data_manager.h +++ b/services/bundlemgr/include/rdb/rdb_data_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -58,11 +58,11 @@ public: bool CheckIsSatisfyTime(); private: std::shared_ptr GetRdbStore(); - std::mutex rdbMutex_; - std::shared_ptr rdbStore_; bool isInitial_ = false; + std::mutex rdbMutex_; static std::mutex restoreRdbMutex_; + std::shared_ptr rdbStore_; BmsRdbConfig bmsRdbConfig_; }; diff --git a/services/bundlemgr/include/sandbox_app/bundle_sandbox_data_mgr.h b/services/bundlemgr/include/sandbox_app/bundle_sandbox_data_mgr.h index 8cfc48a46d5d6e4248de91b48046a2c8c6450f9e..08b4448a45b730dba2804edfeb425613eb04c6f5 100644 --- a/services/bundlemgr/include/sandbox_app/bundle_sandbox_data_mgr.h +++ b/services/bundlemgr/include/sandbox_app/bundle_sandbox_data_mgr.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -53,13 +53,13 @@ public: private: bool RestoreSandboxAppIndex(const std::string &bundleName, int32_t appIndex); + mutable std::mutex sandboxAppIndexMapMutex_; mutable std::shared_mutex sandboxAppMutex_; mutable std::shared_mutex sandboxDbMutex_; - mutable std::mutex sandboxAppIndexMapMutex_; + std::shared_ptr sandboxManagerDb_ = nullptr; // key: bundleName_appindex std::unordered_map sandboxAppInfos_; std::unordered_map> sandboxAppIndexMap_; - std::shared_ptr sandboxManagerDb_ = nullptr; }; } // AppExecFwk } // OHOS diff --git a/services/bundlemgr/include/sandbox_app/bundle_sandbox_exception_handler.h b/services/bundlemgr/include/sandbox_app/bundle_sandbox_exception_handler.h index 16bf6ed82ab00951c6f0ebbf8a3491f58e494aec..f72d3808cd7a7e044fc447cc2bd0c23db5f7ea0d 100644 --- a/services/bundlemgr/include/sandbox_app/bundle_sandbox_exception_handler.h +++ b/services/bundlemgr/include/sandbox_app/bundle_sandbox_exception_handler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -56,8 +56,8 @@ private: void RemoveDataDir(); void ListeningUserUnlocked(); - std::map> sandboxDirs_; std::weak_ptr dataStorage_; + std::map> sandboxDirs_; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/include/sandbox_app/bundle_sandbox_installer.h b/services/bundlemgr/include/sandbox_app/bundle_sandbox_installer.h index 75616bdb744b73830ce0d1e298283ff5599c7326..b256581ca1223f3d69fc3527b39576909ad75a5d 100644 --- a/services/bundlemgr/include/sandbox_app/bundle_sandbox_installer.h +++ b/services/bundlemgr/include/sandbox_app/bundle_sandbox_installer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -60,10 +60,10 @@ private: ErrCode GetDataMgr(); ErrCode GetSandboxDataMgr(); + int32_t userId_ = Constants::INVALID_USERID; + std::string bundleName_; std::shared_ptr dataMgr_ = nullptr; std::shared_ptr sandboxDataMgr_ = nullptr; - std::string bundleName_; - int32_t userId_ = Constants::INVALID_USERID; }; } // AppExecFwk } // OHOS diff --git a/services/bundlemgr/include/shared/inner_shared_bundle_installer.h b/services/bundlemgr/include/shared/inner_shared_bundle_installer.h index d251e557d5f9c9a6ca595dcae2fe7c064938e50f..aae921b5ae758371ebad7163a994882bb0e4cf24 100644 --- a/services/bundlemgr/include/shared/inner_shared_bundle_installer.h +++ b/services/bundlemgr/include/shared/inner_shared_bundle_installer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -122,26 +122,26 @@ private: void UpdateInnerModuleInfo(const std::string packageName, const InnerModuleInfo &innerModuleInfo); void MarkInstallFinish(); + bool isBundleExist_ = false; + bool isEnterpriseBundle_ = false; + bool isPreInstalledBundle_ = false; // the real path or the parent directory of hsp files to be installed. std::string sharedBundlePath_; std::string bundleName_; std::string signatureFileDir_; + std::string nativeLibraryPath_; + std::string appIdentifier_; + std::string compileSdkType_; + std::string cpuAbi_; + std::string tempSoPath_; + std::unique_ptr bundleInstallChecker_ = nullptr; std::vector toDeleteTempHspPath_; // the key is the real path of each hsp file std::unordered_map parsedBundles_; // created directories during installation, will be deleted when rollback. std::vector createdDirs_; - bool isBundleExist_ = false; InnerBundleInfo oldBundleInfo_; InnerBundleInfo newBundleInfo_; - std::unique_ptr bundleInstallChecker_ = nullptr; - std::string nativeLibraryPath_; - bool isEnterpriseBundle_ = false; - std::string appIdentifier_; - std::string compileSdkType_; - std::string cpuAbi_; - std::string tempSoPath_; - bool isPreInstalledBundle_ = false; DISALLOW_COPY_AND_MOVE(InnerSharedBundleInstaller); diff --git a/services/bundlemgr/include/status_receiver_proxy.h b/services/bundlemgr/include/status_receiver_proxy.h index e722959ec14ef046b680fe41c4395a1aac67366f..3510e3ed9190279b7a148829e4fcb517e478c8f5 100644 --- a/services/bundlemgr/include/status_receiver_proxy.h +++ b/services/bundlemgr/include/status_receiver_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -46,8 +46,8 @@ private: private: int32_t resultCode_ = -1; - std::string resultMsg_; uint32_t streamInstallerId_ = 0; + std::string resultMsg_; static inline BrokerDelegator delegator_; }; } // namespace AppExecFwk diff --git a/services/bundlemgr/include/uninstall_data_mgr/uninstall_bundle_info.h b/services/bundlemgr/include/uninstall_data_mgr/uninstall_bundle_info.h index 0fd1e2530cefb7f42bc6d874b2e226a0095df7e1..6e65dc9a2f2adc384e8b51ac11f106e6c6d9a615 100644 --- a/services/bundlemgr/include/uninstall_data_mgr/uninstall_bundle_info.h +++ b/services/bundlemgr/include/uninstall_data_mgr/uninstall_bundle_info.h @@ -23,9 +23,9 @@ namespace OHOS { namespace AppExecFwk { struct UninstallDataUserInfo { int32_t uid = 0; - std::vector gids; uint32_t accessTokenId = 0; uint64_t accessTokenIdEx = 0; + std::vector gids; }; struct UninstallBundleInfo { std::string appId; diff --git a/services/bundlemgr/include/verify/verify_manager_host_impl.h b/services/bundlemgr/include/verify/verify_manager_host_impl.h index 1295a22e995dcb8292b7ea585da54cfb87aa666b..2e67c0add0c92471f839b0173a65fa527c8e4fec 100644 --- a/services/bundlemgr/include/verify/verify_manager_host_impl.h +++ b/services/bundlemgr/include/verify/verify_manager_host_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -55,9 +55,9 @@ private: bool GetCallingBundleName(std::string &bundleName); std::atomic id_ = 0; + mutable std::shared_mutex bundleMutex_; // using for locking by bundleName std::unordered_map bundleMutexMap_; - mutable std::shared_mutex bundleMutex_; }; } // AppExecFwk } // OHOS diff --git a/services/bundlemgr/include/zip_file.h b/services/bundlemgr/include/zip_file.h index 758db1fbd9c33e890cd4b868fa864d62443c0e22..9226d8c175aa4ba83b06e279edfc7c891699323f 100644 --- a/services/bundlemgr/include/zip_file.h +++ b/services/bundlemgr/include/zip_file.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -140,11 +140,11 @@ struct ZipEntry { ~ZipEntry() = default; // for CodeDEX warning uint16_t compressionMethod = 0; + uint16_t flags = 0; uint32_t uncompressedSize = 0; uint32_t compressedSize = 0; uint32_t localHeaderOffset = 0; uint32_t crc = 0; - uint16_t flags = 0; std::string fileName; }; @@ -291,17 +291,17 @@ private: bool ReadZStream(const BytePtr &buffer, z_stream &zstream, uint32_t &remainCompressedSize) const; private: + bool isOpen_ = false; std::string pathName_; FILE *file_ = nullptr; - EndDir endDir_; - ZipEntryMap entriesMap_; // offset of central directory relative to zip file. ZipPos centralDirPos_ = 0; // this zip content start offset relative to zip file. ZipPos fileStartPos_ = 0; // this zip content length in the zip file. ZipPos fileLength_ = 0; - bool isOpen_ = false; + EndDir endDir_; + ZipEntryMap entriesMap_; }; } // namespace AppExecFwk } // namespace OHOS