mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
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:
parent
f8a186b1d9
commit
98448e0481
4 changed files with 3 additions and 18 deletions
|
|
@ -96,7 +96,6 @@ debian_testing:
|
||||||
ipfs-cid
|
ipfs-cid
|
||||||
python3-defusedxml
|
python3-defusedxml
|
||||||
python3-setuptools
|
python3-setuptools
|
||||||
zipalign
|
|
||||||
- python3 -c 'import fdroidserver'
|
- python3 -c 'import fdroidserver'
|
||||||
- python3 -c 'import androguard'
|
- python3 -c 'import androguard'
|
||||||
- cd tests
|
- cd tests
|
||||||
|
|
|
||||||
|
|
@ -3230,20 +3230,6 @@ def apk_strip_v1_signatures(signed_apk, strip_manifest=False):
|
||||||
out_apk.writestr(ClonedZipInfo(info), buf)
|
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):
|
def apk_implant_signatures(apkpath, outpath, manifest):
|
||||||
"""Implant a signature from metadata into an APK.
|
"""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):
|
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
|
NONE is a Java keyword used to configure smartcards as the
|
||||||
keystore. Otherwise, the keystore is a local file.
|
keystore. Otherwise, the keystore is a local file.
|
||||||
|
|
|
||||||
|
|
@ -431,7 +431,7 @@ def main():
|
||||||
unsigned_dir,
|
unsigned_dir,
|
||||||
output_dir))
|
output_dir))
|
||||||
|
|
||||||
# Sign and zipalign the application...
|
# Sign the application...
|
||||||
common.sign_apk(apkfile, signed_apk_path, keyalias)
|
common.sign_apk(apkfile, signed_apk_path, keyalias)
|
||||||
if appid not in signed_apks:
|
if appid not in signed_apks:
|
||||||
signed_apks[appid] = []
|
signed_apks[appid] = []
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ class CommonTest(unittest.TestCase):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _find_all(self):
|
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')):
|
if os.path.exists(os.path.join(os.getenv('ANDROID_HOME'), 'tools', 'android')):
|
||||||
tools.append('android')
|
tools.append('android')
|
||||||
for cmd in tools:
|
for cmd in tools:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue