1b8a72a62Sopenharmony_ci/*
2b8a72a62Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd.
3b8a72a62Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4b8a72a62Sopenharmony_ci * you may not use this file except in compliance with the License.
5b8a72a62Sopenharmony_ci * You may obtain a copy of the License at
6b8a72a62Sopenharmony_ci *
7b8a72a62Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8b8a72a62Sopenharmony_ci *
9b8a72a62Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10b8a72a62Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11b8a72a62Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12b8a72a62Sopenharmony_ci * See the License for the specific language governing permissions and
13b8a72a62Sopenharmony_ci * limitations under the License.
14b8a72a62Sopenharmony_ci */
15b8a72a62Sopenharmony_ci
16b8a72a62Sopenharmony_cipackage ohos;
17b8a72a62Sopenharmony_ci
18b8a72a62Sopenharmony_ci/**
19b8a72a62Sopenharmony_ci * showhelp class of compress tool.
20b8a72a62Sopenharmony_ci *
21b8a72a62Sopenharmony_ci */
22b8a72a62Sopenharmony_cipublic interface ShowHelp {
23b8a72a62Sopenharmony_ci    Log log = new Log(ShowHelp.class.toString());
24b8a72a62Sopenharmony_ci    /**
25b8a72a62Sopenharmony_ci     * content of compress command help menu.
26b8a72a62Sopenharmony_ci     */
27b8a72a62Sopenharmony_ci    static void compressHelp() {
28b8a72a62Sopenharmony_ci        log.info("\nHAP USAGE:\n" +
29b8a72a62Sopenharmony_ci                "java -jar app_packing_tool.jar --mode <options> --json-path <option>\n" +
30b8a72a62Sopenharmony_ci                "--profile-path [option] --maple-so-path [option] --maple-so-dir [option]\n" +
31b8a72a62Sopenharmony_ci                "--dex-path [option] --lib-path [option] --resources-path [option] --assets-path [option]\n" +
32b8a72a62Sopenharmony_ci                "--shell-apk-path [option] --index-path [option] --out-path <option> --force [option]\n" +
33b8a72a62Sopenharmony_ci                "OPTIONS:\n" +
34b8a72a62Sopenharmony_ci                "  --mode               not null  must be hap.\n" +
35b8a72a62Sopenharmony_ci                "  --json-path                    config.json path.\n" +
36b8a72a62Sopenharmony_ci                "  --profile-path                 CAPABILITY.profile path.\n" +
37b8a72a62Sopenharmony_ci                "  --maple-so-path                maple-so/ path\n" +
38b8a72a62Sopenharmony_ci                "  --maple-so-dir                 maple so path must end with .so,\n" +
39b8a72a62Sopenharmony_ci                "                                 if has more than one so, use comma(,) to separate;\n" +
40b8a72a62Sopenharmony_ci                "  --dex-path                     1.dex path must end with .dex,\n" +
41b8a72a62Sopenharmony_ci                "                                 if has more than one dex, use comma(,) to separate;\n" +
42b8a72a62Sopenharmony_ci                "                                 2.dex path also can be directory path.\n" +
43b8a72a62Sopenharmony_ci                "  --lib-path                     lib/ path.\n" +
44b8a72a62Sopenharmony_ci                "  --bin-path                     bin file path.\n" +
45b8a72a62Sopenharmony_ci                "  --resources-path               resources/ path.\n" +
46b8a72a62Sopenharmony_ci                "  --assets-path                  assets/ path.\n" +
47b8a72a62Sopenharmony_ci                "  --shell-apk-path               1.shell apk path must end with .apk,\n" +
48b8a72a62Sopenharmony_ci                "                                 if has more than one apk, use comma(,) to separate;\n" +
49b8a72a62Sopenharmony_ci                "                                 2.shell apk path also can be directory path.\n" +
50b8a72a62Sopenharmony_ci                "  --index-path                   resources.index path\n" +
51b8a72a62Sopenharmony_ci                "  --out-path           not null  target hap binary path, must end with .hap.\n" +
52b8a72a62Sopenharmony_ci                "  --force                        default false; if true, force delete destination\n" +
53b8a72a62Sopenharmony_ci                "                                 out file if exists.\n" +
54b8a72a62Sopenharmony_ci                "----------------------------------------------------------------------------------\n" +
55b8a72a62Sopenharmony_ci                "HAR USAGE:\n" +
56b8a72a62Sopenharmony_ci                "java -jar app_packing_tool.jar --mode <options> --json-path <option>\n" +
57b8a72a62Sopenharmony_ci                "--jar-path <option> --lib-path [option] --resources-path [option] --txt-path [option]\n" +
58b8a72a62Sopenharmony_ci                "--assets-path [option] --out-path <option> --force [option]\n" +
59b8a72a62Sopenharmony_ci                "OPTIONS:\n" +
60b8a72a62Sopenharmony_ci                "  --mode               not null  must be har.\n" +
61b8a72a62Sopenharmony_ci                "  --json-path          not null  config.json path.\n" +
62b8a72a62Sopenharmony_ci                "  --jar-path           not null  1.jar path must end with .jar,\n" +
63b8a72a62Sopenharmony_ci                "                                 if has more than one jar, use comma(,) to separate;\n" +
64b8a72a62Sopenharmony_ci                "                                 2.jar path also can be directory path.\n" +
65b8a72a62Sopenharmony_ci                "  --lib-path                     lib/ path.\n" +
66b8a72a62Sopenharmony_ci                "  --resources-path     not null  resources/ path.\n" +
67b8a72a62Sopenharmony_ci                "  --txt-path                     1.txt path must end with .txt,\n" +
68b8a72a62Sopenharmony_ci                "                                 if has more than one txt, use comma(,) to separate;\n" +
69b8a72a62Sopenharmony_ci                "                                 2.txt path also can be directory path.\n" +
70b8a72a62Sopenharmony_ci                "  --assets-path                  assets/ path.\n" +
71b8a72a62Sopenharmony_ci                "  --out-path           not null  target har binary path, must end with .har.\n" +
72b8a72a62Sopenharmony_ci                "  --force                        default false; if true, force delete destination\n" +
73b8a72a62Sopenharmony_ci                "                                 out file if exists.\n" +
74b8a72a62Sopenharmony_ci                "----------------------------------------------------------------------------------\n" +
75b8a72a62Sopenharmony_ci                "APP USAGE:\n" +
76b8a72a62Sopenharmony_ci                "java -jar app_packing_tool.jar --mode <options> --hap-path <option>\n" +
77b8a72a62Sopenharmony_ci                "--pack-info-path [option] --out-path [option] --signature-path [option]\n" +
78b8a72a62Sopenharmony_ci                "--certificate-path [option]  --force [option]\n" +
79b8a72a62Sopenharmony_ci                "OPTIONS:\n" +
80b8a72a62Sopenharmony_ci                "  --mode               not null  must be app.\n" +
81b8a72a62Sopenharmony_ci                "  --hap-path           not null  1.hap path must end with .hap,\n" +
82b8a72a62Sopenharmony_ci                "                                 if has more than one hap, use comma(,) to separate;\n" +
83b8a72a62Sopenharmony_ci                "                                 2.hap path also can be directory path.\n" +
84b8a72a62Sopenharmony_ci                "  --pack-info-path     not null  pack.info path\n" +
85b8a72a62Sopenharmony_ci                "  --out-path           not null  target app binary path, must end with .app.\n" +
86b8a72a62Sopenharmony_ci                "  --force                        default false; if true, force delete destination\n" +
87b8a72a62Sopenharmony_ci                "                                 out file if exists.\n" +
88b8a72a62Sopenharmony_ci                "  --signature-path               signature file path.\n" +
89b8a72a62Sopenharmony_ci                "  --certificate-path             certificate file path.\n" +
90b8a72a62Sopenharmony_ci                "  --encrypt-path                 encrypt.json file path.");
91b8a72a62Sopenharmony_ci    }
92b8a72a62Sopenharmony_ci
93b8a72a62Sopenharmony_ci    /**
94b8a72a62Sopenharmony_ci     * content of uncompress command help menu.
95b8a72a62Sopenharmony_ci     */
96b8a72a62Sopenharmony_ci    static void uncompressHelp() {
97b8a72a62Sopenharmony_ci        log.info("\nHAP USAGE:\n" +
98b8a72a62Sopenharmony_ci                "java -jar app_unpacking_tool.jar --mode <options> --hap-path <option>\n" +
99b8a72a62Sopenharmony_ci                "--out-path [option] --force [option]\n" +
100b8a72a62Sopenharmony_ci                "OPTIONS:\n" +
101b8a72a62Sopenharmony_ci                "  --mode               not null  must be hap.\n" +
102b8a72a62Sopenharmony_ci                "  --hap-path           not null  hap path.\n" +
103b8a72a62Sopenharmony_ci                "  --out-path                     target path of unzip.\n" +
104b8a72a62Sopenharmony_ci                "  --force                        default false; if true, force delete destination\n" +
105b8a72a62Sopenharmony_ci                "                                 out file if exists.\n" +
106b8a72a62Sopenharmony_ci                "  --unpackapk                    default false; if true, unpack apk files from hap\n" +
107b8a72a62Sopenharmony_ci                "                                 in the app.\n" +
108b8a72a62Sopenharmony_ci                "----------------------------------------------------------------------------------\n" +
109b8a72a62Sopenharmony_ci                "HAR USAGE:\n" +
110b8a72a62Sopenharmony_ci                "java -jar app_unpacking_tool.jar --mode <options> --har-path <option>\n" +
111b8a72a62Sopenharmony_ci                "--out-path [option] --force [option]\n" +
112b8a72a62Sopenharmony_ci                "OPTIONS:\n" +
113b8a72a62Sopenharmony_ci                "  --mode               not null  must be har.\n" +
114b8a72a62Sopenharmony_ci                "  --har-path           not null  har path.\n" +
115b8a72a62Sopenharmony_ci                "  --out-path           not null  target path of unzip.\n" +
116b8a72a62Sopenharmony_ci                "  --force                        default false; if true, force delete destination\n" +
117b8a72a62Sopenharmony_ci                "                                 out file if exists.\n" +
118b8a72a62Sopenharmony_ci                "----------------------------------------------------------------------------------\n" +
119b8a72a62Sopenharmony_ci                "APP USAGE:\n" +
120b8a72a62Sopenharmony_ci                "java -jar app_unpacking_tool.jar --mode <options> --app-path <option>\n" +
121b8a72a62Sopenharmony_ci                "--out-path [option] --force [option]\n" +
122b8a72a62Sopenharmony_ci                "OPTIONS:\n" +
123b8a72a62Sopenharmony_ci                "  --mode               not null  must be app.\n" +
124b8a72a62Sopenharmony_ci                "  --app-path           not null  app path.\n" +
125b8a72a62Sopenharmony_ci                "  --out-path                     target path of unzip.\n" +
126b8a72a62Sopenharmony_ci                "  --force                        default false; if true, force delete destination\n" +
127b8a72a62Sopenharmony_ci                "                                 out file if exists.\n" +
128b8a72a62Sopenharmony_ci                "  --unpackapk                    default false; if true, unpack apk files from hap\n" +
129b8a72a62Sopenharmony_ci                "                                 in the app.");
130b8a72a62Sopenharmony_ci    }
131b8a72a62Sopenharmony_ci
132b8a72a62Sopenharmony_ci    /**
133b8a72a62Sopenharmony_ci     * content of scan command help menu.
134b8a72a62Sopenharmony_ci     */
135b8a72a62Sopenharmony_ci    static void scanHelp() {
136b8a72a62Sopenharmony_ci        log.info(System.lineSeparator() + "STAT DUPLICATE USAGE:" + System.lineSeparator() +
137b8a72a62Sopenharmony_ci                "java -jar app_check_tool.jar --input [options] --out-path [option]" + System.lineSeparator() +
138b8a72a62Sopenharmony_ci                "--stat-duplicate [option]" + System.lineSeparator() +
139b8a72a62Sopenharmony_ci                "OPTIONS:" + System.lineSeparator() +
140b8a72a62Sopenharmony_ci                "  --input              not null  must be hap or hsp or app." + System.lineSeparator() +
141b8a72a62Sopenharmony_ci                "  --out-path           not null  must be folder." + System.lineSeparator() +
142b8a72a62Sopenharmony_ci                "  --stat-duplicate     not null  must be true or false." + System.lineSeparator() +
143b8a72a62Sopenharmony_ci                "                       if true, count duplicate files." + System.lineSeparator() +
144b8a72a62Sopenharmony_ci                "----------------------------------------------------------------------------------"
145b8a72a62Sopenharmony_ci                + System.lineSeparator() +
146b8a72a62Sopenharmony_ci                "STAT FILE SIZE USAGE:" + System.lineSeparator() +
147b8a72a62Sopenharmony_ci                "java -jar app_check_tool.jar --input [options] --out-path [option]" + System.lineSeparator() +
148b8a72a62Sopenharmony_ci                "--stat-file-size [option]" + System.lineSeparator() +
149b8a72a62Sopenharmony_ci                "OPTIONS:" + System.lineSeparator() +
150b8a72a62Sopenharmony_ci                "  --input              not null  must be hap or hsp or app." + System.lineSeparator() +
151b8a72a62Sopenharmony_ci                "  --out-path           not null  must be folder." + System.lineSeparator() +
152b8a72a62Sopenharmony_ci                "  --stat-file-size     not null  must be an number." + System.lineSeparator() +
153b8a72a62Sopenharmony_ci                "                       count files exceeding the specified size." + System.lineSeparator() +
154b8a72a62Sopenharmony_ci                "----------------------------------------------------------------------------------"
155b8a72a62Sopenharmony_ci                + System.lineSeparator() +
156b8a72a62Sopenharmony_ci                "STAT SUFFIX USAGE:" + System.lineSeparator() +
157b8a72a62Sopenharmony_ci                "java -jar app_check_tool.jar --input [options] --out-path [option]" + System.lineSeparator() +
158b8a72a62Sopenharmony_ci                "--stat-suffix [option]" + System.lineSeparator() +
159b8a72a62Sopenharmony_ci                "OPTIONS:" + System.lineSeparator() +
160b8a72a62Sopenharmony_ci                "  --input              not null  must be hap or hsp or app." + System.lineSeparator() +
161b8a72a62Sopenharmony_ci                "  --out-path           not null  must be folder." + System.lineSeparator() +
162b8a72a62Sopenharmony_ci                "  --stat-suffix        not null  must be true or false;" + System.lineSeparator() +
163b8a72a62Sopenharmony_ci    "                                   if true, calculate the proportion of various types of files.");
164b8a72a62Sopenharmony_ci    }
165b8a72a62Sopenharmony_ci}
166