ShowLoggingFuncs¶
This is an autogenerated documentation file for the script: ShowLoggingFuncs
Run it¶
$ ./androanalyze scripts_builtin/ShowLoggingFuncs.py --package-names com.spotify.music
View the results¶
Non-Binary¶
$ ./androquery result -sn ShowLoggingFuncs -pn com.spotify.music
{
"apk meta": {
"package name": "com.spotify.music",
"version name": "2.2.0.636",
"sha256": "bbf2c7d7b8fbbce68a97a2f0fd7e854e29b1ea9e3836615e7e6a35095915a607",
"import date": "2015-04-14T15:10:06.364000",
"build_date": "2015-02-11T12:25:40",
"path": "/mnt/stuff/btsync/apks_manual_downloads/02.03.2015_top_free_4/apps_topselling_free/MUSIC_AND_AUDIO/com.spotify.music.apk",
"tag": null
},
"script meta": {
"name": "ShowLoggingFuncs",
"sha256": "4298a7ac3a603e91692798c0c373d93c7a9d5d4d3f082714d0daa413b0a64470",
"analysis date": "2015-06-22T20:29:34.178000",
"version": "0.1"
},
"category1": {
"category2": {
"logged": {
"normal": "some value",
"bool": true,
"enum": [
"list element"
]
},
"unlogged": {
"normal": null,
"bool": false,
"enum": []
}
}
}
}
Binary¶
For the case that the result may exceed 16MB, it is stored in MongoDB’s gridFS. Therefore we need to use a different query syntax:
View the meta data:
$ ./androquery result -sn ShowLoggingFuncs -pn com.spotify.music -nd
Empty
View the raw data:
$ ./androquery result -sn ShowLoggingFuncs -pn com.spotify.music -nd -r
Empty
Source¶
# encoding: utf-8
__author__ = "Nils Tobias Schmidt"
__email__ = "schmidt89 at informatik.uni-marburg.de"
from androlyze.model.script.AndroScript import AndroScript
#categories
CAT_CLASS_DETAILS = "class details"
CAT_METHODS = "methods"
CAT_FIELDS = "fields"
class ShowLoggingFuncs(AndroScript):
''' Example for demonstrating available logging options and to do some query checks '''
VERSION = "0.1"
def _analyze(self, apk, dalvik_vm_format, vm_analysis, gvm_analysis, *args, **kwargs):
res = self.res
CAT_UNLOGGED = "category1", "category2", "unlogged"
CAT_LOGGED = "category1", "category2", "logged"
res.register_keys(["normal"], *CAT_LOGGED)
res.register_keys(["normal"], *CAT_UNLOGGED)
res.register_bool_keys(["bool"], *CAT_LOGGED)
res.register_bool_keys(["bool"], *CAT_UNLOGGED)
res.register_enum_keys(["enum"], *CAT_LOGGED)
res.register_enum_keys(["enum"], *CAT_UNLOGGED)
res.log("normal", "some value", *CAT_LOGGED)
res.log_true("bool", *CAT_LOGGED)
res.log_append_to_enum("enum", "list element", *CAT_LOGGED)