1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
use clap::{crate_version, App, Arg};
#[allow(clippy::too_many_lines)]
pub fn generate() -> App<'static, 'static> {
App::new("SUPER Android Analyzer")
.version(crate_version!())
.author("SUPER Team <contact@superanalyzer.rocks>")
.about("Audits Android apps (.apk files) for vulnerabilities")
.arg(
Arg::with_name("package")
.help("The package string of the application to test")
.value_name("package")
.required_unless("test-all")
.conflicts_with("test-all")
.takes_value(true),
)
.arg(
Arg::with_name("test-all")
.short("a")
.long("test-all")
.conflicts_with("package")
.conflicts_with("open")
.help("Test all .apk files in the downloads directory"),
)
.arg(
Arg::with_name("verbose")
.short("v")
.long("verbose")
.conflicts_with("quiet")
.help("If you'd like the auditor to talk more than necessary"),
)
.arg(
Arg::with_name("force")
.long("force")
.help("If you'd like to force the auditor to do everything from the beginning"),
)
.arg(
Arg::with_name("bench")
.long("bench")
.help("Show benchmarks for the analysis"),
)
.arg(
Arg::with_name("quiet")
.short("q")
.long("quiet")
.conflicts_with("verbose")
.help("If you'd like a zen auditor that won't output anything in stdout"),
)
.arg(
Arg::with_name("open")
.long("open")
.conflicts_with("test-all")
.help("Open the report in a browser once it is complete"),
)
.arg(
Arg::with_name("json")
.long("json")
.help("Generates the results in JSON format"),
)
.arg(
Arg::with_name("html")
.long("html")
.help("Generates the results in HTML format"),
)
.arg(
Arg::with_name("min_criticality")
.long("min-criticality")
.help("Set a minimum criticality to analyze (Critical, High, Medium, Low)")
.takes_value(true),
)
.arg(
Arg::with_name("threads")
.short("t")
.long("threads")
.help(
"Number of threads to use, by default it will use one thread per logical CPU \
core",
)
.takes_value(true),
)
.arg(
Arg::with_name("downloads")
.long("downloads")
.help("Folder where the downloads are stored")
.takes_value(true),
)
.arg(
Arg::with_name("dist")
.long("dist")
.help("Folder where distribution files will be extracted")
.takes_value(true),
)
.arg(
Arg::with_name("results")
.long("results")
.help("Folder where to store the results")
.takes_value(true),
)
.arg(
Arg::with_name("dex2jar")
.long("dex2jar")
.help("Where to store the jar files")
.takes_value(true),
)
.arg(
Arg::with_name("jd-cmd")
.long("jd-cmd")
.help("Path to the jd-cmd file")
.takes_value(true),
)
.arg(
Arg::with_name("template")
.long("template")
.help("Path to a results template file")
.takes_value(true),
)
.arg(
Arg::with_name("rules")
.long("rules")
.help("Path to a JSON rules file")
.takes_value(true),
)
}