1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-13 02:30:11 +01:00

Merge gitorious.org:f-droid/fdroidserver

This commit is contained in:
Daniel Martí 2013-04-19 16:51:13 +02:00
commit 66f52fd59a
4 changed files with 33 additions and 1 deletions

View File

@ -390,6 +390,10 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir,
re.S|re.M).group(1)
src = os.path.join(bindir, src)
# Make sure it's not debuggable...
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
# code in our new apk match what we expect...
print "Checking " + src

View File

@ -416,6 +416,10 @@ def parse_metadata(metafile, **kw):
thisbuild['origlines'] = lines
thisbuild['version'] = parts[0]
thisbuild['vercode'] = parts[1]
try:
testvercode = int(thisbuild['vercode'])
except:
raise MetaDataException("Invalid version code for build in " + metafile.name)
thisbuild['commit'] = parts[2]
for p in parts[3:]:
pk, pv = p.split('=', 1)
@ -2186,3 +2190,22 @@ class KnownApks:
lst.reverse()
return lst
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'],
stdout=subprocess.PIPE)
output = p.communicate()[0]
if p.returncode != 0:
print "ERROR: Failed to get apk manifest information"
sys.exit(1)
for line in output.splitlines():
if line.find('android:debuggable') != -1 and not line.endswith('0x0'):
return True
return False

View File

@ -329,6 +329,10 @@ def main():
print " WARNING: no SDK version information found"
thisinfo['sdkversion'] = 0
# Check for debuggable apks...
if common.isApkDebuggable(apkfile, sdk_path):
print "WARNING: {0} is debuggable... {1}".format(apkfile, line)
# Calculate the md5 and sha256...
m = hashlib.md5()
sha = hashlib.sha256()

View File

@ -292,13 +292,14 @@ class FDroid
$out.='}';
$out.='</script>';
$out.="<h3>Packages</h3>";
$out.="<p><b>NOTE:</b> Although APK downloads are available below to give ";
$out.="you the choice, you should be aware that by installing that way you ";
$out.="will not receive update notifications, and it's a less secure way ";
$out.="to download, especially if you are not currently using HTTPS. ";
$out.="We recommend that you install the F-Droid client and use that.</p>";
$out.="<h3>Packages</h3>";
$i=0;
foreach($apks as $apk) {
$first = $i+1==count($apks);