lbry-android/release.sh

34 lines
1.5 KiB
Bash
Raw Permalink Normal View History

2019-03-26 15:08:50 +01:00
#!/bin/bash
./gradlew assembleRelease --console=plain
version=$(./gradlew -q printVersionName --console=plain | tail -1)
mkdir -p bin/
rm -f bin/*
2020-03-01 21:37:57 +01:00
cp app/build/outputs/apk/__32bit/release/app-__32bit-release-unsigned.apk bin/browser-$version-release-unsigned__arm.apk
cp app/build/outputs/apk/__64bit/release/app-__64bit-release-unsigned.apk bin/browser-$version-release-unsigned__arm64.apk
# sign 32-bit
echo "Signing 32-bit APK..."
2018-04-24 22:01:11 +02:00
jarsigner -verbose -sigalg SHA1withRSA \
-digestalg SHA1 \
-keystore lbry-android.keystore \
2018-04-24 22:01:11 +02:00
-storepass $KEYSTORE_PASSWORD \
bin/browser-$version-release-unsigned__arm.apk lbry-android > /dev/null \
&& mv bin/browser-$version-release-unsigned__arm.apk bin/browser-$version-release-signed__arm.apk
zipalign -v 4 \
bin/browser-$version-release-signed__arm.apk bin/browser-$version-release__arm.apk > /dev/null \
&& rm bin/browser-$version-release-signed__arm.apk
echo "32-bit APK successfully built."
# sign 64-bit
echo "Signing 64-bit APK..."
jarsigner -verbose -sigalg SHA1withRSA \
-digestalg SHA1 \
-keystore lbry-android.keystore \
-storepass $KEYSTORE_PASSWORD \
bin/browser-$version-release-unsigned__arm64.apk lbry-android > /dev/null \
&& mv bin/browser-$version-release-unsigned__arm64.apk bin/browser-$version-release-signed__arm64.apk
zipalign -v 4 \
bin/browser-$version-release-signed__arm64.apk bin/browser-$version-release__arm64.apk > /dev/null \
&& rm bin/browser-$version-release-signed__arm64.apk
echo "64-bit APK successfully built."