mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
use jarsigner to verify the APK signature is valid
By using jarsigner here, we can get rid of getsig.java, since the rest of what getsig.java does can easily be handled in python. This simplifies installation and deployment, and makes things work better cross-platform. This also means that the fdroidserver Debian package no longer needs to Build-Depends: on default-jdk, which makes builds in pbuilder run a lot faster. :-) refs #5 https://gitlab.com/fdroid/fdroidserver/issues/5
This commit is contained in:
parent
80cc8ef5f0
commit
c88eff9af7
1 changed files with 10 additions and 0 deletions
|
|
@ -465,6 +465,16 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||
sha.update(t)
|
||||
thisinfo['sha256'] = sha.hexdigest()
|
||||
|
||||
# verify the jar signature is correct
|
||||
args = ['jarsigner', '-verify']
|
||||
if options.verbose:
|
||||
args += ['-verbose', '-certs']
|
||||
args += apkfile
|
||||
p = FDroidPopen(args)
|
||||
if p.returncode != 0:
|
||||
logging.critical(apkfile + " has a bad signature!")
|
||||
sys.exit(1)
|
||||
|
||||
# Get the signature (or md5 of, to be precise)...
|
||||
getsig_dir = os.path.join(os.path.dirname(__file__), 'getsig')
|
||||
if not os.path.exists(getsig_dir + "/getsig.class"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue