From e4d3851227b697317d656686a9446a3f6cdfb2f8 Mon Sep 17 00:00:00 2001 From: yangshx Date: Mon, 29 Jul 2024 19:19:46 +0800 Subject: [PATCH 01/57] add btproxy syscap define Signed-off-by: yangshx --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index d1675f6..93db749 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -354,6 +354,7 @@ typedef enum SystemCapabilityNum { ABILITY_APPEXTENSION_PHOTOEDITOREXTENSION, HIVIEWDFX_HICOLLIE, BUNDLEMANAGER_APPDOMAINVERIFY, + COMMUNICATION_NETMANAGER_BTPROXY, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -691,6 +692,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Customization.CustomConfig", CUSTOMIZATION_CUSTOMCONFIG}, {"SystemCapability.Ability.AppExtension.PhotoEditorExtension", ABILITY_APPEXTENSION_PHOTOEDITOREXTENSION}, {"SystemCapability.BundleManager.AppDomainVerify", BUNDLEMANAGER_APPDOMAINVERIFY}, + {"SystemCapability.Communication.NetManager.Btproxy", COMMUNICATION_NETMANAGER_BTPROXY}, }; #ifdef __cplusplus -- Gitee From 55657220adad87d4e20a304d96aa89658d97fa7b Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Sat, 3 Aug 2024 09:28:38 +0800 Subject: [PATCH 02/57] =?UTF-8?q?#IAHKVH=20=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=9C=89=E7=AC=A6=E5=8F=B7?= =?UTF-8?q?=E6=95=B4=E6=95=B0=E8=BF=90=E7=AE=97=E4=B8=8D=E6=BA=A2=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- src/create_pcid.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 4972ac9..0549f05 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -358,7 +358,7 @@ static int32_t GetPriSyscapResult(cJSON *capVectorPtr, int32_t ret) return ret; } -int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, size_t contextBufLen) +int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, uint32_t contextBufLen) { cJSON *capVectorPtr = cJSON_CreateArray(); if (capVectorPtr == NULL) { @@ -366,11 +366,6 @@ int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, size_t contextBufL return -1; } - if (contextBufLen > UINT32_MAX) { - PRINT_ERR("the data privateSyscapLen is out of scope."); - return GetPriSyscapResult(capVectorPtr, -1); - } - int32_t privateSyscapLen = (int32_t)(contextBufLen - sizeof(PCIDMain) - 1); if (privateSyscapLen < 0 || privateSyscapLen > INT32_MAX) { PRINT_ERR("parse private syscap failed."); -- Gitee From e4b288b528f4a9922a9a0713725dc6f1662b6706 Mon Sep 17 00:00:00 2001 From: markYao Date: Tue, 6 Aug 2024 12:39:13 +0800 Subject: [PATCH 03/57] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=96=B0=E5=A2=9Esyscap,=20"SystemCapability.Notification.Noti?= =?UTF-8?q?ficationSettings"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: markYao --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 93db749..8b0b6c9 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -355,6 +355,7 @@ typedef enum SystemCapabilityNum { HIVIEWDFX_HICOLLIE, BUNDLEMANAGER_APPDOMAINVERIFY, COMMUNICATION_NETMANAGER_BTPROXY, + NOTIFICATION_NOTIFICATIONSETTINGS, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -693,6 +694,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Ability.AppExtension.PhotoEditorExtension", ABILITY_APPEXTENSION_PHOTOEDITOREXTENSION}, {"SystemCapability.BundleManager.AppDomainVerify", BUNDLEMANAGER_APPDOMAINVERIFY}, {"SystemCapability.Communication.NetManager.Btproxy", COMMUNICATION_NETMANAGER_BTPROXY}, + {"SystemCapability.Notification.NotificationSettings", NOTIFICATION_NOTIFICATIONSETTINGS}, }; #ifdef __cplusplus -- Gitee From 697cc6e13eb6dd85948039927991d18c62c72919 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Mon, 5 Aug 2024 22:48:19 +0800 Subject: [PATCH 04/57] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- BUILD.gn | 3 ++ interfaces/inner_api/syscap_interface.c | 12 ++++++- src/common_method.c | 24 +++++++++++++ src/common_method.h | 23 ++++++++++++ src/context_tool.c | 6 ++-- src/create_pcid.c | 47 ++++++++++++++----------- src/syscap_tool.c | 29 +++++++++++---- test/unittest/common/BUILD.gn | 2 ++ 8 files changed, 116 insertions(+), 30 deletions(-) create mode 100644 src/common_method.c create mode 100644 src/common_method.h diff --git a/BUILD.gn b/BUILD.gn index 870dbae..c7becf1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -29,6 +29,7 @@ sources_platform_common = [ "./src/create_pcid.c", "./src/endian_internal.c", "./src/context_tool.c", + "./src/common_method.c", ] ohos_executable("syscap_tool_bin") { @@ -97,6 +98,7 @@ if (defined(ohos_lite)) { "./src/context_tool.c", "./src/endian_internal.c", "./src/syscap_tool.c", + "./src/common_method.c", ] deps += [ @@ -121,6 +123,7 @@ if (defined(ohos_lite)) { "./src/context_tool.c", "./src/endian_internal.c", "./src/syscap_tool.c", + "./src/common_method.c", ] external_deps = [ "bounds_checking_function:libsec_static", diff --git a/interfaces/inner_api/syscap_interface.c b/interfaces/inner_api/syscap_interface.c index 017eb5b..0580c69 100644 --- a/interfaces/inner_api/syscap_interface.c +++ b/interfaces/inner_api/syscap_interface.c @@ -26,6 +26,7 @@ #include "endian_internal.h" #include "syscap_interface.h" #include "context_tool.h" +#include "common_method.h" #ifdef SYSCAP_DEFINE_EXTERN_ENABLE #include "syscap_define_custom.h" @@ -292,6 +293,10 @@ static int32_t ParseRpcidToJson(char *input, uint32_t inputLen, cJSON *rpcidJson char *sysCapBegin = input + sizeof(RPCIDHead) + sizeof(uint32_t); RPCIDHead *rpcidHeader = (RPCIDHead *)input; cJSON *sysCapJson = cJSON_CreateArray(); + if (sysCapJson == NULL) { + PRINT_ERR("Get sysCapJson failed, sysCapJson is empty.\n"); + ret = -1; + } for (i = 0; i < sysCapCount; i++) { char *temp = sysCapBegin + i * SINGLE_FEAT_LEN; if (strlen(temp) >= SINGLE_FEAT_LEN) { @@ -443,7 +448,7 @@ static char *FreeAfterDecodeRpcidToString(struct FreeAfterDecodeRpcidInfo freeAf { switch (type) { case FREE_MALLOC_PRISYSCAP_AFTER_DECODE_RPCID: - free(freeAfterDecodeRpcidInfo.priSyscap); + SafeFree(freeAfterDecodeRpcidInfo.priSyscap); free(freeAfterDecodeRpcidInfo.osSysCapIndex); cJSON_Delete(freeAfterDecodeRpcidInfo.sysCapDefine); cJSON_Delete(freeAfterDecodeRpcidInfo.rpcidRoot); @@ -495,6 +500,11 @@ char *DecodeRpcidToStringFormat(const char *inputFile) // parse rpcid to json freeAfterDecodeRpcidInfo.rpcidRoot = cJSON_CreateObject(); + if (freeAfterDecodeRpcidInfo.rpcidRoot == NULL) { + PRINT_ERR("Failed to create cJSON object for rpcidRoot\n"); + return FreeAfterDecodeRpcidToString(freeAfterDecodeRpcidInfo, FREE_CONTEXT_OUT_AFTER_DECODE_RPCID, outBuffer); + } + if (ParseRpcidToJson(freeAfterDecodeRpcidInfo.contextBuffer, bufferLen, freeAfterDecodeRpcidInfo.rpcidRoot)) { PRINT_ERR("Prase rpcid to json failed. Input file: %s\n", inputFile); return FreeAfterDecodeRpcidToString(freeAfterDecodeRpcidInfo, FREE_RPCID_ROOT_AFTER_DECODE_RPCID, outBuffer); diff --git a/src/common_method.c b/src/common_method.c new file mode 100644 index 0000000..cf7880f --- /dev/null +++ b/src/common_method.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "common_method.h" +#include + +void SafeFree(char *pointer) +{ + if ((pointer) != NULL) { + free(pointer); + } +} diff --git a/src/common_method.h b/src/common_method.h new file mode 100644 index 0000000..a9030bb --- /dev/null +++ b/src/common_method.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMON_METHOD_H +#define COMMON_METHOD_H + +#include + +void SafeFree(char *pointer); + +#endif \ No newline at end of file diff --git a/src/context_tool.c b/src/context_tool.c index 1440a6b..ea5359f 100644 --- a/src/context_tool.c +++ b/src/context_tool.c @@ -155,23 +155,25 @@ int32_t CheckRpcidFormat(const char *inputFile, char **buffer, uint32_t *len) } if (bufferLen < (2 * sizeof(uint32_t))) { // 2, header of rpcid.sc PRINT_ERR("Parse file failed(format is invalid), input file : %s\n", inputFile); - free(contextBuffer); + FreeContextBuffer(contextBuffer); return -1; } rpcidHeader = (RPCIDHead *)contextBuffer; if (rpcidHeader->apiVersionType != 1) { PRINT_ERR("Parse file failed(apiVersionType != 1), input file : %s\n", inputFile); - free(contextBuffer); + FreeContextBuffer(contextBuffer); return -1; } sysCaptype = NtohsInter(*(uint16_t *)(rpcidHeader + 1)); if (sysCaptype != 2) { // 2, app syscap type PRINT_ERR("Parse file failed(sysCaptype != 2), input file : %s\n", inputFile); + FreeContextBuffer(contextBuffer); return -1; } sysCapLength = NtohsInter(*(uint16_t *)((char *)(rpcidHeader + 1) + sizeof(uint16_t))); if (bufferLen < sizeof(RPCIDHead) + sizeof(uint32_t) + sysCapLength) { PRINT_ERR("Parse file failed(SysCap length exceeded), input file : %s\n", inputFile); + FreeContextBuffer(contextBuffer); return -1; } diff --git a/src/create_pcid.c b/src/create_pcid.c index 4972ac9..5a73c71 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -25,6 +25,7 @@ #include "endian_internal.h" #include "create_pcid.h" #include "context_tool.h" +#include "common_method.h" #ifdef SYSCAP_DEFINE_EXTERN_ENABLE #include "syscap_define_custom.h" @@ -58,7 +59,6 @@ struct FreeEncodePcidInfo { char *outDirPathFinal; }; - struct FreeDecodePcidJsonInfo { char *strJson; char *contextBuffer; @@ -271,6 +271,7 @@ int32_t CreatePCID(char *inputFile, char *outDirPath) cJSON *jsonOsSyscapObj = cJSON_GetObjectItem(jsonSyscapObj, "os"); cJSON *jsonPriSyscapObj = cJSON_GetObjectItem(jsonSyscapObj, "private"); + ret = GetOsAndPriSyscapSize(jsonOsSyscapObj, jsonPriSyscapObj, &osCapSize, &privateCapSize); if (ret != 0) { return PreFreeAfterCreatePCID(NULL, allOsSyscapObj, jsonRootObj, contextBuffer, 0); @@ -526,15 +527,18 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) return FreeAfterDecodePCID(freePcidJsonInfo, FREE_DECODE_PCID_ROOT_OUT, ret); } - freePcidJsonInfo.sysCapObj = NULL; // avoid being released repeatedly. + freePcidJsonInfo.strJson = cJSON_Print(freePcidJsonInfo.jsonRootObj); + if (freePcidJsonInfo.strJson == NULL) { + PRINT_ERR("cJSON_Print failed to generate JSON string\n"); + return FreeAfterDecodePCID(freePcidJsonInfo, FREE_DECODE_PCID_ROOT_OUT, -1); + } - char *strJson = cJSON_Print(freePcidJsonInfo.jsonRootObj); const char outputFileName[] = "pcid.json"; - ret = ConvertedContextSaveAsFile(outDirPath, outputFileName, strJson, strlen(strJson)); + ret = ConvertedContextSaveAsFile(outDirPath, outputFileName, freePcidJsonInfo.strJson, + strlen(freePcidJsonInfo.strJson)); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outDirPath:%s, filename:%s\n", outDirPath, outputFileName); } - free(strJson); return FreeAfterDecodePCID(freePcidJsonInfo, FREE_DECODE_PCID_CONVERT_OUT, ret); } @@ -665,7 +669,6 @@ static int32_t AddPriSyscapToJsonObj(char *priSyscapString, uint32_t priSyscapSt cJSON *sysCapArray = cJSON_CreateArray(); if (sysCapArray == NULL) { PRINT_ERR("Create cJSON array failed.\n"); - free(sysCapArray); return -1; } if (priSyscapStringLen == 0) { @@ -701,7 +704,6 @@ static int32_t GetSyscapStr(char *input, char const *priSyscapStr, uint32_t* osS uint32_t fileContextLen; if (GetFileContext(input, &ctx, (uint32_t *)&fileContextLen) != 0) { PRINT_ERR("GetFileContext failed, input file : %s\n", input); - free(ctx); return -1; } if (ParseStringSyscap(ctx, osSyscap, OS_SYSCAP_NUM, pcidHeader, PCID_HEADER) != 0) { @@ -719,6 +721,7 @@ int32_t DecodeStringPCIDToJson(char *input, char *outDirPath) uint32_t osSyscap[OS_SYSCAP_NUM] = {0}; uint32_t pcidHeader[PCID_HEADER]; char *priSyscapStr = NULL; + char *jsonBuffer = NULL; ret = GetSyscapStr(input, priSyscapStr, osSyscap, pcidHeader); if (ret == -1) { return ret; @@ -727,40 +730,44 @@ int32_t DecodeStringPCIDToJson(char *input, char *outDirPath) // add to json object cJSON *sysCapObj = cJSON_CreateObject(); cJSON *rootObj = cJSON_CreateObject(); + if (sysCapObj == NULL || rootObj == NULL) { + PRINT_ERR("Failed to create cJSON objects.\n"); + goto FAILED; + } + if (!cJSON_AddItemToObject(rootObj, "syscap", sysCapObj)) { PRINT_ERR("Add syscap to json failed.\n"); - goto ADD_JSON_FAILED; + goto FAILED; } if (AddHeaderToJsonObj(pcidHeader, PCID_HEADER, rootObj) != 0) { PRINT_ERR("Add header to json object failed.\n"); - goto ADD_JSON_FAILED; + goto FAILED; } if (AddOsSyscapToJsonObj(osSyscap, OS_SYSCAP_NUM, sysCapObj) != 0) { PRINT_ERR("Add os syscap json object failed.\n"); - goto ADD_JSON_FAILED; + goto FAILED; } - if (AddPriSyscapToJsonObj(priSyscapStr, (uint32_t)strlen(priSyscapStr), sysCapObj) != 0) { + if (AddPriSyscapToJsonObj(priSyscapStr, (uint32_t) strlen(priSyscapStr), sysCapObj) != 0) { PRINT_ERR("Add private syscap json object failed.\n"); - goto ADD_JSON_FAILED; + goto FAILED; } // save as json file - char *jsonBuffer = cJSON_Print(rootObj); + jsonBuffer = cJSON_Print(rootObj); if (jsonBuffer == NULL) { PRINT_ERR("json buffer is null.\n"); - goto ADD_JSON_FAILED; + goto FAILED; } const char outputFileName[] = "pcid.json"; - if (ConvertedContextSaveAsFile(outDirPath, outputFileName, - jsonBuffer, strlen(jsonBuffer)) != 0) { + if (ConvertedContextSaveAsFile(outDirPath, outputFileName, jsonBuffer, strlen(jsonBuffer)) != 0) { PRINT_ERR("Save as json file failed.\n"); - goto SAVE_FAILED; + goto FAILED; } ret = 0; -SAVE_FAILED: - free(jsonBuffer); -ADD_JSON_FAILED: +FAILED: + SafeFree(jsonBuffer); + SafeFree(priSyscapStr); cJSON_Delete(sysCapObj); cJSON_Delete(rootObj); return ret; diff --git a/src/syscap_tool.c b/src/syscap_tool.c index b2ab4fd..93d3344 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -27,6 +27,7 @@ #include "create_pcid.h" #include "syscap_tool.h" #include "context_tool.h" +#include "common_method.h" #ifdef SYSCAP_DEFINE_EXTERN_ENABLE #include "syscap_define_custom.h" @@ -71,6 +72,14 @@ struct FreeAfterEncodeRpcidscInfo { int16_t flag; }; +static void FreePointerMemory(char *pcidContent, char *rpcidContent, char *pcidPriSyscap, char *rpcidPriSyscap) +{ + SafeFree(pcidContent); + SafeFree(rpcidPriSyscap); + SafeFree(rpcidContent); + SafeFree(pcidPriSyscap); +} + static int32_t FillOsCapLength(char *convertedBuffer, char *contextBuffer, struct JsonObjectSysCap gJsonObjectSysCap, uint32_t sysCapSize, int32_t ret) { @@ -204,6 +213,11 @@ static int32_t ParseRpcidToJson(char *input, uint32_t inputLen, cJSON *rpcidJson char *sysCapBegin = input + sizeof(RPCIDHead) + sizeof(uint32_t); RPCIDHead *rpcidHeader = (RPCIDHead *)input; cJSON *sysCapJson = cJSON_CreateArray(); + if (sysCapJson == NULL) { + PRINT_ERR("Failed to create sysCapJson array\n"); + return -1; + } + for (i = 0; i < sysCapCount; i++) { char *temp = sysCapBegin + i * SINGLE_FEAT_LEN; if (strlen(temp) >= SINGLE_FEAT_LEN || strlen(temp) == 0) { @@ -263,13 +277,16 @@ int32_t RPCIDDecode(char *inputFile, char *outputPath) // save to json file convertedBuffer = cJSON_Print(rpcidRoot); + if (convertedBuffer == NULL) { + PRINT_ERR("cJSON_Print failed to create JSON string\n"); + goto FREE_RPCID_ROOT; + } + ret = ConvertedContextSaveAsFile(outputPath, "rpcid.json", convertedBuffer, strlen(convertedBuffer)); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.json\n", outputPath); - free(convertedBuffer); goto FREE_RPCID_ROOT; } - free(convertedBuffer); FREE_RPCID_ROOT: cJSON_Delete(rpcidRoot); @@ -705,10 +722,7 @@ int32_t ComparePcidWithRpcidString(char *pcidFile, char *rpcidFile, uint32_t typ &rpcidPriSyscap, &rpcidPriSyscapLen); if (ret != 0) { PRINT_ERR("Separate syscap from string failed. ret = %d\n", ret); - free(pcidContent); - free(rpcidContent); - free(pcidPriSyscap); - free(rpcidPriSyscap); + FreePointerMemory(pcidContent, rpcidContent, pcidPriSyscap, rpcidPriSyscap); return -1; } @@ -720,5 +734,6 @@ int32_t ComparePcidWithRpcidString(char *pcidFile, char *rpcidFile, uint32_t typ } else { printf("Fail! The pcid does not meet the rpcid\n"); } + return 0; -} \ No newline at end of file +} diff --git a/test/unittest/common/BUILD.gn b/test/unittest/common/BUILD.gn index 668ac7d..2621342 100644 --- a/test/unittest/common/BUILD.gn +++ b/test/unittest/common/BUILD.gn @@ -41,6 +41,7 @@ if (defined(ohos_lite)) { "../../../src/create_pcid.c", "../../../src/endian_internal.c", "../../../src/syscap_tool.c", + "../../../src/common_method.c", "syscap_codec_test.cpp", ] @@ -82,6 +83,7 @@ if (defined(ohos_lite)) { "../../../src/create_pcid.c", "../../../src/endian_internal.c", "../../../src/syscap_tool.c", + "../../../src/common_method.c", "syscap_codec_test.cpp", ] -- Gitee From 33298c4c7442bc6504076ea1f4eae1c0f5f38963 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Wed, 7 Aug 2024 10:53:58 +0800 Subject: [PATCH 05/57] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/create_pcid.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 5a73c71..c2aa7e7 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -528,10 +528,6 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) } freePcidJsonInfo.strJson = cJSON_Print(freePcidJsonInfo.jsonRootObj); - if (freePcidJsonInfo.strJson == NULL) { - PRINT_ERR("cJSON_Print failed to generate JSON string\n"); - return FreeAfterDecodePCID(freePcidJsonInfo, FREE_DECODE_PCID_ROOT_OUT, -1); - } const char outputFileName[] = "pcid.json"; ret = ConvertedContextSaveAsFile(outDirPath, outputFileName, freePcidJsonInfo.strJson, -- Gitee From 34c4748e63b7f6f56cd97576c0cd7946c57246ef Mon Sep 17 00:00:00 2001 From: huchunlan1 Date: Thu, 8 Aug 2024 10:08:31 +0800 Subject: [PATCH 06/57] =?UTF-8?q?=E8=93=9D=E7=89=99=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E9=80=82=E9=85=8D=E5=BC=80=E5=8F=91=E8=80=85?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huchunlan1 --- include/codec_config/syscap_define.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 8b0b6c9..1b6db54 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -354,7 +354,7 @@ typedef enum SystemCapabilityNum { ABILITY_APPEXTENSION_PHOTOEDITOREXTENSION, HIVIEWDFX_HICOLLIE, BUNDLEMANAGER_APPDOMAINVERIFY, - COMMUNICATION_NETMANAGER_BTPROXY, + COMMUNICATION_NETMANAGER_BLUETOOTH, NOTIFICATION_NOTIFICATIONSETTINGS, // Add before here SYSCAP_BASIC_END = 500, @@ -693,7 +693,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Customization.CustomConfig", CUSTOMIZATION_CUSTOMCONFIG}, {"SystemCapability.Ability.AppExtension.PhotoEditorExtension", ABILITY_APPEXTENSION_PHOTOEDITOREXTENSION}, {"SystemCapability.BundleManager.AppDomainVerify", BUNDLEMANAGER_APPDOMAINVERIFY}, - {"SystemCapability.Communication.NetManager.Btproxy", COMMUNICATION_NETMANAGER_BTPROXY}, + {"SystemCapability.Communication.NetManager.Bluetooth", COMMUNICATION_NETMANAGER_BLUETOOTH}, {"SystemCapability.Notification.NotificationSettings", NOTIFICATION_NOTIFICATIONSETTINGS}, }; -- Gitee From 91d373c62c91b9b256ef603dfec8c33ce41b457d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E5=AD=A6=E8=88=9F?= Date: Thu, 8 Aug 2024 02:51:21 +0000 Subject: [PATCH 07/57] update src/create_pcid.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 严学舟 --- src/create_pcid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 0549f05..c346a43 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -358,7 +358,7 @@ static int32_t GetPriSyscapResult(cJSON *capVectorPtr, int32_t ret) return ret; } -int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, uint32_t contextBufLen) +int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, int32_t contextBufLen) { cJSON *capVectorPtr = cJSON_CreateArray(); if (capVectorPtr == NULL) { @@ -366,7 +366,7 @@ int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, uint32_t contextBu return -1; } - int32_t privateSyscapLen = (int32_t)(contextBufLen - sizeof(PCIDMain) - 1); + int32_t privateSyscapLen = contextBufLen - sizeof(PCIDMain) - 1; if (privateSyscapLen < 0 || privateSyscapLen > INT32_MAX) { PRINT_ERR("parse private syscap failed."); return GetPriSyscapResult(capVectorPtr, -1); -- Gitee From 4972a2abb56b028b59bfc1118f2d1925fed8aa87 Mon Sep 17 00:00:00 2001 From: xuedong Date: Thu, 8 Aug 2024 15:54:49 +0800 Subject: [PATCH 08/57] add VideoProcessingEngine capability Signed-off-by: xuedong --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 8b0b6c9..6730e72 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -356,6 +356,7 @@ typedef enum SystemCapabilityNum { BUNDLEMANAGER_APPDOMAINVERIFY, COMMUNICATION_NETMANAGER_BTPROXY, NOTIFICATION_NOTIFICATIONSETTINGS, + MULTIMEDIA_VIDEOPROCESSINGENGINE, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -695,6 +696,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.BundleManager.AppDomainVerify", BUNDLEMANAGER_APPDOMAINVERIFY}, {"SystemCapability.Communication.NetManager.Btproxy", COMMUNICATION_NETMANAGER_BTPROXY}, {"SystemCapability.Notification.NotificationSettings", NOTIFICATION_NOTIFICATIONSETTINGS}, + {"SystemCapability.Multimedia.VideoProcessingEngine", MULTIMEDIA_VIDEOPROCESSINGENGINE}, }; #ifdef __cplusplus -- Gitee From 5154aa66ae98171109ff3487683e2503b47ac1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E5=AD=A6=E8=88=9F?= Date: Thu, 8 Aug 2024 07:56:09 +0000 Subject: [PATCH 09/57] update src/create_pcid.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 严学舟 --- src/create_pcid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index c346a43..ad3755c 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -358,7 +358,7 @@ static int32_t GetPriSyscapResult(cJSON *capVectorPtr, int32_t ret) return ret; } -int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, int32_t contextBufLen) +static int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, int32_t contextBufLen) { cJSON *capVectorPtr = cJSON_CreateArray(); if (capVectorPtr == NULL) { -- Gitee From 439ca5930226205bf43d70957c8ef066e0160e0b Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Fri, 9 Aug 2024 17:26:47 +0800 Subject: [PATCH 10/57] =?UTF-8?q?issue:#IAJ1T8=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=94=A8=E4=BE=8Bdoublefree=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- src/create_pcid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/create_pcid.c b/src/create_pcid.c index 9a249e3..36f0f20 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -522,6 +522,8 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) return FreeAfterDecodePCID(freePcidJsonInfo, FREE_DECODE_PCID_ROOT_OUT, ret); } + freePcidJsonInfo.sysCapObj = NULL; // avoid being released repeatedly. + freePcidJsonInfo.strJson = cJSON_Print(freePcidJsonInfo.jsonRootObj); const char outputFileName[] = "pcid.json"; -- Gitee From 323c4df5e17234efe50a0c5e262a5d01b6e3c1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E5=AD=A6=E8=88=9F?= Date: Sat, 10 Aug 2024 02:17:18 +0000 Subject: [PATCH 11/57] update src/create_pcid.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 严学舟 --- src/create_pcid.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 36f0f20..3c0db87 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -450,7 +450,6 @@ static int32_t FreeAfterDecodePCID(struct FreeDecodePcidJsonInfo freePcidJsonInf case FREE_DECODE_PCID_CONVERT_OUT: free(freePcidJsonInfo.strJson); cJSON_Delete(freePcidJsonInfo.jsonRootObj); - cJSON_Delete(freePcidJsonInfo.sysCapObj); FreeContextBuffer(freePcidJsonInfo.contextBuffer); break; case FREE_DECODE_PCID_ROOT_OUT: @@ -463,6 +462,7 @@ static int32_t FreeAfterDecodePCID(struct FreeDecodePcidJsonInfo freePcidJsonInf FreeContextBuffer(freePcidJsonInfo.contextBuffer); break; case FREE_DECODE_PCID_CONTEXT_OUT: + cJSON_Delete(freePcidJsonInfo.sysCapObj); default: FreeContextBuffer(freePcidJsonInfo.contextBuffer); } @@ -522,8 +522,6 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) return FreeAfterDecodePCID(freePcidJsonInfo, FREE_DECODE_PCID_ROOT_OUT, ret); } - freePcidJsonInfo.sysCapObj = NULL; // avoid being released repeatedly. - freePcidJsonInfo.strJson = cJSON_Print(freePcidJsonInfo.jsonRootObj); const char outputFileName[] = "pcid.json"; -- Gitee From 4a20b4bd032f920246649a082cf2bdf019d9112d Mon Sep 17 00:00:00 2001 From: lanming Date: Wed, 14 Aug 2024 16:38:58 +0800 Subject: [PATCH 12/57] =?UTF-8?q?=E5=8A=A0=E8=A7=A3=E5=AF=86=E7=AE=97?= =?UTF-8?q?=E6=B3=95=E5=BA=93=E6=A1=86=E6=9E=B6=E6=96=B0=E5=A2=9Esyscap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lanming --- include/codec_config/syscap_define.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index adab79a..ce2e07d 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -357,6 +357,16 @@ typedef enum SystemCapabilityNum { COMMUNICATION_NETMANAGER_BLUETOOTH, NOTIFICATION_NOTIFICATIONSETTINGS, MULTIMEDIA_VIDEOPROCESSINGENGINE, + SECURITY_CRYPTOFRAMEWORK_KEY, + SECURITY_CRYPTOFRAMEWORK_KEY_SYMKEY, + SECURITY_CRYPTOFRAMEWORK_KEY_ASYMKEY, + SECURITY_CRYPTOFRAMEWORK_SIGNATURE, + SECURITY_CRYPTOFRAMEWORK_CIPHER, + SECURITY_CRYPTOFRAMEWORK_KEYAGREEMENT, + SECURITY_CRYPTOFRAMEWORK_MESSAGEDIGEST, + SECURITY_CRYPTOFRAMEWORK_MAC, + SECURITY_CRYPTOFRAMEWORK_KDF, + SECURITY_CRYPTOFRAMEWORK_RAND, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -697,6 +707,16 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Communication.NetManager.Bluetooth", COMMUNICATION_NETMANAGER_BLUETOOTH}, {"SystemCapability.Notification.NotificationSettings", NOTIFICATION_NOTIFICATIONSETTINGS}, {"SystemCapability.Multimedia.VideoProcessingEngine", MULTIMEDIA_VIDEOPROCESSINGENGINE}, + {"SystemCapability.Security.CryptoFramework.Key", SECURITY_CRYPTOFRAMEWORK_KEY}, + {"SystemCapability.Security.CryptoFramework.Key.SymKey", SECURITY_CRYPTOFRAMEWORK_KEY_SYMKEY}, + {"SystemCapability.Security.CryptoFramework.Key.AsymKey", SECURITY_CRYPTOFRAMEWORK_KEY_ASYMKEY}, + {"SystemCapability.Security.CryptoFramework.Signature", SECURITY_CRYPTOFRAMEWORK_SIGNATURE}, + {"SystemCapability.Security.CryptoFramework.Cipher", SECURITY_CRYPTOFRAMEWORK_CIPHER}, + {"SystemCapability.Security.CryptoFramework.KeyAgreement", SECURITY_CRYPTOFRAMEWORK_KEYAGREEMENT}, + {"SystemCapability.Security.CryptoFramework.MessageDigest", SECURITY_CRYPTOFRAMEWORK_MESSAGEDIGEST}, + {"SystemCapability.Security.CryptoFramework.Mac", SECURITY_CRYPTOFRAMEWORK_MAC}, + {"SystemCapability.Security.CryptoFramework.Kdf", SECURITY_CRYPTOFRAMEWORK_KDF}, + {"SystemCapability.Security.CryptoFramework.Rand", SECURITY_CRYPTOFRAMEWORK_RAND}, }; #ifdef __cplusplus -- Gitee From 316da736801bcc228125a382d40413b723c73f8d Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Wed, 14 Aug 2024 16:56:22 +0800 Subject: [PATCH 13/57] =?UTF-8?q?issue:#IAK0Y7=20=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- src/create_pcid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/create_pcid.c b/src/create_pcid.c index 3c0db87..c2c429b 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -463,6 +463,8 @@ static int32_t FreeAfterDecodePCID(struct FreeDecodePcidJsonInfo freePcidJsonInf break; case FREE_DECODE_PCID_CONTEXT_OUT: cJSON_Delete(freePcidJsonInfo.sysCapObj); + FreeContextBuffer(freePcidJsonInfo.contextBuffer); + break; default: FreeContextBuffer(freePcidJsonInfo.contextBuffer); } -- Gitee From b98daccedbdd64bf82dd2d9deecc4a4046976b47 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Thu, 15 Aug 2024 20:36:23 +0800 Subject: [PATCH 14/57] =?UTF-8?q?=E9=87=8A=E6=94=BE=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=86=85=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/create_pcid.c | 2 +- src/syscap_tool.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index c2c429b..d7000b8 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -448,7 +448,7 @@ static int32_t FreeAfterDecodePCID(struct FreeDecodePcidJsonInfo freePcidJsonInf { switch (type) { case FREE_DECODE_PCID_CONVERT_OUT: - free(freePcidJsonInfo.strJson); + cJSON_free(freePcidJsonInfo.strJson); cJSON_Delete(freePcidJsonInfo.jsonRootObj); FreeContextBuffer(freePcidJsonInfo.contextBuffer); break; diff --git a/src/syscap_tool.c b/src/syscap_tool.c index 93d3344..4ff330a 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -285,9 +285,10 @@ int32_t RPCIDDecode(char *inputFile, char *outputPath) ret = ConvertedContextSaveAsFile(outputPath, "rpcid.json", convertedBuffer, strlen(convertedBuffer)); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.json\n", outputPath); + cJSON_free(convertedBuffer); goto FREE_RPCID_ROOT; } - + cJSON_free(convertedBuffer); FREE_RPCID_ROOT: cJSON_Delete(rpcidRoot); FREE_CONTEXT_OUT: -- Gitee From 2447b25c218cd96bf905ec8bed8c051cfd3d52ad Mon Sep 17 00:00:00 2001 From: luming Date: Mon, 19 Aug 2024 11:42:40 +0800 Subject: [PATCH 15/57] [Bug] Using `cJSON_free` to free memory allocated by `cJSON_Print` issueNo: https://gitee.com/openharmony/developtools_syscap_codec/issues/IAKW57 Signed-off-by: luming --- interfaces/inner_api/syscap_interface.h | 4 ++-- src/create_pcid.c | 4 +++- tools/syscap_collector.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/interfaces/inner_api/syscap_interface.h b/interfaces/inner_api/syscap_interface.h index a26bfae..f0c4bd5 100644 --- a/interfaces/inner_api/syscap_interface.h +++ b/interfaces/inner_api/syscap_interface.h @@ -26,7 +26,7 @@ #define PCID_MAIN_BYTES 128 #define PCID_MAIN_INTS 32 -#define E_EORROR (-1) +#define E_ERROR (-1) #define E_OK 0 #define E_APIVERSION 1 #define E_SYSCAP 2 @@ -54,7 +54,7 @@ char *DecodeRpcidToStringFormat(const char *inputFile); * rpcidString, input string format rpcid. * result, output comparison results. * retval: - * E_EORROR, compare failed. + * E_ERROR, compare failed. * E_OK, compare successful and meet the requirements. * E_APIVERSION, compare successful but api version too low. * E_SYSCAP, compare successful but missing some syscaps. diff --git a/src/create_pcid.c b/src/create_pcid.c index d7000b8..f9d6af3 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -759,7 +759,9 @@ int32_t DecodeStringPCIDToJson(char *input, char *outDirPath) ret = 0; FAILED: - SafeFree(jsonBuffer); + if (jsonBuffer != NULL) { + cJSON_free(jsonBuffer) + } SafeFree(priSyscapStr); cJSON_Delete(sysCapObj); cJSON_Delete(rootObj); diff --git a/tools/syscap_collector.py b/tools/syscap_collector.py index 18ee661..74c0f96 100755 --- a/tools/syscap_collector.py +++ b/tools/syscap_collector.py @@ -208,7 +208,7 @@ def _check_path_prefix(paths): def traversal_files(subsystem_path, _files): for item in os.scandir(subsystem_path): - if is_symlik(item.path): + if is_symlink(item.path): continue elif item.is_file() and item.name == 'ohos.build': _files.append(item.path) @@ -230,7 +230,7 @@ def get_file_type(file_path): return 'unknown' -def is_symlik(file_path): +def is_symlink(file_path): file_type = get_file_type(file_path) if file_type == 'symlink': link_target = os.readlink(file_path) -- Gitee From 49c75b54389722bb5d4a1c76b3d616cf93df0d5f Mon Sep 17 00:00:00 2001 From: Luming Date: Mon, 19 Aug 2024 15:07:07 +0000 Subject: [PATCH 16/57] update src/create_pcid.c. Signed-off-by: Luming --- src/create_pcid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index f9d6af3..5db820a 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -760,7 +760,7 @@ int32_t DecodeStringPCIDToJson(char *input, char *outDirPath) FAILED: if (jsonBuffer != NULL) { - cJSON_free(jsonBuffer) + cJSON_free(jsonBuffer); } SafeFree(priSyscapStr); cJSON_Delete(sysCapObj); -- Gitee From 70470274b99e2157c8cd68e40e7075382d995657 Mon Sep 17 00:00:00 2001 From: Luming Date: Tue, 20 Aug 2024 01:51:54 +0000 Subject: [PATCH 17/57] update src/create_pcid.c. Signed-off-by: Luming --- src/create_pcid.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 5db820a..7b99567 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -759,9 +759,7 @@ int32_t DecodeStringPCIDToJson(char *input, char *outDirPath) ret = 0; FAILED: - if (jsonBuffer != NULL) { - cJSON_free(jsonBuffer); - } + cJSON_free(jsonBuffer); SafeFree(priSyscapStr); cJSON_Delete(sysCapObj); cJSON_Delete(rootObj); -- Gitee From aac6053c25e205b22644663cc5194e35bc3ec50c Mon Sep 17 00:00:00 2001 From: huchunlan1 Date: Tue, 3 Sep 2024 12:04:37 +0800 Subject: [PATCH 18/57] =?UTF-8?q?=E8=93=9D=E7=89=99=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E7=BD=91=E7=BB=9Cdeveloptools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huchunlan1 --- include/codec_config/syscap_define.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index ce2e07d..9ecd283 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -354,7 +354,7 @@ typedef enum SystemCapabilityNum { ABILITY_APPEXTENSION_PHOTOEDITOREXTENSION, HIVIEWDFX_HICOLLIE, BUNDLEMANAGER_APPDOMAINVERIFY, - COMMUNICATION_NETMANAGER_BLUETOOTH, + COMMUNICATION_NETMANAGER_WATCH_DISTRIBUTED_NET, NOTIFICATION_NOTIFICATIONSETTINGS, MULTIMEDIA_VIDEOPROCESSINGENGINE, SECURITY_CRYPTOFRAMEWORK_KEY, @@ -704,7 +704,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Customization.CustomConfig", CUSTOMIZATION_CUSTOMCONFIG}, {"SystemCapability.Ability.AppExtension.PhotoEditorExtension", ABILITY_APPEXTENSION_PHOTOEDITOREXTENSION}, {"SystemCapability.BundleManager.AppDomainVerify", BUNDLEMANAGER_APPDOMAINVERIFY}, - {"SystemCapability.Communication.NetManager.Bluetooth", COMMUNICATION_NETMANAGER_BLUETOOTH}, + {"SystemCapability.Communication.NetManager.WatchDistributedNet", COMMUNICATION_NETMANAGER_WATCH_DISTRIBUTED_NET}, {"SystemCapability.Notification.NotificationSettings", NOTIFICATION_NOTIFICATIONSETTINGS}, {"SystemCapability.Multimedia.VideoProcessingEngine", MULTIMEDIA_VIDEOPROCESSINGENGINE}, {"SystemCapability.Security.CryptoFramework.Key", SECURITY_CRYPTOFRAMEWORK_KEY}, -- Gitee From cc56218d146fc208c102d21759eca87f183a23bf Mon Sep 17 00:00:00 2001 From: huchunlan1 Date: Wed, 4 Sep 2024 11:58:12 +0800 Subject: [PATCH 19/57] =?UTF-8?q?=E8=93=9D=E7=89=99=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huchunlan1 --- include/codec_config/syscap_define.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 9ecd283..f17b288 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -354,7 +354,6 @@ typedef enum SystemCapabilityNum { ABILITY_APPEXTENSION_PHOTOEDITOREXTENSION, HIVIEWDFX_HICOLLIE, BUNDLEMANAGER_APPDOMAINVERIFY, - COMMUNICATION_NETMANAGER_WATCH_DISTRIBUTED_NET, NOTIFICATION_NOTIFICATIONSETTINGS, MULTIMEDIA_VIDEOPROCESSINGENGINE, SECURITY_CRYPTOFRAMEWORK_KEY, @@ -367,6 +366,7 @@ typedef enum SystemCapabilityNum { SECURITY_CRYPTOFRAMEWORK_MAC, SECURITY_CRYPTOFRAMEWORK_KDF, SECURITY_CRYPTOFRAMEWORK_RAND, + COMMUNICATION_NETMANAGER_SA_WEARABLE_DISTRIBUTED_NET_SERVICE, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -704,7 +704,6 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Customization.CustomConfig", CUSTOMIZATION_CUSTOMCONFIG}, {"SystemCapability.Ability.AppExtension.PhotoEditorExtension", ABILITY_APPEXTENSION_PHOTOEDITOREXTENSION}, {"SystemCapability.BundleManager.AppDomainVerify", BUNDLEMANAGER_APPDOMAINVERIFY}, - {"SystemCapability.Communication.NetManager.WatchDistributedNet", COMMUNICATION_NETMANAGER_WATCH_DISTRIBUTED_NET}, {"SystemCapability.Notification.NotificationSettings", NOTIFICATION_NOTIFICATIONSETTINGS}, {"SystemCapability.Multimedia.VideoProcessingEngine", MULTIMEDIA_VIDEOPROCESSINGENGINE}, {"SystemCapability.Security.CryptoFramework.Key", SECURITY_CRYPTOFRAMEWORK_KEY}, @@ -717,6 +716,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Security.CryptoFramework.Mac", SECURITY_CRYPTOFRAMEWORK_MAC}, {"SystemCapability.Security.CryptoFramework.Kdf", SECURITY_CRYPTOFRAMEWORK_KDF}, {"SystemCapability.Security.CryptoFramework.Rand", SECURITY_CRYPTOFRAMEWORK_RAND}, + {"SystemCapability.Communication.NetManager.SaWearableDistributedNetService", COMMUNICATION_NETMANAGER_SA_WEARABLE_DISTRIBUTED_NET_SERVICE}, }; #ifdef __cplusplus -- Gitee From 24c2f065d0900c9c1819c356d149474f18854ce2 Mon Sep 17 00:00:00 2001 From: huchunlan1 Date: Wed, 4 Sep 2024 13:45:35 +0800 Subject: [PATCH 20/57] =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huchunlan1 --- include/codec_config/syscap_define.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index f17b288..d59b0f1 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -716,7 +716,8 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Security.CryptoFramework.Mac", SECURITY_CRYPTOFRAMEWORK_MAC}, {"SystemCapability.Security.CryptoFramework.Kdf", SECURITY_CRYPTOFRAMEWORK_KDF}, {"SystemCapability.Security.CryptoFramework.Rand", SECURITY_CRYPTOFRAMEWORK_RAND}, - {"SystemCapability.Communication.NetManager.SaWearableDistributedNetService", COMMUNICATION_NETMANAGER_SA_WEARABLE_DISTRIBUTED_NET_SERVICE}, + {"SystemCapability.Communication.NetManager.SaWearableDistributedNetService", + COMMUNICATION_NETMANAGER_SA_WEARABLE_DISTRIBUTED_NET_SERVICE}, }; #ifdef __cplusplus -- Gitee From 26f11dc3c8195875f0034a67eea918952156bf9f Mon Sep 17 00:00:00 2001 From: huchunlan1 Date: Thu, 5 Sep 2024 15:41:49 +0800 Subject: [PATCH 21/57] =?UTF-8?q?=E8=93=9D=E7=89=99=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huchunlan1 --- include/codec_config/syscap_define.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index d59b0f1..11b7d61 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -366,7 +366,7 @@ typedef enum SystemCapabilityNum { SECURITY_CRYPTOFRAMEWORK_MAC, SECURITY_CRYPTOFRAMEWORK_KDF, SECURITY_CRYPTOFRAMEWORK_RAND, - COMMUNICATION_NETMANAGER_SA_WEARABLE_DISTRIBUTED_NET_SERVICE, + COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET_SERVICE, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -716,8 +716,8 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Security.CryptoFramework.Mac", SECURITY_CRYPTOFRAMEWORK_MAC}, {"SystemCapability.Security.CryptoFramework.Kdf", SECURITY_CRYPTOFRAMEWORK_KDF}, {"SystemCapability.Security.CryptoFramework.Rand", SECURITY_CRYPTOFRAMEWORK_RAND}, - {"SystemCapability.Communication.NetManager.SaWearableDistributedNetService", - COMMUNICATION_NETMANAGER_SA_WEARABLE_DISTRIBUTED_NET_SERVICE}, + {"SystemCapability.Communication.NetManager.WearableDistributedNetService", + COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET_SERVICE}, }; #ifdef __cplusplus -- Gitee From f31918c27f9c9ef18b6c7881604250b34489f05a Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Mon, 9 Sep 2024 19:19:52 +0800 Subject: [PATCH 22/57] =?UTF-8?q?=E7=BB=99syscap=5Finterface=5Fshared?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E5=A2=9E=E5=8A=A0=E7=A1=AC=E4=BB=B6PAC?= =?UTF-8?q?=E5=90=8E=E5=90=91CFI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD.gn b/BUILD.gn index 870dbae..df2cceb 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -107,6 +107,7 @@ if (defined(ohos_lite)) { } } else { ohos_shared_library("syscap_interface_shared") { + branch_protector_ret = "pac_ret" deps = [] if (syscap_codec_config_extern_path != "") { deps += [ ":gen_syscap_define_custom" ] -- Gitee From e132b55b5c6b18d92f83d8dad5b6e4c2e948f4ee Mon Sep 17 00:00:00 2001 From: huchunlan1 Date: Wed, 11 Sep 2024 16:02:00 +0800 Subject: [PATCH 23/57] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huchunlan1 --- include/codec_config/syscap_define.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 11b7d61..679283d 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -716,8 +716,8 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Security.CryptoFramework.Mac", SECURITY_CRYPTOFRAMEWORK_MAC}, {"SystemCapability.Security.CryptoFramework.Kdf", SECURITY_CRYPTOFRAMEWORK_KDF}, {"SystemCapability.Security.CryptoFramework.Rand", SECURITY_CRYPTOFRAMEWORK_RAND}, - {"SystemCapability.Communication.NetManager.WearableDistributedNetService", - COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET_SERVICE}, + {"SystemCapability.Communication.NetManager.WearableDistributedNet", + COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET}, }; #ifdef __cplusplus -- Gitee From 67a4516fe242e54f4e9e57227c28236f44b2252d Mon Sep 17 00:00:00 2001 From: huchunlan1 Date: Thu, 12 Sep 2024 10:27:41 +0800 Subject: [PATCH 24/57] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huchunlan1 --- include/codec_config/syscap_define.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 679283d..a49f32b 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -366,7 +366,7 @@ typedef enum SystemCapabilityNum { SECURITY_CRYPTOFRAMEWORK_MAC, SECURITY_CRYPTOFRAMEWORK_KDF, SECURITY_CRYPTOFRAMEWORK_RAND, - COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET_SERVICE, + COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; -- Gitee From ae2d4a28f08f02df3da67614497842059704c21b Mon Sep 17 00:00:00 2001 From: zhaohang Date: Wed, 18 Sep 2024 10:28:22 +0800 Subject: [PATCH 25/57] =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E6=94=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaohang --- interfaces/inner_api/syscap_interface.c | 5 +++++ src/main.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/interfaces/inner_api/syscap_interface.c b/interfaces/inner_api/syscap_interface.c index 0580c69..ffaec32 100644 --- a/interfaces/inner_api/syscap_interface.c +++ b/interfaces/inner_api/syscap_interface.c @@ -625,6 +625,11 @@ static int32_t ComparePcidWithPriSyscap(struct PcidPriSyscapInfo pcidPriSyscapIn free(temp); return -1; } + if (pcidPriSyscapInfo.ossyscapFlag + prisyscapFlag >= MAX_MISS_SYSCAP) + { + PRINT_ERR("array index out of bounds.\n"); + return -1; + } result->syscap[pcidPriSyscapInfo.ossyscapFlag + prisyscapFlag] = temp; ++prisyscapFlag; } diff --git a/src/main.c b/src/main.c index 2fd051a..be00763 100644 --- a/src/main.c +++ b/src/main.c @@ -74,9 +74,9 @@ int main(int argc, char **argv) int32_t ret; uint16_t bitMap = 0x0; char curpath[PATH_MAX] = {0}; - g_customerfileinfo.inputfile = NULL; - g_customerfileinfo.pcidfile = NULL; - g_customerfileinfo.rpcidfile = NULL; + g_customerfileinfo.inputfile = ""; + g_customerfileinfo.pcidfile = ""; + g_customerfileinfo.rpcidfile = ""; char *outputpath = getcwd(curpath, sizeof(curpath)); if (outputpath == NULL) { PRINT_ERR("Get outputpath failed.\n"); -- Gitee From d24498bced0b9fd4855c810030a01a7cc727b3cb Mon Sep 17 00:00:00 2001 From: zhaohang Date: Wed, 18 Sep 2024 13:55:09 +0800 Subject: [PATCH 26/57] =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=BF=AE=E6=94=B9=20Si?= =?UTF-8?q?gned-off-by:=20zhaohang=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaohang --- interfaces/inner_api/syscap_interface.c | 5 +++-- src/create_pcid.c | 22 +++++++++++++++++++++- src/main.c | 6 +++--- src/syscap_tool.c | 20 ++++++++++++++++++++ 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/interfaces/inner_api/syscap_interface.c b/interfaces/inner_api/syscap_interface.c index ffaec32..7a8442e 100644 --- a/interfaces/inner_api/syscap_interface.c +++ b/interfaces/inner_api/syscap_interface.c @@ -625,9 +625,10 @@ static int32_t ComparePcidWithPriSyscap(struct PcidPriSyscapInfo pcidPriSyscapIn free(temp); return -1; } - if (pcidPriSyscapInfo.ossyscapFlag + prisyscapFlag >= MAX_MISS_SYSCAP) - { + if (pcidPriSyscapInfo.ossyscapFlag + prisyscapFlag >= MAX_MISS_SYSCAP) { + FreeCompareError(result); PRINT_ERR("array index out of bounds.\n"); + free(temp); return -1; } result->syscap[pcidPriSyscapInfo.ossyscapFlag + prisyscapFlag] = temp; diff --git a/src/create_pcid.c b/src/create_pcid.c index 7b99567..ba4b838 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -249,8 +249,13 @@ int32_t CreatePCID(char *inputFile, char *outDirPath) uint32_t privateCapSize, osCapSize; uint32_t contextBufLen; char *contextBuffer = NULL; - cJSON *allOsSyscapObj = CreateWholeSyscapJsonObj(); + if (inputFile == NULL) { + PRINT_ERR("inputFile is null.\n"); + return -1; + } + + cJSON *allOsSyscapObj = CreateWholeSyscapJsonObj(); int32_t ret = GetFileContext(inputFile, &contextBuffer, (uint32_t *)&contextBufLen); if (ret != 0) { PRINT_ERR("GetFileContext failed, input file : %s\n", inputFile); @@ -482,6 +487,11 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) freePcidJsonInfo.sysCapObj = NULL; freePcidJsonInfo.flag = 0; + if (inputFile == NULL) { + PRINT_ERR("inputFile is null.\n"); + return -1; + } + ret = GetFileContext(inputFile, &freePcidJsonInfo.contextBuffer, (uint32_t *)&contextBufLen); if (ret != 0) { PRINT_ERR("GetFileContext failed, input file : %s\n", inputFile); @@ -693,6 +703,10 @@ static int32_t AddPriSyscapToJsonObj(char *priSyscapString, uint32_t priSyscapSt static int32_t GetSyscapStr(char *input, char const *priSyscapStr, uint32_t* osSyscap, uint32_t *pcidHeader) { + if (input == NULL) { + PRINT_ERR("inputFile is null.\n"); + return -1; + } char *ctx = NULL; uint32_t fileContextLen; if (GetFileContext(input, &ctx, (uint32_t *)&fileContextLen) != 0) { @@ -715,6 +729,7 @@ int32_t DecodeStringPCIDToJson(char *input, char *outDirPath) uint32_t pcidHeader[PCID_HEADER]; char *priSyscapStr = NULL; char *jsonBuffer = NULL; + ret = GetSyscapStr(input, priSyscapStr, osSyscap, pcidHeader); if (ret == -1) { return ret; @@ -872,6 +887,11 @@ int32_t EncodePcidscToString(char *inputFile, char *outDirPath) freePcidInfo.outDirPathFinal = outDirPath; PCIDMain *pcidMain = NULL; + if (inputFile == NULL) { + PRINT_ERR("inputFile is null.\n"); + return -1; + } + ret = GetFileContext(inputFile, &freePcidInfo.contextBuffer, (uint32_t *)&bufferLen); if (ret != 0) { PRINT_ERR("Get pcid file failed, pcid file path: %s\n", inputFile); diff --git a/src/main.c b/src/main.c index be00763..2fd051a 100644 --- a/src/main.c +++ b/src/main.c @@ -74,9 +74,9 @@ int main(int argc, char **argv) int32_t ret; uint16_t bitMap = 0x0; char curpath[PATH_MAX] = {0}; - g_customerfileinfo.inputfile = ""; - g_customerfileinfo.pcidfile = ""; - g_customerfileinfo.rpcidfile = ""; + g_customerfileinfo.inputfile = NULL; + g_customerfileinfo.pcidfile = NULL; + g_customerfileinfo.rpcidfile = NULL; char *outputpath = getcwd(curpath, sizeof(curpath)); if (outputpath == NULL) { PRINT_ERR("Get outputpath failed.\n"); diff --git a/src/syscap_tool.c b/src/syscap_tool.c index 4ff330a..2b08974 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -150,6 +150,11 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) gJsonObjectSysCap.cjsonObjectRoot = NULL; gJsonObjectSysCap.sysCapPtr = NULL; + if (inputFile == NULL) { + PRINT_ERR("inputFile is null.\n"); + return -1; + } + if (GetFileContext(inputFile, &contextBuffer, &bufferLen) != 0) { PRINT_ERR("GetFileContext failed, input file : %s\n", inputFile); return -1; @@ -262,6 +267,11 @@ int32_t RPCIDDecode(char *inputFile, char *outputPath) char *convertedBuffer = NULL; uint32_t bufferLen; + if (inputFile == NULL) { + PRINT_ERR("inputFile is null.\n"); + return -1; + } + // check rpcid.sc if (CheckRpcidFormat(inputFile, &contextBuffer, &bufferLen)) { PRINT_ERR("Check rpcid.sc format failed. Input failed: %s\n", inputFile); @@ -480,6 +490,11 @@ int32_t EncodeRpcidscToString(char *inputFile, char *outDirPath) freeAfterEncodeRpcidscInfo.type = 0; freeAfterEncodeRpcidscInfo.flag = 0; + if (inputFile == NULL) { + PRINT_ERR("inputFile is null.\n"); + return -1; + } + // check rpcid.sc if (CheckRpcidFormat(inputFile, &freeAfterEncodeRpcidscInfo.contextBuffer, &bufferLen) != 0) { PRINT_ERR("Check rpcid.sc format failed. Input file: %s\n", inputFile); @@ -699,6 +714,11 @@ int32_t ComparePcidWithRpcidString(char *pcidFile, char *rpcidFile, uint32_t typ uint32_t pcidOsArray[PCID_OUT_BUFFER] = {0}; uint32_t rpcidOsAarry[PCID_OUT_BUFFER] = {0}; + if (pcidFile == NULL || rpcidFile == NULL) { + PRINT_ERR("pcidFile or rpcidFile is null.\n"); + return -1; + } + if (type == TYPE_FILE) { if (GetFileContext(pcidFile, &pcidContent, &pcidContentLen)) { PRINT_ERR("Get pcid file context failed, input file : %s\n", pcidFile); -- Gitee From de301589860baf11a6e1a16f6ada792335982693 Mon Sep 17 00:00:00 2001 From: zhaohang Date: Thu, 19 Sep 2024 16:50:39 +0800 Subject: [PATCH 27/57] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=B6=85=E9=95=BF?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaohang --- include/context_tool.h | 1 + src/context_tool.c | 13 +++++++++++++ src/create_pcid.c | 24 +++--------------------- src/syscap_tool.c | 8 +------- 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/include/context_tool.h b/include/context_tool.h index b8b437a..2160be7 100644 --- a/include/context_tool.h +++ b/include/context_tool.h @@ -40,6 +40,7 @@ typedef struct RequiredProductCompatibilityIDHead { void FreeContextBuffer(char *contextBuffer); int32_t GetFileContext(const char *inputFile, char **contextBufPtr, uint32_t *bufferLen); +int32_t CheckFileAndGetFileContext(const char *inputFile, char **contextBufPtr, uint32_t *bufferLen); int32_t ConvertedContextSaveAsFile(char *outDirPath, const char *filename, char *convertedBuffer, size_t contextBufLen); int32_t CheckRpcidFormat(const char *inputFile, char **buffer, uint32_t *len); cJSON *CreateWholeSyscapJsonObj(void); diff --git a/src/context_tool.c b/src/context_tool.c index ea5359f..e75f853 100644 --- a/src/context_tool.c +++ b/src/context_tool.c @@ -92,6 +92,19 @@ int32_t GetFileContext(const char *inputFile, char **contextBufPtr, uint32_t *bu return 0; } +int32_t CheckFileAndGetFileContext(const char *inputFile, char **contextBufPtr, uint32_t *bufferLen) +{ + if (inputFile == NULL) { + PRINT_ERR("input file is NULL.\n"); + return -1; + } + uint32_t ret = GetFileContext(inputFile, contextBufPtr, bufferLen); + if (ret != 0) { + PRINT_ERR("GetFileContext failed, input file : %s\n", inputFile); + } + return ret; +} + int32_t ConvertedContextSaveAsFile(char *outDirPath, const char *filename, char *convertedBuffer, size_t contextBufLen) { int32_t ret; diff --git a/src/create_pcid.c b/src/create_pcid.c index ba4b838..5a8a327 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -250,15 +250,9 @@ int32_t CreatePCID(char *inputFile, char *outDirPath) uint32_t contextBufLen; char *contextBuffer = NULL; - if (inputFile == NULL) { - PRINT_ERR("inputFile is null.\n"); - return -1; - } - cJSON *allOsSyscapObj = CreateWholeSyscapJsonObj(); - int32_t ret = GetFileContext(inputFile, &contextBuffer, (uint32_t *)&contextBufLen); + int32_t ret = CheckFileAndGetFileContext(inputFile, &contextBuffer, (uint32_t *)&contextBufLen); if (ret != 0) { - PRINT_ERR("GetFileContext failed, input file : %s\n", inputFile); return FreeAfterCreatePCID(NULL, allOsSyscapObj, contextBuffer, 0, -1); } @@ -486,15 +480,9 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) freePcidJsonInfo.jsonRootObj = NULL; freePcidJsonInfo.sysCapObj = NULL; freePcidJsonInfo.flag = 0; - - if (inputFile == NULL) { - PRINT_ERR("inputFile is null.\n"); - return -1; - } - ret = GetFileContext(inputFile, &freePcidJsonInfo.contextBuffer, (uint32_t *)&contextBufLen); + ret = CheckFileAndGetFileContext(inputFile, &freePcidJsonInfo.contextBuffer, (uint32_t *)&contextBufLen); if (ret != 0) { - PRINT_ERR("GetFileContext failed, input file : %s\n", inputFile); return -1; } @@ -887,14 +875,8 @@ int32_t EncodePcidscToString(char *inputFile, char *outDirPath) freePcidInfo.outDirPathFinal = outDirPath; PCIDMain *pcidMain = NULL; - if (inputFile == NULL) { - PRINT_ERR("inputFile is null.\n"); - return -1; - } - - ret = GetFileContext(inputFile, &freePcidInfo.contextBuffer, (uint32_t *)&bufferLen); + ret = CheckFileAndGetFileContext(inputFile, &freePcidInfo.contextBuffer, (uint32_t *)&bufferLen); if (ret != 0) { - PRINT_ERR("Get pcid file failed, pcid file path: %s\n", inputFile); return -1; } diff --git a/src/syscap_tool.c b/src/syscap_tool.c index 2b08974..d58259b 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -150,13 +150,7 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) gJsonObjectSysCap.cjsonObjectRoot = NULL; gJsonObjectSysCap.sysCapPtr = NULL; - if (inputFile == NULL) { - PRINT_ERR("inputFile is null.\n"); - return -1; - } - - if (GetFileContext(inputFile, &contextBuffer, &bufferLen) != 0) { - PRINT_ERR("GetFileContext failed, input file : %s\n", inputFile); + if (CheckFileAndGetFileContext(inputFile, &contextBuffer, &bufferLen) != 0) { return -1; } -- Gitee From 0805f4c96e5fbe4fad94989d8b95c4ac19565aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E4=BC=81=E5=AE=89?= Date: Fri, 20 Sep 2024 17:28:26 +0800 Subject: [PATCH 28/57] =?UTF-8?q?=E6=96=B0=E5=A2=9EFontManager=20syscap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周企安 --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index a49f32b..407b78c 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -367,6 +367,7 @@ typedef enum SystemCapabilityNum { SECURITY_CRYPTOFRAMEWORK_KDF, SECURITY_CRYPTOFRAMEWORK_RAND, COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET, + GLOBAL_FONTMANAGER, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -718,6 +719,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Security.CryptoFramework.Rand", SECURITY_CRYPTOFRAMEWORK_RAND}, {"SystemCapability.Communication.NetManager.WearableDistributedNet", COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET}, + {"SystemCapability.Global.FontManager", GLOBAL_FONTMANAGER}, }; #ifdef __cplusplus -- Gitee From 59798831c0eb4d9f3847c4a0f259e62421a87d8c Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Sat, 21 Sep 2024 17:42:46 +0800 Subject: [PATCH 29/57] =?UTF-8?q?#issue:IASQ00=20=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- src/context_tool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context_tool.c b/src/context_tool.c index e75f853..bb243ef 100644 --- a/src/context_tool.c +++ b/src/context_tool.c @@ -98,7 +98,7 @@ int32_t CheckFileAndGetFileContext(const char *inputFile, char **contextBufPtr, PRINT_ERR("input file is NULL.\n"); return -1; } - uint32_t ret = GetFileContext(inputFile, contextBufPtr, bufferLen); + int32_t ret = GetFileContext(inputFile, contextBufPtr, bufferLen); if (ret != 0) { PRINT_ERR("GetFileContext failed, input file : %s\n", inputFile); } -- Gitee From 6a2f5bdb9e6bbfd46974b6030cdbb93e9bbe7520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E6=B3=A5=E5=B0=8F=E5=89=91=E5=85=B3?= Date: Sun, 29 Sep 2024 11:11:28 +0800 Subject: [PATCH 30/57] =?UTF-8?q?=E6=9B=B4=E6=96=B0README=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 青泥小剑关 --- README.md | 46 ++++++++++++++++++++++++++---------- README_ZH.md | 67 +++++++++++++++++++++++++++++++++------------------- tree.txt | 57 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+), 36 deletions(-) create mode 100644 tree.txt diff --git a/README.md b/README.md index 4ca90a9..aa30323 100644 --- a/README.md +++ b/README.md @@ -18,19 +18,40 @@ Main function: ``` /developtools -├── syscap_codec # root directory -│ ├── include -│ │ └── syscap_tool.h # interfaces -│ └── src -│ │ ├── endian_internel.h # internal big/little endian conversion headers(common for win、mac、linux) -│ │ ├── endian_internel.c # big/little endian conversion implement -│ │ ├── main.c # command line implement -│ │ └── syscap_tool.c # codec implement +├── syscap_codec # syscap codec代码目录 +│ ├── include +│   │ ├──code_config # syscap_tool_shared对外接口定义 +│ │ │  └──syscap_define.h +│ │ ├── context_tool.h +│   │   ├── create_pcid.h +│   │   └── syscap_tool.h +│ ├── interfaces/inner_api # 提供部件之间的接口 +│ │ ├── syscap_interface.c +│ │ └── syscap_interface.h +│ ├── napi # napi 接口实现 +│ │ ├── BUILD.gn +│ │ ├── napi_query_syscap.cpp +│ │ └── query_syscap.js +│ ├── src +│   │   ├── common_method.c +│   │   ├── common_method.h +│   │   ├── context_tool.c +│   │   ├── create_pcid.c +│ │ ├── endian_internal.h # 内部实现的大小端转换接口定义(便于win、mac、linux平台通用) +│ │ ├── endian_internal.c # 大小端转换实现 +│ │ ├── main.c # syscap_tool命令行工具代码实现 +│ │ └── syscap_tool.c # syscap_tool编解码接口的实现 │ └── test -│ | └── syscap_tool_test.c # syscap_tool test codec implement +│ │ └── unittest/common # inner 接口测试代码实现 +│ │  ├── BUILD.gn +│ │  ├── include +│ │  │ └── syscap_codec_test.h +│ │   └── syscap_codec_test.cpp    # syscap_tool功能测试代码实现 | |—— tools -| │ │ -| │ └── syscap_check.py # syscap一致性检查脚本 +| │ ├── requirements.txt +│   │   ├── syscap_check.py # syscap一致性检查脚本 +│   │   ├── syscap_collector.py +| │ └── syscap_config_merge.py ``` ### API @@ -51,7 +72,7 @@ Note: Ubuntu host only avaiable for windows/linux building, MacOs binary should 1. Downlaod SDK(recommonded) -Download daily builds(http://ci.openharmony.cn/dailybuilds) which included SDK. +Download daily builds( https://ci.openharmony.cn/workbench/cicd/dailybuild/dailylist ) which included SDK. 2. Supported Host @@ -62,6 +83,7 @@ Windows x86_64/Linux x86_64/Darwin x86_64 SysCap tools usually integrate to IDE, APP store and bundle tools. Follow instructions for debugging manually: ./syscap_tool -h or ./syscap_tool --help: + ``` ./syscap_tool --help diff --git a/README_ZH.md b/README_ZH.md index a12c356..40dda44 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -19,56 +19,71 @@ 6. pcid与rpcid比较:查询pcid是否满足rpcid的要求,并输出不满足的地方。 ## 代码目录 + ``` /developtools ├── syscap_codec # syscap codec代码目录 -│ ├── include # syscap_tool_shared对外接口定义 -│ │ ├── syscap_define.h -│ │ └── syscap_tool.h +│ ├── include +│   │ ├──code_config # syscap_tool_shared对外接口定义 +│ │ │  └──syscap_define.h +│ │ ├── context_tool.h +│   │   ├── create_pcid.h +│   │   └── syscap_tool.h │ ├── interfaces/inner_api # 提供部件之间的接口 │ │ ├── syscap_interface.c │ │ └── syscap_interface.h │ ├── napi # napi 接口实现 │ │ ├── BUILD.gn │ │ ├── napi_query_syscap.cpp -│ │ └── syscap_interface.h +│ │ └── query_syscap.js │ ├── src -│ │ ├── endian_internel.h # 内部实现的大小端转换接口定义(便于win、mac、linux平台通用) -│ │ ├── endian_internel.c # 大小端转换实现 +│   │   ├── common_method.c +│   │   ├── common_method.h +│   │   ├── context_tool.c +│   │   ├── create_pcid.c +│ │ ├── endian_internal.h # 内部实现的大小端转换接口定义(便于win、mac、linux平台通用) +│ │ ├── endian_internal.c # 大小端转换实现 │ │ ├── main.c # syscap_tool命令行工具代码实现 │ │ └── syscap_tool.c # syscap_tool编解码接口的实现 │ └── test -│ │ ├── unittest/common # inner 接口测试代码实现 -│ │ │ ├── BUILD.gn -│ │ │ ├── include -│ │ │ │ └── syscap_codec_test.h -│ │ │ └── syscap_codec_test.cpp -│ │ └── syscap_tool_test.c # syscap_tool功能测试代码实现 +│ │ └── unittest/common # inner 接口测试代码实现 +│ │  ├── BUILD.gn +│ │  ├── include +│ │  │ └── syscap_codec_test.h +│ │   └── syscap_codec_test.cpp    # syscap_tool功能测试代码实现 | |—— tools -| │ │ -| │ └── syscap_check.py # syscap一致性检查脚本 +| │ ├── requirements.txt +│   │   ├── syscap_check.py # syscap一致性检查脚本 +│   │   ├── syscap_collector.py +| │ └── syscap_config_merge.py ``` ## API + PC端工具,不对外提供API。 -## PC端编译说明 +## PC端编译说明 + syscap_tool PC端可执行文件编译步骤: + 1. 编译命令:参考[编译构建](https://gitee.com/openharmony/build/blob/master/README_zh.md)文档,执行其指定的sdk编译命令来编译整个sdk,syscap_tool会被编译打包到里面。 2. 编译:在目标开发机上运行上面调整好的sdk编译命令,正常编译syscap_tool会输出到sdk平台相关目录下。 注意:ubuntu环境下只能编译windows/linux版本工具,mac版需要在macos开发机上编译。 ## PC端获取说明 + 1. 下载sdk获取(建议) - 通过访问本社区门禁[每日构建](http://ci.openharmony.cn/dailys/dailybuilds)网站,下载最新的ohos-sdk压缩包,并从相应平台的toolchains压缩包中提取syscap_tool。 + 通过访问本社区门禁[每日构建](https://ci.openharmony.cn/workbench/cicd/dailybuild/dailylist)网站,下载最新的ohos-sdk压缩包,并从相应平台的toolchains压缩包中提取syscap_tool。 2. 支持运行环境 Windows x86_64/Linux x86_64/Darwin x86_64 -## 命令帮助 +## 命令帮助 + 本工具一般被IDE、应用市场和包管理器集成,手工调试时可参考以下说明。 使用./syscap_tool -h或者./syscap_tool --help查看: + ```shell syscap_tool -R/P -e/d -i filepath [-o outpath] -h, --help : how to use @@ -86,22 +101,24 @@ syscap_tool -R/P -e/d -i filepath [-o outpath] syscap_tool v1.1.1 ``` + ### 使用示例 + ```shell # 将 rpcid.json 编码为SC格式,文件名rpcid.sc syscap_tool -Rei rpcid.json -o path/ -# 将 pcid.sc 编码为JSON格式,文件名rpcid.json -syscap_tool -Rdi pcid.sc -o path/ +# 将 rpcid.sc 解码为JSON格式,文件名rpcid.json +syscap_tool -Rdi rpcid.sc -o path/ # 将 pcid.json 编码为SC格式,文件名pcid.sc syscap_tool -Pei pcid.json -o path/ -# 将 pcid.sc 编码为JSON格式,文件名pcid.json +# 将 pcid.sc 解码为JSON格式,文件名pcid.json syscap_tool -Pdi pcid.sc -o path/ -# 将 pcid.sc 编码为字符串格式,文件名rpcid.txt -syscap_tool -Resi pcid.sc -o path/ +# 将 rpcid.sc 编码为字符串格式,文件名rpcid.txt +syscap_tool -Resi rpcid.sc -o path/ # 将 pcid.sc 编码为字符串格式,文件名pcid.txt syscap_tool -Pesi pcid.sc -o path/ @@ -115,6 +132,7 @@ syscap_tool -sC "pcidstring" "rpcidstring" # 将字符串格式的 pcid 转为 json 格式,文件名 pcid.json。 syscap_tool -Pdsi pcid.txt -o path/ ``` + **说明:** -o 选项指定输出目录,缺省为当前目录。 ## syscap一致性检查工具 @@ -137,7 +155,7 @@ requirements: prettytable==3.3.0 ``` -使用python3 syscap-check.py -h或python3 syscap-check.py --help查看用法: +使用python3 syscap_check.py -h或python3 syscap_check.py --help查看用法: ```shell usage: syscap_check.py [-h] [-p PROJECT_PATH] -t {component_codec,component_sdk,sdk_codec} @@ -171,12 +189,13 @@ python3 syscap_check.py -p path_of_openarmony -t sdk_codec ``` ## syscap_define.h 文件规则 + - 每一个 SyscapNum 枚举值都唯一对应于一个 syscap 字符串。 - 如果弃用某个 syscap,在对应的枚举值后面注释 "// abandoned" 即可,请勿删除和修改。对应的 syscap 字符串也不需要修改。 - 添加 syscap,请在 SyscapNum 和 g_arraySyscap 末尾添加相应数据。 - 数组 g_arraySyscap 按照 SyscapNum 枚举值从小到大排序。 - ## Release Note + v1.1.0 2022-6-17 添加转字符串格式以及比较功能。 v1.0.0 2022-3-8 首版本,提供Windows/Linux/Mac平台的系统能力编解码。 diff --git a/tree.txt b/tree.txt new file mode 100644 index 0000000..a67883c --- /dev/null +++ b/tree.txt @@ -0,0 +1,57 @@ + ļ PATH б +кΪ 1DD4-5ADE +D:. + BUILD.gn + bundle.json + config.gni + libsyscap_interface_shared.versionscript + LICENSE + OAT.xml + README.md + README_ZH.md + RELEASE-NOTE.txt + tree.txt + +include + context_tool.h + create_pcid.h + syscap_tool.h + + codec_config + syscap_define.h + +interfaces + inner_api + syscap_interface.c + syscap_interface.h + +napi + BUILD.gn + napi_query_syscap.cpp + query_syscap.js + +src + common_method.c + common_method.h + context_tool.c + create_pcid.c + endian_internal.c + endian_internal.h + main.c + syscap_tool.c + +test + unittest + common + BUILD.gn + syscap_codec_test.cpp + + include + syscap_codec_test.h + +tools + requirements.txt + syscap_check.py + syscap_collector.py + syscap_config_merge.py + -- Gitee From 8093caec187ffb391062dfb4e64b8ccc602b2206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E6=B3=A5=E5=B0=8F=E5=89=91=E5=85=B3?= Date: Sun, 29 Sep 2024 11:13:07 +0800 Subject: [PATCH 31/57] =?UTF-8?q?=E6=9B=B4=E6=96=B0README=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 青泥小剑关 --- tree.txt | 57 -------------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 tree.txt diff --git a/tree.txt b/tree.txt deleted file mode 100644 index a67883c..0000000 --- a/tree.txt +++ /dev/null @@ -1,57 +0,0 @@ - ļ PATH б -кΪ 1DD4-5ADE -D:. - BUILD.gn - bundle.json - config.gni - libsyscap_interface_shared.versionscript - LICENSE - OAT.xml - README.md - README_ZH.md - RELEASE-NOTE.txt - tree.txt - -include - context_tool.h - create_pcid.h - syscap_tool.h - - codec_config - syscap_define.h - -interfaces - inner_api - syscap_interface.c - syscap_interface.h - -napi - BUILD.gn - napi_query_syscap.cpp - query_syscap.js - -src - common_method.c - common_method.h - context_tool.c - create_pcid.c - endian_internal.c - endian_internal.h - main.c - syscap_tool.c - -test - unittest - common - BUILD.gn - syscap_codec_test.cpp - - include - syscap_codec_test.h - -tools - requirements.txt - syscap_check.py - syscap_collector.py - syscap_config_merge.py - -- Gitee From 11c4af913de3f5196c32f9f3f75427bc56a9e8cc Mon Sep 17 00:00:00 2001 From: w00657280 Date: Tue, 15 Oct 2024 21:17:17 +0800 Subject: [PATCH 32/57] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E6=A3=80=E8=A7=86=E9=97=AE=E9=A2=98=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: w00657280 --- tools/syscap_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/syscap_check.py b/tools/syscap_check.py index e2b97fa..c404369 100644 --- a/tools/syscap_check.py +++ b/tools/syscap_check.py @@ -114,8 +114,7 @@ def collect_syscap_from_codec(filepath: str, pattern: str = r'{"(.*)"') -> tuple def collect_syscap_from_component(project_path: str, black_dirs: tuple, key_heirarchy: tuple, - bundles: list = None, - ) -> tuple: + bundles: list = None) -> tuple: """ 从部件的bundle.json中收集syscap :param project_path: 项目根路径 @@ -136,6 +135,7 @@ def collect_syscap_from_component(project_path: str, for line in output: line = line.strip() read_value_from_json(line, key_heirarchy, result_dict, post_handler=bundle_syscap_post_handler) + output.close() else: for bundle in bundles: read_value_from_json(bundle, key_heirarchy, result_dict, post_handler=bundle_syscap_post_handler) -- Gitee From 121ee7248de599ee9c5189e9029dacad17f7f8f8 Mon Sep 17 00:00:00 2001 From: wangxingboo Date: Tue, 22 Oct 2024 17:42:31 +0800 Subject: [PATCH 33/57] add esim syscap Signed-off-by: wangxingboo --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 407b78c..d0c0a8b 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -164,6 +164,7 @@ typedef enum SystemCapabilityNum { TELEPHONY_CELLULARCALL, TELEPHONY_CELLULARDATA, TELEPHONY_CORESERVICE, + TELEPHONY_CORESERVICE_ESIM, TELEPHONY_DATASTORAGE, TELEPHONY_DCALL, TELEPHONY_SMSMMS, @@ -524,6 +525,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Telephony.CellularCall", TELEPHONY_CELLULARCALL}, {"SystemCapability.Telephony.CellularData", TELEPHONY_CELLULARDATA}, {"SystemCapability.Telephony.CoreService", TELEPHONY_CORESERVICE}, + {"SystemCapability.Telephony.CoreService.Esim", TELEPHONY_CORESERVICE_ESIM}, {"SystemCapability.Telephony.DataStorage", TELEPHONY_DATASTORAGE}, {"SystemCapability.Telephony.DCall", TELEPHONY_DCALL}, {"SystemCapability.Telephony.SmsMms", TELEPHONY_SMSMMS}, -- Gitee From e87a35548223239084eded035e8cbb901d2b7c9e Mon Sep 17 00:00:00 2001 From: wangxingboo Date: Wed, 23 Oct 2024 14:24:45 +0800 Subject: [PATCH 34/57] fix codex Signed-off-by: wangxingboo --- include/codec_config/syscap_define.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index d0c0a8b..13f4b5a 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -164,7 +164,6 @@ typedef enum SystemCapabilityNum { TELEPHONY_CELLULARCALL, TELEPHONY_CELLULARDATA, TELEPHONY_CORESERVICE, - TELEPHONY_CORESERVICE_ESIM, TELEPHONY_DATASTORAGE, TELEPHONY_DCALL, TELEPHONY_SMSMMS, @@ -371,6 +370,7 @@ typedef enum SystemCapabilityNum { GLOBAL_FONTMANAGER, // Add before here SYSCAP_BASIC_END = 500, + TELEPHONY_CORESERVICE_ESIM, } SyscapNum; @@ -525,7 +525,6 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Telephony.CellularCall", TELEPHONY_CELLULARCALL}, {"SystemCapability.Telephony.CellularData", TELEPHONY_CELLULARDATA}, {"SystemCapability.Telephony.CoreService", TELEPHONY_CORESERVICE}, - {"SystemCapability.Telephony.CoreService.Esim", TELEPHONY_CORESERVICE_ESIM}, {"SystemCapability.Telephony.DataStorage", TELEPHONY_DATASTORAGE}, {"SystemCapability.Telephony.DCall", TELEPHONY_DCALL}, {"SystemCapability.Telephony.SmsMms", TELEPHONY_SMSMMS}, @@ -722,6 +721,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Communication.NetManager.WearableDistributedNet", COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET}, {"SystemCapability.Global.FontManager", GLOBAL_FONTMANAGER}, + {"SystemCapability.Telephony.CoreService.Esim", TELEPHONY_CORESERVICE_ESIM}, }; #ifdef __cplusplus -- Gitee From 65a1cba9abc36ed963298b81c1ec9429e438bffd Mon Sep 17 00:00:00 2001 From: wangxingboo Date: Wed, 23 Oct 2024 15:20:36 +0800 Subject: [PATCH 35/57] fix codex Signed-off-by: wangxingboo --- include/codec_config/syscap_define.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 13f4b5a..9e6b468 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -368,9 +368,9 @@ typedef enum SystemCapabilityNum { SECURITY_CRYPTOFRAMEWORK_RAND, COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET, GLOBAL_FONTMANAGER, + TELEPHONY_CORESERVICE_ESIM, // Add before here SYSCAP_BASIC_END = 500, - TELEPHONY_CORESERVICE_ESIM, } SyscapNum; -- Gitee From f09010dc53ea442b16cb47e4afbb60afded7b198 Mon Sep 17 00:00:00 2001 From: xuzhongwu Date: Fri, 25 Oct 2024 08:09:23 +0000 Subject: [PATCH 36/57] update include/codec_config/syscap_define.h. Signed-off-by: xuzhongwu --- include/codec_config/syscap_define.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 9e6b468..4f934c7 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -696,7 +696,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Resourceschedule.Ffrt.Core", RESOURCESCHEDULE_FFRT_CORE}, {"SystemCapability.AI.MindSporeLite", AI_MINDSPORELITE}, {"SystemCapability.Ability.AppStartup", ABILITY_APP_STARTUP}, - {"SystemCapability.Multimedia.Media.AVTransCoder", MULTIMEDIA_MEDIA_AVTRANSCODER}, + {"SystemCapability.Multimedia.Media.AVTranscoder", MULTIMEDIA_MEDIA_AVTRANSCODER}, {"SystemCapability.Base", BASE}, {"SystemCapability.MultimodalInput.Input.InfraredEmitter", MULTIMODALINPUT_INPUT_INFRAREDEMITTER}, {"SystemCapability.Multimedia.ImageEffect.Core", MULTIMEDIA_IMAGEEFFECT_CORE}, -- Gitee From 9b86d559b429b5771baf412527d7480c0959fb99 Mon Sep 17 00:00:00 2001 From: lcaidm Date: Tue, 12 Nov 2024 16:51:24 +0800 Subject: [PATCH 37/57] bugfix Signed-off-by:lcaidm Signed-off-by: lcaidm --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 4f934c7..81fd771 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -64,6 +64,7 @@ typedef enum SystemCapabilityNum { DISTRIBUTEDDATAMANAGER_KVSTORE_LITE, DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE, DISTRIBUTEDDATAMANAGER_RELATIONALSTORE_CORE, + DISTRIBUTEDDATAMANAGER_ARKDATA_INTELLIGENCE_PLATFORM, DISTRIBUTEDHARDWARE_DEVICEMANAGER, DISTRIBUTEDHARDWARE_DISTRIBUTEDCAMERA, DISTRIBUTEDHARDWARE_DISTRIBUTEDAUDIO, @@ -409,6 +410,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.DistributedDataManager.Preferences.Core", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE}, {"SystemCapability.DistributedDataManager.Preferences.Core.Lite", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE_LITE}, {"SystemCapability.DistributedDataManager.RelationalStore.Core", DISTRIBUTEDDATAMANAGER_RELATIONALSTORE_CORE}, + {"SystemCapability.DistributedDataManager.Arkdata.Intelligence.Platform", DISTRIBUTEDDATAMANAGER_ARKDATA_INTELLIGENCE_PLATFORM}, {"SystemCapability.DistributedDataManager.CloudSync.Client", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CLIENT}, {"SystemCapability.DistributedDataManager.CloudSync.Server", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_SERVER}, {"SystemCapability.DistributedDataManager.CloudSync.Config", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CONFIG}, -- Gitee From 3802682ee424695df9f579522d9fea797902a272 Mon Sep 17 00:00:00 2001 From: lcaidm Date: Tue, 12 Nov 2024 18:46:44 +0800 Subject: [PATCH 38/57] bugfix Signed-off-by:lcaidm Signed-off-by: lcaidm --- include/codec_config/syscap_define.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 81fd771..14d421c 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -410,7 +410,8 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.DistributedDataManager.Preferences.Core", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE}, {"SystemCapability.DistributedDataManager.Preferences.Core.Lite", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE_LITE}, {"SystemCapability.DistributedDataManager.RelationalStore.Core", DISTRIBUTEDDATAMANAGER_RELATIONALSTORE_CORE}, - {"SystemCapability.DistributedDataManager.Arkdata.Intelligence.Platform", DISTRIBUTEDDATAMANAGER_ARKDATA_INTELLIGENCE_PLATFORM}, + {"SystemCapability.DistributedDataManager.Arkdata.Intelligence.Platform", + DISTRIBUTEDDATAMANAGER_ARKDATA_INTELLIGENCE_PLATFORM}, {"SystemCapability.DistributedDataManager.CloudSync.Client", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CLIENT}, {"SystemCapability.DistributedDataManager.CloudSync.Server", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_SERVER}, {"SystemCapability.DistributedDataManager.CloudSync.Config", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CONFIG}, -- Gitee From aca5b328ca4953b62d927da9f654b24faf32a1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8A=E5=AE=98=E6=99=AF=E5=A8=81?= Date: Tue, 12 Nov 2024 16:14:26 +0800 Subject: [PATCH 39/57] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86syscap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 上官景威 --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 4f934c7..5237ef2 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -369,6 +369,7 @@ typedef enum SystemCapabilityNum { COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET, GLOBAL_FONTMANAGER, TELEPHONY_CORESERVICE_ESIM, + SECURITY_CERTIFICATE_MANAGER_DIALOG, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -542,6 +543,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.UserIAM.UserAuth.PinAuth", USERIAM_USERAUTH_PINAUTH}, {"SystemCapability.ArkUI.UiAppearance", ARKUI_UIAPPEARANCE}, {"SystemCapability.Security.CertificateManager", SECURITY_CERTIFICATE_MANAGER}, + {"SystemCapability.Security.CertificateManagerDialog", SECURITY_CERTIFICATE_MANAGER_DIALOG}, {"SystemCapability.Graphic.Vulkan", GRAPHIC_VULKAN}, {"SystemCapability.Location.Location.Core", LOCATION_LOCATION_CORE}, {"SystemCapability.Location.Location.Gnss", LOCATION_LOCATION_GNSS}, -- Gitee From df19bbbc4a9b9e7c86ffb83290c9389f85bd2b88 Mon Sep 17 00:00:00 2001 From: lcaidm Date: Wed, 13 Nov 2024 10:08:51 +0800 Subject: [PATCH 40/57] bugfix Signed-off-by:lcaidm Signed-off-by: lcaidm --- include/codec_config/syscap_define.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 14d421c..579c678 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -64,7 +64,7 @@ typedef enum SystemCapabilityNum { DISTRIBUTEDDATAMANAGER_KVSTORE_LITE, DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE, DISTRIBUTEDDATAMANAGER_RELATIONALSTORE_CORE, - DISTRIBUTEDDATAMANAGER_ARKDATA_INTELLIGENCE_PLATFORM, + DISTRIBUTEDDATAMANAGER_ARKDATAINTELLIGENCE_CORE, DISTRIBUTEDHARDWARE_DEVICEMANAGER, DISTRIBUTEDHARDWARE_DISTRIBUTEDCAMERA, DISTRIBUTEDHARDWARE_DISTRIBUTEDAUDIO, @@ -410,8 +410,8 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.DistributedDataManager.Preferences.Core", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE}, {"SystemCapability.DistributedDataManager.Preferences.Core.Lite", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE_LITE}, {"SystemCapability.DistributedDataManager.RelationalStore.Core", DISTRIBUTEDDATAMANAGER_RELATIONALSTORE_CORE}, - {"SystemCapability.DistributedDataManager.Arkdata.Intelligence.Platform", - DISTRIBUTEDDATAMANAGER_ARKDATA_INTELLIGENCE_PLATFORM}, + {"SystemCapability.DistributedDataManager.ArkdataIntelligence.Core", + DISTRIBUTEDDATAMANAGER_ARKDATAINTELLIGENCE_CORE}, {"SystemCapability.DistributedDataManager.CloudSync.Client", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CLIENT}, {"SystemCapability.DistributedDataManager.CloudSync.Server", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_SERVER}, {"SystemCapability.DistributedDataManager.CloudSync.Config", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CONFIG}, -- Gitee From 3a1154ec629cb1c921bd9b7ea359f81b57461b16 Mon Sep 17 00:00:00 2001 From: lcaidm Date: Wed, 13 Nov 2024 11:28:27 +0800 Subject: [PATCH 41/57] bugfix Signed-off-by:lcaidm Signed-off-by: lcaidm --- include/codec_config/syscap_define.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 579c678..cf54b0c 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -64,7 +64,7 @@ typedef enum SystemCapabilityNum { DISTRIBUTEDDATAMANAGER_KVSTORE_LITE, DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE, DISTRIBUTEDDATAMANAGER_RELATIONALSTORE_CORE, - DISTRIBUTEDDATAMANAGER_ARKDATAINTELLIGENCE_CORE, + DISTRIBUTEDDATAMANAGER_AIP_CORE, DISTRIBUTEDHARDWARE_DEVICEMANAGER, DISTRIBUTEDHARDWARE_DISTRIBUTEDCAMERA, DISTRIBUTEDHARDWARE_DISTRIBUTEDAUDIO, @@ -410,8 +410,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.DistributedDataManager.Preferences.Core", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE}, {"SystemCapability.DistributedDataManager.Preferences.Core.Lite", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE_LITE}, {"SystemCapability.DistributedDataManager.RelationalStore.Core", DISTRIBUTEDDATAMANAGER_RELATIONALSTORE_CORE}, - {"SystemCapability.DistributedDataManager.ArkdataIntelligence.Core", - DISTRIBUTEDDATAMANAGER_ARKDATAINTELLIGENCE_CORE}, + {"SystemCapability.DistributedDataManager.AIP.Core", DISTRIBUTEDDATAMANAGER_AIP_CORE}, {"SystemCapability.DistributedDataManager.CloudSync.Client", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CLIENT}, {"SystemCapability.DistributedDataManager.CloudSync.Server", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_SERVER}, {"SystemCapability.DistributedDataManager.CloudSync.Config", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CONFIG}, -- Gitee From be6df505f5990956483ea55e8bf3ca6dc7717060 Mon Sep 17 00:00:00 2001 From: lcaidm Date: Wed, 13 Nov 2024 17:44:11 +0800 Subject: [PATCH 42/57] bugfix Signed-off-by:lcaidm Signed-off-by: lcaidm --- include/codec_config/syscap_define.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index cf54b0c..9233c11 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -64,7 +64,6 @@ typedef enum SystemCapabilityNum { DISTRIBUTEDDATAMANAGER_KVSTORE_LITE, DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE, DISTRIBUTEDDATAMANAGER_RELATIONALSTORE_CORE, - DISTRIBUTEDDATAMANAGER_AIP_CORE, DISTRIBUTEDHARDWARE_DEVICEMANAGER, DISTRIBUTEDHARDWARE_DISTRIBUTEDCAMERA, DISTRIBUTEDHARDWARE_DISTRIBUTEDAUDIO, @@ -370,6 +369,7 @@ typedef enum SystemCapabilityNum { COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET, GLOBAL_FONTMANAGER, TELEPHONY_CORESERVICE_ESIM, + DISTRIBUTEDDATAMANAGER_AIP_CORE, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -410,7 +410,6 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.DistributedDataManager.Preferences.Core", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE}, {"SystemCapability.DistributedDataManager.Preferences.Core.Lite", DISTRIBUTEDDATAMANAGER_PREFERENCES_CORE_LITE}, {"SystemCapability.DistributedDataManager.RelationalStore.Core", DISTRIBUTEDDATAMANAGER_RELATIONALSTORE_CORE}, - {"SystemCapability.DistributedDataManager.AIP.Core", DISTRIBUTEDDATAMANAGER_AIP_CORE}, {"SystemCapability.DistributedDataManager.CloudSync.Client", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CLIENT}, {"SystemCapability.DistributedDataManager.CloudSync.Server", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_SERVER}, {"SystemCapability.DistributedDataManager.CloudSync.Config", DISTRIBUTEDDATAMANAGER_CLOUDSYNC_CONFIG}, @@ -724,6 +723,7 @@ const static SyscapWithNum g_arraySyscap[] = { COMMUNICATION_NETMANAGER_WEARABLE_DISTRIBUTED_NET}, {"SystemCapability.Global.FontManager", GLOBAL_FONTMANAGER}, {"SystemCapability.Telephony.CoreService.Esim", TELEPHONY_CORESERVICE_ESIM}, + {"SystemCapability.DistributedDataManager.AIP.Core", DISTRIBUTEDDATAMANAGER_AIP_CORE}, }; #ifdef __cplusplus -- Gitee From 16759717a9222ab3a463d30b8b6d9b19c249eb65 Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Fri, 13 Dec 2024 17:31:31 +0800 Subject: [PATCH 43/57] =?UTF-8?q?#isssue:IBB6QI=20=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- src/create_pcid.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 5a8a327..77ba9b0 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -523,6 +523,10 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) } freePcidJsonInfo.strJson = cJSON_Print(freePcidJsonInfo.jsonRootObj); + if (freePcidJsonInfo.strJson == NULL) { + PRINT_ERR("cJSON_Print failed\n"); + return FreeAfterDecodePCID(freePcidJsonInfo, FREE_DECODE_PCID_ROOT_OUT, -1); + } const char outputFileName[] = "pcid.json"; ret = ConvertedContextSaveAsFile(outDirPath, outputFileName, freePcidJsonInfo.strJson, @@ -615,7 +619,7 @@ static int32_t AddOsSyscapToJsonObj(uint32_t *osSyscapArray, uint32_t osSyscapAr if (osSyscapArrayLen != OS_SYSCAP_NUM) { PRINT_ERR("Input os syscap array len error.\n"); - free(sysCapArray); + cJSON_Delete(sysCapArray); return -1; } uint8_t *osSysCapArrayUint8 = (uint8_t *)osSyscapArray; @@ -638,7 +642,7 @@ static int32_t AddOsSyscapToJsonObj(uint32_t *osSyscapArray, uint32_t osSyscapAr } if (!cJSON_AddItemToArray(sysCapArray, cJSON_CreateString(g_arraySyscap[j].str))) { PRINT_ERR("Add os syscap string to json failed.\n"); - free(sysCapArray); + cJSON_Delete(sysCapArray); return -1; } break; @@ -647,7 +651,7 @@ static int32_t AddOsSyscapToJsonObj(uint32_t *osSyscapArray, uint32_t osSyscapAr if (!cJSON_AddItemToObject(sysCapObj, "os", sysCapArray)) { PRINT_ERR("Add os syscap item to json object failed.\n"); - free(sysCapArray); + cJSON_Delete(sysCapArray); return -1; } return 0; -- Gitee From 0eeebde79ad032f2a692d6db46f6d6bfe324abef Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Mon, 16 Dec 2024 11:44:53 +0800 Subject: [PATCH 44/57] =?UTF-8?q?#issue:IBBHM1=20=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E8=B6=85=E5=A4=A7=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- src/create_pcid.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 77ba9b0..da299fe 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -480,7 +480,7 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) freePcidJsonInfo.jsonRootObj = NULL; freePcidJsonInfo.sysCapObj = NULL; freePcidJsonInfo.flag = 0; - + ret = CheckFileAndGetFileContext(inputFile, &freePcidJsonInfo.contextBuffer, (uint32_t *)&contextBufLen); if (ret != 0) { return -1; @@ -495,8 +495,7 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) } /* system type */ - char *systemType = pcidMain->systemType == 0b001 ? "mini" : - (pcidMain->systemType == 0b010 ? "small" : + char *systemType = pcidMain->systemType == 0b001 ? "mini" :(pcidMain->systemType == 0b010 ? "small" : (pcidMain->systemType == 0b100 ? "standard" : NULL)); if (systemType == NULL) { PRINT_ERR("prase file failed, systemType is invaild, %u\n", pcidMain->systemType); @@ -524,7 +523,6 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) freePcidJsonInfo.strJson = cJSON_Print(freePcidJsonInfo.jsonRootObj); if (freePcidJsonInfo.strJson == NULL) { - PRINT_ERR("cJSON_Print failed\n"); return FreeAfterDecodePCID(freePcidJsonInfo, FREE_DECODE_PCID_ROOT_OUT, -1); } -- Gitee From 22f60cdd51f06bcd6bb4ca5d18c78fd0d01f5656 Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 26 Dec 2024 06:33:21 +0000 Subject: [PATCH 45/57] =?UTF-8?q?=E6=96=B0=E5=A2=9EDRIVER=5FSCSI=5FEXTENSI?= =?UTF-8?q?ON=E5=92=8CDRIVER=5FUSBSERIAL=5FEXTENSION?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- include/codec_config/syscap_define.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 7ad42c8..3e3ca40 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -371,6 +371,8 @@ typedef enum SystemCapabilityNum { TELEPHONY_CORESERVICE_ESIM, DISTRIBUTEDDATAMANAGER_AIP_CORE, SECURITY_CERTIFICATE_MANAGER_DIALOG, + DRIVER_USBSERIAL_EXTENSION, + DRIVER_SCSI_EXTENSION, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -726,6 +728,8 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Global.FontManager", GLOBAL_FONTMANAGER}, {"SystemCapability.Telephony.CoreService.Esim", TELEPHONY_CORESERVICE_ESIM}, {"SystemCapability.DistributedDataManager.AIP.Core", DISTRIBUTEDDATAMANAGER_AIP_CORE}, + {"SystemCapability.Driver.UsbSerial.Extension", DRIVER_USBSERIAL_EXTENSION}, + {"SystemCapability.Driver.SCSI.Extension", DRIVER_SCSI_EXTENSION}, }; #ifdef __cplusplus -- Gitee From 7d9ce963e585268c36e1b56755eec75610f0e42a Mon Sep 17 00:00:00 2001 From: shilong Date: Thu, 26 Dec 2024 07:04:40 +0000 Subject: [PATCH 46/57] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E9=80=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shilong --- include/codec_config/syscap_define.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 3e3ca40..6b3a8e9 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -372,7 +372,7 @@ typedef enum SystemCapabilityNum { DISTRIBUTEDDATAMANAGER_AIP_CORE, SECURITY_CERTIFICATE_MANAGER_DIALOG, DRIVER_USBSERIAL_EXTENSION, - DRIVER_SCSI_EXTENSION, + DRIVER_SCSI_EXTENSION, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; -- Gitee From 840645393439715fa4fd0e64ad53e994932de1ba Mon Sep 17 00:00:00 2001 From: weiliuq Date: Wed, 5 Feb 2025 11:14:13 +0800 Subject: [PATCH 47/57] add syscap SystemCapability.ArkUI.ArkUI.Circle Signed-off-by: weiliuq --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 6b3a8e9..ab57875 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -373,6 +373,7 @@ typedef enum SystemCapabilityNum { SECURITY_CERTIFICATE_MANAGER_DIALOG, DRIVER_USBSERIAL_EXTENSION, DRIVER_SCSI_EXTENSION, + ARKUI_ARKUI_CIRCLE, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -730,6 +731,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.DistributedDataManager.AIP.Core", DISTRIBUTEDDATAMANAGER_AIP_CORE}, {"SystemCapability.Driver.UsbSerial.Extension", DRIVER_USBSERIAL_EXTENSION}, {"SystemCapability.Driver.SCSI.Extension", DRIVER_SCSI_EXTENSION}, + {"SystemCapability.ArkUI.ArkUI.Circle", ARKUI_ARKUI_CIRCLE}, }; #ifdef __cplusplus -- Gitee From 87edcfdff189e8858dae03ae20688bdfdf58146a Mon Sep 17 00:00:00 2001 From: Bagwey Date: Tue, 18 Feb 2025 11:14:43 +0800 Subject: [PATCH 48/57] add SystemCapability.Resourceschedule.BackgroundProcessManager Signed-off-by: Bagwey --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index ab57875..523a619 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -374,6 +374,7 @@ typedef enum SystemCapabilityNum { DRIVER_USBSERIAL_EXTENSION, DRIVER_SCSI_EXTENSION, ARKUI_ARKUI_CIRCLE, + RESOURCESCHEDULE_BACKGROUND_PROCESS_MANAGER, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -732,6 +733,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Driver.UsbSerial.Extension", DRIVER_USBSERIAL_EXTENSION}, {"SystemCapability.Driver.SCSI.Extension", DRIVER_SCSI_EXTENSION}, {"SystemCapability.ArkUI.ArkUI.Circle", ARKUI_ARKUI_CIRCLE}, + {"SystemCapability.Resourceschedule.BackgroundProcessManager", RESOURCESCHEDULE_BACKGROUND_PROCESS_MANAGER}, }; #ifdef __cplusplus -- Gitee From 93518e1510881ce15aa014a57d83dbaebf9ad8ae Mon Sep 17 00:00:00 2001 From: lcaidm Date: Tue, 18 Feb 2025 16:14:25 +0800 Subject: [PATCH 49/57] bugfix Signed-off-by:lcaidm Signed-off-by: lcaidm --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 523a619..6a353a6 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -375,6 +375,7 @@ typedef enum SystemCapabilityNum { DRIVER_SCSI_EXTENSION, ARKUI_ARKUI_CIRCLE, RESOURCESCHEDULE_BACKGROUND_PROCESS_MANAGER, + MULTIMODALAWARENESS_MOTION, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -734,6 +735,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Driver.SCSI.Extension", DRIVER_SCSI_EXTENSION}, {"SystemCapability.ArkUI.ArkUI.Circle", ARKUI_ARKUI_CIRCLE}, {"SystemCapability.Resourceschedule.BackgroundProcessManager", RESOURCESCHEDULE_BACKGROUND_PROCESS_MANAGER}, + {"SystemCapability.MultimodalAwarness.Motion", MULTIMODALAWARENESS_MOTION}, }; #ifdef __cplusplus -- Gitee From c7e05f6340cdf04d3d26c2ee45cdac90a20c81f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A6=E5=9B=BD=E5=BA=86?= Date: Fri, 21 Feb 2025 15:19:01 +0800 Subject: [PATCH 50/57] =?UTF-8?q?=E6=96=B0=E5=A2=9EDistributedSched?= =?UTF-8?q?=E7=9A=84syscap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 韦国庆 --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 6a353a6..9560041 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -376,6 +376,7 @@ typedef enum SystemCapabilityNum { ARKUI_ARKUI_CIRCLE, RESOURCESCHEDULE_BACKGROUND_PROCESS_MANAGER, MULTIMODALAWARENESS_MOTION, + DISTRIBUTEDSCHED_APPCOLLABORATION, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -736,6 +737,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.ArkUI.ArkUI.Circle", ARKUI_ARKUI_CIRCLE}, {"SystemCapability.Resourceschedule.BackgroundProcessManager", RESOURCESCHEDULE_BACKGROUND_PROCESS_MANAGER}, {"SystemCapability.MultimodalAwarness.Motion", MULTIMODALAWARENESS_MOTION}, + {"SystemCapability.DistributedSched.AppCollaboration", DISTRIBUTEDSCHED_APPCOLLABORATION}, }; #ifdef __cplusplus -- Gitee From e0a8d2b18f5e62735395ef4e97db99f174f19bb5 Mon Sep 17 00:00:00 2001 From: ccfriend Date: Thu, 27 Feb 2025 11:43:37 +0800 Subject: [PATCH 51/57] add avinpucast syscap Signed-off-by: ccfriend --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 9560041..d23bea7 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -377,6 +377,7 @@ typedef enum SystemCapabilityNum { RESOURCESCHEDULE_BACKGROUND_PROCESS_MANAGER, MULTIMODALAWARENESS_MOTION, DISTRIBUTEDSCHED_APPCOLLABORATION, + MULTIMEDIA_AVSESSION_AVINPUTCAST, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -633,6 +634,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Multimedia.AVSession.Manager", MULTIMEDIA_AVSESSION_MANAGER}, {"SystemCapability.Multimedia.AVSession.AVCast", MULTIMEDIA_AVSESSION_AVCAST}, {"SystemCapability.Multimedia.AVSession.ExtendedDisplayCast", MULTIMEDIA_AVSESSION_EXTENDEDDISPLAYCAST}, + {"SystemCapability.Multimedia.AVSession.AVInputCast", MULTIMEDIA_AVSESSION_AVINPUTCAST}, {"SystemCapability.Multimedia.Audio.Tone", MULTIMEDIA_AUDIO_TONE}, {"SystemCapability.Multimedia.Audio.Interrupt", MULTIMEDIA_AUDIO_INTERRUPT}, {"SystemCapability.Cloud.AAID", CLOUD_AAID}, -- Gitee From da8149c965781110ecc89ce5d4dfbcac35a7858b Mon Sep 17 00:00:00 2001 From: jinsitao Date: Tue, 11 Mar 2025 08:30:29 +0800 Subject: [PATCH 52/57] =?UTF-8?q?=E6=96=B0=E5=A2=9ESystemCapability.Game.G?= =?UTF-8?q?ameController?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jinsitao --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index d23bea7..be54e82 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -378,6 +378,7 @@ typedef enum SystemCapabilityNum { MULTIMODALAWARENESS_MOTION, DISTRIBUTEDSCHED_APPCOLLABORATION, MULTIMEDIA_AVSESSION_AVINPUTCAST, + GAME_GAMECONTROLLER, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -740,6 +741,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Resourceschedule.BackgroundProcessManager", RESOURCESCHEDULE_BACKGROUND_PROCESS_MANAGER}, {"SystemCapability.MultimodalAwarness.Motion", MULTIMODALAWARENESS_MOTION}, {"SystemCapability.DistributedSched.AppCollaboration", DISTRIBUTEDSCHED_APPCOLLABORATION}, + {"SystemCapability.Game.GameController", GAME_GAMECONTROLLER}, }; #ifdef __cplusplus -- Gitee From 8e768b649f36a71e1771c998357fca2a64fefe5c Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Fri, 14 Mar 2025 16:31:40 +0800 Subject: [PATCH 53/57] =?UTF-8?q?ISSUE:IBTG29=20=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- src/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.c b/src/main.c index 2fd051a..4593ddf 100644 --- a/src/main.c +++ b/src/main.c @@ -212,7 +212,6 @@ void PrintHelp(void) void OutputVersion(const char *arg, int opt) { if (arg != NULL && opt > 1) { - printf("syscap_tool: extra operand \"%s\"\n", arg); printf("Try 'syscap_tool --help' for more information.\n"); } else { (void)PrintVersion(); -- Gitee From 4ed8bd7f051f3141b3abac0b6d801650d14900dd Mon Sep 17 00:00:00 2001 From: lcaidm Date: Thu, 20 Mar 2025 18:06:27 +0800 Subject: [PATCH 54/57] bugfix Signed-off-by:lcaidm Signed-off-by: lcaidm --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index be54e82..9b793a6 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -379,6 +379,7 @@ typedef enum SystemCapabilityNum { DISTRIBUTEDSCHED_APPCOLLABORATION, MULTIMEDIA_AVSESSION_AVINPUTCAST, GAME_GAMECONTROLLER, + DISTRIBUTEDDATAMANAGER_DATAINTELLIGENCE_CORE, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -742,6 +743,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.MultimodalAwarness.Motion", MULTIMODALAWARENESS_MOTION}, {"SystemCapability.DistributedSched.AppCollaboration", DISTRIBUTEDSCHED_APPCOLLABORATION}, {"SystemCapability.Game.GameController", GAME_GAMECONTROLLER}, + {"SystemCapability.DistributedDataManager.DataIntelligence.Core", DISTRIBUTEDDATAMANAGER_DATAINTELLIGENCE_CORE}, }; #ifdef __cplusplus -- Gitee From 4e42a7d999e63e85cf64f6d95350a54a16405c04 Mon Sep 17 00:00:00 2001 From: zhaohang Date: Mon, 24 Mar 2025 16:16:21 +0800 Subject: [PATCH 55/57] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaohang --- src/create_pcid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/create_pcid.c b/src/create_pcid.c index da299fe..c5e5bed 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -379,6 +379,11 @@ static int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, int32_t con char *tempPriSyscapStr = priSyscapStr; char *ptrPrivateSyscap = (char *)(pcidMain + 1); while (*ptrPrivateSyscap != '\0') { + size_t currentLen = tempPriSyscapStr - priSyscapStr; + if (currentLen >= SINGLE_SYSCAP_LEN - 1) { + PRINT_ERR("Syscap name exceeds maximum length\n"); + return GetPriSyscapResult(capVectorPtr, -1); + } if (*ptrPrivateSyscap == ',') { *tempPriSyscapStr = '\0'; int32_t ret = sprintf_s(fullCapStr, SINGLE_SYSCAP_LEN, "SystemCapability.%s", priSyscapStr); -- Gitee From 2363cf20f328eae70a474acd542fa3ddf23639ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E6=98=AF=E9=93=B8=E5=B8=81=E6=8D=8F?= Date: Wed, 26 Mar 2025 08:03:37 +0000 Subject: [PATCH 56/57] add syscap for device_status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 就是铸币捏 --- include/codec_config/syscap_define.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 9b793a6..aa8026a 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -380,6 +380,7 @@ typedef enum SystemCapabilityNum { MULTIMEDIA_AVSESSION_AVINPUTCAST, GAME_GAMECONTROLLER, DISTRIBUTEDDATAMANAGER_DATAINTELLIGENCE_CORE, + MULTIMODALAWARENESS_DEVICESTATUS, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -744,6 +745,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.DistributedSched.AppCollaboration", DISTRIBUTEDSCHED_APPCOLLABORATION}, {"SystemCapability.Game.GameController", GAME_GAMECONTROLLER}, {"SystemCapability.DistributedDataManager.DataIntelligence.Core", DISTRIBUTEDDATAMANAGER_DATAINTELLIGENCE_CORE}, + {"SystemCapability.MultimodalAwareness.DeviceStatus", MULTIMODALAWARENESS_DEVICESTATUS}, }; #ifdef __cplusplus -- Gitee From a0e8b56b22ee06771097a035325bdf0bd57a35fa Mon Sep 17 00:00:00 2001 From: zhaohang Date: Thu, 27 Mar 2025 15:01:50 +0800 Subject: [PATCH 57/57] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaohang --- src/create_pcid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index c5e5bed..1b08215 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -381,7 +381,7 @@ static int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, int32_t con while (*ptrPrivateSyscap != '\0') { size_t currentLen = tempPriSyscapStr - priSyscapStr; if (currentLen >= SINGLE_SYSCAP_LEN - 1) { - PRINT_ERR("Syscap name exceeds maximum length\n"); + printf("Syscap name exceeds maximum length\n"); return GetPriSyscapResult(capVectorPtr, -1); } if (*ptrPrivateSyscap == ',') { -- Gitee