update: use androguard by default if it is available

closes #236
This commit is contained in:
Hans-Christoph Steiner 2018-02-14 17:22:25 +01:00
parent 5281228ea5
commit d1ded7f64d

View file

@ -1049,10 +1049,12 @@ def scan_apk(apk_file):
'antiFeatures': set(), 'antiFeatures': set(),
} }
if SdkToolsPopen(['aapt', 'version'], output=False): try:
scan_apk_aapt(apk, apk_file) import androguard
else: androguard # silence pyflakes
scan_apk_androguard(apk, apk_file) scan_apk_androguard(apk, apk_file)
except ImportError:
scan_apk_aapt(apk, apk_file)
# Get the signature, or rather the signing key fingerprints # Get the signature, or rather the signing key fingerprints
logging.debug('Getting signature of {0}'.format(os.path.basename(apk_file))) logging.debug('Getting signature of {0}'.format(os.path.basename(apk_file)))