android: the launcher's ground is the desktop's, not a flat colour under it

The icon round left the adaptive background as one `#FF05080B` and a note that
a gradient was being mocked. The mock settles it: the falcon covers about a
quarter of a circle-masked tile, so the ground is three quarters of what
anyone sees, and concept 04's glow survives every mask — the visible top-left
corner goes from `#05080B` to `#0E3543`. So `@color/ic_launcher_background`
becomes `@drawable/ic_launcher_ground`, a vector carrying the desktop icon's
own linear surface and the radial glow over it, every number
`src-tauri/icons/icon.svg`'s multiplied by 108/1024 and nothing else. The
colour resource stays where it is, unreferenced, because its filename is the
only thing stopping tauri's own `#fff` from colliding with it.

A vector and not five PNGs on evidence. The kit's glow has a uniform scale, so
the SVG ellipse is a circle and its rotation is a no-op, which is exactly what
`android:type="radial"` can carry; two numbers there and no vector could have
said it. The linear axis is 51.1° off horizontal, which rules out a
`<layer-list>` of shapes as well, whose angle must be a multiple of 45. It was
compiled and linked with the SDK's own aapt2 over the real merged res tree and
every stop read back out of the APK. The name is `ic_launcher_ground` and not
`ic_launcher_background` on purpose: the generated project still carries
Android Studio's template drawable of that name, so under the other name an
overlay copy that failed would silently link the green robot — under this one
it is a hard link error, which was tested too.

`verify-icon.sh` follows the layer. It does not ask whether the file is in the
APK; it asks what the adaptive icon's `<background>` resolves to, through the
resource table, in both build types, and then reads concept 04's six stops back
out of what it found — which catches a stale APK as well as a lost overlay.
Passing on a debug APK and on one put through `--shorten-resource-paths`,
failing on a stale one, and saying NOT CHECKED rather than guessing when aapt2
is absent. What none of it can see is a pixel: banding on the OLED, the glow's
weight under the Pixel's mask and how the falcon reads on a lit ground are a
launcher screenshot on the phone, and ANDROID.md says so instead of implying
the check covers it.

One slot the ground reaches is not the launcher at all. `MediaHub.appIcon()`
draws whatever `getApplicationIcon()` returns into a 512 px bitmap and hands
it to the lock-screen card as the large icon for any track whose cover has
not been decoded yet, so the card and the shade carry this ground as well —
the quickest place for Kyle to look at it, and the only reader of the
launcher icon inside the app. The walk reads that card's title and the
session's playback state and never its icon, so no step changes meaning. The
Android 12+ splash very likely changes as well, and the other way from what
the docs' one-line version of the rule suggests: the platform drops an
adaptive background only when it is a single colour close to
`windowSplashScreenBackground`, which round 44's flat `#05080B` was, so the
falcon has been drawing there alone and enlarged; a gradient is not one
colour, so it is kept and the whole icon is drawn. Likely, not proven — that
one is a screenshot too.
This commit is contained in:
KeelrLeek committed 2026-09-15 07:22:02 -05:00
1 parent afcd3cc7f3
commit da4abeb8c9
6 files changed
+314 -35

No files matched your search

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- The adaptive background: concept 04's ground, not a flat colour.
The desktop ships concept 04 "Deep navy glow" (src-tauri/icons/icon.svg,
byte-identical to the kit's soulstream-04-deep-navy-glow.svg) and the
phone shipped #05080B under the same falcon. The falcon covers about a
quarter of a circle-masked tile, so the ground is three quarters of what
anyone sees; the glow survives every mask, lifting the visible top-left
corner from #05080B to #0E3543; and a phone wearing a flatter icon than
the desktop is a divergence for no gain.
LAYER-FIT, not mask-fit: the 1024 artwork is mapped onto the whole 108
layer, not onto the 72 window inside it. Under a circle or a squircle the
two are indistinguishable, and this one never shows a flat edge when a
launcher parallaxes the layers apart.
Every number below is the kit's, multiplied by 108/1024 and nothing else:
surface <linearGradient x1=130 y1=50 x2=880 y2=980>
glow <radialGradient gradientTransform=
"translate(270 220) rotate(43) scale(660)">
108/1024 is 27/256, so each of those terminates inside eight decimals and
is an exact float — nothing here is a rounded coordinate.
The glow's transform has a UNIFORM scale, so the ellipse is a circle and
the rotate is a no-op — which is the whole reason a VectorDrawable can
carry this at all: android:type="radial" is centre plus radius, circular,
with no transform of its own. Had that scale been two numbers, no vector
could have expressed it and this would be five PNGs. stop-opacity folds
into the 8-bit alpha of android:color (0.18 -> 2E, 0.05 -> 0D, 0 -> 00);
the worst error that introduces, measured against the SVG's own float
composite at the layer corners, the visible corners, the circle's rim and
the centre, is one level of 255.
The rx="232" on the kit's two rects is deliberately NOT here. That is the
desktop window's corner; on the phone the launcher's mask does that job,
and an adaptive background must fill its layer.
Two full-bleed paths, surface then glow, because an adaptive background
must be opaque: the first is #FF everywhere and the second only lightens
it. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M0,0h108v108h-108z">
<aapt:attr name="android:fillColor">
<gradient
android:type="linear"
android:startX="13.7109375"
android:startY="5.2734375"
android:endX="92.8125"
android:endY="103.359375">
<item android:offset="0" android:color="#FF0A2330" />
<item android:offset="0.52" android:color="#FF07141F" />
<item android:offset="1" android:color="#FF040A10" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M0,0h108v108h-108z">
<aapt:attr name="android:fillColor">
<gradient
android:type="radial"
android:centerX="28.4765625"
android:centerY="23.203125"
android:gradientRadius="69.609375">
<item android:offset="0" android:color="#2E31C0CB" />
<item android:offset="0.58" android:color="#0D1F8FC9" />
<item android:offset="1" android:color="#0007141F" />
</gradient>
</aapt:attr>
</path>
</vector>
@@ -1,10 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- @mipmap, not the kit's @drawable: the layers ship as PNGs under
mipmap-*, and @drawable/ic_launcher_foreground still resolves to the
template robot in the generated project. The background is one colour
resource, so the gradient replaces one file when it is approved. -->
template robot in the generated project.
The background is a drawable of our own — concept 04's gradient ground,
drawable/ic_launcher_ground.xml — and the name is chosen so that it
CANNOT collide with the template's drawable/ic_launcher_background.xml,
which is still sitting in gen/android as the green robot. If the overlay
ever fails to reach the generated project, this reference does not
resolve and aapt2 stops the build, instead of quietly drawing that. -->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background" />
<background android:drawable="@drawable/ic_launcher_ground" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>
@@ -1,10 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- @mipmap, not the kit's @drawable: the layers ship as PNGs under
mipmap-*, and @drawable/ic_launcher_foreground still resolves to the
template robot in the generated project. The background is one colour
resource, so the gradient replaces one file when it is approved. -->
template robot in the generated project.
The background is a drawable of our own — concept 04's gradient ground,
drawable/ic_launcher_ground.xml — and the name is chosen so that it
CANNOT collide with the template's drawable/ic_launcher_background.xml,
which is still sitting in gen/android as the green robot. If the overlay
ever fails to reach the generated project, this reference does not
resolve and aapt2 stops the build, instead of quietly drawing that. -->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background" />
<background android:drawable="@drawable/ic_launcher_ground" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>
@@ -1,5 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the brand's night; the whole adaptive background is this -->
<!-- The brand's night. It WAS the whole adaptive background until the
ground became a gradient, and nothing points at it now:
drawable/ic_launcher_ground.xml is the background, and
values-v31/themes.xml writes this same colour as a literal on
purpose. It is kept for its FILENAME rather than for its value.
tauri's own src-tauri/icons/android/values/ic_launcher_background.xml
declares this same resource name as #fff, and two files in one
values/ directory declaring one colour is a hard aapt2 error — while
this file exists, a copy of that one overwrites it instead of
colliding with it. Deleting it would build today, since nothing reads
the colour; it would just hand that trap back for nothing saved. -->
<color name="ic_launcher_background">#FF05080B</color>
</resources>
+107 -9
View File
@@ -7,6 +7,17 @@
#
# bash src-tauri/android/verify-icon.sh <apk> [--crunched]
#
# Since the background became a gradient there is a second way to lose, and it
# is quieter still: the adaptive icon's <background> is a reference, and a
# reference resolves to whatever the APK happens to hold. A stale APK, or an
# overlay copy that did not run, and the name points at something else while
# every PNG in the file is still the falcon's. So the check does not ask
# whether drawable/ic_launcher_ground.xml is in the APK — it asks what
# <background> RESOLVES to, through the resource table, in both build types,
# and then reads concept 04's six gradient stops back out of the thing it
# found. That half needs aapt2; without it the ground says NOT CHECKED and the
# rest of the script still runs.
#
# Debug and release are read DIFFERENTLY, because AGP treats their resources
# differently and both differences were measured on 2026-09-14:
#
@@ -53,6 +64,21 @@ for x in ic_launcher ic_launcher_round; do
grep -q "<monochrome" "$RES/mipmap-anydpi-v26/$x.xml" \
|| bad "$RES/mipmap-anydpi-v26/$x.xml declares no <monochrome> layer — themed icons need one"
done
# The ground is the other half of the icon and three quarters of what a
# masked tile shows, so a later edit that flattens it back to one colour
# should not pass quietly either.
GROUND="$RES/drawable/ic_launcher_ground.xml"
test -f "$GROUND" || bad "$GROUND is missing from the overlay — the adaptive background has nowhere to come from"
grep -q 'android:type="linear"' "$GROUND" || bad "$GROUND declares no linear gradient — concept 04's surface"
grep -q 'android:type="radial"' "$GROUND" || bad "$GROUND declares no radial gradient — concept 04's glow"
# quote-anchored, so the comment above them cannot satisfy the check
for c in FF0A2330 FF07141F FF040A10 2E31C0CB 0D1F8FC9 0007141F; do
grep -qi "\"#$c\"" "$GROUND" || bad "$GROUND has lost concept 04's stop #$c — it is no longer the desktop's ground"
done
for x in ic_launcher ic_launcher_round; do
grep -q '@drawable/ic_launcher_ground' "$RES/mipmap-anydpi-v26/$x.xml" \
|| bad "$RES/mipmap-anydpi-v26/$x.xml does not point its background at @drawable/ic_launcher_ground"
done
for d in $DPI; do for n in $NAMES; do
test -f "$RES/mipmap-$d/$n.png" || bad "$RES/mipmap-$d/$n.png is missing from the overlay"
done; done
@@ -69,14 +95,90 @@ dims() {
LIST="$(unzip -l "$APK")" || bad "cannot read $APK"
# aapt2 is beside the zipalign and apksigner build.sh has just used. Found
# here rather than in the release branch below, because both build types want
# it now: only the resource table can say what <background> resolves to.
SDKU=""
[ -n "${ANDROID_HOME:-}" ] && SDKU="$(cygpath -u "$ANDROID_HOME" 2>/dev/null || echo "")"
[ -z "$SDKU" ] && [ -n "${LOCALAPPDATA:-}" ] && SDKU="$(cygpath -u "$LOCALAPPDATA" 2>/dev/null || echo "")/Android/Sdk"
A2="$(ls -1 "$SDKU"/build-tools/*/aapt2.exe 2>/dev/null | sort -V | tail -1 || true)"
# 2. the ground, in BOTH build types. Not "is the file in the APK" — the
# adaptive icon's <background> is a REFERENCE, so what matters is what it
# resolves to, and that is the one question a stale APK answers wrongly
# while every other check still passes. (build.sh pipes Gradle through
# `| tail -20 || true` and then runs `ls -la "$APK"`, so a Gradle run that
# failed leaves the PREVIOUS build's APK exactly where the next step looks
# for it.) Everything below comes out of the resource table and never out
# of a path: a release APK has had res/mipmap-anydpi-v26/ic_launcher.xml
# renamed to res/BW.xml, and the table is the only thing that still knows.
TBL=""
[ -n "$A2" ] && { TBL="$("$A2" dump resources "$APK" 2>/dev/null)" || bad "aapt2 could not read the resource table of $APK"; }
# name [config] -> the file that resource points at. The config is not
# optional detail: mipmap/ic_launcher has SIX entries — the anydpi adaptive
# XML and five legacy PNGs — so a name-only lookup hands back
# res/mipmap-mdpi-v4/ic_launcher.png and the whole check collapses. An empty
# config means the entry with no qualifier at all, which is what a plain
# drawable has. "anydpi" matches the "anydpi-v26" too, as look() does.
path_of() { echo "$TBL" | awk -v n="$1" -v c="${2:-}" '
$1 == "resource" && $3 == n { f = 1; next }
/^[ \t]*resource 0x/ { f = 0 }
f { cfg = $1; gsub(/[()]/, "", cfg)
if (c == "" || cfg == c || cfg ~ "^" c "-v[0-9]+$")
for (i = 1; i <= NF; i++) if ($i ~ /^res\//) { print $i; exit } }'; }
name_of() { echo "$TBL" | awk -v id="$1" '$1 == "resource" && $2 == id { print $3; exit }'; }
if [ -z "$TBL" ]; then
echo "== ground: NOT CHECKED — no aapt2 under ${SDKU:-(no SDK path)}/build-tools."
echo " What <background> points at is a resource id; only the table reads it."
elif echo "$TBL" | grep -q "0_resource_name_obfuscated"; then
echo "== ground: NOT CHECKED — this APK's resource names are collapsed."
else
ADAPT="$(path_of mipmap/ic_launcher anydpi)"
test -n "$ADAPT" || bad "mipmap/ic_launcher has no anydpi entry in this APK — the adaptive icon is not in it, so $RES never reached src-tauri/gen/android/app/src/main/res"
BGID="$("$A2" dump xmltree "$APK" --file "$ADAPT" 2>/dev/null \
| awk '/E: background/ { f = 1 } f && /android:drawable\(/ { sub(/.*=@?/, ""); print; exit }')"
test -n "$BGID" || bad "the adaptive icon in this APK ($ADAPT) declares no <background>"
BGNAME="$(name_of "$BGID")"
[ "$BGNAME" = "drawable/ic_launcher_ground" ] \
|| bad "the APK's adaptive background is ${BGNAME:-$BGID}, not drawable/ic_launcher_ground — a stale APK, or the overlay did not reach src-tauri/gen/android/app/src/main/res"
# and that what it resolves to is still concept 04 rather than a flat
# fill. aapt:attr lifts each inline <gradient> out into a resource of its
# own, so the two fills are references as well; follow the ids rather than
# the $name__N filenames aapt2 happens to give them this version.
GPATH="$(path_of drawable/ic_launcher_ground)"
test -n "$GPATH" || bad "drawable/ic_launcher_ground resolves to no file in this APK"
GTREE="$("$A2" dump xmltree "$APK" --file "$GPATH" 2>/dev/null)" || bad "aapt2 cannot read $GPATH out of this APK"
IDS="$(echo "$GTREE" | grep -oE 'fillColor\(0x[0-9a-f]+\)=@0x[0-9a-f]+' | grep -oE '0x[0-9a-f]+$')"
NFILL="$(echo "$IDS" | grep -c . || true)"
[ "$NFILL" = 2 ] || bad "the ground in this APK has $NFILL gradient fills, not 2 — concept 04 is a surface and the glow over it"
STOPS=""
for id in $IDS; do
g="$(path_of "$(name_of "$id")")"
test -n "$g" || bad "the ground's gradient $id has no file in the resource table"
STOPS="$STOPS $("$A2" dump xmltree "$APK" --file "$g" | grep -oE 'color\(0x[0-9a-f]+\)=#[0-9a-f]{8}' | grep -oE '[0-9a-f]{8}$' | tr '\n' ' ')"
done
for c in ff0a2330 ff07141f ff040a10 2e31c0cb 0d1f8fc9 0007141f; do
echo "$STOPS" | grep -qw "$c" || bad "the ground in this APK has lost concept 04's stop #$c"
done
echo "== ground: <background> = $BGNAME, concept 04's six stops, read back out of the APK"
fi
# What none of this can see is a pixel. Whether the gradient BANDS on the
# phone's OLED, how the glow reads under the Pixel's mask and how the falcon
# sits on a lit ground rather than a flat one are a launcher screenshot, not a
# resource table.
if [ "$CRUNCH" = 0 ]; then
# 2. debug: the adaptive XMLs by name, then all twenty PNGs byte for byte.
# 3. debug: the adaptive XMLs by name, then all twenty PNGs byte for byte.
# Nothing but the overlay makes a mipmap-anydpi-v26 file, so its absence
# is exactly the failure this script exists for.
for x in ic_launcher ic_launcher_round; do
echo "$LIST" | grep -q " res/mipmap-anydpi-v26/$x\.xml$" \
|| bad "res/mipmap-anydpi-v26/$x.xml is not in the APK — $RES never reached src-tauri/gen/android/app/src/main/res"
done
# and the ground by name as well. In release the paths are shortened
# away and only the table above can find it; here it is still a file.
echo "$LIST" | grep -q " res/drawable/ic_launcher_ground\.xml$" \
|| bad "res/drawable/ic_launcher_ground.xml is not in the APK — the adaptive background never reached src-tauri/gen/android/app/src/main/res"
for d in $DPI; do for n in $NAMES; do
got="res/mipmap-$d-v4/$n.png"
echo "$LIST" | grep -q " $got$" || bad "$got is not in the APK"
@@ -87,13 +189,9 @@ if [ "$CRUNCH" = 0 ]; then
exit 0
fi
# 3. release. Ask the resource table what the names point at, since the paths
# have very likely been shortened away. aapt2 is beside the zipalign and
# apksigner build.sh has just used.
SDKU=""
[ -n "${ANDROID_HOME:-}" ] && SDKU="$(cygpath -u "$ANDROID_HOME" 2>/dev/null || echo "")"
[ -z "$SDKU" ] && [ -n "${LOCALAPPDATA:-}" ] && SDKU="$(cygpath -u "$LOCALAPPDATA" 2>/dev/null || echo "")/Android/Sdk"
A2="$(ls -1 "$SDKU"/build-tools/*/aapt2.exe 2>/dev/null | sort -V | tail -1 || true)"
# 4. release. Ask the resource table what the names point at, since the paths
# have very likely been shortened away.
# $A2 and $SDKU come from section 2, which both build types now need.
if [ -z "$A2" ]; then
echo "== icon: NOT CHECKED — no aapt2 under ${SDKU:-(no SDK path)}/build-tools."
echo " A release APK's resource paths are shortened (res/Ag.png), so names"
@@ -101,7 +199,7 @@ if [ -z "$A2" ]; then
exit 0
fi
# one line per file entry: "<name> <config> <path in the APK>"
MAP="$("$A2" dump resources "$APK" | awk '
MAP="$(echo "$TBL" | awk '
/^[ \t]*resource 0x[0-9a-f]+ mipmap\// { split($3, a, "/"); cur = a[2]; next }
/^[ \t]*resource 0x/ { cur = ""; next }
cur != "" { for (i = 1; i <= NF; i++) if ($i ~ /^res\//) { cfg = $1; gsub(/[()]/, "", cfg); print cur, cfg, $i } }