How to sign your own Android update

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 packages you find, signature verification will be needed for the .zip file. These instructions are for Linux.

1. Download on XDA forums page following (11879 bytes, md5sum aa4e2420630d75c02904c761d53c186)

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

3. Unzip into an empty folder.

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

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

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