From a3b60db4c346cd15934abd8613bfcd23fd237418 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Fri, 22 Mar 2024 10:29:54 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9PCID=E4=BB=A5=E5=8F=8ARPC?= =?UTF-8?q?ID=E5=A4=A7=E5=86=99=E4=B8=BA=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- BUILD.gn | 12 +++--- README.md | 16 ++++---- README_ZH.md | 50 ++++++++++++------------- RELEASE-NOTE.txt | 2 +- interfaces/inner_api/syscap_interface.c | 6 +-- src/create_pcid.c | 6 +-- src/main.c | 32 ++++++++-------- src/syscap_tool.c | 6 +-- 8 files changed, 65 insertions(+), 65 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index f9d2aee..8369bf3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -137,7 +137,7 @@ group("syscap_tool_bin_linux") { } build_ext_component("generate_pcid") { - outputs = [ "$root_out_dir/PCID.sc" ] + outputs = [ "$root_out_dir/pcid.sc" ] deps = [ ":syscap_tool_bin_linux" ] exec_path = rebase_path(root_out_dir) preload_path = rebase_path(preloader_output_dir) @@ -148,15 +148,15 @@ build_ext_component("generate_pcid") { } command = "chmod 777 $cmd" command += - " && $cmd -P -e -i ${preload_path}/system/etc/SystemCapability.json" + " && $cmd -p -e -i ${preload_path}/system/etc/SystemCapability.json" if (defined(ohos_lite)) { - command += " && mkdir -p $exec_path/system/etc && cp $exec_path/PCID.sc $exec_path/system/etc/PCID.sc" + command += " && mkdir -p $exec_path/system/etc && cp $exec_path/pcid.sc $exec_path/system/etc/pcid.sc" } } -ohos_prebuilt_etc("PCID.sc") { +ohos_prebuilt_etc("pcid.sc") { deps = [ ":generate_pcid" ] - source = "$root_out_dir/PCID.sc" + source = "$root_out_dir/pcid.sc" subsystem_name = "developtools" part_name = "syscap_codec" } @@ -182,7 +182,7 @@ if (syscap_codec_config_extern_path != "") { } group("pcid_sc") { - deps = [ ":PCID.sc" ] + deps = [ ":pcid.sc" ] } group("syscap_codec") { diff --git a/README.md b/README.md index 005c7bc..312bc67 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,17 @@ SysCap(SystemCapability) encoder and decoder tools common usage scenarios as follow: -APP development: IDE collect APP required SysCap and API verssion as in RPCID encoder input. And IDE will decode PCID to device SysCap list when it imported. This tool is only for use by the IDE, developers will not be used directly. +APP development: IDE collect APP required SysCap and API verssion as in rpcid encoder input. And IDE will decode pcid to device SysCap list when it imported. This tool is only for use by the IDE, developers will not be used directly. Main function: -1. PCID Encode: Encode SysCap list to PCID. +1. pcid Encode: Encode SysCap list to pcid. -2. PCID Decode: Decode PCID to get system SysCap list. +2. pcid Decode: Decode pcid to get system SysCap list. -3. RPCID Encode: Encode APP required SysCap list to RPCID. +3. rpcid Encode: Encode APP required SysCap list to rpcid. -4. RPCID Decode: Decode RPCID to get APP required SysCap list. +4. rpcid Decode: Decode rpcid to get APP required SysCap list. ## File Structure @@ -65,13 +65,13 @@ SysCap tools usually integrate to IDE, APP store and bundle tools. Follow instru ``` ./syscap_tool --help -./syscap_tool -R/P -e/d -i filepath [-o outpath] +./syscap_tool -r/p -e/d -i filepath [-o outpath] -h, --help : how to use --R, --RPCID : encode or decode RPCID +-r, --rpcid : encode or decode rpcid --P, --PCID : encode or decode PCID +-p, --pcid : encode or decode pcid -e, --encode : to encode diff --git a/README_ZH.md b/README_ZH.md index b39cfbc..b213b40 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -2,21 +2,21 @@ 系统能力(SystemCapability, 本文中使用SysCap缩写)编解码工具应用场景如下: -应用开发时,IDE会根据应用配置的SysCap和API版本生成描述RPCID(Required Product Compatibility ID)的json文件,并调用编解码工具syscap_tool将该json文件编码成RPCID。另一方面,IDE拿到开发者导入PCID(Product Compatibility ID),使用该工具解码出设备的SysCap集合。该工具仅供IDE使用,对用户不可见。 +应用开发时,IDE会根据应用配置的SysCap和API版本生成描述rpcid(Required Product Compatibility ID)的json文件,并调用编解码工具syscap_tool将该json文件编码成rpcid。另一方面,IDE拿到开发者导入pcid(Product Compatibility ID),使用该工具解码出设备的SysCap集合。该工具仅供IDE使用,对用户不可见。 提供的主要功能: -1. PCID编码:对描述SysCap集合的文件编码生成PCID。 +1. pcid编码:对描述SysCap集合的文件编码生成pcid。 -2. PCID解码:对编码后的PCID文件解码获取SysCap集合。 +2. pcid解码:对编码后的pcid文件解码获取SysCap集合。 -3. RPCID编码:对描述应用所需的SysCap集合的文件编码生成RPCID。 +3. rpcid编码:对描述应用所需的SysCap集合的文件编码生成rpcid。 -4. RPCID解码:对编码后的RPCID文件解码获取应用所需的SysCap集合。 +4. rpcid解码:对编码后的rpcid文件解码获取应用所需的SysCap集合。 -5. 编码字符串:将sc后缀形式的PCID/RPCID编码为字符串形式。 +5. 编码字符串:将sc后缀形式的pcid/rpcid编码为字符串形式。 -6. PCID与RPCID比较:查询PCID是否满足RPCID的要求,并输出不满足的地方。 +6. pcid与rpcid比较:查询pcid是否满足rpcid的要求,并输出不满足的地方。 ## 代码目录 ``` @@ -70,10 +70,10 @@ syscap_tool PC端可执行文件编译步骤: 使用./syscap_tool -h或者./syscap_tool --help查看: ```shell -syscap_tool -R/P -e/d -i filepath [-o outpath] +syscap_tool -r/p -e/d -i filepath [-o outpath] -h, --help : how to use --R, --RPCID : encode or decode RPCID --P, --PCID : encode or decode PCID +-r, --rpcid : encode or decode rpcid +-p, --pcid : encode or decode pcid -C, --compare : compare pcid with rpcid string format. -s, --string : input string. -e, --encode : encode to sc format. @@ -88,32 +88,32 @@ syscap_tool v1.1.1 ``` ### 使用示例 ```shell -# 将 RPCID.json 编码为SC格式,文件名RPCID.sc -syscap_tool -Rei RPCID.json -o path/ +# 将 rpcid.json 编码为SC格式,文件名rpcid.sc +syscap_tool -rei rpcid.json -o path/ -# 将 RPCID.sc 编码为JSON格式,文件名RPCID.json -syscap_tool -Rdi RPCID.sc -o path/ +# 将 pcid.sc 编码为JSON格式,文件名rpcid.json +syscap_tool -rdi pcid.sc -o path/ -# 将 PCID.json 编码为SC格式,文件名PCID.sc -syscap_tool -Pei PCID.json -o path/ +# 将 pcid.json 编码为SC格式,文件名pcid.sc +syscap_tool -pei pcid.json -o path/ -# 将 PCID.sc 编码为JSON格式,文件名PCID.json -syscap_tool -Pdi PCID.sc -o path/ +# 将 pcid.sc 编码为JSON格式,文件名pcid.json +syscap_tool -pdi pcid.sc -o path/ -# 将 RPCID.sc 编码为字符串格式,文件名RPCID.txt -syscap_tool -Resi RPCID.sc -o path/ +# 将 pcid.sc 编码为字符串格式,文件名rpcid.txt +syscap_tool -resi pcid.sc -o path/ -# 将 PCID.sc 编码为字符串格式,文件名PCID.txt -syscap_tool -Pesi PCID.sc -o path/ +# 将 pcid.sc 编码为字符串格式,文件名pcid.txt +syscap_tool -pesi pcid.sc -o path/ -# 比较字符串格式的PCID和RPCID,pcid 符合条件返回成功提示,不符合则提示原因。 +# 比较字符串格式的pcid和rpcid,pcid 符合条件返回成功提示,不符合则提示原因。 syscap_tool -C pcid.txt rpcid.txt # 功能类似 -C 选项,区别为 -SC 选项为直接输入字符串。 syscap_tool -sC "pcidstring" "rpcidstring" -# 将字符串格式的 pcid 转为 json 格式,文件名 PCID.json。 -syscap_tool -Pdsi pcid.txt -o path/ +# 将字符串格式的 pcid 转为 json 格式,文件名 pcid.json。 +syscap_tool -pdsi pcid.txt -o path/ ``` **说明:** -o 选项指定输出目录,缺省为当前目录。 diff --git a/RELEASE-NOTE.txt b/RELEASE-NOTE.txt index 7a8e370..2bc6e3e 100644 --- a/RELEASE-NOTE.txt +++ b/RELEASE-NOTE.txt @@ -1,5 +1,5 @@ v2.0.0 reorganize syscap define. v1.1.2 add syscap "SystemCapability.ArkUI.UiAppearance". v1.1.1 add compare string pcid with rpcid function. -v1.1.0 add encode/decode string format PCID/RPCID. +v1.1.0 add encode/decode string format pcid/rpcid. v1.0.0 first release. \ No newline at end of file diff --git a/interfaces/inner_api/syscap_interface.c b/interfaces/inner_api/syscap_interface.c index 4eb457c..b407613 100644 --- a/interfaces/inner_api/syscap_interface.c +++ b/interfaces/inner_api/syscap_interface.c @@ -57,7 +57,7 @@ typedef struct ProductCompatibilityID { uint8_t osSyscap[OS_SYSCAP_BYTES]; } PCIDMain; -static const char *g_pcidPath = "/system/etc/PCID.sc"; +static const char *g_pcidPath = "/system/etc/pcid.sc"; struct FreeAfterDecodeRpcidInfo { char *priSyscap; @@ -91,7 +91,7 @@ bool EncodeOsSyscap(char *output, int len) ret = GetFileContext(g_pcidPath, &contextBuffer, &bufferLen); if (ret != 0) { - PRINT_ERR("GetFileContext failed, input file : /system/etc/PCID.sc\n"); + PRINT_ERR("GetFileContext failed, input file : /system/etc/pcid.sc\n"); return false; } @@ -115,7 +115,7 @@ bool EncodePrivateSyscap(char **output, int *outputLen) ret = GetFileContext(g_pcidPath, &contextBuffer, &bufferLen); if (ret != 0) { - PRINT_ERR("GetFileContext failed, input file : /system/etc/PCID.sc\n"); + PRINT_ERR("GetFileContext failed, input file : /system/etc/pcid.sc\n"); return false; } diff --git a/src/create_pcid.c b/src/create_pcid.c index cea4e57..adacedd 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -213,7 +213,7 @@ int32_t GetPriSyscapLen(uint32_t privateCapSize, cJSON *jsonPriSyscapObj, uint16 static int32_t CheckConvertedContextSaveAsFile(char *outDirPath, PCIDMain *pcidBuffer, uint16_t pcidLength, int32_t ret) { - const char pcidFileName[] = "PCID.sc"; + const char pcidFileName[] = "pcid.sc"; ret = ConvertedContextSaveAsFile(outDirPath, pcidFileName, (char *)pcidBuffer, pcidLength); if (ret != 0) { PRINT_ERR("Save as file failed, outDirPath:%s, filename:%s\n", outDirPath, pcidFileName); @@ -502,7 +502,7 @@ int32_t DecodePCID(char *inputFile, char *outDirPath) freePcidJsonInfo.sysCapObj = NULL; // avoid being released repeatedly. char *strJson = cJSON_Print(freePcidJsonInfo.jsonRootObj); - const char outputFileName[] = "PCID.json"; + const char outputFileName[] = "pcid.json"; ret = ConvertedContextSaveAsFile(outDirPath, outputFileName, strJson, strlen(strJson)); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outDirPath:%s, filename:%s\n", outDirPath, outputFileName); @@ -706,7 +706,7 @@ int32_t DecodeStringPCIDToJson(char *input, char *outDirPath) } // save as json file char *jsonBuffer = cJSON_Print(rootObj); - const char outputFileName[] = "PCID.json"; + const char outputFileName[] = "pcid.json"; if (ConvertedContextSaveAsFile(outDirPath, outputFileName, jsonBuffer, strlen(jsonBuffer)) != 0) { PRINT_ERR("Save as json file failed.\n"); diff --git a/src/main.c b/src/main.c index 4cc9e42..f75515c 100644 --- a/src/main.c +++ b/src/main.c @@ -50,8 +50,8 @@ int32_t OperateByBitMap(char *const *argv, uint16_t bitMap, char *outputpath); static struct option g_longOptions[] = { {"help", no_argument, 0, 'h' }, {"version", no_argument, 0, 'v' }, - {"RPCID", no_argument, 0, 'R' }, - {"PCID", no_argument, 0, 'P' }, + {"rpcid", no_argument, 0, 'r' }, + {"pcid", no_argument, 0, 'p' }, {"compare", required_argument, 0, 'C' }, {"encode", no_argument, 0, 'e' }, {"decode", no_argument, 0, 'd' }, @@ -103,28 +103,28 @@ int32_t OperateByBitMap(char *const *argv, uint16_t bitMap, char *outputpath) { int32_t ret = 0; switch (bitMap) { - case 0x109: // 0x109, -Rei inputfile + case 0x109: // 0x109, -rei inputfile ret = RPCIDEncode(g_customerfileinfo.inputfile, outputpath); break; - case 0x10A: // 0x10A, -Rdi inputfile + case 0x10A: // 0x10A, -rdi inputfile ret = RPCIDDecode(g_customerfileinfo.inputfile, outputpath); break; - case 0x10D: // 0x10D, -Resi inputfile + case 0x10D: // 0x10D, -resi inputfile ret = EncodeRpcidscToString(g_customerfileinfo.inputfile, outputpath); break; - case 0x115: // 0x115, -Pesi inputfile + case 0x115: // 0x115, -pesi inputfile ret = EncodePcidscToString(g_customerfileinfo.inputfile, outputpath); break; - case 0x60: // 0x60, -C PCID.txt RPCID.txt + case 0x60: // 0x60, -C pcid.txt rpcid.txt ret = ComparePcidWithRpcidString(g_customerfileinfo.pcidfile, g_customerfileinfo.rpcidfile, TYPE_FILE); break; - case 0x64: // 0x64, -sC "pcidstring" "rpcidstring" + case 0x64: // 0x64, -sc "pcidstring" "rpcidstring" ret = ComparePcidWithRpcidString(g_customerfileinfo.pcidfile, g_customerfileinfo.rpcidfile, TYPE_STRING); break; - case 0x111: // 0x111, -Pei inputfile + case 0x111: // 0x111, -pei inputfile ret = CreatePCID(g_customerfileinfo.inputfile, outputpath); break; - case 0x112: // 0x112, -Pdi inputfile + case 0x112: // 0x112, -pdi inputfile ret = DecodePCID(g_customerfileinfo.inputfile, outputpath); break; - case 0x116: // 0x116, -Pdsi inputfile + case 0x116: // 0x116, -pdsi inputfile ret = DecodeStringPCIDToJson(g_customerfileinfo.inputfile, outputpath); break; - case 0x10E: // 0x10E, -Rdsi inputfile - printf("-Rdsi is not support currently.\n"); break; + case 0x10E: // 0x10E, -rdsi inputfile + printf("-rdsi is not support currently.\n"); break; case 0x80: // 0x80, -v (void)OutputVersion(argv[optind], optind); break; default: @@ -186,10 +186,10 @@ void PrintVersion(void) void PrintHelp(void) { - printf("syscap_tool -R/P -e/d -i filepath [-o outpath]\n"); + printf("syscap_tool -r/p -e/d -i filepath [-o outpath]\n"); printf("-h, --help\t: how to use\n"); - printf("-R, --RPCID\t: encode or decode RPCID\n"); - printf("-P, --PCID\t: encode or decode PCID\n"); + printf("-r, --rpcid\t: encode or decode rpcid\n"); + printf("-p, --pcid\t: encode or decode pcid\n"); printf("-C, --compare\t: compare pcid with rpcid string format.\n\t" "-s, --string : input string.\n"); printf("-e, --encode\t: encode to sc format.\n\t-s, --string : encode to string format.\n"); diff --git a/src/syscap_tool.c b/src/syscap_tool.c index ff4e084..421e9d1 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -179,7 +179,7 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) if (ret == -1) { return FreeAfterRPCIDEncode(convertedBuffer, contextBuffer, FREE_CONVERT_OUT_RPCID_ENCODE, ret); } - ret = ConvertedContextSaveAsFile(outputPath, "RPCID.sc", convertedBuffer, convertedBufLen); + ret = ConvertedContextSaveAsFile(outputPath, "rpcid.sc", convertedBuffer, convertedBufLen); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.sc\n", outputPath); } @@ -258,7 +258,7 @@ int32_t RPCIDDecode(char *inputFile, char *outputPath) // save to json file convertedBuffer = cJSON_Print(rpcidRoot); - ret = ConvertedContextSaveAsFile(outputPath, "RPCID.json", convertedBuffer, strlen(convertedBuffer)); + ret = ConvertedContextSaveAsFile(outputPath, "rpcid.json", convertedBuffer, strlen(convertedBuffer)); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.json\n", outputPath); goto FREE_RPCID_ROOT; @@ -333,7 +333,7 @@ static int32_t PrintOutputToFile(struct FreeAfterEncodeRpcidscInfo freeAfterEnco } } - const char outputFilename[] = "RPCID.txt"; + const char outputFilename[] = "rpcid.txt"; ret = ConvertedContextSaveAsFile(outDirPath, outputFilename, freeAfterEncodeRpcidscInfo.outBuffer, strlen(freeAfterEncodeRpcidscInfo.outBuffer)); if (ret != 0) { -- Gitee From 5976100e52c14e203baeff9bb4d6ced84339cc3c Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Mon, 25 Mar 2024 10:29:18 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9PCID=E4=BB=A5=E5=8F=8ARPC?= =?UTF-8?q?ID=E5=A4=A7=E5=86=99=E4=B8=BA=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index f75515c..4b1d0b1 100644 --- a/src/main.c +++ b/src/main.c @@ -145,10 +145,10 @@ void SetBitMap(char *const *argv, int32_t flag, uint16_t *bitMap, char **outputp case 's': (*bitMap) |= 0x1 << STRING_DECODE; break; - case 'R': + case 'r': (*bitMap) |= 0x1 << RPCID; break; - case 'P': + case 'p': (*bitMap) |= 0x1 << PCID; break; case 'C': -- Gitee From ee2aa753ba03fae8634e620e94b32e76b789f0d1 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Fri, 22 Mar 2024 10:29:54 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9PCID=E4=BB=A5=E5=8F=8ARPC?= =?UTF-8?q?ID=E5=A4=A7=E5=86=99=E4=B8=BA=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- README.md | 6 +++--- README_ZH.md | 22 +++++++++++----------- src/create_pcid.c | 2 +- src/main.c | 34 +++++++++++++++++----------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 312bc67..4ca90a9 100644 --- a/README.md +++ b/README.md @@ -65,13 +65,13 @@ SysCap tools usually integrate to IDE, APP store and bundle tools. Follow instru ``` ./syscap_tool --help -./syscap_tool -r/p -e/d -i filepath [-o outpath] +./syscap_tool -R/P -e/d -i filepath [-o outpath] -h, --help : how to use --r, --rpcid : encode or decode rpcid +-R, --rpcid : encode or decode rpcid --p, --pcid : encode or decode pcid +-P, --pcid : encode or decode pcid -e, --encode : to encode diff --git a/README_ZH.md b/README_ZH.md index b213b40..a12c356 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -70,10 +70,10 @@ syscap_tool PC端可执行文件编译步骤: 使用./syscap_tool -h或者./syscap_tool --help查看: ```shell -syscap_tool -r/p -e/d -i filepath [-o outpath] +syscap_tool -R/P -e/d -i filepath [-o outpath] -h, --help : how to use --r, --rpcid : encode or decode rpcid --p, --pcid : encode or decode pcid +-R, --rpcid : encode or decode rpcid +-P, --pcid : encode or decode pcid -C, --compare : compare pcid with rpcid string format. -s, --string : input string. -e, --encode : encode to sc format. @@ -89,31 +89,31 @@ syscap_tool v1.1.1 ### 使用示例 ```shell # 将 rpcid.json 编码为SC格式,文件名rpcid.sc -syscap_tool -rei rpcid.json -o path/ +syscap_tool -Rei rpcid.json -o path/ # 将 pcid.sc 编码为JSON格式,文件名rpcid.json -syscap_tool -rdi pcid.sc -o path/ +syscap_tool -Rdi pcid.sc -o path/ # 将 pcid.json 编码为SC格式,文件名pcid.sc -syscap_tool -pei pcid.json -o path/ +syscap_tool -Pei pcid.json -o path/ # 将 pcid.sc 编码为JSON格式,文件名pcid.json -syscap_tool -pdi pcid.sc -o path/ +syscap_tool -Pdi pcid.sc -o path/ # 将 pcid.sc 编码为字符串格式,文件名rpcid.txt -syscap_tool -resi pcid.sc -o path/ +syscap_tool -Resi pcid.sc -o path/ # 将 pcid.sc 编码为字符串格式,文件名pcid.txt -syscap_tool -pesi pcid.sc -o path/ +syscap_tool -Pesi pcid.sc -o path/ # 比较字符串格式的pcid和rpcid,pcid 符合条件返回成功提示,不符合则提示原因。 syscap_tool -C pcid.txt rpcid.txt -# 功能类似 -C 选项,区别为 -SC 选项为直接输入字符串。 +# 功能类似 -C选项,区别为 -sC 选项为直接输入字符串。 syscap_tool -sC "pcidstring" "rpcidstring" # 将字符串格式的 pcid 转为 json 格式,文件名 pcid.json。 -syscap_tool -pdsi pcid.txt -o path/ +syscap_tool -Pdsi pcid.txt -o path/ ``` **说明:** -o 选项指定输出目录,缺省为当前目录。 diff --git a/src/create_pcid.c b/src/create_pcid.c index adacedd..8f37087 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -775,7 +775,7 @@ static int32_t GetEncodePCIDOut(uint16_t priSyscapCount, uint32_t privateSyscapL } } // save as file - const char outputFileName[] = "PCID.txt"; + const char outputFileName[] = "pcid.txt"; ret = ConvertedContextSaveAsFile(freePcidInfo.outDirPathFinal, outputFileName, output, strlen(output)); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outDirPath:%s, filename:%s\n", diff --git a/src/main.c b/src/main.c index 4b1d0b1..a54d331 100644 --- a/src/main.c +++ b/src/main.c @@ -50,8 +50,8 @@ int32_t OperateByBitMap(char *const *argv, uint16_t bitMap, char *outputpath); static struct option g_longOptions[] = { {"help", no_argument, 0, 'h' }, {"version", no_argument, 0, 'v' }, - {"rpcid", no_argument, 0, 'r' }, - {"pcid", no_argument, 0, 'p' }, + {"rpcid", no_argument, 0, 'R' }, + {"pcid", no_argument, 0, 'P' }, {"compare", required_argument, 0, 'C' }, {"encode", no_argument, 0, 'e' }, {"decode", no_argument, 0, 'd' }, @@ -103,28 +103,28 @@ int32_t OperateByBitMap(char *const *argv, uint16_t bitMap, char *outputpath) { int32_t ret = 0; switch (bitMap) { - case 0x109: // 0x109, -rei inputfile + case 0x109: // 0x109, -Rei inputfile ret = RPCIDEncode(g_customerfileinfo.inputfile, outputpath); break; - case 0x10A: // 0x10A, -rdi inputfile + case 0x10A: // 0x10A, -Rdi inputfile ret = RPCIDDecode(g_customerfileinfo.inputfile, outputpath); break; - case 0x10D: // 0x10D, -resi inputfile + case 0x10D: // 0x10D, -Resi inputfile ret = EncodeRpcidscToString(g_customerfileinfo.inputfile, outputpath); break; - case 0x115: // 0x115, -pesi inputfile + case 0x115: // 0x115, -Pesi inputfile ret = EncodePcidscToString(g_customerfileinfo.inputfile, outputpath); break; case 0x60: // 0x60, -C pcid.txt rpcid.txt ret = ComparePcidWithRpcidString(g_customerfileinfo.pcidfile, g_customerfileinfo.rpcidfile, TYPE_FILE); break; - case 0x64: // 0x64, -sc "pcidstring" "rpcidstring" + case 0x64: // 0x64, -sC "pcidstring" "rpcidstring" ret = ComparePcidWithRpcidString(g_customerfileinfo.pcidfile, g_customerfileinfo.rpcidfile, TYPE_STRING); break; - case 0x111: // 0x111, -pei inputfile + case 0x111: // 0x111, -Pei inputfile ret = CreatePCID(g_customerfileinfo.inputfile, outputpath); break; - case 0x112: // 0x112, -pdi inputfile + case 0x112: // 0x112, -Pdi inputfile ret = DecodePCID(g_customerfileinfo.inputfile, outputpath); break; - case 0x116: // 0x116, -pdsi inputfile + case 0x116: // 0x116, -Pdsi inputfile ret = DecodeStringPCIDToJson(g_customerfileinfo.inputfile, outputpath); break; - case 0x10E: // 0x10E, -rdsi inputfile - printf("-rdsi is not support currently.\n"); break; + case 0x10E: // 0x10E, -Rdsi inputfile + printf("-Rdsi is not support currently.\n"); break; case 0x80: // 0x80, -v (void)OutputVersion(argv[optind], optind); break; default: @@ -145,10 +145,10 @@ void SetBitMap(char *const *argv, int32_t flag, uint16_t *bitMap, char **outputp case 's': (*bitMap) |= 0x1 << STRING_DECODE; break; - case 'r': + case 'R': (*bitMap) |= 0x1 << RPCID; break; - case 'p': + case 'P': (*bitMap) |= 0x1 << PCID; break; case 'C': @@ -186,10 +186,10 @@ void PrintVersion(void) void PrintHelp(void) { - printf("syscap_tool -r/p -e/d -i filepath [-o outpath]\n"); + printf("syscap_tool -R/P -e/d -i filepath [-o outpath]\n"); printf("-h, --help\t: how to use\n"); - printf("-r, --rpcid\t: encode or decode rpcid\n"); - printf("-p, --pcid\t: encode or decode pcid\n"); + printf("-R, --rpcid\t: encode or decode rpcid\n"); + printf("-P, --pcid\t: encode or decode pcid\n"); printf("-C, --compare\t: compare pcid with rpcid string format.\n\t" "-s, --string : input string.\n"); printf("-e, --encode\t: encode to sc format.\n\t-s, --string : encode to string format.\n"); -- Gitee From 6dbd533653abfbb482efb0804cf134c32d6f2317 Mon Sep 17 00:00:00 2001 From: yangzk Date: Wed, 27 Mar 2024 10:15:02 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=96=B0=E5=A2=9ESystemCapability.Ability.?= =?UTF-8?q?AppStartup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangzk Change-Id: I5658eb0a2d5f6eb4591aaebe46b74697c821e361 --- 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 8e1d5c1..1e42cbd 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -342,6 +342,7 @@ typedef enum SystemCapabilityNum { AI_NEURAL_NETWORK_RUNTIME, RESOURCESCHEDULE_SYSTEMLOAD, MSDP_MULTIMODAL_AWARENESS, + ABILITY_APP_STARTUP, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -666,6 +667,7 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.Multimedia.AudioHaptic.Core", MULTIMEDIA_MEDIA_AUDIOHAPTIC_CORE}, {"SystemCapability.Resourceschedule.Ffrt.Core", RESOURCESCHEDULE_FFRT_CORE}, {"SystemCapability.AI.MindSporeLite", AI_MINDSPORELITE}, + {"SystemCapability.Ability.AppStartup", ABILITY_APP_STARTUP}, {"SystemCapability.Base", BASE}, }; -- Gitee From 0974d398f9b571135bb569b991eb491e395e8442 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Fri, 22 Mar 2024 10:29:54 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9PCID=E4=BB=A5=E5=8F=8ARPC?= =?UTF-8?q?ID=E5=A4=A7=E5=86=99=E4=B8=BA=E5=B0=8F=E5=86=99=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- README.md | 6 +++--- README_ZH.md | 22 +++++++++++----------- src/create_pcid.c | 2 +- src/main.c | 34 +++++++++++++++++----------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 312bc67..4ca90a9 100644 --- a/README.md +++ b/README.md @@ -65,13 +65,13 @@ SysCap tools usually integrate to IDE, APP store and bundle tools. Follow instru ``` ./syscap_tool --help -./syscap_tool -r/p -e/d -i filepath [-o outpath] +./syscap_tool -R/P -e/d -i filepath [-o outpath] -h, --help : how to use --r, --rpcid : encode or decode rpcid +-R, --rpcid : encode or decode rpcid --p, --pcid : encode or decode pcid +-P, --pcid : encode or decode pcid -e, --encode : to encode diff --git a/README_ZH.md b/README_ZH.md index b213b40..a12c356 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -70,10 +70,10 @@ syscap_tool PC端可执行文件编译步骤: 使用./syscap_tool -h或者./syscap_tool --help查看: ```shell -syscap_tool -r/p -e/d -i filepath [-o outpath] +syscap_tool -R/P -e/d -i filepath [-o outpath] -h, --help : how to use --r, --rpcid : encode or decode rpcid --p, --pcid : encode or decode pcid +-R, --rpcid : encode or decode rpcid +-P, --pcid : encode or decode pcid -C, --compare : compare pcid with rpcid string format. -s, --string : input string. -e, --encode : encode to sc format. @@ -89,31 +89,31 @@ syscap_tool v1.1.1 ### 使用示例 ```shell # 将 rpcid.json 编码为SC格式,文件名rpcid.sc -syscap_tool -rei rpcid.json -o path/ +syscap_tool -Rei rpcid.json -o path/ # 将 pcid.sc 编码为JSON格式,文件名rpcid.json -syscap_tool -rdi pcid.sc -o path/ +syscap_tool -Rdi pcid.sc -o path/ # 将 pcid.json 编码为SC格式,文件名pcid.sc -syscap_tool -pei pcid.json -o path/ +syscap_tool -Pei pcid.json -o path/ # 将 pcid.sc 编码为JSON格式,文件名pcid.json -syscap_tool -pdi pcid.sc -o path/ +syscap_tool -Pdi pcid.sc -o path/ # 将 pcid.sc 编码为字符串格式,文件名rpcid.txt -syscap_tool -resi pcid.sc -o path/ +syscap_tool -Resi pcid.sc -o path/ # 将 pcid.sc 编码为字符串格式,文件名pcid.txt -syscap_tool -pesi pcid.sc -o path/ +syscap_tool -Pesi pcid.sc -o path/ # 比较字符串格式的pcid和rpcid,pcid 符合条件返回成功提示,不符合则提示原因。 syscap_tool -C pcid.txt rpcid.txt -# 功能类似 -C 选项,区别为 -SC 选项为直接输入字符串。 +# 功能类似 -C选项,区别为 -sC 选项为直接输入字符串。 syscap_tool -sC "pcidstring" "rpcidstring" # 将字符串格式的 pcid 转为 json 格式,文件名 pcid.json。 -syscap_tool -pdsi pcid.txt -o path/ +syscap_tool -Pdsi pcid.txt -o path/ ``` **说明:** -o 选项指定输出目录,缺省为当前目录。 diff --git a/src/create_pcid.c b/src/create_pcid.c index adacedd..8f37087 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -775,7 +775,7 @@ static int32_t GetEncodePCIDOut(uint16_t priSyscapCount, uint32_t privateSyscapL } } // save as file - const char outputFileName[] = "PCID.txt"; + const char outputFileName[] = "pcid.txt"; ret = ConvertedContextSaveAsFile(freePcidInfo.outDirPathFinal, outputFileName, output, strlen(output)); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outDirPath:%s, filename:%s\n", diff --git a/src/main.c b/src/main.c index 4b1d0b1..a54d331 100644 --- a/src/main.c +++ b/src/main.c @@ -50,8 +50,8 @@ int32_t OperateByBitMap(char *const *argv, uint16_t bitMap, char *outputpath); static struct option g_longOptions[] = { {"help", no_argument, 0, 'h' }, {"version", no_argument, 0, 'v' }, - {"rpcid", no_argument, 0, 'r' }, - {"pcid", no_argument, 0, 'p' }, + {"rpcid", no_argument, 0, 'R' }, + {"pcid", no_argument, 0, 'P' }, {"compare", required_argument, 0, 'C' }, {"encode", no_argument, 0, 'e' }, {"decode", no_argument, 0, 'd' }, @@ -103,28 +103,28 @@ int32_t OperateByBitMap(char *const *argv, uint16_t bitMap, char *outputpath) { int32_t ret = 0; switch (bitMap) { - case 0x109: // 0x109, -rei inputfile + case 0x109: // 0x109, -Rei inputfile ret = RPCIDEncode(g_customerfileinfo.inputfile, outputpath); break; - case 0x10A: // 0x10A, -rdi inputfile + case 0x10A: // 0x10A, -Rdi inputfile ret = RPCIDDecode(g_customerfileinfo.inputfile, outputpath); break; - case 0x10D: // 0x10D, -resi inputfile + case 0x10D: // 0x10D, -Resi inputfile ret = EncodeRpcidscToString(g_customerfileinfo.inputfile, outputpath); break; - case 0x115: // 0x115, -pesi inputfile + case 0x115: // 0x115, -Pesi inputfile ret = EncodePcidscToString(g_customerfileinfo.inputfile, outputpath); break; case 0x60: // 0x60, -C pcid.txt rpcid.txt ret = ComparePcidWithRpcidString(g_customerfileinfo.pcidfile, g_customerfileinfo.rpcidfile, TYPE_FILE); break; - case 0x64: // 0x64, -sc "pcidstring" "rpcidstring" + case 0x64: // 0x64, -sC "pcidstring" "rpcidstring" ret = ComparePcidWithRpcidString(g_customerfileinfo.pcidfile, g_customerfileinfo.rpcidfile, TYPE_STRING); break; - case 0x111: // 0x111, -pei inputfile + case 0x111: // 0x111, -Pei inputfile ret = CreatePCID(g_customerfileinfo.inputfile, outputpath); break; - case 0x112: // 0x112, -pdi inputfile + case 0x112: // 0x112, -Pdi inputfile ret = DecodePCID(g_customerfileinfo.inputfile, outputpath); break; - case 0x116: // 0x116, -pdsi inputfile + case 0x116: // 0x116, -Pdsi inputfile ret = DecodeStringPCIDToJson(g_customerfileinfo.inputfile, outputpath); break; - case 0x10E: // 0x10E, -rdsi inputfile - printf("-rdsi is not support currently.\n"); break; + case 0x10E: // 0x10E, -Rdsi inputfile + printf("-Rdsi is not support currently.\n"); break; case 0x80: // 0x80, -v (void)OutputVersion(argv[optind], optind); break; default: @@ -145,10 +145,10 @@ void SetBitMap(char *const *argv, int32_t flag, uint16_t *bitMap, char **outputp case 's': (*bitMap) |= 0x1 << STRING_DECODE; break; - case 'r': + case 'R': (*bitMap) |= 0x1 << RPCID; break; - case 'p': + case 'P': (*bitMap) |= 0x1 << PCID; break; case 'C': @@ -186,10 +186,10 @@ void PrintVersion(void) void PrintHelp(void) { - printf("syscap_tool -r/p -e/d -i filepath [-o outpath]\n"); + printf("syscap_tool -R/P -e/d -i filepath [-o outpath]\n"); printf("-h, --help\t: how to use\n"); - printf("-r, --rpcid\t: encode or decode rpcid\n"); - printf("-p, --pcid\t: encode or decode pcid\n"); + printf("-R, --rpcid\t: encode or decode rpcid\n"); + printf("-P, --pcid\t: encode or decode pcid\n"); printf("-C, --compare\t: compare pcid with rpcid string format.\n\t" "-s, --string : input string.\n"); printf("-e, --encode\t: encode to sc format.\n\t-s, --string : encode to string format.\n"); -- Gitee From 06496898e8df6cae1c4260d7e29577d6290f9335 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Fri, 22 Mar 2024 10:29:54 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9PCID=E4=BB=A5=E5=8F=8ARPC?= =?UTF-8?q?ID=E5=A4=A7=E5=86=99=E4=B8=BA=E5=B0=8F=E5=86=99,=E8=BF=98?= =?UTF-8?q?=E5=8E=9Fgn=E4=B8=AD=E7=9A=84-P=E4=B8=BA=E5=A4=A7=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- BUILD.gn | 2 +- README.md | 6 +++--- README_ZH.md | 22 +++++++++++----------- src/create_pcid.c | 2 +- src/main.c | 34 +++++++++++++++++----------------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 8369bf3..6d7e3d2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -148,7 +148,7 @@ build_ext_component("generate_pcid") { } command = "chmod 777 $cmd" command += - " && $cmd -p -e -i ${preload_path}/system/etc/SystemCapability.json" + " && $cmd -P -e -i ${preload_path}/system/etc/SystemCapability.json" if (defined(ohos_lite)) { command += " && mkdir -p $exec_path/system/etc && cp $exec_path/pcid.sc $exec_path/system/etc/pcid.sc" } diff --git a/README.md b/README.md index 312bc67..4ca90a9 100644 --- a/README.md +++ b/README.md @@ -65,13 +65,13 @@ SysCap tools usually integrate to IDE, APP store and bundle tools. Follow instru ``` ./syscap_tool --help -./syscap_tool -r/p -e/d -i filepath [-o outpath] +./syscap_tool -R/P -e/d -i filepath [-o outpath] -h, --help : how to use --r, --rpcid : encode or decode rpcid +-R, --rpcid : encode or decode rpcid --p, --pcid : encode or decode pcid +-P, --pcid : encode or decode pcid -e, --encode : to encode diff --git a/README_ZH.md b/README_ZH.md index b213b40..a12c356 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -70,10 +70,10 @@ syscap_tool PC端可执行文件编译步骤: 使用./syscap_tool -h或者./syscap_tool --help查看: ```shell -syscap_tool -r/p -e/d -i filepath [-o outpath] +syscap_tool -R/P -e/d -i filepath [-o outpath] -h, --help : how to use --r, --rpcid : encode or decode rpcid --p, --pcid : encode or decode pcid +-R, --rpcid : encode or decode rpcid +-P, --pcid : encode or decode pcid -C, --compare : compare pcid with rpcid string format. -s, --string : input string. -e, --encode : encode to sc format. @@ -89,31 +89,31 @@ syscap_tool v1.1.1 ### 使用示例 ```shell # 将 rpcid.json 编码为SC格式,文件名rpcid.sc -syscap_tool -rei rpcid.json -o path/ +syscap_tool -Rei rpcid.json -o path/ # 将 pcid.sc 编码为JSON格式,文件名rpcid.json -syscap_tool -rdi pcid.sc -o path/ +syscap_tool -Rdi pcid.sc -o path/ # 将 pcid.json 编码为SC格式,文件名pcid.sc -syscap_tool -pei pcid.json -o path/ +syscap_tool -Pei pcid.json -o path/ # 将 pcid.sc 编码为JSON格式,文件名pcid.json -syscap_tool -pdi pcid.sc -o path/ +syscap_tool -Pdi pcid.sc -o path/ # 将 pcid.sc 编码为字符串格式,文件名rpcid.txt -syscap_tool -resi pcid.sc -o path/ +syscap_tool -Resi pcid.sc -o path/ # 将 pcid.sc 编码为字符串格式,文件名pcid.txt -syscap_tool -pesi pcid.sc -o path/ +syscap_tool -Pesi pcid.sc -o path/ # 比较字符串格式的pcid和rpcid,pcid 符合条件返回成功提示,不符合则提示原因。 syscap_tool -C pcid.txt rpcid.txt -# 功能类似 -C 选项,区别为 -SC 选项为直接输入字符串。 +# 功能类似 -C选项,区别为 -sC 选项为直接输入字符串。 syscap_tool -sC "pcidstring" "rpcidstring" # 将字符串格式的 pcid 转为 json 格式,文件名 pcid.json。 -syscap_tool -pdsi pcid.txt -o path/ +syscap_tool -Pdsi pcid.txt -o path/ ``` **说明:** -o 选项指定输出目录,缺省为当前目录。 diff --git a/src/create_pcid.c b/src/create_pcid.c index adacedd..8f37087 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -775,7 +775,7 @@ static int32_t GetEncodePCIDOut(uint16_t priSyscapCount, uint32_t privateSyscapL } } // save as file - const char outputFileName[] = "PCID.txt"; + const char outputFileName[] = "pcid.txt"; ret = ConvertedContextSaveAsFile(freePcidInfo.outDirPathFinal, outputFileName, output, strlen(output)); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outDirPath:%s, filename:%s\n", diff --git a/src/main.c b/src/main.c index 4b1d0b1..a54d331 100644 --- a/src/main.c +++ b/src/main.c @@ -50,8 +50,8 @@ int32_t OperateByBitMap(char *const *argv, uint16_t bitMap, char *outputpath); static struct option g_longOptions[] = { {"help", no_argument, 0, 'h' }, {"version", no_argument, 0, 'v' }, - {"rpcid", no_argument, 0, 'r' }, - {"pcid", no_argument, 0, 'p' }, + {"rpcid", no_argument, 0, 'R' }, + {"pcid", no_argument, 0, 'P' }, {"compare", required_argument, 0, 'C' }, {"encode", no_argument, 0, 'e' }, {"decode", no_argument, 0, 'd' }, @@ -103,28 +103,28 @@ int32_t OperateByBitMap(char *const *argv, uint16_t bitMap, char *outputpath) { int32_t ret = 0; switch (bitMap) { - case 0x109: // 0x109, -rei inputfile + case 0x109: // 0x109, -Rei inputfile ret = RPCIDEncode(g_customerfileinfo.inputfile, outputpath); break; - case 0x10A: // 0x10A, -rdi inputfile + case 0x10A: // 0x10A, -Rdi inputfile ret = RPCIDDecode(g_customerfileinfo.inputfile, outputpath); break; - case 0x10D: // 0x10D, -resi inputfile + case 0x10D: // 0x10D, -Resi inputfile ret = EncodeRpcidscToString(g_customerfileinfo.inputfile, outputpath); break; - case 0x115: // 0x115, -pesi inputfile + case 0x115: // 0x115, -Pesi inputfile ret = EncodePcidscToString(g_customerfileinfo.inputfile, outputpath); break; case 0x60: // 0x60, -C pcid.txt rpcid.txt ret = ComparePcidWithRpcidString(g_customerfileinfo.pcidfile, g_customerfileinfo.rpcidfile, TYPE_FILE); break; - case 0x64: // 0x64, -sc "pcidstring" "rpcidstring" + case 0x64: // 0x64, -sC "pcidstring" "rpcidstring" ret = ComparePcidWithRpcidString(g_customerfileinfo.pcidfile, g_customerfileinfo.rpcidfile, TYPE_STRING); break; - case 0x111: // 0x111, -pei inputfile + case 0x111: // 0x111, -Pei inputfile ret = CreatePCID(g_customerfileinfo.inputfile, outputpath); break; - case 0x112: // 0x112, -pdi inputfile + case 0x112: // 0x112, -Pdi inputfile ret = DecodePCID(g_customerfileinfo.inputfile, outputpath); break; - case 0x116: // 0x116, -pdsi inputfile + case 0x116: // 0x116, -Pdsi inputfile ret = DecodeStringPCIDToJson(g_customerfileinfo.inputfile, outputpath); break; - case 0x10E: // 0x10E, -rdsi inputfile - printf("-rdsi is not support currently.\n"); break; + case 0x10E: // 0x10E, -Rdsi inputfile + printf("-Rdsi is not support currently.\n"); break; case 0x80: // 0x80, -v (void)OutputVersion(argv[optind], optind); break; default: @@ -145,10 +145,10 @@ void SetBitMap(char *const *argv, int32_t flag, uint16_t *bitMap, char **outputp case 's': (*bitMap) |= 0x1 << STRING_DECODE; break; - case 'r': + case 'R': (*bitMap) |= 0x1 << RPCID; break; - case 'p': + case 'P': (*bitMap) |= 0x1 << PCID; break; case 'C': @@ -186,10 +186,10 @@ void PrintVersion(void) void PrintHelp(void) { - printf("syscap_tool -r/p -e/d -i filepath [-o outpath]\n"); + printf("syscap_tool -R/P -e/d -i filepath [-o outpath]\n"); printf("-h, --help\t: how to use\n"); - printf("-r, --rpcid\t: encode or decode rpcid\n"); - printf("-p, --pcid\t: encode or decode pcid\n"); + printf("-R, --rpcid\t: encode or decode rpcid\n"); + printf("-P, --pcid\t: encode or decode pcid\n"); printf("-C, --compare\t: compare pcid with rpcid string format.\n\t" "-s, --string : input string.\n"); printf("-e, --encode\t: encode to sc format.\n\t-s, --string : encode to string format.\n"); -- Gitee