mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 23:42:37 +03:00
Don't rely on undocumented global
This commit is contained in:
parent
dae3c9af9d
commit
2bb6d51dd3
3 changed files with 7 additions and 4 deletions
|
@ -391,7 +391,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir,
|
||||||
src = os.path.join(bindir, src)
|
src = os.path.join(bindir, src)
|
||||||
|
|
||||||
# Make sure it's not debuggable...
|
# 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")
|
raise BuildException("APK is debuggable")
|
||||||
|
|
||||||
# By way of a sanity check, make sure the version and version
|
# By way of a sanity check, make sure the version and version
|
||||||
|
|
|
@ -2180,8 +2180,11 @@ class KnownApks:
|
||||||
lst.reverse()
|
lst.reverse()
|
||||||
return lst
|
return lst
|
||||||
|
|
||||||
def isApkDebuggable(apkfile):
|
def isApkDebuggable(apkfile, sdk_path):
|
||||||
"""Returns True if the given apk file is debuggable"""
|
"""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'),
|
p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'),
|
||||||
'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
|
'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
|
||||||
|
|
|
@ -330,7 +330,7 @@ def main():
|
||||||
thisinfo['sdkversion'] = 0
|
thisinfo['sdkversion'] = 0
|
||||||
|
|
||||||
# Check for debuggable apks...
|
# Check for debuggable apks...
|
||||||
if common.isApkDebuggable(apkfile):
|
if common.isApkDebuggable(apkfile, sdk_path):
|
||||||
print "WARNING: {0} is debuggable... {1}".format(apkfile, line)
|
print "WARNING: {0} is debuggable... {1}".format(apkfile, line)
|
||||||
|
|
||||||
# Calculate the md5 and sha256...
|
# Calculate the md5 and sha256...
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue