summaryrefslogtreecommitdiffstats
path: root/build.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-17 08:19:41 -0700
committerAdam Soltys <[email protected]>2026-09-17 08:19:41 -0700
commit1bd3e2613641a8d2bc63c262a58cad126632459f (patch)
tree4365b59063893d779e47bd8dd520eaeed21f6f30 /build.js
parent16c77b192e27ab08c7aa8ee821f2b1cc41013ac9 (diff)
downloadcoinosv3-fdroid-v1.6.tar.gz
coinosv3-fdroid-v1.6.zip
Android: a reproducible F-Droid flavor with the web app bundled inside.fdroid-v1.6
The Android builds so far were shells around the live site: a verified APK proved nothing about the code that ran. The new `fdroid` flavor (io.coinos.fdroid) shares the WebView shell and carries the built web app in its assets. The page still lives at the v3.coinos.io origin — same storage, links and gift URLs — but every file under it is answered from the APK (Assets.java); only the site's live API paths reach the network, and the bundled page registers no service worker (HAL_NO_SW=1). Two clean unsigned builds give the same APK. COINOS_UNSIGNED=1 builds without the keystore; Bun is pinned via packageManager; the Gradle wrapper properties pin 8.12. fdroid/io.coinos.fdroid.yml is the fdroiddata recipe (checksum-pinned Bun in sudo, prebuild web build, scandelete, our signing key allowed for the Binaries match) and docs/REPRODUCIBLE.md the how-to. Verified on a phone: the bundled build cold-starts in airplane mode. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JuwQqNWtDJcxPWtEm9134z
Diffstat (limited to 'build.js')
-rw-r--r--build.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/build.js b/build.js
index 0f2373e..fc58f8f 100644
--- a/build.js
+++ b/build.js
@@ -360,6 +360,11 @@ function bootShell(logo, staging) {
}
const BOOT_SHELL_SCRIPT = `<script>try{var m=location.pathname.match(/^\\/([A-Za-z0-9._-]{1,64})\\/?$/);if(m){document.getElementById('boot-shell').style.display='';document.getElementById('boot-shell-name').textContent=decodeURIComponent(m[1]);}}catch(e){}</script>`;
+// HAL_NO_SW=1: the page registers no service worker. The Android bundled
+// build serves this page from its own assets, where a worker would only
+// fetch the live site over the top of them.
+const NO_SW = !!process.env.HAL_NO_SW;
+
async function pageHtml({ css, staging, pwa, scriptHtml }) {
return `<!doctype html>
<html lang="en">
@@ -376,7 +381,7 @@ ${pwa ? PWA_HEAD : ''}<style>${css}</style>
<div id="app">${bootShell(await brandSvg(), staging)}</div>
${BOOT_SHELL_SCRIPT}
${scriptHtml}
-${pwa ? SW_REGISTER + '\n' : ''}</body>
+${pwa && !NO_SW ? SW_REGISTER + '\n' : ''}</body>
</html>`;
}