#!/bin/zsh set -euo pipefail ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" ANDROID_DIR="$ROOT_DIR/android" RELEASE_AAB="$ANDROID_DIR/app/build/outputs/bundle/release/app-release.aab" BUILD_GRADLE="$ROOT_DIR/android/app/build.gradle" VERSION_NAME="$(sed -n 's/.*versionName \"\([^\"]*\)\"/\1/p' "$BUILD_GRADLE" | head -n 1)" VERSIONED_RELEASE_AAB="$ANDROID_DIR/app/build/outputs/bundle/release/boss-android-v${VERSION_NAME}-release.aab" zsh "$ROOT_DIR/scripts/prepare-android-signing.sh" cd "$ANDROID_DIR" ./gradlew bundleRelease cd "$ROOT_DIR" cp "$RELEASE_AAB" "$VERSIONED_RELEASE_AAB" zsh "$ROOT_DIR/scripts/publish-aab-to-public.sh" "$RELEASE_AAB" JARSIGNER="$(command -v jarsigner || true)" if [[ -n "${JARSIGNER:-}" ]]; then "$JARSIGNER" -verify -verbose -certs "$RELEASE_AAB" else echo "jarsigner not found, skipped signature verification output" >&2 fi echo "Signed release AAB ready: $RELEASE_AAB" echo "Versioned release AAB ready: $VERSIONED_RELEASE_AAB"