Three things. A download whose signing certificate does not match the installed copy is stopped with a dialog naming both digests and offering the one thing that gets past it: removing the old app. Android's own answer is "App not installed" with no cause, which reads as the download having failed. Where either certificate cannot be read the answer is "don't know" and the install goes ahead as before. The download is carried on the component's state so that the removal is followed by the install it was for rather than by a second download. Pressing that revealed that ACTION_DELETE now needs REQUEST_DELETE_PACKAGES, and fails invisibly without it -- so the "Remove the old app" offer for a renamed package had presumably never worked either. The build mode and the installed variant are one dropdown, not two. They answer to the same words, so two pickers offering debug and release read as one choice asked twice. Where a component declares modes the mode is the whole answer, and the server serves the build named after it rather than the newest. Every dropdown now hangs from one outlined pill with a chevron. And a checkout parked on a chosen commit is no longer called out of date, with HEAD in the commit picker as the way back to following the branch. The commit list comes from that branch rather than from HEAD, so parking no longer hides the commits after it -- the same one-way door the tracked-only dirty check closed, in a place that check did not reach. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
59 lines
2.3 KiB
Bash
Executable File
59 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Rebuilds androidApp/src/main/res/font/nerd_icons.ttf.
|
|
#
|
|
# The app draws a handful of icons -- a folder, a git branch, a server, a
|
|
# cog -- as text in a Nerd Fonts glyph, rather than as vector assets or as
|
|
# ordinary Unicode. Unicode has no character for most of these, and the
|
|
# ones it does have are not reliably in an Android system font, so they
|
|
# land as tofu boxes on somebody's phone.
|
|
#
|
|
# The whole symbols font is 2.5 MB for the handful below, so what is
|
|
# committed is a subset. Add a codepoint to GLYPHS below and to NerdIcons.kt (the two
|
|
# lists have to agree -- a codepoint in the Kotlin but not here is a glyph
|
|
# that silently doesn't exist), then run this and commit the result.
|
|
#
|
|
# Needs python3 and network access; fontTools is fetched into a temporary
|
|
# venv, so nothing has to be installed on the machine.
|
|
set -euo pipefail
|
|
|
|
# Codepoint, then the Nerd Fonts glyph name it came from. All from the
|
|
# Material Design Icons set bar one, so they look like one family; the
|
|
# exception is noted on its own line.
|
|
GLYPHS=(
|
|
U+F024B # md-folder
|
|
U+F062C # md-source_branch
|
|
U+F233 # fa-server
|
|
U+F0493 # md-cog
|
|
U+F0415 # md-plus
|
|
U+F0450 # md-refresh
|
|
U+F0A7A # md-trash_can_outline
|
|
U+F02D # fa-book
|
|
U+F0140 # md-chevron_down
|
|
)
|
|
|
|
url=https://github.com/ryanoasis/nerd-fonts/releases/latest/download/NerdFontsSymbolsOnly.zip
|
|
out="$(cd "$(dirname "$0")" && pwd)/androidApp/src/main/res/font/nerd_icons.ttf"
|
|
work="$(mktemp -d)"
|
|
trap 'rm -rf "$work"' EXIT
|
|
|
|
echo "Fetching $url"
|
|
curl -fsSL -o "$work/nf.zip" "$url"
|
|
python3 -c 'import sys,zipfile; zipfile.ZipFile(sys.argv[1]).extractall(sys.argv[2])' "$work/nf.zip" "$work"
|
|
|
|
python3 -m venv "$work/venv"
|
|
"$work/venv/bin/pip" -q install fonttools
|
|
|
|
unicodes="$(IFS=,; echo "${GLYPHS[*]}")"
|
|
mkdir -p "$(dirname "$out")"
|
|
# The Mono face: every glyph gets the same advance, so an icon occupies the
|
|
# same width whichever one it is and a row of them lines up with the row
|
|
# above. The proportional face varies the advance per glyph, which puts the
|
|
# text after each icon at a slightly different place.
|
|
"$work/venv/bin/pyftsubset" "$work/SymbolsNerdFontMono-Regular.ttf" \
|
|
--unicodes="$unicodes" \
|
|
--layout-features= \
|
|
--drop-tables+=DSIG \
|
|
--output-file="$out"
|
|
|
|
echo "Wrote $out ($(stat -c %s "$out") bytes) with ${#GLYPHS[@]} glyphs"
|