blob: 547e4e7ad124380e269ae7e32ce188c55841b3ec [file] [log] [blame]
import subprocess
def get_apk_certificate(file: str):
output = subprocess.check_output(['keytool', '-printcert', '-rfc', '-jarfile', file], text=True)
lines = output.split("\n")
return '\n'.join(lines[
lines.index('-----BEGIN CERTIFICATE-----'):
(lines.index('-----END CERTIFICATE-----')+1)
])