purge all references to zipalign, that is delegated to other things

Things like apksigner and @obfusk's tools handle this now.
jarsigner is used in the test, since that's the most common use of
`common.find_sdk_tools_cmd()`.

closes #1100
This commit is contained in:
Hans-Christoph Steiner 2023-02-22 14:22:29 +01:00
parent f8a186b1d9
commit 98448e0481
4 changed files with 3 additions and 18 deletions

View File

@ -96,7 +96,6 @@ debian_testing:
ipfs-cid
python3-defusedxml
python3-setuptools
zipalign
- python3 -c 'import fdroidserver'
- python3 -c 'import androguard'
- cd tests

View File

@ -3230,20 +3230,6 @@ def apk_strip_v1_signatures(signed_apk, strip_manifest=False):
out_apk.writestr(ClonedZipInfo(info), buf)
def _zipalign(unsigned_apk, aligned_apk):
"""Run 'zipalign' using standard flags used by Gradle Android Plugin.
-p was added in build-tools-23.0.0
References
----------
https://developer.android.com/studio/publish/app-signing#sign-manually
"""
p = SdkToolsPopen(['zipalign', '-v', '-p', '4', unsigned_apk, aligned_apk])
if p.returncode != 0:
raise BuildException("Failed to align application")
def apk_implant_signatures(apkpath, outpath, manifest):
"""Implant a signature from metadata into an APK.
@ -3322,7 +3308,7 @@ def get_apksigner_smartcardoptions(smartcardoptions):
def sign_apk(unsigned_path, signed_path, keyalias):
"""Sign and zipalign an unsigned APK, then save to a new file, deleting the unsigned.
"""Sign an unsigned APK, then save to a new file, deleting the unsigned.
NONE is a Java keyword used to configure smartcards as the
keystore. Otherwise, the keystore is a local file.

View File

@ -431,7 +431,7 @@ def main():
unsigned_dir,
output_dir))
# Sign and zipalign the application...
# Sign the application...
common.sign_apk(apkfile, signed_apk_path, keyalias)
if appid not in signed_apks:
signed_apks[appid] = []

View File

@ -118,7 +118,7 @@ class CommonTest(unittest.TestCase):
return False
def _find_all(self):
tools = ['aapt', 'adb', 'zipalign']
tools = ['aapt', 'adb', 'jarsigner']
if os.path.exists(os.path.join(os.getenv('ANDROID_HOME'), 'tools', 'android')):
tools.append('android')
for cmd in tools: