diff --git a/.githooks/pre-push b/.githooks/pre-push index 4c840e35..c943bc06 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -2,7 +2,7 @@ # Keep the served companion APK in sync with main on every push. # # When a push to main includes Android changes, rebuild the APK, refresh -# neode-ui/public/packages/archipelago-companion.apk.zip, commit it, and ask +# neode-ui/public/packages/archipelago-companion.apk, commit it, and ask # you to push again (so the refreshed APK rides along in the same push). # # Enable once per clone: git config core.hooksPath .githooks @@ -40,7 +40,7 @@ fi bash scripts/publish-companion-apk.sh || exit 0 -DEST="neode-ui/public/packages/archipelago-companion.apk.zip" +DEST="neode-ui/public/packages/archipelago-companion.apk" if git diff --cached --quiet -- "$DEST"; then exit 0 # APK unchanged — nothing to do fi diff --git a/Android/ship-companion.sh b/Android/ship-companion.sh index 8639f7a6..3c7f62d7 100755 --- a/Android/ship-companion.sh +++ b/Android/ship-companion.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash # # Build the Android companion app and publish it as the served download -# (neode-ui/public/packages/archipelago-companion.apk.zip), then commit + push. +# (neode-ui/public/packages/archipelago-companion.apk — a plain APK a phone can +# install straight from the link), then commit + push. # # Use this INSTEAD of `git push` when shipping the companion app, so the # downloadable APK on the node always matches what's on main. @@ -17,7 +18,8 @@ export JAVA_HOME="${JAVA_HOME:-/opt/homebrew/opt/openjdk@17}" export ANDROID_HOME="${ANDROID_HOME:-$HOME/Library/Android/sdk}" APK="Android/app/build/outputs/apk/debug/app-debug.apk" -DEST="neode-ui/public/packages/archipelago-companion.apk.zip" +DEST="neode-ui/public/packages/archipelago-companion.apk" +OLD_ZIP="neode-ui/public/packages/archipelago-companion.apk.zip" echo "==> Building debug APK" ( cd Android && ./gradlew :app:assembleDebug --console=plain -q ) @@ -25,8 +27,11 @@ echo "==> Building debug APK" echo "==> Publishing -> $DEST" mkdir -p "$(dirname "$DEST")" -rm -f "$DEST" -( cd "$(dirname "$APK")" && zip -j -q "$ROOT/$DEST" "$(basename "$APK")" ) +cp "$APK" "$DEST" +# Drop the legacy zipped artifact so the served download is the raw APK only. +if [ -f "$OLD_ZIP" ]; then + git rm -q --ignore-unmatch "$OLD_ZIP" 2>/dev/null || rm -f "$OLD_ZIP" +fi git add "$DEST" if git diff --cached --quiet; then diff --git a/neode-ui/public/packages/archipelago-companion.apk.zip b/neode-ui/public/packages/archipelago-companion.apk similarity index 77% rename from neode-ui/public/packages/archipelago-companion.apk.zip rename to neode-ui/public/packages/archipelago-companion.apk index c7f392d3..feff51a0 100644 Binary files a/neode-ui/public/packages/archipelago-companion.apk.zip and b/neode-ui/public/packages/archipelago-companion.apk differ diff --git a/neode-ui/src/components/CompanionIntroOverlay.vue b/neode-ui/src/components/CompanionIntroOverlay.vue index 89f2c2a7..122a5a76 100644 --- a/neode-ui/src/components/CompanionIntroOverlay.vue +++ b/neode-ui/src/components/CompanionIntroOverlay.vue @@ -82,7 +82,7 @@ const STORAGE_KEY = 'neode_companion_intro_seen' // Absolute URL so the QR works when scanned by a phone (a relative path has no // host to resolve). Points at the companion APK hosted on the 146 release server // (publicly reachable) rather than the local node's /packages copy. -const DEFAULT_DOWNLOAD_URL = 'http://146.59.87.168:3000/lfg2025/archy/raw/branch/main/neode-ui/public/packages/archipelago-companion.apk.zip' +const DEFAULT_DOWNLOAD_URL = 'http://146.59.87.168:3000/lfg2025/archy/raw/branch/main/neode-ui/public/packages/archipelago-companion.apk' const visible = ref(false) const qrDataUrl = ref('') diff --git a/scripts/publish-companion-apk.sh b/scripts/publish-companion-apk.sh index 52818138..85c4dcab 100755 --- a/scripts/publish-companion-apk.sh +++ b/scripts/publish-companion-apk.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Build the Archipelago companion debug APK and stage it as the served download -# at neode-ui/public/packages/archipelago-companion.apk.zip. +# at neode-ui/public/packages/archipelago-companion.apk (a plain APK, so a phone +# can install it straight from the link — no unzip step). # # Run manually, or automatically via the pre-push hook (.githooks/pre-push). set -euo pipefail @@ -21,15 +22,16 @@ echo "publish-companion-apk: building debug APK…" >&2 ( cd Android && JAVA_HOME="$JAVA" ANDROID_HOME="$SDK" ./gradlew -q :app:assembleDebug ) APK="Android/app/build/outputs/apk/debug/app-debug.apk" -DEST="neode-ui/public/packages/archipelago-companion.apk.zip" +DEST="neode-ui/public/packages/archipelago-companion.apk" +OLD_ZIP="neode-ui/public/packages/archipelago-companion.apk.zip" mkdir -p "$(dirname "$DEST")" -TMP="$(mktemp -d)" -cp "$APK" "$TMP/app-debug.apk" -# -X drops platform-specific extra fields for a stabler archive. -( cd "$TMP" && zip -q -X archipelago-companion.apk.zip app-debug.apk ) -cp "$TMP/archipelago-companion.apk.zip" "$DEST" -rm -rf "$TMP" +cp "$APK" "$DEST" + +# Drop the legacy zipped artifact so the served download is the raw APK only. +if [ -f "$OLD_ZIP" ]; then + git rm -q --ignore-unmatch "$OLD_ZIP" 2>/dev/null || rm -f "$OLD_ZIP" +fi git add "$DEST" echo "publish-companion-apk: staged $DEST" >&2