From e0e6e711c3318416cf6293bc3dbc28f67661824c Mon Sep 17 00:00:00 2001 From: Frans Gifford Date: Thu, 18 Jul 2013 18:23:17 +0100 Subject: [PATCH] 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 --- fdroidserver/build.py | 10 ++++++++-- fdroidserver/common.py | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) 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]