forked from thai-ng/PostureProcessor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·42 lines (31 loc) · 1.13 KB
/
build.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
41
42
#!/bin/bash
set -e
BL=$PWD/treble_aosp
BD=$PWD/duo-de/builds
BV=$1
echo "--> Setting up build environment"
source build/envsetup.sh &>/dev/null
mkdir -p $BD
lunch treble_arm64_bgN-ap2a-userdebug
make PostureProcessor
# adb install --staged out/target/product/tdgsi_arm64_ab/system/system_ext/priv-app/PostureProcessor/PostureProcessor.apk
# adb reboot
# Set variables
REPO="Archfx/duoPosture"
TAG_NAME="v$(date +'%Y%m%d%H%M%S')"
APK_PATH="out/target/product/tdgsi_arm64_ab/system/system_ext/priv-app/PostureProcessor/PostureProcessor.apk"
RELEASE_NAME="PostureProcessor Release $TAG_NAME"
RELEASE_BODY="Dubug"
SIGNED_APK_PATH="duo-de/apk/PostureProcessor.apk"
KEY="../archfx-priv/keys/releasekey.pk8"
CERT="../archfx-priv/keys/releasekey.x509.pem"
apksigner sign --key $KEY --cert $CERT $APK_PATH
apksigner verify $APK_PATH
# Check if build was successful
if [ ! -f "$APK_PATH" ]; then
echo "Error: APK not found at $APK_PATH"
exit 1
fi
echo "Creating GitHub release $RELEASE_NAME..."
gh release create "$TAG_NAME" "$APK_PATH" --repo "$REPO" --title "$RELEASE_NAME" --notes "$RELEASE_BODY"
echo "Release $RELEASE_NAME created successfully!"