[][src]Struct super_analyzer_core::config::Config

pub struct Config {
    app_packages: Vec<PathBuf>,
    verbose: bool,
    quiet: bool,
    overall_force: bool,
    force: bool,
    bench: bool,
    open: bool,
    json: bool,
    html: bool,
    min_criticality: Criticality,
    threads: usize,
    downloads_folder: PathBuf,
    dist_folder: PathBuf,
    results_folder: PathBuf,
    dex2jar_folder: PathBuf,
    jd_cmd_file: PathBuf,
    rules_json: PathBuf,
    templates_folder: PathBuf,
    template: String,
    unknown_permission: (Criticality, String),
    permissions: BTreeSet<Permission>,
    loaded_files: Vec<PathBuf>,
}

Config structure.

Contains configuration related fields. It is used for storing the configuration parameters and checking their values. Implements the Default trait.

Fields

app_packages: Vec<PathBuf>

Application packages to analyze.

verbose: bool

Boolean to represent --verbose mode.

quiet: bool

Boolean to represent --quiet mode.

overall_force: bool

Boolean to represent overall --force mode.

force: bool

Boolean to represent current --force mode.

bench: bool

Boolean to represent --bench mode.

open: bool

Boolean to represent --open mode.

json: bool

Boolean to represent --json mode.

html: bool

Boolean to represent --html mode.

min_criticality: Criticality

Minimum criticality to analyze

threads: usize

Number of threads.

downloads_folder: PathBuf

Folder where the applications are stored.

dist_folder: PathBuf

Folder with files from analyzed applications.

results_folder: PathBuf

Folder to store the results of analysis.

dex2jar_folder: PathBuf

Path to the Dex2jar binaries.

jd_cmd_file: PathBuf

Path to the JD_CMD binary.

rules_json: PathBuf

Path to the rules.json file.

templates_folder: PathBuf

The folder where the templates are stored.

template: String

The name of the template to use.

unknown_permission: (Criticality, String)

Represents an unknown permission.

permissions: BTreeSet<Permission>

List of permissions to analyze.

loaded_files: Vec<PathBuf>

Checker for the loaded files

Methods

impl Config[src]

pub fn from_file<P: AsRef<Path>>(config_path: P) -> Result<Self, Error>[src]

Creates a new Config struct.

pub fn decorate_with_cli(
    &mut self,
    cli: &ArgMatches<'static>
) -> Result<(), Error>
[src]

Decorates the loaded config with the given flags from CLI

fn set_options(&mut self, cli: &ArgMatches<'static>)[src]

Modifies the options from the CLI.

fn read_apks(&mut self) -> Result<(), Error>[src]

Reads all the apk files in the downloads folder and adds them to the configuration.

pub fn check(&self) -> bool[src]

Checks if all the needed folders and files exist.

pub fn errors(&self) -> Vec<String>[src]

Returns the folders and files that do not exist.

pub fn loaded_config_files(&self) -> VecIter<PathBuf>[src]

Returns the currently loaded config files.

pub fn app_packages(&self) -> Vec<PathBuf>[src]

Returns the app package.

pub(crate) fn add_app_package<P: AsRef<Path>>(&mut self, app_package: P)[src]

Adds a package to check.

pub fn is_verbose(&self) -> bool[src]

Returns true if the application is running in --verbose mode, false otherwise.

pub fn is_quiet(&self) -> bool[src]

Returns true if the application is running in --quiet mode, false otherwise.

pub fn is_force(&self) -> bool[src]

Returns true if the application is running in --force mode, false otherwise.

pub fn set_force(&mut self)[src]

Sets the application to force recreate the analysis files and results temporarily.

pub fn reset_force(&mut self)[src]

Resets the --force option, so that it gets reset to the configured force option.

pub fn is_bench(&self) -> bool[src]

Returns true if the application is running in --bench mode, false otherwise.

pub fn is_open(&self) -> bool[src]

Returns true if the application is running in --open mode, false otherwise.

pub fn has_to_generate_json(&self) -> bool[src]

Returns true if the application has to generate result in JSON format.

pub fn has_to_generate_html(&self) -> bool[src]

Returns true if the application has to generate result in HTML format.

pub fn min_criticality(&self) -> Criticality[src]

Returns the min_criticality field.

pub fn threads(&self) -> usize[src]

Returns the threads field.

pub fn dist_folder(&self) -> &Path[src]

Returns the path to the dist_folder.

pub fn results_folder(&self) -> &Path[src]

Returns the path to the results_folder.

pub fn dex2jar_folder(&self) -> &Path[src]

Returns the path to the dex2jar_folder.

pub fn jd_cmd_file(&self) -> &Path[src]

Returns the path to the jd_cmd_file.

pub fn template_path(&self) -> PathBuf[src]

Gets the path to the template.

pub fn templates_folder(&self) -> &Path[src]

Gets the path to the templates folder.

pub fn template_name(&self) -> &str[src]

Gets the name of the template.

pub fn rules_json(&self) -> &Path[src]

Returns the path to the rules_json.

pub fn unknown_permission_criticality(&self) -> Criticality[src]

Returns the criticality of the unknown_permission field.

pub fn unknown_permission_description(&self) -> &str[src]

Returns the description of the unknown_permission field.

pub fn permissions(&self) -> Iter<Permission>[src]

Returns the loaded permissions.

fn local_default() -> Self[src]

Returns the default Config struct.

Trait Implementations

impl Default for Config[src]

fn default() -> Self[src]

Creates the default Config struct in Unix systems.

impl Debug for Config[src]

impl<'de> Deserialize<'de> for Config where
    Config: Default
[src]

Auto Trait Implementations

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

impl RefUnwindSafe for Config

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self