From cb4bc9b61622803024345538fb55f6781ef872b9 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Sun, 22 Jul 2018 23:37:03 +0200 Subject: Extracted information about AndroidManifest files. --- python/amanifest.py | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 python/amanifest.py diff --git a/python/amanifest.py b/python/amanifest.py new file mode 100644 index 0000000..a076bc4 --- /dev/null +++ b/python/amanifest.py @@ -0,0 +1,65 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +import argparse +import pychrysalide +from pychrysalide.analysis.contents import FileContent +from pychrysalide.format.axml import AxmlFormat +from pychrysalide.format.axml import AndroidManifest + + +if __name__ == '__main__': + + parser = argparse.ArgumentParser(description='amanifest - Displays information about Android Manifests.', add_help=False) + + parser.add_argument('-H', '--help', action='store_true', help='Display the command line options.') + + parser.add_argument('file', type=str, help='The object file to be examined') + + args = parser.parse_args() + + if args.help: + parser.print_help() + sys.exit(1) + + cnt = FileContent(args.file) + + fmt = AxmlFormat(cnt) + + manifest = AndroidManifest(fmt) + + manifest.analyze_and_wait() + + #print(fmt.text) + + print() + + print('Min SDK: ', manifest.min_sdk) + print('Target SDK:', manifest.target_sdk) + print('Max SDK: ', manifest.max_sdk) + print() + + print('Permissions:') + for p in manifest.permissions: + print(' - ', p) + print() + + print('Activities:') + for p in manifest.activities: + print(' - ', p) + print() + + print('Providers:') + for p in manifest.providers: + print(' - ', p) + print() + + print('Receivers:') + for p in manifest.receivers: + print(' - ', p) + print() + + print('Services:') + for p in manifest.services: + print(' - ', p) + print() -- cgit v0.11.2-87-g4458