Parse command-line arguments.
()
| 124 | |
| 125 | |
| 126 | def parse_args(): |
| 127 | """ |
| 128 | Parse command-line arguments. |
| 129 | """ |
| 130 | util.print_logo() |
| 131 | |
| 132 | parser = argparse.ArgumentParser( |
| 133 | description=( |
| 134 | "{BOLD}{GREEN}APKDeepLens:{ENDC}" |
| 135 | " Android security insights in full spectrum. " |
| 136 | ).format( |
| 137 | BOLD=util.BOLD, GREEN=util.OKCYAN, ENDC=util.ENDC |
| 138 | ), |
| 139 | epilog=( |
| 140 | "For more information, visit our GitHub repository" |
| 141 | " - https://github.com/d78ui98/APKDeepLens" |
| 142 | ), |
| 143 | formatter_class=argparse.RawTextHelpFormatter, |
| 144 | ) |
| 145 | |
| 146 | parser.add_argument( |
| 147 | "-apk", |
| 148 | metavar="APK", |
| 149 | type=str, |
| 150 | required=True, |
| 151 | help="Path to the APK file to be analyzed.", |
| 152 | ) |
| 153 | parser.add_argument( |
| 154 | "-v", |
| 155 | "-version", |
| 156 | action="version", |
| 157 | version="APKDeepLens v1.0", |
| 158 | help="Display the version of APKDeepLens.", |
| 159 | ) |
| 160 | parser.add_argument( |
| 161 | "-source_code_path", |
| 162 | metavar="APK", |
| 163 | type=str, |
| 164 | help="Enter a valid path of extracted source for apk.", |
| 165 | ) |
| 166 | parser.add_argument( |
| 167 | "-report", |
| 168 | choices=["json", "pdf", "html", "txt"], |
| 169 | default="json", |
| 170 | help="Format of the report to be generated. Default is JSON.", |
| 171 | ) |
| 172 | parser.add_argument( |
| 173 | "-o", |
| 174 | metavar="output path or file", |
| 175 | type=str, |
| 176 | help="Output report path (can be filename or dir)" |
| 177 | ) |
| 178 | parser.add_argument( |
| 179 | "--ignore_virtualenv", |
| 180 | action="store_true", |
| 181 | help="Ignore virtual environment check.", |
| 182 | ) |
| 183 | parser.add_argument("-l", metavar="log level", help="Set the logging level") |
no test coverage detected