From 685ecf94109d8062f1e2b4ba2c79aa3b8f17f513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=99=BA=E5=AE=87?= Date: Fri, 17 Jan 2025 19:33:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E7=94=A8oh=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic8f9d01597448b36f9a81c38313f41ebf0699bbb Signed-off-by: 谢智宇 --- include/file_manager.h | 4 ++++ include/resource_data.h | 2 +- src/id_defined_parser.cpp | 4 +++- src/resource_pack.cpp | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/file_manager.h b/include/file_manager.h index 655dfdf..6268b63 100644 --- a/include/file_manager.h +++ b/include/file_manager.h @@ -35,6 +35,10 @@ public: { moduleName_ = moduleName; }; + const std::string &GetModuleName() const + { + return moduleName_; + }; uint32_t MergeResourceItem(const std::map> &resourceInfos); bool ScaleIcons(const std::string &output, const std::map> &iconMap); void SetScanHap(bool state); diff --git a/include/resource_data.h b/include/resource_data.h index 61f56f3..490cc12 100644 --- a/include/resource_data.h +++ b/include/resource_data.h @@ -49,7 +49,7 @@ const static std::string SOLUTIONS_ARROW = "> "; const static std::string LONG_PATH_HEAD = "\\\\?\\"; const static int32_t VERSION_MAX_LEN = 128; const static int32_t INT_TO_BYTES = sizeof(uint32_t); -static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 5.1.0.005" }; +static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 5.1.0.006" }; const static int32_t TAG_LEN = 4; constexpr static int DEFAULT_POOL_SIZE = 8; static std::set g_resourceSet; diff --git a/src/id_defined_parser.cpp b/src/id_defined_parser.cpp index 381b639..28a0116 100755 --- a/src/id_defined_parser.cpp +++ b/src/id_defined_parser.cpp @@ -15,6 +15,7 @@ #include "id_defined_parser.h" #include "file_entry.h" +#include "file_manager.h" #include "resource_util.h" namespace OHOS { @@ -57,7 +58,8 @@ uint32_t IdDefinedParser::Init() } } //SystemResource.hap only defined by base/element/id_defined.json - if (isSys) { + string moduleName = FileManager::GetInstance().GetModuleName(); + if (isSys && moduleName == "entry") { return RESTOOL_SUCCESS; } if (!idDefinedInput.empty() && ResourceUtil::FileExist(idDefinedInput)) { diff --git a/src/resource_pack.cpp b/src/resource_pack.cpp index 18ca72a..92a4716 100644 --- a/src/resource_pack.cpp +++ b/src/resource_pack.cpp @@ -101,6 +101,7 @@ uint32_t ResourcePack::InitModule() } moduleName_ = configJson_.GetModuleName(); + FileManager::GetInstance().SetModuleName(moduleName_); vector moduleNames = packageParser_.GetModuleNames(); IdWorker &idWorker = IdWorker::GetInstance(); int64_t startId = static_cast(packageParser_.GetStartId());