From fd5304a0a16446c8ab51c9930a7ffaa2451ebe05 Mon Sep 17 00:00:00 2001 From: HanSY Date: Mon, 16 Jun 2025 10:11:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=93=9D=E5=8C=BA=E7=BC=96=E8=AF=91=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=AE=A1=E7=90=86=E6=96=B0=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: HanSY --- include/resource_data.h | 2 +- include/resource_table.h | 3 ++- src/resource_table.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/resource_data.h b/include/resource_data.h index 1be5482..2822ca8 100644 --- a/include/resource_data.h +++ b/include/resource_data.h @@ -55,7 +55,7 @@ constexpr static int DEFAULT_POOL_SIZE = 8; static std::set g_resourceSet; static std::set g_hapResourceSet; const static int8_t INVALID_ID = -1; -const static int MIN_SUPPORT_NEW_MODULE_API_VERSION = 60000020; +const static int MIN_SUPPORT_NEW_MODULE_API_VERSION = 50101017; enum class IgnoreType { IGNORE_FILE, diff --git a/include/resource_table.h b/include/resource_table.h index 2fb3e0c..eb8d2c8 100644 --- a/include/resource_table.h +++ b/include/resource_table.h @@ -17,6 +17,7 @@ #define OHOS_RESTOOL_RESOURCE_TABLE_H #include +#include #include #include #include @@ -115,7 +116,7 @@ private: uint32_t resId = 0; uint32_t length = 0; uint32_t valueCount = 0; - std::unordered_map dataOffset; // + std::map dataOffset; // }; struct DataHeader { diff --git a/src/resource_table.cpp b/src/resource_table.cpp index 55073f2..ff96b81 100644 --- a/src/resource_table.cpp +++ b/src/resource_table.cpp @@ -335,7 +335,7 @@ void ResourceTable::PrepareResIndex(IdSetHeader &idSetHeader, const TableData &t ResIndex resIndex; resIndex.resId = tableData.id; - resIndex.name = tableData.resourceItem.GetName(); + resIndex.name = ResourceUtil::GetIdName(tableData.resourceItem.GetName(),resType); resIndex.length = resIndex.name.length(); idSetHeader.resTypes[resType].resIndexs[tableData.id] = resIndex; idSetHeader.resTypes[resType].length += ResIndex::RES_INDEX_LEN + resIndex.length; -- Gitee