2019-03-26 15:08:50 +01:00
|
|
|
#!/bin/bash
|
2020-02-27 19:20:06 +01:00
|
|
|
./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
|
2020-02-27 19:20:06 +01:00
|
|
|
|
|
|
|
# sign 32-bit
|
|
|
|
echo "Signing 32-bit APK..."
|
2018-04-24 22:01:11 +02:00
|
|
|
jarsigner -verbose -sigalg SHA1withRSA \
|
|
|
|
-digestalg SHA1 \
|
2018-05-09 20:26:57 +02:00
|
|
|
-keystore lbry-android.keystore \
|
2018-04-24 22:01:11 +02:00
|
|
|
-storepass $KEYSTORE_PASSWORD \
|
2020-02-27 19:20:06 +01:00
|
|
|
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."
|