Preparations
- JAVA ( jarsigner )
- Key file ( .keystore or .jks )
- Alias and PassPhrase (password) that were set when key file was created
[ APK ]
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore "KEYSTORE_PATH" "APP_FILE_PATH" "ALIAS_NAME"
[ AAB ]
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore "KEYSTORE_PATH" "APP_FILE_PATH" "ALIAS_NAME"
[ KEYSTORE_PATH ]
- Enter the path to the keystore.
- Usually, it has an extension of .keystore or .jks.
* How to check the keystore in Android Studio
Build Menu => Generate Signed Bundle / APK => Select Android Aab Bundle or APK => Check Key store path
* How to check keystore from Unity
File Menu => Build Settings => Player Settings => Publishing Settings => Check the Path=> Check the location of a file with the identified name
[ APP_FILE_PATH ]
- Enter the path to the app file you wish to sign.
[ ALIAS_NAME ]
- Enter the Alias name created when you created the key.
* How to check Alias from Android Studio
Build menu => Select Generate Signed Bundle / APK => Select Android Aab Bundle or APK => Check Key alias
* How to check Alias from Unity
File Menu => Build Settings => Player Settings => Publishing Settings => Check Alias
Enter Passphrase for keystore:
jarsigner error: java.lang.RuntimeException: keystore load: Keystore was tampered with, or password was incorrect
Enter key password for ALIAS_NAME:
[ APK ]
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore -storepass [Keystore_password] -keypass [Key_password] "KEYSTORE_PATH" "APP_FILE_PATH" "ALIAS_NAME"
[ AAB ]
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore -storepass [Keystore_password] -keypass [Key_password] "KEYSTORE_PATH" "APP_FILE_PATH" "ALIAS_NAME"
zipalign -f -v 4 "apk file Path that needs zipalign" "apk file Path that will be saved after zipalign-ing "
[ script for windows ]
[ script for MAC ]
KeyStorePath=" Keystore path "
ALIAS_NAME="alias name"
STORE_PASS=" Keystore Password"
KEY_PASS="Key password"
ZIP_ALIGN="zipalign File Path"
Ex. /Users/username/Downloads/LIAPP_sign_mac.sh /Users/username/AndroidStudioProjects/MyApplication/app/release/app-release.apk
The Advantage of ANDROID APP BUNDLE (AAB) and Its Test Method – The post explains the benefits of using AAB provided by Google and test methods to verify that the actual app is working properly..
Read More