-
-
Notifications
You must be signed in to change notification settings - Fork 130
/
build-aab.sh
39 lines (31 loc) · 1.08 KB
/
build-aab.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
#!/bin/bash
function err_and_exit()
{
echo "$1" >&2
exit 1
}
function getVersionName()
{
echo $(grep versionName ./app/build.gradle.kts | awk -F '"' '{print $2}')
}
git clone [email protected]:ismartcoding/plain-app.git build
cd build
sed -i -e '/READ_SMS/d' app/src/main/AndroidManifest.xml
sed -i -e '/SEND_SMS/d' app/src/main/AndroidManifest.xml
sed -i -e '/READ_CALL_LOG/d' app/src/main/AndroidManifest.xml
sed -i -e '/WRITE_CALL_LOG/d' app/src/main/AndroidManifest.xml
sed -i -e '/REQUEST_INSTALL_PACKAGES/d' app/src/main/AndroidManifest.xml
sed -i -e '/QUERY_ALL_PACKAGES/d' app/src/main/AndroidManifest.xml
sed -i -e '/REQUEST_DELETE_PACKAGES/d' app/src/main/AndroidManifest.xml
cat > ./keystore.properties <<EOF
storePassword=$ANDROID_STORE_PASSWORD
keyPassword=$ANDROID_KEY_PASSWORD
keyAlias=plain
storeFile=release.jks
EOF
cat > ./local.properties <<EOF
sdk.dir=/Users/$USER/Library/Android/sdk
EOF
./gradlew :app:bundleRelease || err_and_exit "build failed"
BUILD_FILE="PlainApp-$(getVersionName).aab"
mv ./app/build/outputs/bundle/googleRelease/app-google-release.aab $BUILD_FILE