Skip to content

Commit

Permalink
fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
subho007 committed Feb 7, 2019
1 parent 676abb3 commit 2f7aa16
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions pyaxmlparser/core.py
Expand Up @@ -209,13 +209,15 @@ class APK(object):
_APK_SIG_ATTR_V2_STRIPPING_PROTECTION = 0xbeeff00d

_APK_SIG_ALGO_IDS = {
0x0101 : "RSASSA-PSS with SHA2-256 digest, SHA2-256 MGF1, 32 bytes of salt, trailer: 0xbc",
0x0102 : "RSASSA-PSS with SHA2-512 digest, SHA2-512 MGF1, 64 bytes of salt, trailer: 0xbc",
0x0103 : "RSASSA-PKCS1-v1_5 with SHA2-256 digest.", # This is for build systems which require deterministic signatures.
0x0104 : "RSASSA-PKCS1-v1_5 with SHA2-512 digest.", # This is for build systems which require deterministic signatures.
0x0201 : "ECDSA with SHA2-256 digest",
0x0202 : "ECDSA with SHA2-512 digest",
0x0301 : "DSA with SHA2-256 digest",
0x0101: "RSASSA-PSS with SHA2-256 digest, SHA2-256 MGF1, 32 bytes of salt, trailer: 0xbc",
0x0102: "RSASSA-PSS with SHA2-512 digest, SHA2-512 MGF1, 64 bytes of salt, trailer: 0xbc",
# This is for build systems which require deterministic signatures.
0x0103: "RSASSA-PKCS1-v1_5 with SHA2-256 digest.",
# This is for build systems which require deterministic signatures.
0x0104: "RSASSA-PKCS1-v1_5 with SHA2-512 digest.",
0x0201: "ECDSA with SHA2-256 digest",
0x0202: "ECDSA with SHA2-512 digest",
0x0301: "DSA with SHA2-256 digest",
}

def __init__(self, filename, raw=False, magic_file=None, skip_analysis=False, testzip=False):
Expand All @@ -231,7 +233,8 @@ def __init__(self, filename, raw=False, magic_file=None, skip_analysis=False, te
:param raw: specify if the filename is a path or raw data (optional)
:param magic_file: specify the magic file (not used anymore - legacy only)
:param skip_analysis: Skip the analysis, e.g. no manifest files are read. (default: False)
:param testzip: Test the APK for integrity, e.g. if the ZIP file is broken. Throw an exception on failure (default False)
:param testzip: Test the APK for integrity, e.g. if the ZIP file is broken.
Throw an exception on failure (default False)
:type filename: string
:type raw: boolean
Expand Down Expand Up @@ -1332,7 +1335,10 @@ def is_androidtv(self):
:return: True if 'android.hardware.touchscreen' is not required, False otherwise
"""
return self.get_attribute_value('uses-feature', 'name', required="false", name="android.hardware.touchscreen") == "android.hardware.touchscreen"
return self.get_attribute_value(
'uses-feature', 'name', required="false",
name="android.hardware.touchscreen"
) == "android.hardware.touchscreen"

def get_certificate_der(self, filename):
"""
Expand Down Expand Up @@ -1424,7 +1430,8 @@ def get_android_manifest_xml(self):

def get_android_resources(self):
"""
Return the :class:`~androguard.core.bytecodes.axml.ARSCParser` object which corresponds to the resources.arsc file
Return the :class:`~androguard.core.bytecodes.axml.ARSCParser`
object which corresponds to the resources.arsc file
:rtype: :class:`~androguard.core.bytecodes.axml.ARSCParser`
"""
Expand Down Expand Up @@ -1632,7 +1639,6 @@ def parse_v3_signing_block(self):
raw_digests = signed_data.read(len_digests)
digests = self.parse_signatures_or_digests(raw_digests)


# Certs
certs = []
len_certs = self.read_uint32_le(signed_data)
Expand Down

0 comments on commit 2f7aa16

Please sign in to comment.