From: Frans Gifford Date: Thu, 18 Jul 2013 17:23:17 +0000 (+0100) Subject: Use config.py to locate aapt X-Git-Tag: 0.1~467 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e0e6e711c3318416cf6293bc3dbc28f67661824c;p=fdroidserver.git Use config.py to locate aapt This uses aapt_path in config.py to locate the aapt command. The latest Android SDK moved aapt out of platform-tools/ causing builds which depend on this path to fail. Signed-off-by: Frans Gifford --- diff --git a/fdroidserver/build.py b/fdroidserver/build.py index ac040e08..72eba258 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -478,8 +478,14 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d print "Checking " + src if not os.path.exists(src): raise BuildException("Unsigned apk is not at expected location of " + src) - p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', - 'aapt'), + if ('aapt_path' not in globals()): + # (re-)read configuration + execfile('config.py', globals()) + if not os.path.exists(aapt_path): + print "Missing aapt - check aapt_path in your config" + sys.exit(1) + + p = subprocess.Popen([aapt_path, 'dump', 'badging', src], stdout=subprocess.PIPE) output = p.communicate()[0] diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 566284b3..8f3d5551 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1564,9 +1564,16 @@ def isApkDebuggable(apkfile, sdk_path): """Returns True if the given apk file is debuggable :param apkfile: full path to the apk to check - :param sdk_path: path to android sdk""" + :param sdk_path: path to android sdk (deprecated)""" - p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'), + if ('aapt_path' not in globals()): + # (re-)read configuration + execfile('config.py', globals()) + if not os.path.exists(aapt_path): + print "Missing aapt - check aapt_path in your config" + sys.exit(1) + + p = subprocess.Popen([aapt_path, 'dump', 'xmltree', apkfile, 'AndroidManifest.xml'], stdout=subprocess.PIPE) output = p.communicate()[0]