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