diff --git a/.gitignore b/.gitignore index d24984d..5887fb1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ app/.expo/ # OS / editor .DS_Store *.log +.keys/ diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..c24474d --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,46 @@ +# Install BigBrainParking + +BigBrainParking is distributed through **Obtainium** — a free, open-source app updater. +No Google Play, no account. Works great on **GrapheneOS** and any Android phone. + +## 1. Get Obtainium (once) + +Install Obtainium from **F-Droid** or its GitHub releases: +- F-Droid / IzzyOnDroid: search "Obtainium" +- or https://github.com/ImranR98/Obtainium/releases (grab the `.apk`) + +## 2. Add BigBrainParking + +**Easiest — one tap:** open this link on your phone (with Obtainium installed): + +> `obtainium://add/https://git.mowden.top/hank/BigBrainParking` + +It opens Obtainium's Add screen pre-filled. Tap **Add**. + +**Manual (if the link doesn't work):** +1. Open Obtainium → **Add App**. +2. Paste the source URL: + ``` + https://git.mowden.top/hank/BigBrainParking + ``` +3. If asked for a source type, choose **Forgejo** (git.mowden.top runs Forgejo). +4. Tap **Add**. + +## 3. Install & update + +Obtainium shows the latest version — tap **Install**. GrapheneOS/Android will ask you to +allow installs from Obtainium the first time; approve it. + +From then on, Obtainium notifies you when a new version is released and updates in a tap. + +## Notifications (optional) + +Parking-expiry reminders work on-device with **no Google services**. For any future +server-pushed notifications, install **ntfy** (F-Droid) and set it as your UnifiedPush +distributor — BigBrainParking will use it automatically. + +## Notes + +- Unofficial client for the ParkSmarter (IPS Group) parking system. Not affiliated with or + endorsed by IPS Group. Use with your own ParkSmarter account. +- Source & releases: https://git.mowden.top/hank/BigBrainParking diff --git a/README.md b/README.md index e21d5ab..f88e710 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ An unofficial, de-Googled client for the ParkSmarter (IPS Group) parking system, built to run on **GrapheneOS** with **UnifiedPush** notifications and distributed via **Obtainium** — no Google Play Services, no Firebase, no app store. +## Install it (users) + +BigBrainParking installs and updates through **Obtainium** — no Google Play, no account. +**One tap** (with Obtainium installed): `obtainium://add/https://git.mowden.top/hank/BigBrainParking` +— or follow **[INSTALL.md](INSTALL.md)** for the manual steps. Works on GrapheneOS. + ## Monorepo layout ``` diff --git a/app/plugins/withReleaseSigning.js b/app/plugins/withReleaseSigning.js index 1f89242..fc629fe 100644 --- a/app/plugins/withReleaseSigning.js +++ b/app/plugins/withReleaseSigning.js @@ -33,10 +33,12 @@ module.exports = function withReleaseSigning(config) { /signingConfigs \{/, `signingConfigs {${SIGNING_BLOCK}`, ); - // 2) Point the release buildType at it *only* when the keystore env is set. + // 2) Point the release buildType at the release key when its env is set, else + // debug. Replace the RN template's unconditional debug line inside the + // release {} block (otherwise it overrides the release config). gradle = gradle.replace( - /(buildTypes \{[\s\S]*?release \{)/, - `$1\n if (System.getenv("BBP_UPLOAD_STORE_FILE") != null) { signingConfig signingConfigs.release }`, + /(release \{[\s\S]*?)signingConfig signingConfigs\.debug/, + `$1signingConfig System.getenv("BBP_UPLOAD_STORE_FILE") != null ? signingConfigs.release : signingConfigs.debug`, ); } diff --git a/scripts/publish-release.sh b/scripts/publish-release.sh new file mode 100755 index 0000000..b203fd8 --- /dev/null +++ b/scripts/publish-release.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# Publish a signed APK as a Forgejo release so Obtainium can track it. +# +# Prereqs: +# - A signed APK built at ./BigBrainParking-v.apk (see docs/DISTRIBUTION.md) +# - A Forgejo token with repo write scope, in $FORGEJO_TOKEN or .keys/forgejo.token +# (create at: git.mowden.top -> Settings -> Applications -> Generate Token, scope: repository) +# +# Usage: ./scripts/publish-release.sh +set -euo pipefail +cd "$(dirname "$0")/.." + +REPO="hank/BigBrainParking" +API="https://git.mowden.top/api/v1" +TOKEN="${FORGEJO_TOKEN:-$(cat .keys/forgejo.token 2>/dev/null || true)}" +[ -n "$TOKEN" ] || { echo "ERROR: set FORGEJO_TOKEN or put a token in .keys/forgejo.token"; exit 1; } + +VERSION="$(node -e "console.log(require('./app/app.json').expo.version)")" +TAG="v$VERSION" +APK="BigBrainParking-$TAG.apk" +[ -f "$APK" ] || { echo "ERROR: $APK not found — build a signed release first"; exit 1; } + +echo "Publishing $TAG ($APK)…" + +# Create the release (also creates the git tag on main if missing). +REL="$(curl -sf -X POST "$API/repos/$REPO/releases" \ + -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \ + -d "{\"tag_name\":\"$TAG\",\"target_commitish\":\"main\",\"name\":\"BigBrainParking $TAG\",\"body\":\"Unofficial ParkSmarter client for GrapheneOS. Install/update via Obtainium.\"}")" +ID="$(printf '%s' "$REL" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>console.log(JSON.parse(s).id||''))")" +[ -n "$ID" ] || { echo "ERROR: release create failed: $REL"; exit 1; } + +# Upload the APK asset. +curl -sf -X POST "$API/repos/$REPO/releases/$ID/assets?name=$APK" \ + -H "Authorization: token $TOKEN" -F "attachment=@$APK" >/dev/null + +echo "✓ Published: https://git.mowden.top/$REPO/releases/tag/$TAG"