#!/usr/bin/env bash # 一键构建 EasyView APK(Linux / 本工作区 ven 工具链) # 用法:./build-apk.sh set -euo pipefail here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ven="$(cd "$here/../ven" && pwd)" source "$ven/node-env.sh" export npm_config_cache="$ven/npm" export ANDROID_HOME="$ven/android-sdk" export ANDROID_SDK_ROOT="$ANDROID_HOME" # 签名口令:优先取 android/keystore/.env.keystore(已 gitignore) if [[ -f "$here/android/keystore/.env.keystore" ]]; then set -a # shellcheck disable=SC1091 . "$here/android/keystore/.env.keystore" set +a fi : "${EASYVIEW_KEYSTORE_PASS:?未设置签名口令:请在 android/keystore/.env.keystore 中写入 EASYVIEW_KEYSTORE_PASS}" cd "$here" node scripts/build-apk.mjs