diff --git a/README.md b/README.md index da6c152..4f50635 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,8 @@ The installer prints the final dashboard address, normally `http:// It also installs the BlueZ GATT bridge used by the optional [Android companion](./android/README.md). Pair phones from **Settings → Mobile** after the Pi has Bluetooth enabled. +A ready-to-install development build is available at [`apks/pi-car-companion-debug.apk`](./apks/pi-car-companion-debug.apk). Android 8 or newer is required. + `install.sh` is idempotent. After pulling changes in the original clone, run it again to deploy that checkout: ```bash diff --git a/android/README.md b/android/README.md index 3a018b6..ca7963b 100644 --- a/android/README.md +++ b/android/README.md @@ -20,14 +20,13 @@ The one-use code expires after ten minutes. The resulting credential is encrypte ## Build -Open this `android/` directory in Android Studio (JDK 17, Android SDK 35) and run the `app` configuration, or use the included Gradle wrapper: +Open this `android/` directory in Android Studio (JDK 17, Android SDK 35) and run the `app` configuration, or build the downloadable APK from the repository root: ```bash -cd android -./gradlew :app:assembleDebug +./build-apk.sh ``` -The debug APK is produced at `app/build/outputs/apk/debug/app-debug.apk`. Hardware validation requires an Android 8+ phone with BLE and a Raspberry Pi with a BlueZ-compatible BLE adapter. +The debug APK is copied to [`apks/pi-car-companion-debug.apk`](../apks/pi-car-companion-debug.apk). Hardware validation requires an Android 8+ phone with BLE and a Raspberry Pi with a BlueZ-compatible BLE adapter. ## BLE protocol diff --git a/apks/README.md b/apks/README.md new file mode 100644 index 0000000..08e2505 --- /dev/null +++ b/apks/README.md @@ -0,0 +1,11 @@ +# Android APKs + +Download [`pi-car-companion-debug.apk`](./pi-car-companion-debug.apk) and open it on an Android 8 or newer device to install the companion app. + +This is a development build signed with Android's standard debug key. Android may require permission to install apps from the browser or file manager used to open it. + +To rebuild the APK from the repository root (JDK 17+ and Android SDK 35 required), run: + +```bash +./build-apk.sh +``` diff --git a/apks/pi-car-companion-debug.apk b/apks/pi-car-companion-debug.apk new file mode 100644 index 0000000..f04b993 Binary files /dev/null and b/apks/pi-car-companion-debug.apk differ diff --git a/build-apk.sh b/build-apk.sh new file mode 100755 index 0000000..cb08e58 --- /dev/null +++ b/build-apk.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +android_dir="${repository_dir}/android" +output_dir="${repository_dir}/apks" +source_apk="${android_dir}/app/build/outputs/apk/debug/app-debug.apk" +output_apk="${output_dir}/pi-car-companion-debug.apk" + +mkdir -p "${output_dir}" + +( + cd "${android_dir}" + ./gradlew --no-daemon :app:assembleDebug +) + +install -m 0644 "${source_apk}" "${output_apk}" + +echo "APK written to ${output_apk}" +if command -v sha256sum >/dev/null 2>&1; then + sha256sum "${output_apk}" +fi diff --git a/package.json b/package.json index 7599381..c775fc8 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "typecheck": "npm run typecheck --workspaces --if-present", "test": "npm run test --workspaces --if-present", "build": "npm run build --workspaces --if-present", - "check:scripts": "bash -n install.sh scripts/pi-car-companion-update scripts/pi-car-companion-network-setup scripts/pi-car-companion-power scripts/pi-car-companion-bluetooth-control && python3 -c \"compile(open('scripts/pi-car-companion-bluetooth', encoding='utf-8').read(), 'scripts/pi-car-companion-bluetooth', 'exec')\"", + "build:apk": "./build-apk.sh", + "check:scripts": "bash -n install.sh build-apk.sh scripts/pi-car-companion-update scripts/pi-car-companion-network-setup scripts/pi-car-companion-power scripts/pi-car-companion-bluetooth-control && python3 -c \"compile(open('scripts/pi-car-companion-bluetooth', encoding='utf-8').read(), 'scripts/pi-car-companion-bluetooth', 'exec')\"", "check": "npm run check:scripts && npm run lint && npm run typecheck && npm test && npm run build" }, "devDependencies": {