In case you want to re-sign your apk with a different keystore one day you might be delighted to hear that there is a convenient shell script for this already.
It basically removes the java manifest meta file, then runs zip align and the apk signing tool of the android sdk. It naturally requires the apk, the keystore with its alias and password.
Here is the script:
An error has occurred. Please try again later.
In order to run it, add execution permission in the terminal:
chmod +x signapk.sh
Then simply run the script by adding the parameters.
./signapk.sh myold.apk newrelease.keystore mykeystorepwd mykestorealias