修改PCID以及RPCID大写为小写

Signed-off-by: liutuantuan <liutuantuan1@huawei.com>
This commit is contained in:
liutuantuan
2024-03-22 10:29:54 +08:00
parent 9c3206bf41
commit f95a3a72b6
4 changed files with 32 additions and 32 deletions
+3 -3
View File
@@ -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
+11 -11
View File
@@ -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 选项指定输出目录,缺省为当前目录。
+1 -1
View File
@@ -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",
+17 -17
View File
@@ -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");