资源管理新模型支持OH工程

Signed-off-by: LongerJokies <hansiyuan1@huawei.com>
This commit is contained in:
LongerJokies
2025-12-10 12:13:41 +08:00
parent d60b7e9151
commit eb8ccdac5d
2 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -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<std::string> g_resourceSet;
static std::set<std::string> 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;
+5 -2
View File
@@ -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) {