def get_metadata_from_apk(app, build, apkfile):
"""get the required metadata from the built APK"""
- if common.set_command_in_config('aapt'):
+ if common.SdkToolsPopen(['aapt', 'version'], output=False):
vercode, version, foundid, nativecode = get_apk_metadata_aapt(apkfile)
else:
vercode, version, foundid, nativecode = get_apk_metadata_androguard(apkfile)
if get_file_extension(apkfile) != 'apk':
return False
- if set_command_in_config('aapt'):
+ if SdkToolsPopen(['aapt', 'version'], output=False):
return get_apk_debuggable_aapt(apkfile)
else:
return get_apk_debuggable_androguard(apkfile)
apk['antiFeatures'].add('KnownVuln')
try:
- if common.set_command_in_config('aapt'):
+ if SdkToolsPopen(['aapt', 'version'], output=False):
scan_apk_aapt(apk, apkfile)
else:
scan_apk_androguard(apk, apkfile)
import logging
import optparse
import os
-import shutil
import sys
-import tempfile
import unittest
-import yaml
-from binascii import unhexlify
localmodule = os.path.realpath(
os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..'))
fdroidserver.update.options.clean = True
fdroidserver.update.options.delete_unknown = True
- self.assertTrue(fdroidserver.common.set_command_in_config('aapt'))
+ self.assertTrue(fdroidserver.common.SdkToolsPopen('aapt'))
try:
from androguard.core.bytecodes.apk import APK
+ dir(APK)
except ImportError:
raise Exception("androguard not installed!")
newSuite = unittest.TestSuite()
newSuite.addTest(unittest.makeSuite(UpdateTest))
- unittest.main()
\ No newline at end of file
+ unittest.main()