mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
28 lines
889 B
Bash
Executable File
28 lines
889 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -f "$1" ];
|
|
then
|
|
CERTIFICATE=$1
|
|
else
|
|
echo "Usage: $0 Kiwix-android.keystore"
|
|
echo "You must specify the path of the certificate keystore."
|
|
exit 1
|
|
fi
|
|
|
|
function die {
|
|
echo -n "[ERROR] "
|
|
echo -n $1
|
|
echo -n " Aborting.
|
|
"
|
|
exit 1
|
|
}
|
|
|
|
../src/dependencies/android-sdk/sdk/tools/android update project -p . -n Kiwix -t android-14
|
|
ant release || die "ant release error."
|
|
jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore $CERTIFICATE bin/Kiwix-release-unsigned.apk kiwix || die "Error signing the package."
|
|
jarsigner -verify bin/Kiwix-release-unsigned.apk || die "The package is not properly signed."
|
|
../src/dependencies/android-sdk/sdk/tools/zipalign -f -v 4 bin/Kiwix-release-unsigned.apk bin/kiwix-android.apk || die "Could not zipalign the signed package. Please check."
|
|
|
|
echo "[SUCCESS] Your signed release package is ready:"
|
|
ls -lh bin/kiwix-android.apk
|