From 07699592da989ffd2094ef3c913e0fdc3f2045ae Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Thu, 27 Aug 2026 14:27:00 +0700 Subject: [PATCH] =?UTF-8?q?Fix=20Amber=20"Waiting=E2=80=A6"=20hang=20on=20?= =?UTF-8?q?GrapheneOS:=20unblock=20setPackageName=20+=20auto-inject=20=20(v1.1.9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two concrete root causes for the eternal "Waiting for Amber…": 1. setPackageName could hang forever on GrapheneOS. getPlugin() awaited it with no timeout, so getPublicKey() (and its 90s timeout) was never even reached. Now setPackageName races a 3s timeout and continues regardless — the Amber package is passed explicitly on every call anyway, so it's non-essential. 2. AndroidManifest.xml had no block. On Android 11+/GrapheneOS the OS silently blocks the nostrsigner intent without it, so Amber never opens. Added scripts/inject-amber-queries.mjs (idempotent) and wired it into android:init / android:sync / android:build so the block is guaranteed present in every APK, surviving cap sync regeneration. Bump version to 1.1.9. Co-authored-by: shakespeare.diy --- package.json | 8 ++--- scripts/inject-amber-queries.mjs | 59 ++++++++++++++++++++++++++++++++ src/lib/capacitorAmberSigner.ts | 30 +++++++++------- 3 files changed, 81 insertions(+), 16 deletions(-) create mode 100644 scripts/inject-amber-queries.mjs diff --git a/package.json b/package.json index 1020247..97dd13e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "skate-spots", "private": true, - "version": "1.1.8", + "version": "1.1.9", "type": "module", "homepage": "https://skate-spots.com", "scripts": { @@ -9,11 +9,11 @@ "build": "npm i --silent && vite build -l error && cp dist/index.html dist/404.html && echo 'Project built successfully!'", "test": "npm i --silent && tsc --noEmit && eslint && vitest run --reporter=dot --silent && vite build -l error && cp dist/index.html dist/404.html && echo 'All tests passed!'", "deploy": "npm i --silent && npm run build && npx -y nostr-deploy-cli deploy --skip-setup", - "android:init": "npm run android:build:apk && npx cap add android && npx cap sync android", - "android:sync": "npm run android:build:apk && npx cap sync android && node scripts/sync-android-version.mjs", + "android:init": "npm run android:build:apk && npx cap add android && npx cap sync android && node scripts/inject-amber-queries.mjs", + "android:sync": "npm run android:build:apk && npx cap sync android && node scripts/sync-android-version.mjs && node scripts/inject-amber-queries.mjs", "android:open": "npx cap open android", "android:version": "node scripts/sync-android-version.mjs", - "android:build": "npm run android:build:apk && npx cap sync android && node scripts/sync-android-version.mjs && cd android && ./gradlew assembleRelease", + "android:build": "npm run android:build:apk && npx cap sync android && node scripts/sync-android-version.mjs && node scripts/inject-amber-queries.mjs && cd android && ./gradlew assembleRelease", "android:build:apk": "CAPACITOR_BUILD=1 vite build && sed -i 's|||g' dist/index.html && sed -i 's|