mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
use verify_apks for checking build output
This commit is contained in:
parent
f4a7c19043
commit
4044e06e7b
2 changed files with 8 additions and 5 deletions
|
@ -1230,8 +1230,7 @@ def main():
|
||||||
unsigned_apk = os.path.join(output_dir,
|
unsigned_apk = os.path.join(output_dir,
|
||||||
unsigned_apk)
|
unsigned_apk)
|
||||||
compare_result = \
|
compare_result = \
|
||||||
common.compare_apks(of, unsigned_apk,
|
common.verify_apks(of, unsigned_apk, tmpdir,
|
||||||
tmpdir, log_dir,
|
|
||||||
skip_manual_diff=True)
|
skip_manual_diff=True)
|
||||||
if compare_result:
|
if compare_result:
|
||||||
compare_result = compare_result.split('\n')
|
compare_result = compare_result.split('\n')
|
||||||
|
|
|
@ -1968,7 +1968,7 @@ def place_srclib(root_dir, number, libpath):
|
||||||
apk_sigfile = re.compile(r'META-INF/[0-9A-Za-z]+\.(SF|RSA|DSA|EC)')
|
apk_sigfile = re.compile(r'META-INF/[0-9A-Za-z]+\.(SF|RSA|DSA|EC)')
|
||||||
|
|
||||||
|
|
||||||
def verify_apks(signed_apk, unsigned_apk, tmp_dir):
|
def verify_apks(signed_apk, unsigned_apk, tmp_dir, skip_manual_diff=False):
|
||||||
"""Verify that two apks are the same
|
"""Verify that two apks are the same
|
||||||
|
|
||||||
One of the inputs is signed, the other is unsigned. The signature metadata
|
One of the inputs is signed, the other is unsigned. The signature metadata
|
||||||
|
@ -1987,6 +1987,8 @@ def verify_apks(signed_apk, unsigned_apk, tmp_dir):
|
||||||
:param signed_apk: Path to a signed apk file
|
:param signed_apk: Path to a signed apk file
|
||||||
:param unsigned_apk: Path to an unsigned apk file expected to match it
|
:param unsigned_apk: Path to an unsigned apk file expected to match it
|
||||||
:param tmp_dir: Path to directory for temporary files
|
:param tmp_dir: Path to directory for temporary files
|
||||||
|
:param skip_manual_diff: Skipping to displaying defferences between apks
|
||||||
|
with meld, kdiff, etc.
|
||||||
:returns: None if the verification is successful, otherwise a string
|
:returns: None if the verification is successful, otherwise a string
|
||||||
describing what went wrong.
|
describing what went wrong.
|
||||||
"""
|
"""
|
||||||
|
@ -2020,7 +2022,9 @@ def verify_apks(signed_apk, unsigned_apk, tmp_dir):
|
||||||
|
|
||||||
if not verified:
|
if not verified:
|
||||||
logging.info("...NOT verified - {0}".format(tmp_apk))
|
logging.info("...NOT verified - {0}".format(tmp_apk))
|
||||||
return compare_apks(signed_apk, tmp_apk, tmp_dir, os.path.dirname(unsigned_apk))
|
return compare_apks(signed_apk, tmp_apk, tmp_dir,
|
||||||
|
os.path.dirname(unsigned_apk),
|
||||||
|
skip_manual_diff=skip_manual_diff)
|
||||||
|
|
||||||
logging.info("...successfully verified")
|
logging.info("...successfully verified")
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue