lbry-android/release.sh

37 lines
1.6 KiB
Bash
Raw Normal View History

2019-03-26 15:08:50 +01:00
#!/bin/bash
2022-11-26 05:31:23 +01:00
echo "release.sh"
2022-11-26 05:23:06 +01:00
echo $HOME
echo $ANDROID_SDK_ROOT
2022-11-26 05:05:28 +01:00
./gradlew assembleRelease --console=plain --stacktrace
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."