12
12
from androguard .core .bytecodes .dvm_types import Operand
13
13
from androguard .misc import AnalyzeAPK , AnalyzeDex
14
14
15
- from quark .core .interface .baseapkinfo import BaseApkinfo , XMLElement
15
+ from quark .core .interface .baseapkinfo import BaseApkinfo
16
16
from quark .core .struct .bytecodeobject import BytecodeObject
17
17
from quark .core .struct .methodobject import MethodObject
18
18
from quark .evaluator .pyeval import PyEval
21
21
class AndroguardImp (BaseApkinfo ):
22
22
"""Information about apk based on androguard analysis"""
23
23
24
- __slots__ = ("apk" , "dalvikvmformat" , "analysis" )
24
+ __slots__ = ("apk" , "dalvikvmformat" , "analysis" , "_manifest" )
25
25
26
26
def __init__ (self , apk_filepath : Union [str , PathLike ]):
27
27
super ().__init__ (apk_filepath , "androguard" )
@@ -32,55 +32,10 @@ def __init__(self, apk_filepath: Union[str, PathLike]):
32
32
elif self .ret_type == "DEX" :
33
33
# return the sha256hash, DalvikVMFormat, and Analysis objects
34
34
_ , _ , self .analysis = AnalyzeDex (apk_filepath )
35
+ self ._manifest = None
35
36
else :
36
37
raise ValueError ("Unsupported File type." )
37
38
38
- @property
39
- def permissions (self ) -> List [str ]:
40
- if self .ret_type == "APK" :
41
- return self .apk .get_permissions ()
42
-
43
- if self .ret_type == "DEX" :
44
- return []
45
-
46
- @property
47
- def application (self ) -> XMLElement :
48
- """Get the application element from the manifest file.
49
-
50
- :return: an application element
51
- """
52
- if self .ret_type == "DEX" :
53
- return []
54
-
55
- manifest_root = self .apk .get_android_manifest_xml ()
56
-
57
- return manifest_root .find ("application" )
58
-
59
- @property
60
- def activities (self ) -> List [XMLElement ]:
61
- if self .ret_type == "DEX" :
62
- return []
63
-
64
- manifest_root = self .apk .get_android_manifest_xml ()
65
- application = manifest_root .find ("application" )
66
-
67
- return application .findall ("activity" )
68
-
69
- @property
70
- def receivers (self ) -> List [XMLElement ]:
71
- """
72
- Return all receivers from the given APK.
73
-
74
- :return: a list of all receivers
75
- """
76
- if self .ret_type == "DEX" :
77
- return []
78
-
79
- manifest_root = self .apk .get_android_manifest_xml ()
80
- application = manifest_root .find ("application" )
81
-
82
- return application .findall ("receiver" )
83
-
84
39
@property
85
40
def android_apis (self ) -> Set [MethodObject ]:
86
41
apis = set ()
0 commit comments