chiark / gitweb /
Don't rely on undocumented global
authorCiaran Gultnieks <ciaran@ciarang.com>
Mon, 15 Apr 2013 14:07:23 +0000 (15:07 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Mon, 15 Apr 2013 14:07:23 +0000 (15:07 +0100)
fdroidserver/build.py
fdroidserver/common.py
fdroidserver/update.py

index 220e368b907dde0bcd428fad021d673d8f04d56b..307b650ac96b63ac640819dc2683e74f9c3b5d00 100644 (file)
@@ -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
index d10d304cd1613d416fab9d481cd69ae06bbe93d1..b37fe0eae6ba45c189364b60ff9637c8e2e9bb7b 100644 (file)
@@ -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'],
index 28619168fbfa38da47210ee173edd84a6b6f75d7..21cd4add3d763a4fd6b8af18d6c4dc5e88606e34 100644 (file)
@@ -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...