androlyze.model.analysis.result package

Submodules

androlyze.model.analysis.result.ResultObject module

class androlyze.model.analysis.result.ResultObject.ResultObject(apk=None)[source]

Bases: object

This class is intended to be used for a consistent storage of the analysis results. It’s a wrapper around a dictionary and enables you to store any json serializable data types. For a more structured way of storing the results you can group them into different categories.

Before you can log any data, you have to register the keys as well as the categories if you want to use them. The order in which you register the keys will be kept and used for JSON export.

You don’t have to register all keys iterative, just give a list of categories to create the structure at once.

Attributes

Methods

apk

apk : the APK file for which the results will be collected

del_apk()[source]
del_results()[source]
description_dict()[source]

Returns a dict with meta information about the Apk added to the ResultObject. At least if ResultObject is linked to an Apk

get_apk()[source]
get_results()[source]
static load_from_json(json_str)[source]

Load an ResultObject from json string. This works by cutting off the meta information.

Don’t forget to link it to the corresponding Apk class!

Parameters:json_str : str
Returns:ResultObject
log(key, value, *categories)[source]

Store the value for the given key.

You can pass a list of categories to group the log entries.

Parameters:

key: object

value: json serializable

categories: object

Can be used to group the results into different categories. The string representation will be used for the category name.

Raises:

KeyNotRegisteredError

If the key has not been registered first.

log_append_to_enum(key, value, *categories)[source]

Append the value to the list under the given key.

You can pass a list of categories to group the log entries.

Parameters:

key: object

value: json serializable

categories: object

Can be used to group the results into different categories. The string representation will be used for the category name.

Raises:

KeyNotRegisteredError

If the key has not been registered first.

log_true(key, *categories)[source]

Log a boolean value for the key under the given categories.

Parameters:

key: object

categories: object

Can be used to group the results into different categories. The string representation will be used for the category name.

Raises:

KeyNotRegisteredError

If the key has not been registered first.

register_bool_keys(keys, *categories)[source]

Register the keys under the given categories (will be set to False).

Parameters:

keys : list<str>

categories: object

Can be used to group the results into different categories. The string representation will be used for the category name.

register_enum_keys(keys, *categories)[source]

Register the keys under the given categories (will be set to []).

Parameters:

keys : list<str>

categories: object

Can be used to group the results into different categories. The string representation will be used for the category name.

register_keys(keys, *categories)[source]

Register the keys under the given categories (will be set to None).

Parameters:

keys : list<str>

categories: object

Can be used to group the results into different categories. The string representation will be used for the category name.

results

OrderedDict : stores the results

set_apk(value)[source]
set_results(value)[source]
write_to_json()[source]

Returns a json representation as str

androlyze.model.analysis.result.StaticResultKeys module

Module contents