From 5fdb670cb2572e25c3faab39fb49d80727593ef0 Mon Sep 17 00:00:00 2001 From: krnick Date: Sun, 19 Apr 2020 00:22:16 +0800 Subject: [PATCH] add get_android_api_usage method --- androguard/core/analysis/analysis.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/androguard/core/analysis/analysis.py b/androguard/core/analysis/analysis.py index 135edd4b..4fe95d01 100644 --- a/androguard/core/analysis/analysis.py +++ b/androguard/core/analysis/analysis.py @@ -2041,6 +2041,18 @@ class Analysis: if meth.permission_api_name in apis: yield meth_analysis + def get_android_api_usage(self): + """ + Get all usage of the Android APIs inside the Analysis. + + :return: yields :class:`MethodAnalysis` objects for all Android APIs methods + """ + + for cls in self.get_external_classes(): + for meth_analysis in cls.get_methods(): + if meth_analysis.is_android_api(): + yield meth_analysis + def is_ascii_obfuscation(vm): """