mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
Merge branch 'start-integrating' into 'master'
start integrating See merge request fdroid/fdroidserver!1631
This commit is contained in:
commit
bb7394ab3c
2 changed files with 6 additions and 32 deletions
|
|
@ -3410,22 +3410,6 @@ def apk_signer_fingerprint(apk_path):
|
|||
return signer_fingerprint(cert_encoded)
|
||||
|
||||
|
||||
def apk_signer_fingerprint_short(apk_path):
|
||||
"""Get 7 hex digit SHA-256 fingerprint string for the first signer from given APK.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
apk_path
|
||||
path to APK
|
||||
|
||||
Returns
|
||||
-------
|
||||
first 7 chars of the standard SHA-256 signer fingerprint
|
||||
|
||||
"""
|
||||
return apk_signer_fingerprint(apk_path)[:7]
|
||||
|
||||
|
||||
def metadata_get_sigdir(appid, vercode=None):
|
||||
"""Get signature directory for app."""
|
||||
if vercode:
|
||||
|
|
@ -3958,11 +3942,13 @@ def compare_apks(apk1, apk2, tmp_dir, log_dir=None):
|
|||
f.extractall(path=os.path.join(apk2dir, 'content'))
|
||||
|
||||
if set_command_in_config('apktool'):
|
||||
if subprocess.call([config['apktool'], 'd', absapk1, '--output', 'apktool'],
|
||||
cwd=apk1dir) != 0:
|
||||
if subprocess.call(
|
||||
[config['apktool'], 'd', absapk1, '--output', 'apktool'], cwd=apk1dir
|
||||
):
|
||||
return "Failed to run apktool " + apk1
|
||||
if subprocess.call([config['apktool'], 'd', absapk2, '--output', 'apktool'],
|
||||
cwd=apk2dir) != 0:
|
||||
if subprocess.call(
|
||||
[config['apktool'], 'd', absapk2, '--output', 'apktool'], cwd=apk2dir
|
||||
):
|
||||
return "Failed to run apktool " + apk2
|
||||
|
||||
p = FDroidPopen(['diff', '-r', apk1dir, apk2dir], output=False)
|
||||
|
|
|
|||
|
|
@ -794,18 +794,6 @@ class CommonTest(SetUpTearDownMixin, unittest.TestCase):
|
|||
self.assertEqual(keytoolcertfingerprint,
|
||||
fdroidserver.common.apk_signer_fingerprint(apkfile))
|
||||
|
||||
@unittest.skipIf(sys.byteorder == 'big', 'androguard is not ported to big-endian')
|
||||
def test_apk_signer_fingerprint_short(self):
|
||||
|
||||
# fingerprints fetched with: keytool -printcert -file ____.RSA
|
||||
testapks = (('repo/obb.main.oldversion_1444412523.apk', '818e469'),
|
||||
('repo/obb.main.twoversions_1101613.apk', '32a2362'),
|
||||
('repo/obb.main.twoversions_1101617.apk', '32a2362'))
|
||||
|
||||
for apkfile, keytoolcertfingerprint in testapks:
|
||||
self.assertEqual(keytoolcertfingerprint,
|
||||
fdroidserver.common.apk_signer_fingerprint_short(apkfile))
|
||||
|
||||
def test_find_apksigner_system_package_default_path(self):
|
||||
"""apksigner should be automatically used from the PATH"""
|
||||
usr_bin_apksigner = '/usr/bin/apksigner'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue