purge dead code: apk_signer_fingerprint_short

This commit is contained in:
Hans-Christoph Steiner 2025-01-28 20:26:54 +01:00
parent ef4bbe4612
commit 9a8d80ee6b
2 changed files with 0 additions and 28 deletions

View file

@ -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:

View file

@ -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'