mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 23:42:37 +03:00
Merge gitorious.org:f-droid/fdroidserver
This commit is contained in:
commit
66f52fd59a
4 changed files with 33 additions and 1 deletions
|
@ -390,6 +390,10 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir,
|
||||||
re.S|re.M).group(1)
|
re.S|re.M).group(1)
|
||||||
src = os.path.join(bindir, src)
|
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
|
# By way of a sanity check, make sure the version and version
|
||||||
# code in our new apk match what we expect...
|
# code in our new apk match what we expect...
|
||||||
print "Checking " + src
|
print "Checking " + src
|
||||||
|
|
|
@ -416,6 +416,10 @@ def parse_metadata(metafile, **kw):
|
||||||
thisbuild['origlines'] = lines
|
thisbuild['origlines'] = lines
|
||||||
thisbuild['version'] = parts[0]
|
thisbuild['version'] = parts[0]
|
||||||
thisbuild['vercode'] = parts[1]
|
thisbuild['vercode'] = parts[1]
|
||||||
|
try:
|
||||||
|
testvercode = int(thisbuild['vercode'])
|
||||||
|
except:
|
||||||
|
raise MetaDataException("Invalid version code for build in " + metafile.name)
|
||||||
thisbuild['commit'] = parts[2]
|
thisbuild['commit'] = parts[2]
|
||||||
for p in parts[3:]:
|
for p in parts[3:]:
|
||||||
pk, pv = p.split('=', 1)
|
pk, pv = p.split('=', 1)
|
||||||
|
@ -2186,3 +2190,22 @@ class KnownApks:
|
||||||
lst.reverse()
|
lst.reverse()
|
||||||
return lst
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -329,6 +329,10 @@ def main():
|
||||||
print " WARNING: no SDK version information found"
|
print " WARNING: no SDK version information found"
|
||||||
thisinfo['sdkversion'] = 0
|
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...
|
# Calculate the md5 and sha256...
|
||||||
m = hashlib.md5()
|
m = hashlib.md5()
|
||||||
sha = hashlib.sha256()
|
sha = hashlib.sha256()
|
||||||
|
|
|
@ -292,13 +292,14 @@ class FDroid
|
||||||
$out.='}';
|
$out.='}';
|
||||||
$out.='</script>';
|
$out.='</script>';
|
||||||
|
|
||||||
|
$out.="<h3>Packages</h3>";
|
||||||
|
|
||||||
$out.="<p><b>NOTE:</b> Although APK downloads are available below to give ";
|
$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.="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.="will not receive update notifications, and it's a less secure way ";
|
||||||
$out.="to download, especially if you are not currently using HTTPS. ";
|
$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.="We recommend that you install the F-Droid client and use that.</p>";
|
||||||
|
|
||||||
$out.="<h3>Packages</h3>";
|
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($apks as $apk) {
|
foreach($apks as $apk) {
|
||||||
$first = $i+1==count($apks);
|
$first = $i+1==count($apks);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue