How to sign your own Android update package.zip

It's not necessary to flash custom recovery in order to get features such as TWRP recovery or custom root shells. You can use the apply update from external storage menu in Android system recovery (stock recovery). However, for any update.zip packages you find, signature verification will be needed for the .zip file. These instructions are for Linux.

1. Download Flashable-zip_Signer.zip https://forum.xda-developers.com/attachment.php?attachmentid=2258926&d=1379239477 on XDA forums page following https://forum.xda-developers.com/showthread.php?t=2324874 (11879 bytes, md5sum aa4e2420630d75c02904c761d53c186)

2. Make sure java is installed ie openjdk-8-jre

3. Unzip Flashable-zip_Signer.zip into an empty folder.

4. Copy your update package zip file into this folder named: update.zip

5. Execute in same shell: java -Xmx1024m -jar signapk.jar -w testkey.x509.pem testkey.pk8 update.zip signed.zip
output file is signed.zip


This only seems to work for old Android versions and newer phones balk at the signed update file.