chiark / gitweb /
update: use androguard by default if it is available
authorHans-Christoph Steiner <hans@eds.org>
Wed, 14 Feb 2018 16:22:25 +0000 (17:22 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 15 Feb 2018 13:28:48 +0000 (14:28 +0100)
closes #236

fdroidserver/update.py

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