forked from docker-android-sdk/android-31
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sign-releases.sh
executable file
·40 lines (35 loc) · 1.25 KB
/
sign-releases.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
34
35
36
37
38
39
40
#!/bin/sh
if [ -z "$KEYSTORE_FILE" ] || [ -z "$KEYSTORE_ALIAS" ] || [ -z "$KEYSTORE_PASSWORD" ]
then
echo "Not signing. Missing vars: KEYSTORE_FILE, KEYSTORE_ALIAS, and KEYSTORE_PASSwORD"
exit 1
fi
APP_TYPES=${APP_TYPES:="embed"}
RECORD_TYPES=${RECORD_TYPES:="record noRecord"}
for APP in $APP_TYPES
do
for RECORD in $RECORD_TYPES
do
OUTPUT_NAME="app-${APP}-${RECORD}-release"
UNSIGNED_APK=`find outputs/apk -name "$OUTPUT_NAME-unsigned.apk"`
if [ ! -z "$UNSIGNED_APK" ]
then
APK_DIR=`dirname $UNSIGNED_APK`
apksigner sign --ks "$KEYSTORE_FILE" \
--ks-key-alias $KEYSTORE_ALIAS \
--ks-pass env:KEYSTORE_PASSWORD --key-pass env:KEYSTORE_PASSWORD \
--out $APK_DIR/$OUTPUT_NAME-signed.apk \
$UNSIGNED_APK
fi
UNSIGNED_BUNDLE=`find outputs/bundle -name "$OUTPUT_NAME.aab"`
if [ ! -z "$UNSIGNED_BUNDLE" ]
then
BUNDLE_DIR=`dirname $UNSIGNED_BUNDLE`
jarsigner -keystore "$KEYSTORE_FILE" \
-storepass $KEYSTORE_PASSWORD \
-signedjar $BUNDLE_DIR/$OUTPUT_NAME-signed.aab \
$UNSIGNED_BUNDLE \
$KEYSTORE_ALIAS
fi
done
done