From: Ciaran Gultnieks Date: Sun, 16 Jan 2011 11:33:57 +0000 (+0000) Subject: Include signature id for each apk in repo index X-Git-Tag: 0.1~1536 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7f60b54b3be75ba5fee8e203d55e2bc381f1b6a0;p=fdroidserver.git Include signature id for each apk in repo index --- diff --git a/update.py b/update.py index a9fb109c..6cab91e1 100644 --- a/update.py +++ b/update.py @@ -142,6 +142,17 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')): thisinfo['md5'] = m.hexdigest() f.close() + # Get the signature (or md5 of, to be precise)... + p = subprocess.Popen(['java', 'getsig', os.path.join('..', apkfile)] + , cwd='getsig', stdout=subprocess.PIPE) + output = p.communicate()[0] + if options.verbose: + print output + if p.returncode != 0 or not output.startswith('Result:'): + print "ERROR: Failed to get apk signature" + sys.exit(1) + thisinfo['sig'] = output[7:].strip() + # Extract the icon file... apk = zipfile.ZipFile(apkfile, 'r') thisinfo['icon'] = (thisinfo['id'] + '.' + @@ -261,6 +272,7 @@ for app in apps: addElement('versioncode', apk['versioncode'], doc, apkel) addElement('apkname', apk['apkname'], doc, apkel) addElement('hash', apk['md5'], doc, apkel) + addElement('sig', apk['sig'], doc, apkel) addElement('size', str(apk['size']), doc, apkel) addElement('sdkver', str(apk['sdkversion']), doc, apkel) perms = ""