Skip to content

Commit 3028978

Browse files
aautonomiccclaude
andcommitted
Fix Android splash hang: hold shared_preferences_android <2.5.0, keep JNI Kotlin classes, verifier refuses renamed ones
alpha.125's pub wave took shared_preferences_android to 2.5.0, whose Pigeon JNI bindings resolve kotlin.coroutines.Continuation/Unit/Result by name. R8 renamed them in the release APK, the first prefs read before runApp threw NoSuchMethodError, and the app never left the Android splash. - pubspec: shared_preferences_android '>=2.4.28 <2.5.0' (pre-JNI impl) - android/app/proguard-rules.pro keeps the six JNI-resolved classes - verify_android_apk.py: inspect_dex_keeps refuses an APK where any of the three was renamed (+3 tests); receipt gains kept_jni_classes - CLAUDE.md: root cause + verification record Upstream: flutter/flutter#194649, flutter/packages#13311. Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent bf9dc0f commit 3028978

6 files changed

Lines changed: 100 additions & 5 deletions

File tree

‎CLAUDE.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In `app/`: `flutter analyze`, `flutter test` (PATH needs `~/flutter/bin`; `sourc
1414

1515
## Current Status
1616
⚠️ GIT HISTORY REWRITTEN A THIRD TIME 2026-09-27 (catalog purge — the Public Domain.watch-list bundle removed from HEAD and ALL history, see Recent Changes; earlier the same day: build-box metadata scrub; previously 2026-08-11 legal purge): every commit SHA in this file predating the catalog purge is stale; the alpha.107 line is now bump 38f124f + feature 49345dd. Old clones must re-clone or hard-reset.
17-
v0.1.0-alpha.125 RELEASED (2026-10-18, Latest: APK + AppImage + Windows zip + macOS dmg; tag v0.1.0-alpha.125 on bump fe5b900, dep-pass commit 5a127e3 x0x 0.48.1 + cargo wave + dbus 0.8 + cupertino_icons 2 + pub wave; all 3 tag CI runs green FIRST TRY incl. macOS — CI 39138921061 / Windows 39138922660 / macOS 39138922700): https://github.com/aautonomicc/Watch-It/releases/tag/v0.1.0-alpha.125 — DEPENDENCY-PASS RELEASE on top of alpha.124, no feature/sync/storage/UI changes: x0x 0.48.1 (one-sided peer-link detect + re-dial, closing the #1419 MASQUE-relay caveat from 0.48.0; ant-quic 0.27.61; saorsa-gossip 0.5.90) + a plain `cargo update` wave (zip 2.x un-yanked upstream, lockfile plain-resolvable again) + dbus 0.8 / cupertino_icons 2.0 / connectivity_plus 7.3.2 + pub wave; ant-core stays 0.13.0. All four GitHub per-asset sha256 digests verified byte-identical to local builds (valid self-update source); alpha.124's assets swept (only Latest carries binaries). ⚠️ User on-device pass for this release: first release on x0x 0.48.1 / dbus 0.8 — install everywhere, then the carried legs (two-device pair/burst on 0.48.x now with the one-sided-link re-dial, funded backup on ant-core 0.13.0, the alpha.124 drawer/About credit visuals, pending .124→.125 in-app offer). watch-site: no card staged (dep pass).
17+
⚠️ ALPHA.125 ANDROID APK IS BROKEN ON-DEVICE (hangs on the splash — shared_preferences_android 2.5.0 JNI classes renamed by R8; FIXED ON MAIN 2026-10-19, unreleased — cut alpha.126 promptly, Android users must sideload it; see Recent Changes 2026-10-19). v0.1.0-alpha.125 RELEASED (2026-10-18, Latest: APK + AppImage + Windows zip + macOS dmg; tag v0.1.0-alpha.125 on bump fe5b900, dep-pass commit 5a127e3 x0x 0.48.1 + cargo wave + dbus 0.8 + cupertino_icons 2 + pub wave; all 3 tag CI runs green FIRST TRY incl. macOS — CI 39138921061 / Windows 39138922660 / macOS 39138922700): https://github.com/aautonomicc/Watch-It/releases/tag/v0.1.0-alpha.125 — DEPENDENCY-PASS RELEASE on top of alpha.124, no feature/sync/storage/UI changes: x0x 0.48.1 (one-sided peer-link detect + re-dial, closing the #1419 MASQUE-relay caveat from 0.48.0; ant-quic 0.27.61; saorsa-gossip 0.5.90) + a plain `cargo update` wave (zip 2.x un-yanked upstream, lockfile plain-resolvable again) + dbus 0.8 / cupertino_icons 2.0 / connectivity_plus 7.3.2 + pub wave; ant-core stays 0.13.0. All four GitHub per-asset sha256 digests verified byte-identical to local builds (valid self-update source); alpha.124's assets swept (only Latest carries binaries). ⚠️ User on-device pass for this release: first release on x0x 0.48.1 / dbus 0.8 — install everywhere, then the carried legs (two-device pair/burst on 0.48.x now with the one-sided-link re-dial, funded backup on ant-core 0.13.0, the alpha.124 drawer/About credit visuals, pending .124→.125 in-app offer). watch-site: no card staged (dep pass).
1818
Previously: v0.1.0-alpha.124 RELEASED (2026-10-17, Latest: APK + AppImage + Windows zip + macOS dmg; tag v0.1.0-alpha.124 on bump 134cf5d, feature commits 433a34e drawer credit pinned to the bottom edge + 3481eeb About credit styled like the W@tch row; all 3 tag CI runs green FIRST TRY incl. macOS — CI 39029193319 / Windows 39029194911 / macOS 39029194837): https://github.com/aautonomicc/Watch-It/releases/tag/v0.1.0-alpha.124 — SMALL VISUAL FOLLOW-UP to alpha.123, no network/sync/storage changes: the library drawer's "Powered by autonomi" credit is anchored to the drawer's bottom edge (bottom-left of the home screen on desktop where the drawer is pinned; flush at the bottom of the modal drawer) instead of scrolling as the last row, and Settings → About's Autonomi credit row now matches the W@tch identity row above it (hub icon in W@tch blue, Autonomi wordmark as the title, description below, whole row opens autonomi.com / snackbar on TV). All four GitHub per-asset sha256 digests verified byte-identical to local builds (valid self-update source); alpha.123's assets swept (only Latest carries binaries). ⚠️ User on-device pass for this release: eyeball the drawer credit at the bottom-left on desktop + flush-bottom on a phone's modal drawer, the restyled About row on phone/TV, and the carried alpha.122/.123 legs (two-device pair/burst on x0x 0.48.0, funded backup on ant-core 0.13.0, pending .123→.124 in-app offer). watch-site: no card staged (visual follow-up).
1919
Previously: v0.1.0-alpha.123 RELEASED (2026-10-16, Latest → superseded: APK + AppImage + Windows zip + macOS dmg; tag v0.1.0-alpha.123 on bump bafc4a9, feature commit 6814ca1 app-bar lockup doubled + "Powered by the Autonomi network" credit; all 3 tag CI runs green FIRST TRY incl. macOS — CI 38923684743 / Windows 38923688912 / macOS 38923689620): https://github.com/aautonomicc/Watch-It/releases/tag/v0.1.0-alpha.123 — SMALL VISUAL RELEASE on top of alpha.122's dependency pass, no network/sync/storage changes: the home app bar's W@tch lockup is twice the size (32px mark + 36px wordmark, scale-down FittedBox on narrow phones) and W@tch now credits the network it runs on — "Powered by the Autonomi network" with the official wordmark (text recoloured bone) linking https://autonomi.com/ in the library drawer's footer (permanent on desktop where the drawer is pinned) and in Settings → About under the W@tch identity row (TV boxes without a browser get the address in a snackbar); the watch-site gained the matching credit band + footer line the same day (f79a25d). All four GitHub per-asset sha256 digests verified byte-identical to local builds (valid self-update source); alpha.122's assets swept (only Latest carries binaries). ⚠️ User on-device pass for this release: eyeball the doubled lockup on a narrow phone (must shrink, never overflow) and on TV, tap the drawer-footer + About credit on desktop/phone (opens autonomi.com) and on a TV box (snackbar with the address); plus the carried alpha.122 legs (first release on x0x 0.48.0 / ant-core 0.13.0 — two-device pair/burst, funded backup on the new pointer path, pending .122→.123 in-app offer proving the alpha.119 stale-update-bar fix). watch-site: credit band already live (no separate card).
2020
Previously: v0.1.0-alpha.122 RELEASED (2026-10-16, Latest → superseded: APK + AppImage + Windows zip + macOS dmg; tag v0.1.0-alpha.122 on bump 6b9ce16, fix commit 97770fb stale cargo-ndk side dylibs swept, dep-pass commit ff31acd x0x 0.48.0 + ant-core 0.13.0; all 3 tag CI runs green FIRST TRY incl. macOS — CI 38906012938 / Windows 38906013635 / macOS 38906013115): https://github.com/aautonomicc/Watch-It/releases/tag/v0.1.0-alpha.122 — DEPENDENCY-PASS + APK-SLIM RELEASE, no feature changes: x0x 0.48.0 (ant-quic 0.27.60 superseded-connection arbiter fix, dials no longer cut at the ~2s direct stage, Happy Eyeballs keeps its dials; saorsa-gossip 0.5.88) + ant-core 0.13.0 (pointer ownership handover ADR-0018 + majority fork reads + whole-group checks on the backup's pointer path, in-flight chunk fetches shared, self_encryption 0.36.2, ant-protocol 5) + the APK no longer ships the 18 stale libant_core-*/libself_encryption-* side dylibs (APK 179.2 → 165.5 MB, only libwatchit_core.so from the Rust side; verifier refuses them from now on). All four GitHub per-asset sha256 digests verified byte-identical to local builds (valid self-update source); alpha.121's assets swept (only Latest carries binaries). ⚠️ User on-device pass for this release: first release on x0x 0.48.0 / ant-core 0.13.0 — install everywhere, then the carried legs: a real two-device pair/burst on 0.48.0 (expect steadier pairing/bursts; watch for the benign PlumTree recovery-intent WARN noise), a funded backup on 0.13.0's pointer-write path, and the carried alpha.120 legs (round trip narrated in the drawer/info bar + failed-first-fetch self-heal; a pending .121→.122 in-app offer proving the alpha.119 stale-update-bar fix). watch-site: no card staged (dep pass).
@@ -92,6 +92,7 @@ v0.1.0-alpha.64 "UPLOAD" RELEASED (2026-08-27, AppImage + Windows zip + APK; tag
9292
- Repo: github.com/aautonomicc/Watch-It — LICENSING (2026-08-03): own source MIT (LICENSE), but binaries statically link self_encryption 0.36.0 (GPL-3.0) so every released APK/AppImage is a combined work offered under GPLv3 (COPYING.GPL-3.0 at repo root, README ## License). In-app notice: Settings → About → Open-source licenses (showLicensePage) + services/licenses.dart registerNativeLicenses() (called in main()) registering W@tch MIT+GPLv3 note, self_encryption GPL full text (asset assets/licenses/gpl-3.0.txt), watchit_core Rust crate list, libmpv/FFmpeg notice, Anton OFL
9393

9494
## Recent Changes
95+
- [2026-10-19] ANDROID SPLASH HANG ON ALPHA.125 ROOT-CAUSED + FIXED (UNRELEASED — ships next release, which should be cut promptly since the shipped alpha.125 APK is unusable on Android; user report "after updating on Android the app hangs on open showing a white screen with the circular W@tch logo"; finished across two sessions — the first diagnosed, wrote the fix + verifier, launched the detached unit /tmp/wi126 and died, this "status" follow-up found RESULT.md all-PASS and turned the bot checkpoint into the real commit): ROOT CAUSE — the 2026-10-18 pub wave took **shared_preferences_android 2.4.x → 2.5.0**, whose Android side moved to Pigeon "native interop" JNI bindings (package:jni) that resolve Kotlin classes BY NAME from Dart (`kotlin.coroutines.Continuation`, `kotlin.Unit`, `kotlin.Result`); the plugin ships no ProGuard keep rules and package:jni's consumer rules cover only its own package, so R8 RENAMED those classes in the release APK (dexdump of the shipped alpha.125 APK: `Continuation` → `c6.d`, the descriptor surviving only inside Kotlin metadata signatures) and the first `SharedPreferences.getInstance()` threw NoSuchMethodError — which in W@tch happens BEFORE runApp (theme/TV/terms prefs in main()), so the Flutter engine never drew a frame and the install sat on the Android splash forever. Debug builds (no R8) and desktop (no Android plugin) were unaffected, which is why every test + the Xvfb smoke passed. Upstream: flutter/flutter#194649, fix pending in flutter/packages#13311, dart-lang/native#3732. FIX (3 parts): (1) pubspec pins `shared_preferences_android: '>=2.4.28 <2.5.0'` as a direct dep (lock 2.5.0 → 2.4.28, the pre-JNI implementation; lift the cap once a 2.5.x ships consumer keep rules); (2) NEW `app/android/app/proguard-rules.pro` (picked up automatically by Flutter's Gradle plugin) keeps the six JNI-resolved Kotlin classes as belt-and-braces for any future jnigen plugin; (3) `scripts/verify_android_apk.py` gains `inspect_dex_keeps` — matches the exact dex string_data_item of `Lkotlin/coroutines/Continuation;` / `Lkotlin/Unit;` / `Lkotlin/Result;` across every classes*.dex (whole-entry match so a metadata-embedded signature can't fake it) and REFUSES a release APK where any was renamed; receipt gains `kept_jni_classes`; +3 python tests (13 green). VERIFIED (detached unit /tmp/wi126/RESULT.md): flutter analyze clean + **1211 flutter + 6 skipped** + dual-ABI release APK built (167.2 MB) + verifier PASS (versionCode-agnostic structure/cert 7911…0a69); dexdump confirms all SIX kept class descriptors present and the Pigeon `SharedPreferencesApiRegistrar` ABSENT (the 2.4.28 non-JNI implementation is what's in the APK); the new check REFUSES the shipped dist/Watch-It-0.1.0-alpha.125.apk naming all three renamed classes and passes the rebuilt one. NOT verified on-device (Ella headless): the user's next Android install is the proof — expect the app to open normally; a downgrade path is NOT needed (same signing cert, prefs file format unchanged between 2.4.28 and 2.5.0 — both read the same `FlutterSharedPreferences` XML). RELEASE NOTE for next release: Android users on alpha.125 must sideload the new APK (the stuck app can't run its own updater); desktop installs were never affected.
9596
- [2026-10-18] v0.1.0-alpha.125 RELEASED ("Status ?" found the release session dead at the usual point — bump fe5b900 + tag pushed, local release_build.sh APK+AppImage ALL BUILDS DONE 15:21, notes drafted at /tmp/wi125-notes.md, CI + Windows tag runs green, macOS still running; this task finished it): macOS run 39138922700 went green FIRST TRY too (no ffmpeg repin, no explicit-modules flake; all 3 tag runs 39138921061 / 39138922660 / 39138922700); Windows zip (63 files incl. ffmpeg/ffprobe/watchit.exe/watchit_core.dll 64.7MB) + dmg (koly-verified, 228MB) pulled from tag CI artifacts as-is; APK verifier PASS (versionCode 125 + leanback + both ABIs + only libwatchit_core.so from the Rust side + cert 7911…0a69, source clean); clean-HOME Xvfb :78 smoke of the dist AppImage — Terms v5 gate renders, /health ready w/ 5 peers + 5 stored maps, and /versions on the shipped binary reports x0x 0.48.1 / ant-quic 0.27.61 / saorsa-gossip 0.5.90 / saorsa-core 0.29.1 / ant-core 0.13.0 (/tmp/wi125-smoke.png); gh release create --latest → https://github.com/aautonomicc/Watch-It/releases/tag/v0.1.0-alpha.125 (Latest, 4 assets); all four GitHub per-asset sha256 digests verified byte-identical to local files (valid self-update source — alpha.101+ installs take this in-app). alpha.124's 4 assets deleted per the standing sweep (verified: only alpha.125 carries binaries). ~/.local/bin/watch-it repointed. watch-site clean, no card staged (dep pass). The armeabi-v7a jniLibs noted as stale after the bump was rebuilt by release_build.sh (verifier confirms one .so per ABI). User on-device pass: first release on x0x 0.48.1 / dbus 0.8 — install everywhere + the carried alpha.122–.124 legs.
9697
- [2026-10-18] FULL DEPENDENCY BUMP (commit on main, UNRELEASED — ships next release; user "bump all dependencies"; finished across two sessions — the first applied the bumps + launched the detached verify unit /tmp/wibump then died, this "status" follow-up found RESULT.md all-PASS and turned the bot checkpoint into the real commit): RUST — x0x 0.48.0 → **0.48.1** (fix: detect + re-dial a one-sided peer link — closes the #1419 MASQUE-relay caveat recorded at the 0.48.0 bump; plane legacy grace per connection generation; pubsub msg_id on live frames #869), ant-quic 0.27.60 → **0.27.61**, all 11 saorsa-gossip crates 0.5.88 → **0.5.90**, plus a plain `cargo update` wave (tokio 1.53.3, rustls 0.23.46, aws-lc-rs 1.18.2, serde_json 1.0.154, cc 1.8, ~45 small transitives; 4 windows-* crates dropped; psm/stacker/typed-path new). ZIP-YANK HAZARD RESOLVED UPSTREAM: the 2.x line is un-yanked again, so the lock now holds zip 2.6.1 (ant-core's ^2) beside x0x's zip 9.0.5 and a plain `cargo update` resolves — Cargo.toml comment rewritten to say so (keep the lockfile under version control, read `cargo update` output before trusting it). ant-core stays at the 0.13.0 tag (newest). FLUTTER — the two deliberately-skipped majors taken: **dbus 0.7 → 0.8** (screen_wake.dart compiles unchanged — analyze + suite clean) and **cupertino_icons 1.0 → 2.0**, + connectivity_plus 7.3.2 and a `pub upgrade` wave (shared_preferences_android 2.5.0, wakelock_plus 1.8.1, nm 0.6, dart_style/source_gen/vm_service patches; cli + watchit_naming locks refreshed). Flutter SDK 3.47.7 and the Gradle/AGP/Kotlin pins (AGP 9.0.1, Kotlin 2.3.20, Gradle 9.1) were already current — untouched. Zero source changes. VERIFIED (detached unit, /tmp/wibump/RESULT.md): release build **0 warnings** + **114 cargo** + Android arm64 cross-build (jniLibs refreshed) + **flutter analyze clean** + **1211 flutter + 6 skipped** + 47 naming + 20 cli; LIVE MAINNET SMOKE: /versions x0x 0.48.1 / ant-quic 0.27.61 / saorsa-gossip 0.5.90 / ant-core 0.13.0, ready w/ 5 peers in 2s, My W@tch agent ready/leaf in 71s, agent off in 5.2s w/ 0 watchdog fires, re-enable ready, same-dir relaunch ready w/ 0 "database is locked"; the PlumTree recovery-intent WARN noise from 0.48.0 persists (~600/445 lines per leg — upstream, benign). NOT done: the armeabi-v7a jniLibs is still the 0.48.0 build (release_build.sh rebuilds both ABIs at release time); no release cut. Next release = first on x0x 0.48.1 / dbus 0.8.
9798
- [2026-10-18] x0x 0.48.1 COMPILE CHECK PASSED (analysis only, NO dep change applied — completes the same-day "pros and cons of bumping x0x and saorsa-gossip" question; the detached unit wi481-verify ran on a scratch copy at /tmp/wi481, gone on reboot): Cargo.toml `x0x = "0.48.1"` + `cargo update -p x0x` resolves cleanly as a LOCKFILE-ONLY move — x0x 0.48.0 → **0.48.1**, all 11 saorsa-gossip crates 0.5.88 → **0.5.90**, ant-quic 0.27.60 → **0.27.61**, + new transitives zip 9.0.5 (beside the locked zip 2.4.2 ant-core still pins — the yank hazard is untouched) and typed-path 0.12.3, 4 windows-* crates dropped. Zero source changes: release build **0 warnings** + **114 cargo tests** green + Android arm64 cross-build green. GOTCHA (cost one false FAIL): the scratch script first ran bare `cargo ndk … build --release`, which also links the devserver BIN and dies on `undefined symbol: getifaddrs` — the real recipe is build-android.sh's `--platform 24 … --lib` (Android libc gained getifaddrs in API 24; documented in that script since alpha.61). Any future detached verify must copy those flags. NOT done: the bump itself, mainnet agent toggle/relaunch smoke, Flutter suite — awaiting go-ahead; recipe when wanted = the 0.47.1/0.48.0 pass (pin edit + `cargo update -p x0x` + cargo tests + build-android.sh + mainnet smoke w/ a linked My W@tch agent).

‎app/android/app/proguard-rules.pro‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Picked up automatically by Flutter's Gradle plugin for release builds
2+
# (FlutterPlugin.kt adds android/app/proguard-rules.pro when it exists).
3+
#
4+
# Pigeon "native interop" (JNI) plugins — shared_preferences_android 2.5.0+,
5+
# any future jnigen-based plugin — resolve these Kotlin classes BY NAME from
6+
# Dart. R8 renames them otherwise and the JNI lookup fails with
7+
# NoSuchMethodError at the first call, which in this app happens before
8+
# runApp (theme/TV prefs) and left alpha.125 on the Android splash forever.
9+
# Neither package:jni (its consumer-rules.pro keeps only its own package) nor
10+
# the plugin shipped these rules at the time — flutter/flutter#194649,
11+
# flutter/packages#13311, dart-lang/native#3732. scripts/verify_android_apk.py
12+
# refuses a release APK where these classes were renamed.
13+
-keep class kotlin.Unit { *; }
14+
-keep class kotlin.Result { *; }
15+
-keep class kotlin.Result$Failure { *; }
16+
-keep class kotlin.coroutines.Continuation { *; }
17+
-keep class kotlin.coroutines.intrinsics.CoroutineSingletons { *; }
18+
-keep class kotlin.coroutines.intrinsics.IntrinsicsKt { *; }

‎app/pubspec.lock‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -888,13 +888,13 @@ packages:
888888
source: hosted
889889
version: "2.5.6"
890890
shared_preferences_android:
891-
dependency: transitive
891+
dependency: "direct main"
892892
description:
893893
name: shared_preferences_android
894-
sha256: b90caa27669d5f3ef9918d55343b44000f088ee9d4685ed822310848004c793e
894+
sha256: "1e12aafe408aa50da80edfd679a2a6bf63ba7ab37c7fa98286da459a757b3399"
895895
url: "https://pub.dev"
896896
source: hosted
897-
version: "2.5.0"
897+
version: "2.4.28"
898898
shared_preferences_foundation:
899899
dependency: transitive
900900
description:

0 commit comments

Comments
 (0)