Showing 1 of 1 files from the diff.

@@ -74,13 +74,14 @@
Loading
74 74
        return a, d, dx
75 75
76 76
77 -
def AnalyzeDex(filename, session=None):
77 +
def AnalyzeDex(filename, session=None, raw=False):
78 78
    """
79 79
    Analyze an android dex file and setup all stuff for a more quickly analysis !
80 80
81 81
    :param filename: the filename of the android dex file or a buffer which represents the dex file
82 82
    :type filename: string
83 83
    :param session: A session (Default None)
84 +
    :param raw: If set, ``filename`` will be used as the odex's data (bytes). Defaults to ``False``
84 85
85 86
    :rtype: return a tuple of (sha256hash, :class:`DalvikVMFormat`, :class:`Analysis`)
86 87
    """
@@ -89,19 +90,23 @@
Loading
89 90
    if not session:
90 91
        session = get_default_session()
91 92
92 -
    with open(filename, "rb") as fd:
93 -
        data = fd.read()
93 +
    if raw:
94 +
        data = filename
95 +
    else:
96 +
        with open(filename, "rb") as fd:
97 +
            data = fd.read()
94 98
95 99
    return session.addDEX(filename, data)
96 100
97 101
98 -
def AnalyzeODex(filename, session=None):
102 +
def AnalyzeODex(filename, session=None, raw=False):
99 103
    """
100 104
    Analyze an android odex file and setup all stuff for a more quickly analysis !
101 105
102 106
    :param filename: the filename of the android dex file or a buffer which represents the dex file
103 107
    :type filename: string
104 108
    :param session: The Androguard Session to add the ODex to (default: None)
109 +
    :param raw: If set, ``filename`` will be used as the odex's data (bytes). Defaults to ``False``
105 110
106 111
    :rtype: return a tuple of (sha256hash, :class:`DalvikOdexVMFormat`, :class:`Analysis`)
107 112
    """
@@ -110,8 +115,11 @@
Loading
110 115
    if not session:
111 116
        session = get_default_session()
112 117
113 -
    with open(filename, "rb") as fd:
114 -
        data = fd.read()
118 +
    if raw:
119 +
        data = filename
120 +
    else:
121 +
        with open(filename, "rb") as fd:
122 +
            data = fd.read()
115 123
116 124
    return session.addDEY(filename, data)
117 125
Files Coverage
androguard 73.54%
tests 96.95%
Project Totals (51 files) 76.84%
1086.4
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
1086.2
TRAVIS_PYTHON_VERSION=3.7
TRAVIS_OS_NAME=linux
1086.3
TRAVIS_PYTHON_VERSION=3.5
TRAVIS_OS_NAME=linux
1086.1
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading