mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
fallback to v3 signatures if v1 and v2 are not available
This commit is contained in:
parent
d96f5ff660
commit
2907aa3ea3
1 changed files with 7 additions and 2 deletions
|
@ -2528,12 +2528,17 @@ def get_first_signer_certificate(apkpath):
|
|||
elif len(cert_files) == 1:
|
||||
cert_encoded = get_certificate(apk.read(cert_files[0]))
|
||||
|
||||
if cert_encoded is None:
|
||||
if not cert_encoded:
|
||||
apkobject = _get_androguard_APK(apkpath)
|
||||
certs = apkobject.get_certificates_der_v2()
|
||||
if len(certs) > 0:
|
||||
logging.info(_('Using APK v2 Signature'))
|
||||
logging.info(_('Using APK Signature v2'))
|
||||
cert_encoded = certs[0]
|
||||
if not cert_encoded:
|
||||
certs = apkobject.get_certificates_der_v3()
|
||||
if len(certs) > 0:
|
||||
logging.info(_('Using APK Signature v3'))
|
||||
cert_encoded = certs[0]
|
||||
|
||||
if not cert_encoded:
|
||||
logging.error(_("No signing certificates found in {path}").format(path=apkpath))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue