This was used for signing an apk built with buildozer and made with kivy.
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Above command will recommend this so do it:
keytool -importkeystore -srckeystore my-release-key.keystore -destkeystore my-release-key.keystore -deststoretype pkcs12
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name
This is required for uploading to the Play Store. It aligns the data in apk to start on 4 byte boundaries for faster memory access and reduced memory consumption.
Install tool
sudo apt install zipalign
Align
zipalign -v 4 my_application.apk-signed.apk my_application.apk-signed-aligned.apk