git clone https://garage44.eu/jeroen/cartopolis.git.. /.forgejo/workflows/deploy-android.yml
name: Deploy Android
# Build the arm64 APK and publish it to https://cartopolis.org/apk/, so a
# phone can install it by tapping a link.
#
# **The fallback.** `midas deploy apk` is the usual path since 2026-10-16: it builds
# a landed, gate-verified commit on a workshop node (deploy/build/apk.sh, these steps)
# and publishes it on the VPS, where the release key signs it — the key never reaches a node.
# This workflow is for when the workshop is down.
#
# Separate from ci.yml for the reason deploy-wasm.yml is: this is a *link*, thin
# LTO over the whole Bevy stack, tens of minutes cold against a runner with
# capacity 3. ci.yml's android lane stays a `cargo check` and remains the gate on
# every push; this runs only when `main` moves, plus on demand.
#
# There is exactly one APK on disk at a time. The filename is fixed, so each run
# overwrites the last and nothing accumulates — an APK is 25-45 MB and a history
# of them is 45 MB per push of something nobody would install twice.
#
# **A commit is published once.** The `published` job below compares this run's
# commit against the one recorded beside the APK and skips the build entirely
# when they match. Two reasons, and the second is the one that matters:
#
# * it is 15-25 minutes of a capacity-3 runner to rebuild bytes that already
# exist, and this workflow is dispatched by hand — by someone who cannot see
# from the Actions tab what is currently on the site;
# * `VERSION_CODE` is derived from the *run number*, so a second run of the
# same commit publishes an APK that differs from the installed one in
# nothing but its version code. Every phone then offers an update whose
# entire content is that it is numbered higher, which is exactly the noise
# that teaches people to ignore updates.
#
# Pass `force` to rebuild anyway — for a signing-key change, a landing-page fix
# applied by hand, or an APK that shipped from a bad checkout.
on:
# Manual only. This used to run on every push to `main`, which on a
# capacity-3 runner meant the APK competed with CI for a slot on every
# merge — and a publish is not something you want to happen because a
# README typo landed. `workflow_dispatch` from the Actions tab, or:
# curl -X POST -H "Authorization: token $FORGEJO_TOKEN" \
# -d '{"ref":"main"}' \
# "$FORGEJO_API/repos/$FORGEJO_REPO/actions/workflows/deploy-android.yml/dispatches"
# …and to build a commit that is already published, add the input:
# -d '{"ref":"main","inputs":{"force":"true"}}'
workflow_dispatch:
inputs:
force:
description: Rebuild even if this commit is already published
type: boolean
default: false
env:
# Save the Rust cache even when the job fails. `rust-cache`'s post step is
# gated on `success()`, so until today — when this workflow succeeded for the
# first time ever, after six failures — the `android-release` cache had never
# once been written, and every APK build recompiled the whole Bevy stack from
# nothing. Every one of those failures happened *after* the 13-minute compile,
# at packaging or verification, so the expensive half was always done and
# always thrown away.
CACHE_ON_FAILURE: "true"
CARGO_TERM_COLOR: always
CARGO_NET_RETRY: "3"
# sccache, the same second cache layer ci.yml has had since it was written, and
# for the reason that file states at length: `rust-cache` has exactly one key, so
# a key change or a failed run leaves nothing behind, while sccache is keyed on
# the compiler invocation and its inputs and therefore cannot miss for a reason
# unrelated to the code. This lane is the one with the worst cache history in the
# repo -- see CACHE_ON_FAILURE above -- so it is the one that needed a floor
# under it most, and it was the only one without.
#
# This shares a cache *directory* with ci.yml but not its entries: a different
# target triple and a different profile mean a different compiler invocation and
# so a different key. What it warms from is its own history, which is the point.
#
# `[profile.release] incremental = false` (inherited by android-release) is what
# makes this work at all -- sccache silently declines to cache an incremental
# compilation. That setting was overridden by a `[build] incremental = true` in
# .cargo/config.toml until it was removed; without that fix this block would
# have been decoration.
RUSTC_WRAPPER: sccache
SCCACHE_DIR: /sccache
SCCACHE_CACHE_SIZE: 20G
jobs:
# Seconds, and it saves tens of minutes. A separate job rather than a first
# step with eight `if:`s hung off it: a skipped *job* says so in the Actions
# tab, while a job that runs every step as a no-op and reports success is
# indistinguishable from one that published something.
#
# It mounts the web root **read-only** — this job's whole purpose is to read
# one file, and the deploy job below is the only thing that may write there.
# No `actions/checkout`: the commit it compares is `github.sha`, which the
# runner supplies, and cloning a repo with LFS assets to read a 41-byte file
# would cost more than the check saves.
published:
name: already published?
runs-on: ubuntu-latest
container:
image: cartopolis-ci:latest
options: --volume /data/cartopolis/site:/publish:ro
outputs:
skip: ${{ steps.check.outputs.skip }}
steps:
- name: Compare the published commit with this one
id: check
env:
COMMIT: ${{ github.sha }}
# A `type: boolean` input arrives as the string "true"/"false", and as
# empty when the workflow is dispatched through the API without an
# `inputs` object at all — hence the default below rather than a bare
# comparison.
FORCE: ${{ github.event.inputs.force }}
run: |
set -euo pipefail
apk=/publish/apk/cartopolis.apk
marker=/publish/apk/cartopolis.apk.commit
# The marker is written *after* the APK is in place (see Publish), so
# it can be stale but never ahead: a run that dies at packaging leaves
# the previous commit recorded and the next dispatch rebuilds. Both
# halves are required — a marker with no APK beside it is a web root
# someone has cleaned out, and skipping there would leave the install
# page pointing at nothing.
if [ "${FORCE:-false}" = "true" ]; then
echo "force requested — building $COMMIT regardless of what is published"
elif [ ! -f "$apk" ]; then
echo "no APK published yet — building $COMMIT"
elif [ ! -f "$marker" ]; then
echo "the published APK predates this check and records no commit — building $COMMIT"
elif [ "$(cat "$marker")" = "$COMMIT" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "::notice::$COMMIT is already published at https://cartopolis.org/apk/ — nothing to build. Dispatch with force=true to rebuild it."
exit 0
else
echo "published $(cat "$marker"), want $COMMIT — building"
fi
echo "skip=false" >> "$GITHUB_OUTPUT"
deploy-android:
name: build apk & publish
needs: published
if: needs.published.outputs.skip != 'true'
runs-on: ubuntu-latest
container:
image: cartopolis-ci:latest
# Four mounts, all listed in the runner's `valid_volumes`:
# /publish — the same web root deploy-wasm.yml writes, so serving the APK
# needs no Caddy site, no DNS record and no second file_server.
# That job's `rsync --delete` excludes `/apk/`; without the
# exclude the next web deploy would silently delete this.
# /signing — the app signing key, deliberately *outside* the web root.
# Android keys an installed app to its certificate, so a key
# that changed per build would mean uninstalling the app before
# every install. Read-only: this job needs to sign, not rotate.
# /sccache — the compilation cache, the same host directory ci.yml
# mounts. sccache is keyed on the compiler invocation and is
# safe to share; the registry below is not.
# /root/.cargo/registry — the download cache, and **this lane's own
# copy**. deploy-wasm.yml has the long version: a bind mount
# of `registry/` excludes cargo's lock, which lives one level
# above it at `$CARGO_HOME/.package-cache`, so two concurrent
# containers write one registry with nothing serialising
# them. The three `deploy-*` lanes dispatched together on
# 2026-08-21 half-extracted a crate and failed deploy-wasm.
options: >-
--volume /data/cartopolis/site:/publish
--volume /data/cartopolis/android-key:/signing:ro
--volume /data/ci-cache/sccache:/sccache
--volume /data/ci-cache/cargo-registry-android:/root/.cargo/registry
steps:
- uses: actions/checkout@v4
with:
# Required, not an optimisation: the font, app icon, star catalog and
# map fixtures are `include_bytes!`-ed, so without the smudge filter
# this job packages 130-byte LFS pointers into the APK and only finds
# out on the phone. See `.gitattributes`.
lfs: true
- uses: https://github.com/Swatinem/rust-cache@v2
with:
# Distinct from every other lane: different target triple and a
# release-shaped profile. Sharing a key with the debug native lanes
# would thrash both.
key: android-release
# Same cache key as ci.yml's check lane, so on `main` this is a restore
# rather than a second 660 MB download. The fetch step below is the
# cold-cache path, not the normal one.
- name: Cache the Android NDK
id: ndk-cache
uses: https://github.com/actions/cache@v4
with:
path: /opt/android-ndk
key: android-ndk-r27c
- name: Fetch the Android NDK
if: steps.ndk-cache.outputs.cache-hit != 'true'
run: |
curl -fsSL -o /tmp/ndk.zip \
https://dl.google.com/android/repository/android-ndk-r27c-linux.zip
unzip -q /tmp/ndk.zip -d /tmp/ndk
mv /tmp/ndk/android-ndk-r27c /opt/android-ndk
rm -rf /tmp/ndk.zip /tmp/ndk
# Deliberately *not* cached: 124 MB from Google takes seconds, while a cache
# entry is 124 MB living on the runner host forever, and that host's disk is
# the thing this whole workflow is trying not to fill.
#
# Direct zips rather than `sdkmanager`, which would mean the 150 MB
# commandline-tools package and a licence dance to obtain the same three
# binaries. The zips' internal directory names are codename-based
# (`android-14` is build-tools 34.0.0) and unrelated to the API level, hence
# the renames — build-apk.sh discovers both by globbing this layout.
- name: Fetch the Android SDK bits (aapt2, zipalign, apksigner, android.jar)
run: |
set -euo pipefail
mkdir -p /opt/android-sdk/build-tools /opt/android-sdk/platforms
curl -fsSL -o /tmp/bt.zip https://dl.google.com/android/repository/build-tools_r34-linux.zip
curl -fsSL -o /tmp/pl.zip https://dl.google.com/android/repository/platform-34-ext8_r01.zip
unzip -q /tmp/bt.zip -d /tmp/bt && mv /tmp/bt/* /opt/android-sdk/build-tools/34.0.0
unzip -q /tmp/pl.zip -d /tmp/pl && mv /tmp/pl/android-34 /opt/android-sdk/platforms/
rm -rf /tmp/bt.zip /tmp/pl.zip /tmp/bt /tmp/pl
test -x /opt/android-sdk/build-tools/34.0.0/aapt2
test -f /opt/android-sdk/platforms/android-34/android.jar
# `apksigner` and `d8` are shell scripts that run `java`, `javac` compiles
# `crates/cartopolis_android/java/`, and `zip` is how the .so gets its
# `lib/<abi>/` entry. None is in cartopolis-ci:latest, which has no other
# reason to carry a JVM. Baking these into the image is the better end state,
# same as for the NDK; the image lives in another repo.
#
# **A JDK, not a JRE.** This was `openjdk-17-jre-headless` for as long as the
# APK carried no Java, under a comment saying "a JRE is enough — nothing here
# compiles Java (that is what `hasCode=\"false\"` buys)". The dex lane made
# that false: a JRE has no `javac`, so the build would fail at the "java +
# dex" step with a command-not-found, ~20 minutes into a job that had already
# compiled the whole Bevy stack. `keytool` is still never called — the
# signing key comes from the mount — but it arrives with the JDK anyway.
- name: Install the packaging tools (JDK + zip)
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends openjdk-17-jdk-headless zip >/dev/null
java_version=$(java -version 2>&1)
printf '%s\n' "${java_version%%$'\n'*}"
javac -version
# Needed here and not in the check lane because this one *links*: cargo-ndk
# is what points the linker at the NDK sysroot. `--locked` so a fresh
# dependency release cannot change what this job installs.
- name: cargo-ndk
run: command -v cargo-ndk >/dev/null || cargo install cargo-ndk --locked
# `VERSION_CODE` is the number Android compares to decide whether this APK
# updates the one already on the phone, and it has to be monotonic. The run
# number is the only counter here that is: `git rev-list --count HEAD`,
# which build-apk.sh falls back to for a local build, is 1 under
# `actions/checkout`'s depth-1 fetch.
#
# The 10000 offset is not decoration. It keeps every published build above
# every hand-built one (a local build gets the commit count, in the
# hundreds), because a phone refuses a *lower* code as a downgrade — so the
# download from the install page must always be able to install over
# something a developer sideloaded, and never the reverse.
- name: Build the APK (arm64-v8a, android-release)
env:
ANDROID_NDK_HOME: /opt/android-ndk
ANDROID_SDK_HOME: /opt/android-sdk
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
ANDROID_KEY: /signing/cartopolis.pk8
ANDROID_CERT: /signing/cartopolis.x509.pem
RUN_NUMBER: ${{ github.run_number }}
run: |
rustup target add aarch64-linux-android
export VERSION_CODE=$(( 10000 + RUN_NUMBER ))
crates/cartopolis_android/build-apk.sh
# `apksigner verify` runs inside the script. These are the three that catch
# a *packaging* regression, and all three are cheap:
#
# * `android_main` is looked up by name from C and referenced by nothing in
# Rust, so a linker or strip change that drops it still builds, still
# signs, and produces an app that installs and never starts.
# * a *missing* `classes.dex` is the check this used to be, inverted. It
# asserted the APK had none, back when `hasCode="false"` was true. Now
# the archive must carry one, and the reason to assert it is that its
# absence is silent end to end: javac and d8 are the last steps before
# packaging, an APK built without them installs and launches perfectly,
# and the only symptom is a ClassNotFoundException on a phone the first
# time Rust reaches for one of our classes.
# * `libc++_shared.so` would have to be shipped if a dependency ever pulls
# in C++; today nothing does, and a missing one is a load-time failure on
# the phone rather than a build failure here.
# * the LOAD segments must be 16 KB-aligned. NDK r27 does that by default
# for 64-bit targets, so this asserts a property we already have rather
# than fixing one we lack — but the day it stops being true (an NDK
# bump, a stray `-Wl,-z,max-page-size`) the only symptom is that the app
# refuses to load on every 16 KB-page device: Pixel 8 and later, and
# whatever ships next. That is invisible from this container, which has
# no device to try it on, so it has to be an assertion on the bytes.
# ci.yml's own rule for this cache: print the stats unconditionally, so the
# next person can tell whether it worked instead of inferring it from a
# duration. `if: always()` because a failed build is exactly when you want
# to know whether the cache was cold.
- name: sccache stats
if: always()
# **A diagnostic may not fail a deploy.** On 2026-09-05 this exact
# command ended a web publish: the wasm build had finished and trunk had
# written the distribution, and `--show-stats` then answered "Failed to
# read response header … Mismatch of client/server versions?" and exited
# 2 — so the threading check, the pre-compression and the publish never
# ran, and a good artifact was thrown away over the answer to "how did
# the cache do?".
#
# Why the server stopped answering is **not established**. It is not a
# stale server shared between lanes: each container has its own network
# namespace, so each has its own. What is established is that every
# compile had already succeeded, so whatever happened to the server
# happened after the work. Print the stats, say so when they cannot be
# printed, and let the checks that actually inspect the artifact decide.
run: sccache --show-stats || echo "sccache could not report its stats — the build above is unaffected"
- name: Verify the archive
run: |
set -euo pipefail
apk="${CARGO_TARGET_DIR:-target}/android/cartopolis-arm64-v8a.apk"
unzip -p "$apk" lib/arm64-v8a/libcartopolis_android.so > /tmp/lib.so
ndk_bin=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin
# Each check reads its tool's output into a variable and matches with
# `case`, rather than piping into `grep -q`.
#
# That is not style. `grep -q` exits the instant it matches, which closes
# the pipe; the tool upstream then takes SIGPIPE and dies with 141, and
# `pipefail` makes 141 the pipeline's status. Every one of these three
# sat inside an `if`, so `set -e` could not fire on them — but the step
# still ended up exiting 141 *after* printing its own success line, which
# cost a complete 16-minute build whose APK had already been packaged,
# signed and verified. A check that fails the build it just passed is
# worse than no check.
nm_out=$("$ndk_bin/llvm-nm" --dynamic --defined-only /tmp/lib.so)
case "$nm_out" in
*android_main*) ;;
*) echo "::error::android_main is not an exported symbol — the APK would install and fail to start."; exit 1 ;;
esac
zip_list=$(unzip -l "$apk")
case "$zip_list" in
*classes.dex*) ;;
*) echo "::error::the APK has no classes.dex — javac/d8 did not run, and every Java-backed feature will fail with ClassNotFoundException on the device."; exit 1 ;;
esac
# The other half of the same fact: a dex the manifest disclaims is a dex
# the framework never loads, and nothing about that combination fails
# until a class is looked up at runtime. Read out of the *compiled*
# manifest, so it checks what shipped rather than what the source says —
# and via `xmltree` rather than `dump badging`, which does not report the
# attribute at all (verified against a pre-dex APK, where badging is
# silent and this line reads `hasCode(0x0101000c)=false`).
xmltree=$(/opt/android-sdk/build-tools/34.0.0/aapt2 dump xmltree --file AndroidManifest.xml "$apk")
case "$xmltree" in
*"hasCode(0x0101000c)=false"*) echo "::error::classes.dex is packaged but android:hasCode is false, so the framework will never load it."; exit 1 ;;
esac
dyn_out=$("$ndk_bin/llvm-readelf" -d /tmp/lib.so)
case "$dyn_out" in
*libc++_shared*) echo "::error::the .so needs libc++_shared.so, which the APK does not ship — it will fail to load."; exit 1 ;;
esac
# Program headers, `LOAD` rows, last column is the alignment — printed
# in hex, hence `$((...))` rather than awk's `strtonum`, which is a gawk
# extension this image has no reason to carry. It is the *smallest*
# alignment that decides: the loader maps every segment, so one 4 KB
# LOAD fails on a 16 KB-page device even if the rest are fine.
align=0
ph_out=$("$ndk_bin/llvm-readelf" --program-headers /tmp/lib.so)
for a in $(printf '%s\n' "$ph_out" | awk '$1 == "LOAD" { print $NF }'); do
v=$((a))
if [ "$align" = 0 ] || [ "$v" -lt "$align" ]; then align=$v; fi
done
[ "$align" != 0 ] || { echo "::error::no LOAD segments in the packaged .so"; exit 1; }
if [ "$align" -lt 16384 ]; then
echo "::error::LOAD segments are aligned to $align bytes, under the 16384 that Pixel 8+ require."
echo "The NDK aligns 64-bit output to 16 KB by default, so something has overridden it —"
echo "look for a -Wl,-z,max-page-size in .cargo/config.toml or a cargo-ndk flag."
exit 1
fi
echo "android_main exported, classes.dex present and hasCode=true, no C++ runtime needed, LOAD aligned to $align"
# Fixed filenames, written through a temp file and renamed: the rename is
# atomic within the filesystem, so a phone that starts a download mid-deploy
# gets the old APK whole rather than half of the new one. Nothing here is
# dated or hashed into a name, which is what keeps the directory at exactly
# one APK forever.
- name: Publish
env:
COMMIT: ${{ github.sha }}
run: |
set -euo pipefail
src="${CARGO_TARGET_DIR:-target}/android/cartopolis-arm64-v8a.apk"
size=$(du -h "$src" | cut -f1)
sha=$(sha256sum "$src" | cut -d' ' -f1)
short=${COMMIT:0:8}
built=$(date -u '+%Y-%m-%d %H:%M UTC')
# Read the version back out of the archive rather than recomputing it
# from the same inputs the build used — that is the difference between
# reporting what was built and reporting what we meant to build.
# Captured whole, then trimmed — never `aapt2 ... | head -1`.
#
# `head` exits after its line and closes the pipe, and `aapt2 dump
# badging` on a 40 MB APK is usually still writing, so it takes SIGPIPE
# and `pipefail` promotes 141 to the step's status. It is a *race*, which
# is the worst shape for this: the first publish of this app succeeded
# and the next one failed on the identical command. Same fault the verify
# step above had; this was the one it hid behind.
badging_all=$(/opt/android-sdk/build-tools/34.0.0/aapt2 dump badging "$src")
badging=${badging_all%%$'\n'*}
vname=$(printf '%s' "$badging" | sed -n "s/.*versionName='\([^']*\)'.*/\1/p")
vcode=$(printf '%s' "$badging" | sed -n "s/.*versionCode='\([^']*\)'.*/\1/p")
echo "packaged $vname (code $vcode)"
mkdir -p /publish/apk
cp "$src" /publish/apk/.cartopolis.apk.tmp
mv -f /publish/apk/.cartopolis.apk.tmp /publish/apk/cartopolis.apk
echo "$sha cartopolis.apk" > /publish/apk/cartopolis.apk.sha256
# A landing page, because the install path on a phone is "open a link",
# and a bare .apk URL gives no way to tell which build is being
# installed. Plain HTML on purpose: this directory is inside the wasm
# client's web root and must not grow a build step of its own.
#
# Most of this page is the install walkthrough, and that is not padding.
# Getting an APK from a browser onto a phone crosses **two** separate
# refusals, and only the first is the well-known one. After the source
# consent ("allow installing from this browser") comes Google Play
# Protect with a dialog headed *Unsafe app blocked*, whose visible
# buttons are "More details" and "Don't install" — the install button
# does not exist until you tap "More details". A page that stops at
# "allow the browser" hands a non-technical installer a dialog with no
# way forward and an accusation on it, and they stop there. So the exact
# strings and the exact taps are written out, including the one that
# looks like a dead end.
#
# The wording drifts between Android versions and between OEM skins
# (Samsung and Xiaomi both reword the source consent), which is why each
# step says what to look *for* rather than only what to tap.
cat > /publish/apk/index.html <<HTML
<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cartopolis for Android</title>
<style>
body { background:#1B2830; color:#F2EFEA; font:16px/1.6 system-ui, sans-serif;
margin:0; padding:2rem 1.25rem; }
main { max-width:32rem; margin:0 auto; }
h1 { color:#FD9212; font-size:1.5rem; margin:0 0 0.5rem; }
h2 { color:#FD9212; font-size:1.05rem; margin:2rem 0 0.5rem; }
.lede { margin:0; }
a.dl { display:block; background:#FD6012; color:#1B2830; font-weight:700;
text-align:center; text-decoration:none; padding:0.9rem; border-radius:0.5rem;
margin:1.5rem 0; }
a { color:#FD9212; }
dl { display:grid; grid-template-columns:auto 1fr; gap:0.25rem 1rem; font-size:0.9rem; }
dt { color:#FD9212; } dd { margin:0; }
ol { padding-left:1.2rem; } li { margin:0.6rem 0; }
b.tap { color:#F2EFEA; background:#2e424e; border-radius:0.25rem; padding:0 0.35rem; }
q { color:#F2EFEA; opacity:0.95; }
p { font-size:0.9rem; opacity:0.85; }
hr { border:0; border-top:1px solid #2e424e; margin:2rem 0; }
</style>
<main>
<h1>Cartopolis for Android</h1>
<p class="lede">A 3D map of the real world you can walk around in and fly out
of, built from OpenStreetMap. This is the phone build: the map viewer, free,
no account, no ads, nothing collected. It comes from us rather than from the
Play Store, so Android will question it twice on the way in — both dialogs
are below, with what to tap.</p>
<a class="dl" href="cartopolis.apk">Download the APK ($size)</a>
<p><b>Upgrading from Viberfox?</b> This release renames the app, and
Android identifies an app by a hidden id rather than by its name — so
this installs <em>beside</em> the old one instead of replacing it, and
the old one will never update again. Uninstall <b class="tap">Viberfox</b>
by hand once you have this running. Nothing is carried over
automatically; the map viewer keeps no account and no world data, so
there is nothing to migrate.</p>
<dl>
<dt>version</dt><dd>$vname (code $vcode)</dd>
<dt>commit</dt><dd>$short</dd>
<dt>built</dt><dd>$built</dd>
<dt>abi</dt><dd>arm64-v8a, Android 9+</dd>
<dt>sha256</dt><dd style="word-break:break-all">$sha</dd>
</dl>
<h2>Installing it</h2>
<ol>
<li>Tap <b class="tap">Download the APK</b> above. If the browser warns
that <q>this type of file can harm your device</q>, choose
<b class="tap">Download anyway</b>.</li>
<li>Open the downloaded file — from the notification, or from
<b class="tap">Files</b> → <b class="tap">Downloads</b>.</li>
<li>Android says <q>For your security, your phone is not allowed to install
unknown apps from this source</q>. Tap <b class="tap">Settings</b>, turn on
<b class="tap">Allow from this source</b>, then press Back. Some phones word
this as <q>Install unknown apps</q>.</li>
<li>Tap <b class="tap">Install</b>.</li>
<li><b>This is the step people stop at.</b> Play Protect shows
<q>Unsafe app blocked</q> or <q>Play Protect doesn't recognize this app's
developer</q>, and offers only <b class="tap">More details</b> and
<b class="tap">Don't install</b>. Tap <b class="tap">More details</b> — that
reveals <b class="tap">Install anyway</b>. Tap it.</li>
<li>If it offers to <b class="tap">Send app for scanning</b>, either answer
is fine; the install continues.</li>
</ol>
<p>That warning means <em>Google has never seen this app before</em>, not that
anything was found in it. Every app not distributed through the Play Store gets
it. If you would rather check for yourself, the sha256 above is of the exact
file this page links to.</p>
<hr>
<p>Signed with the project's own key, so later builds install straight over
this one — but only one build is kept here at a time, and a fresh one replaces
it whenever the code changes. Nothing on this page needs an account.</p>
<p>It is early software: the phone build is the map viewer, typing goes
through the app's own on-screen keyboard rather than your usual one, and it
wants a reasonably recent phone. There is also a browser version at
<a href="/">cartopolis.org</a>.</p>
</main>
HTML
# **Last, and on purpose.** This file is what the `published` job reads
# to decide there is nothing to do, so it must never claim a build that
# is not fully on disk: written here, a run that dies anywhere above
# leaves the *previous* commit recorded and the next dispatch rebuilds.
# Written before the APK, a half-finished publish would be skipped
# forever and the site would keep serving the old app while every log
# said the new one had shipped.
#
# The full sha, where index.html carries only the first eight — that
# page is for a human deciding whether to install, this is a machine
# comparing against `github.sha`, and eight hex digits is a comparison
# that can collide. Served publicly like everything else here, which
# also makes `curl https://cartopolis.org/apk/cartopolis.apk.commit`
# the answer to "what is on the site right now".
printf '%s\n' "$COMMIT" > /publish/apk/.commit.tmp
mv -f /publish/apk/.commit.tmp /publish/apk/cartopolis.apk.commit
echo "published $size to https://cartopolis.org/apk/ ($vname, code $vcode, commit $short)"
ls -la /publish/apk