From: Ciaran Gultnieks Date: Mon, 15 Apr 2013 14:07:23 +0000 (+0100) Subject: Don't rely on undocumented global X-Git-Tag: 0.1~642^2~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2bb6d51dd3fbaba71a79dc1ee9c2eb57b84ca2e2;p=fdroidserver.git Don't rely on undocumented global --- diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 220e368b..307b650a 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -391,7 +391,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir, src = os.path.join(bindir, src) # Make sure it's not debuggable... - if not install and common.isApkDebuggable(src): + if not install and common.isApkDebuggable(src, sdk_path): raise BuildException("APK is debuggable") # By way of a sanity check, make sure the version and version diff --git a/fdroidserver/common.py b/fdroidserver/common.py index d10d304c..b37fe0ea 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -2180,8 +2180,11 @@ class KnownApks: lst.reverse() return lst -def isApkDebuggable(apkfile): - """Returns True if the given apk file is debuggable""" +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""" p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'), 'dump', 'xmltree', apkfile, 'AndroidManifest.xml'], diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 28619168..21cd4add 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -330,7 +330,7 @@ def main(): thisinfo['sdkversion'] = 0 # Check for debuggable apks... - if common.isApkDebuggable(apkfile): + if common.isApkDebuggable(apkfile, sdk_path): print "WARNING: {0} is debuggable... {1}".format(apkfile, line) # Calculate the md5 and sha256...