From b37bb2b5c9a5613ee4e1fc0be2ba7f228b9516d4 Mon Sep 17 00:00:00 2001 From: David Schachter Date: Thu, 30 Jul 2026 10:41:03 -0700 Subject: [PATCH 1/5] ADFA-3771: Document android-sdk.zip image recompression procedure Recompressed the two oversized default_wallpaper.png files in the downloaded android-sdk.zip with pngquant (~66% combined size reduction, no visible quality loss) and wrote up the repeatable procedure so future oversized-asset findings don't require rediscovering the snap-confinement workaround or the in-place zip-entry-replacement trick. Co-Authored-By: Claude Sonnet 5 --- docs/process/recompress-android-sdk-images.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/process/recompress-android-sdk-images.md diff --git a/docs/process/recompress-android-sdk-images.md b/docs/process/recompress-android-sdk-images.md new file mode 100644 index 0000000000..dfaaef4a11 --- /dev/null +++ b/docs/process/recompress-android-sdk-images.md @@ -0,0 +1,67 @@ +# Recompressing oversized images in android-sdk.zip + +`android-sdk-arm64-v8a.zip` / `android-sdk-armeabi-v7a.zip` are downloaded assets +(see `debugAssets`/`releaseAssets` in `app/build.gradle.kts`), not built in this +repo — they're a packaged copy of Android SDK platform data (`platforms/android-/`) +fetched from appdevforall.org. Some of the bundled platform resources are large, +unoptimized PNGs that bloat the APK for no benefit (ADFA-3771 found two default +wallpaper images at ~2.7MB and ~3.9MB). + +## Finding an oversized asset + +``` +unzip -l assets/android-sdk-arm64-v8a.zip | sort -n -k1 | tail -20 +``` + +## Recompressing + +Lossless recompression (`zopflipng`) barely helps here — these PNGs are already +well DEFLATE-compressed, and re-running DEFLATE on the same pixel data doesn't +buy much. The real win is `pngquant`'s palette quantization, which is lossy but +usually visually indistinguishable at these quality settings for +photographic/gradient content like a wallpaper: + +``` +pngquant --quality=80-95 --strip --force --output out.png in.png +``` + +**`pngquant` on this machine is a snap package** and can't read files outside +its allowed roots — a path like `/tmp/.../scratchpad/foo.png` fails with +`cannot open ... for reading` even though the file exists and is readable by +the same user. Copy the input into `$HOME` first (same snap-confinement +pattern as `jira-cli` — see the memory note on that). Confirmed savings for +ADFA-3771: `drawable-sw600dp-nodpi/default_wallpaper.png` 2.75MB → 844KB (69%), +`drawable-sw720dp-nodpi/default_wallpaper.png` 3.94MB → 1.43MB (64%). + +Always visually diff before/after (open both images) — quantization quality +varies a lot by image content, and this doesn't have a UI test to catch a bad +result. + +## Updating the zip in place + +`zip` can replace a single entry in an existing archive without rewriting the +whole thing, as long as the working directory mirrors the archive's internal +path structure: + +``` +mkdir -p work/platforms/android-36/data/res/drawable-sw600dp-nodpi +cp out.png work/platforms/android-36/data/res/drawable-sw600dp-nodpi/default_wallpaper.png +cd work +zip assets/android-sdk-arm64-v8a.zip platforms/android-36/data/res/drawable-sw600dp-nodpi/default_wallpaper.png +``` + +Repeat for `android-sdk-armeabi-v7a.zip` — SDK platform resources are +architecture-independent, so both zips carry byte-identical copies of these +files (verified via `md5sum` before touching either). Verify afterward: + +``` +unzip -t assets/android-sdk-arm64-v8a.zip # "No errors detected" +``` + +## Scope + +This only rewrites the locally downloaded copies under `assets/` (gitignored — +see `assetsDownloadDebug`/`assetsDownloadRelease` in `app/build.gradle.kts`). +Getting the recompressed images into the real, published `android-sdk.zip` / +`android-sdk.zip.br` on appdevforall.org is a separate, external publishing +step outside this repo. From 984899633c2f1e696811f8fc3034cb341931514e Mon Sep 17 00:00:00 2001 From: David Schachter Date: Thu, 30 Jul 2026 10:59:31 -0700 Subject: [PATCH 2/5] ADFA-3771: Add sh language identifier to fenced code blocks Review feedback on PR #1602 -- bare triple-backtick fences don't get shell syntax highlighting or get picked up as shell snippets by doc tooling that keys off the language tag. Co-Authored-By: Claude Sonnet 5 --- docs/process/recompress-android-sdk-images.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/process/recompress-android-sdk-images.md b/docs/process/recompress-android-sdk-images.md index dfaaef4a11..8d0ed3ba9a 100644 --- a/docs/process/recompress-android-sdk-images.md +++ b/docs/process/recompress-android-sdk-images.md @@ -9,7 +9,7 @@ wallpaper images at ~2.7MB and ~3.9MB). ## Finding an oversized asset -``` +```sh unzip -l assets/android-sdk-arm64-v8a.zip | sort -n -k1 | tail -20 ``` @@ -21,7 +21,7 @@ buy much. The real win is `pngquant`'s palette quantization, which is lossy but usually visually indistinguishable at these quality settings for photographic/gradient content like a wallpaper: -``` +```sh pngquant --quality=80-95 --strip --force --output out.png in.png ``` @@ -43,7 +43,7 @@ result. whole thing, as long as the working directory mirrors the archive's internal path structure: -``` +```sh mkdir -p work/platforms/android-36/data/res/drawable-sw600dp-nodpi cp out.png work/platforms/android-36/data/res/drawable-sw600dp-nodpi/default_wallpaper.png cd work @@ -54,7 +54,7 @@ Repeat for `android-sdk-armeabi-v7a.zip` — SDK platform resources are architecture-independent, so both zips carry byte-identical copies of these files (verified via `md5sum` before touching either). Verify afterward: -``` +```sh unzip -t assets/android-sdk-arm64-v8a.zip # "No errors detected" ``` From 84c25928c89f18922f8f0f43f40547e68d44309b Mon Sep 17 00:00:00 2001 From: David Schachter Date: Thu, 30 Jul 2026 11:01:26 -0700 Subject: [PATCH 3/5] ADFA-3771: Fix relative zip path after cd work Review feedback on PR #1602 -- the command referenced assets/ relative to the directory before cd work, which resolves to the nonexistent work/assets/ instead of the sibling assets/ directory. Co-Authored-By: Claude Sonnet 5 --- docs/process/recompress-android-sdk-images.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/process/recompress-android-sdk-images.md b/docs/process/recompress-android-sdk-images.md index 8d0ed3ba9a..64f17c3f36 100644 --- a/docs/process/recompress-android-sdk-images.md +++ b/docs/process/recompress-android-sdk-images.md @@ -47,7 +47,7 @@ path structure: mkdir -p work/platforms/android-36/data/res/drawable-sw600dp-nodpi cp out.png work/platforms/android-36/data/res/drawable-sw600dp-nodpi/default_wallpaper.png cd work -zip assets/android-sdk-arm64-v8a.zip platforms/android-36/data/res/drawable-sw600dp-nodpi/default_wallpaper.png +zip ../assets/android-sdk-arm64-v8a.zip platforms/android-36/data/res/drawable-sw600dp-nodpi/default_wallpaper.png ``` Repeat for `android-sdk-armeabi-v7a.zip` — SDK platform resources are From 026e37f9cbc3511e7433f6b0db3f75cadbf60fdc Mon Sep 17 00:00:00 2001 From: David Schachter Date: Thu, 30 Jul 2026 11:02:26 -0700 Subject: [PATCH 4/5] ADFA-3771: Verify both zips, not just arm64-v8a Review feedback on PR #1602 -- the verification step only checked android-sdk-arm64-v8a.zip even though the same section says to repeat the update for android-sdk-armeabi-v7a.zip, so a bad update to the armv7 zip would go undetected. Co-Authored-By: Claude Sonnet 5 --- docs/process/recompress-android-sdk-images.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/process/recompress-android-sdk-images.md b/docs/process/recompress-android-sdk-images.md index 64f17c3f36..3207d0a021 100644 --- a/docs/process/recompress-android-sdk-images.md +++ b/docs/process/recompress-android-sdk-images.md @@ -55,7 +55,8 @@ architecture-independent, so both zips carry byte-identical copies of these files (verified via `md5sum` before touching either). Verify afterward: ```sh -unzip -t assets/android-sdk-arm64-v8a.zip # "No errors detected" +unzip -t assets/android-sdk-arm64-v8a.zip # "No errors detected" +unzip -t assets/android-sdk-armeabi-v7a.zip # "No errors detected" ``` ## Scope From d7a7ff89365ef5a59ecbf6071c373b7521846d83 Mon Sep 17 00:00:00 2001 From: David Schachter Date: Thu, 30 Jul 2026 11:08:20 -0700 Subject: [PATCH 5/5] ADFA-3771: Fix dangling memory-note reference and hardcoded platform path Inline the snap-confinement explanation instead of pointing at a personal Claude Code memory note nobody else can resolve. Replace the hardcoded android-36 example path with an android- placeholder and a note to substitute the actual platform directory. Co-Authored-By: Claude Sonnet 5 --- docs/process/recompress-android-sdk-images.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/process/recompress-android-sdk-images.md b/docs/process/recompress-android-sdk-images.md index 3207d0a021..90ad7dd854 100644 --- a/docs/process/recompress-android-sdk-images.md +++ b/docs/process/recompress-android-sdk-images.md @@ -28,8 +28,10 @@ pngquant --quality=80-95 --strip --force --output out.png in.png **`pngquant` on this machine is a snap package** and can't read files outside its allowed roots — a path like `/tmp/.../scratchpad/foo.png` fails with `cannot open ... for reading` even though the file exists and is readable by -the same user. Copy the input into `$HOME` first (same snap-confinement -pattern as `jira-cli` — see the memory note on that). Confirmed savings for +the same user. Snap confinement only grants read/write access under `$HOME`, +`/media`, and a few other allowed roots, so copy the input into `$HOME` first +(the same workaround applies to other snap-packaged CLI tools, e.g. `jira-cli`). +Confirmed savings for ADFA-3771: `drawable-sw600dp-nodpi/default_wallpaper.png` 2.75MB → 844KB (69%), `drawable-sw720dp-nodpi/default_wallpaper.png` 3.94MB → 1.43MB (64%). @@ -41,13 +43,16 @@ result. `zip` can replace a single entry in an existing archive without rewriting the whole thing, as long as the working directory mirrors the archive's internal -path structure: +path structure. Substitute `android-` below with whichever platform +directory (from `unzip -l`) actually contains the target asset — it's +`android-36` for ADFA-3771's SDK level, but will differ for other assets or +future SDK bumps: ```sh -mkdir -p work/platforms/android-36/data/res/drawable-sw600dp-nodpi -cp out.png work/platforms/android-36/data/res/drawable-sw600dp-nodpi/default_wallpaper.png +mkdir -p work/platforms/android-/data/res/drawable-sw600dp-nodpi +cp out.png work/platforms/android-/data/res/drawable-sw600dp-nodpi/default_wallpaper.png cd work -zip ../assets/android-sdk-arm64-v8a.zip platforms/android-36/data/res/drawable-sw600dp-nodpi/default_wallpaper.png +zip ../assets/android-sdk-arm64-v8a.zip platforms/android-/data/res/drawable-sw600dp-nodpi/default_wallpaper.png ``` Repeat for `android-sdk-armeabi-v7a.zip` — SDK platform resources are