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) {