Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Changed to super-analyzer (binary name still super)
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican committed Apr 9, 2017
1 parent 4bf137b commit bebdf26
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 68 deletions.
74 changes: 37 additions & 37 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,50 +77,50 @@ assets = [
["target/release/super.fish", "usr/share/fish/vendor_completions.d/", "755"],
["target/release/_super", "usr/share/zsh/vendor-completions/", "755"],
# JD-CMD
["vendor/jd-cmd.jar", "usr/share/super/vendor/", "755"],
["vendor/jd-cmd.LICENSE.txt", "usr/share/super/vendor/", "644"],
["vendor/jd-cmd.jar", "usr/share/super-analyzer/vendor/", "755"],
["vendor/jd-cmd.LICENSE.txt", "usr/share/super-analyzer/vendor/", "644"],
# Dex2Jar
["vendor/dex2jar-2.1-SNAPSHOT/LICENSE.txt", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/", "644"],
["vendor/dex2jar-2.1-SNAPSHOT/NOTICE.txt", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/", "644"],
["vendor/dex2jar-2.1-SNAPSHOT/d2j-dex2jar.sh", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/d2j_invoke.sh", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/antlr-runtime-3.5.2.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/asm-debug-all-4.1.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/d2j-base-cmd-2.1-SNAPSHOT.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/d2j-jasmin-2.1-SNAPSHOT.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/d2j-smali-2.1-SNAPSHOT.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-ir-2.1-SNAPSHOT.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-reader-2.1-SNAPSHOT.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-reader-api-2.1-SNAPSHOT.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-tools-2.1-SNAPSHOT.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-translator-2.1-SNAPSHOT.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-writer-2.1-SNAPSHOT.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dx-1.7.jar", "usr/share/super/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/LICENSE.txt", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/", "644"],
["vendor/dex2jar-2.1-SNAPSHOT/NOTICE.txt", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/", "644"],
["vendor/dex2jar-2.1-SNAPSHOT/d2j-dex2jar.sh", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/d2j_invoke.sh", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/antlr-runtime-3.5.2.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/asm-debug-all-4.1.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/d2j-base-cmd-2.1-SNAPSHOT.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/d2j-jasmin-2.1-SNAPSHOT.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/d2j-smali-2.1-SNAPSHOT.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-ir-2.1-SNAPSHOT.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-reader-2.1-SNAPSHOT.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-reader-api-2.1-SNAPSHOT.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-tools-2.1-SNAPSHOT.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-translator-2.1-SNAPSHOT.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dex-writer-2.1-SNAPSHOT.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
["vendor/dex2jar-2.1-SNAPSHOT/lib/dx-1.7.jar", "usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT/lib/", "755"],
#CSS
["templates/super/css/androidstudio.css", "usr/share/super/templates/super/css/", "644"],
["templates/super/css/style.css", "usr/share/super/templates/super/css/", "644"],
["templates/super-analyzer/css/androidstudio.css", "usr/share/super-analyzer/templates/super-analyzer/css/", "644"],
["templates/super-analyzer/css/style.css", "usr/share/super-analyzer/templates/super-analyzer/css/", "644"],
# Images
["templates/super/img/folder-icon.png", "usr/share/super/templates/super/img/", "644"],
["templates/super/img/java-icon.png", "usr/share/super/templates/super/img/", "644"],
["templates/super/img/xml-icon.png", "usr/share/super/templates/super/img/", "644"],
["templates/super/img/report.png", "usr/share/super/vendor/results_template/img/", "644"],
["templates/super/img/logo.png", "usr/share/super/templates/super/img/", "644"],
["templates/super-analyzer/img/folder-icon.png", "usr/share/super-analyzer/templates/super-analyzer/img/", "644"],
["templates/super-analyzer/img/java-icon.png", "usr/share/super-analyzer/templates/super-analyzer/img/", "644"],
["templates/super-analyzer/img/xml-icon.png", "usr/share/super-analyzer/templates/super-analyzer/img/", "644"],
["templates/super-analyzer/img/report.png", "usr/share/super-analyzer/vendor/results_template/img/", "644"],
["templates/super-analyzer/img/logo.png", "usr/share/super-analyzer/templates/super-analyzer/img/", "644"],
# JavaScript
["templates/super/js/highlight.js.LICENSE", "usr/share/super/templates/super/js/", "644"],
["templates/super/js/highlight.pack.js", "usr/share/super/templates/super/js/", "644"],
["templates/super/js/jquery-3.2.0.slim.min.js", "usr/share/super/templates/super/js/", "644"],
["templates/super/js/src_nav.js", "usr/share/super/templates/super/js/", "644"],
["templates/super-analyzer/js/highlight.js.LICENSE", "usr/share/super-analyzer/templates/super-analyzer/js/", "644"],
["templates/super-analyzer/js/highlight.pack.js", "usr/share/super-analyzer/templates/super-analyzer/js/", "644"],
["templates/super-analyzer/js/jquery-3.2.0.slim.min.js", "usr/share/super-analyzer/templates/super-analyzer/js/", "644"],
["templates/super-analyzer/js/src_nav.js", "usr/share/super-analyzer/templates/super-analyzer/js/", "644"],
# templates
["templates/super/code.hbs", "usr/share/super/templates/super/", "644"],
["templates/super/report.hbs", "usr/share/super/templates/super/", "644"],
["templates/super/src.hbs", "usr/share/super/templates/super/", "644"],
["templates/super/vulnerability.hbs", "usr/share/super/templates/super/", "644"],
["templates/super-analyzer/code.hbs", "usr/share/super-analyzer/templates/super-analyzer/", "644"],
["templates/super-analyzer/report.hbs", "usr/share/super-analyzer/templates/super-analyzer/", "644"],
["templates/super-analyzer/src.hbs", "usr/share/super-analyzer/templates/super-analyzer/", "644"],
["templates/super-analyzer/vulnerability.hbs", "usr/share/super-analyzer/templates/super-analyzer/", "644"],
# Config
["rules.json", "etc/super/", "644"],
["config.toml", "etc/super/", "644"],
["config.toml.sample", "etc/super/", "644"],
["rules.json", "etc/super-analyzer/", "644"],
["config.toml", "etc/super-analyzer/", "644"],
["config.toml.sample", "etc/super-analyzer/", "644"],
# README
["README.md", "usr/share/doc/super/README.md", "644"],
["README.md", "usr/share/doc/super-analyzer/README.md", "644"],
]

# The release profile, used for `cargo build`.
Expand Down
8 changes: 4 additions & 4 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
# results_folder = "results"

# Dex2Jar folder
# dex2jar_folder = "/usr/share/super/vendor/dex2jar-2.1-SNAPSHOT"
# dex2jar_folder = "/usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT"

# JD-cmd JAR file
# jd_cmd_file = "/usr/share/super/vendor/jd-cmd.jar"
# jd_cmd_file = "/usr/share/super-analyzer/vendor/jd-cmd.jar"

# Templates folder
# templates_folder = "/usr/share/super/templates"
# templates_folder = "/usr/share/super-analyzer/templates"

# Results template used
# template = "super"

# Vulnerability rules JSON
# rules_json = "/etc/super/rules.json"
# rules_json = "/etc/super-analyzer/rules.json"

# Generates HTML report
# html_report = true
Expand Down
8 changes: 4 additions & 4 deletions config.toml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ threads = 2 # Number of threads for the application
downloads_folder = "downloads" # Folder for APK files
dist_folder = "dist" # Folder where the source code will be extracted
results_folder = "results" # Folder where results will be generated
dex2jar_folder = "/usr/share/super/vendor/dex2jar-2.1-SNAPSHOT" # Dex2Jar folder
jd_cmd_file = "/usr/share/super/vendor/jd-cmd.jar" # JD-cmd JAR file
templates_folder = "/usr/share/super/templates"
dex2jar_folder = "/usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT" # Dex2Jar folder
jd_cmd_file = "/usr/share/super-analyzer/vendor/jd-cmd.jar" # JD-cmd JAR file
templates_folder = "/usr/share/super-analyzer/templates"
template = "super" # Results template
rules_json = "/etc/super/rules.json" # Vulnerability rules JSON
rules_json = "/etc/super-analyzer/rules.json" # Vulnerability rules JSON

# Vulnerable or potentially vulnerable permissions
[[permissions]]
Expand Down
23 changes: 12 additions & 11 deletions rpmbuild/super.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Secure, Unified, Powerful and Extensible Rust Android Analyzer.
%prep
%autosetup
/usr/bin/curl https://sh.rustup.rs -sSf | sh -s -- -y
~/.cargo/bin/rustup update

%build
~/.cargo/bin/cargo build --release
Expand All @@ -23,24 +24,24 @@ mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
mkdir -p %{buildroot}%{_datadir}/fish/vendor_completions.d
mkdir -p %{buildroot}%{_datadir}/zsh/site-functions
mkdir -p %{buildroot}%{_datadir}/%{name}/templates/%{name}/css
mkdir -p %{buildroot}%{_datadir}/%{name}/templates/%{name}/img
mkdir -p %{buildroot}%{_datadir}/%{name}/templates/%{name}/js
mkdir -p %{buildroot}%{_datadir}/%{name}/templates/super/css
mkdir -p %{buildroot}%{_datadir}/%{name}/templates/super/img
mkdir -p %{buildroot}%{_datadir}/%{name}/templates/super/js
mkdir -p %{buildroot}%{_datadir}/%{name}/vendor/dex2jar-2.1-SNAPSHOT/lib
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}/
install -p -d -m 755 %{buildroot}%{_datadir}/%{name}
install -p -m 755 target/release/%{name} %{buildroot}%{_bindir}/
install -p -m 755 target/release/%{name}.bash-completion %{buildroot}%{_datadir}/bash-completion/completions/
install -p -m 755 target/release/%{name}.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/
install -p -m 755 target/release/_%{name} %{buildroot}%{_datadir}/zsh/site-functions/
install -p -m 755 target/release/super %{buildroot}%{_bindir}/
install -p -m 755 target/release/super.bash-completion %{buildroot}%{_datadir}/bash-completion/completions/
install -p -m 755 target/release/super.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/
install -p -m 755 target/release/_super %{buildroot}%{_datadir}/zsh/site-functions/
install -p -m 755 -D vendor/dex2jar-2.1-SNAPSHOT/lib/* %{buildroot}%{_datadir}/%{name}/vendor/dex2jar-2.1-SNAPSHOT/lib/
install -p -m 755 -D vendor/dex2jar-2.1-SNAPSHOT/*.sh %{buildroot}%{_datadir}/%{name}/vendor/dex2jar-2.1-SNAPSHOT/
install -p -m 644 -D vendor/dex2jar-2.1-SNAPSHOT/LICENSE.txt %{buildroot}%{_datadir}/%{name}/vendor/dex2jar-2.1-SNAPSHOT/
install -p -m 644 -D templates/%{name}/css/* %{buildroot}%{_datadir}/%{name}/templates/%{name}/css/
install -p -m 644 -D templates/%{name}/img/* %{buildroot}%{_datadir}/%{name}/templates/%{name}/img/
install -p -m 644 -D templates/%{name}/js/* %{buildroot}%{_datadir}/%{name}/templates/%{name}/js/
install -p -m 644 -D templates/%{name}/*.hbs %{buildroot}%{_datadir}/%{name}/templates/%{name}/
install -p -m 644 -D templates/%{name}/css/* %{buildroot}%{_datadir}/%{name}/templates/super/css/
install -p -m 644 -D templates/%{name}/img/* %{buildroot}%{_datadir}/%{name}/templates/super/img/
install -p -m 644 -D templates/%{name}/js/* %{buildroot}%{_datadir}/%{name}/templates/super/js/
install -p -m 644 -D templates/%{name}/*.hbs %{buildroot}%{_datadir}/%{name}/templates/super/
install -p -m 755 -D vendor/*.jar %{buildroot}%{_datadir}/%{name}/vendor/
install -p -m 644 -D vendor/*.txt %{buildroot}%{_datadir}/%{name}/vendor/
install -p -m 644 rules.json %{buildroot}%{_sysconfdir}/%{name}/
Expand Down
26 changes: 14 additions & 12 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,14 +690,14 @@ impl Default for Config {
#[cfg(target_family = "unix")]
fn default() -> Config {
let mut config = Config::local_default();
let etc_rules = PathBuf::from("/etc/super/rules.json");
let etc_rules = PathBuf::from("/etc/super-analyzer/rules.json");
if etc_rules.exists() {
config.rules_json = etc_rules;
}
let share_path = Path::new(if cfg!(target_os = "macos") {
"/usr/local/super"
"/usr/local/super-analyzer"
} else {
"/usr/share/super"
"/usr/share/super-analyzer"
});
if share_path.exists() {
config.dex2jar_folder = share_path.join("vendor/dex2jar-2.1-SNAPSHOT");
Expand Down Expand Up @@ -814,11 +814,11 @@ mod tests {
assert_eq!(config.get_results_folder(), Path::new("results"));
assert_eq!(config.get_template_name(), "super");
let share_path = Path::new(if cfg!(target_os = "macos") {
"/usr/local/super"
"/usr/local/super-analyzer"
} else if cfg!(target_family = "windows") {
""
} else {
"/usr/share/super"
"/usr/share/super-analyzer"
});
let share_path = if share_path.exists() {
share_path
Expand All @@ -832,8 +832,9 @@ mod tests {
assert_eq!(config.get_templates_folder(), share_path.join("templates"));
assert_eq!(config.get_template_path(),
share_path.join("templates").join("super"));
if cfg!(target_family = "unix") && Path::new("/etc/super/rules.json").exists() {
assert_eq!(config.get_rules_json(), Path::new("/etc/super/rules.json"));
if cfg!(target_family = "unix") && Path::new("/etc/super-analyzer/rules.json").exists() {
assert_eq!(config.get_rules_json(),
Path::new("/etc/super-analyzer/rules.json"));
} else {
assert_eq!(config.get_rules_json(), Path::new("rules.json"));
}
Expand Down Expand Up @@ -906,15 +907,16 @@ mod tests {
assert_eq!(config.get_dist_folder(), Path::new("dist"));
assert_eq!(config.get_results_folder(), Path::new("results"));
assert_eq!(config.get_dex2jar_folder(),
Path::new("/usr/share/super/vendor/dex2jar-2.1-SNAPSHOT"));
Path::new("/usr/share/super-analyzer/vendor/dex2jar-2.1-SNAPSHOT"));
assert_eq!(config.get_jd_cmd_file(),
Path::new("/usr/share/super/vendor/jd-cmd.jar"));
Path::new("/usr/share/super-analyzer/vendor/jd-cmd.jar"));
assert_eq!(config.get_templates_folder(),
Path::new("/usr/share/super/templates"));
Path::new("/usr/share/super-analyzer/templates"));
assert_eq!(config.get_template_path(),
Path::new("/usr/share/super/templates/super"));
Path::new("/usr/share/super-analyzer/templates/super"));
assert_eq!(config.get_template_name(), "super");
assert_eq!(config.get_rules_json(), Path::new("/etc/super/rules.json"));
assert_eq!(config.get_rules_json(),
Path::new("/etc/super-analyzer/rules.json"));
assert_eq!(config.get_unknown_permission_criticality(),
Criticality::Low);
assert_eq!(config.get_unknown_permission_description(),
Expand Down

0 comments on commit bebdf26

Please sign in to comment.