From eb8ccdac5da814ba98fddf60092ee4b8eaf8b18e Mon Sep 17 00:00:00 2001 From: LongerJokies Date: Wed, 10 Dec 2025 12:13:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86=E6=96=B0?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=94=AF=E6=8C=81OH=E5=B7=A5=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: LongerJokies --- include/resource_data.h | 4 ++-- src/config_parser.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/resource_data.h b/include/resource_data.h index 024a469..c33ac69 100644 --- a/include/resource_data.h +++ b/include/resource_data.h @@ -50,13 +50,13 @@ const static std::string LONG_PATH_HEAD = "\\\\?\\"; const static int32_t VERSION_MAX_LEN = 128; static const std::string RESTOOL_NAME = "Restool"; static const std::string RESTOOLV2_NAME = "RestoolV2"; -static const std::string RESTOOL_VERSION = { " 6.1.0.001" }; +static const std::string RESTOOL_VERSION = { " 6.1.0.002" }; const static int32_t TAG_LEN = 4; 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 = 20; const static int MIN_SUPPORT_TS_HEADER_API_VERSION = 22; const static int API_VERSION_DIVISOR = 1000; diff --git a/src/config_parser.cpp b/src/config_parser.cpp index b43f4b8..9ab4e76 100644 --- a/src/config_parser.cpp +++ b/src/config_parser.cpp @@ -86,8 +86,11 @@ uint32_t ConfigParser::Init() cJSON *appNode = cJSON_GetObjectItem(root_, "app"); if (appNode && cJSON_IsObject(appNode)) { cJSON *minAPIVersionNode = cJSON_GetObjectItem(appNode, "minAPIVersion"); - int version = minAPIVersionNode ? minAPIVersionNode->valueint : 0; - if (version >= MIN_SUPPORT_NEW_MODULE_API_VERSION) { + int version = 0; + if (minAPIVersionNode && cJSON_IsNumber(minAPIVersionNode)) { + version = minAPIVersionNode->valueint; + } + if (version % API_VERSION_DIVISOR >= MIN_SUPPORT_NEW_MODULE_API_VERSION) { newModule_ = true; } if (version % API_VERSION_DIVISOR >= MIN_SUPPORT_TS_HEADER_API_VERSION) {