forked from lbryio/lbry-android
-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
executable file
·33 lines (31 loc) · 1.51 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
./gradlew assembleRelease --console=plain
version=$(./gradlew -q printVersionName --console=plain | tail -1)
mkdir -p bin/
rm -f bin/*
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..."
jarsigner -verbose -sigalg SHA1withRSA \
-digestalg SHA1 \
-keystore lbry-android.keystore \
-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."