fix(android): make wallet migrations fail-safe and data-preserving - #1259
Draft
takemiyamakoto wants to merge 25 commits into
Draft
fix(android): make wallet migrations fail-safe and data-preserving#1259takemiyamakoto wants to merge 25 commits into
takemiyamakoto wants to merge 25 commits into
Conversation
Pin the Maven Central checksum for junit-bom 5.9.2 Gradle module metadata so strict dependency verification succeeds in fresh emulator lanes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
Migration-safe Android 4.2.0/230 candidate. This supersedes #1258 without modifying, retargeting, or closing it. The PR intentionally remains draft and requires protected-branch review.
The previously withdrawn
921da5f6artifact remains invalid and must not be installed or shared. The exact successor below fixes the delayed WalletConnect startup crash, makes AAB identity verification distinguish a non-minified debug bundle (R8 metadata must be absent) from minified IAS/release bundles (exact R8 metadata remains required), and permanently exercises the R8-fixture synthesizer's configured rejection boundaries.What changed
WCDelegateobject initializer.Appinvokes it only after WalletKit succeeds,RootViewModelretries safely, and recoverable registration failures are contained without raw output.absentR8 metadata policy to non-minified debug AAB verification and an explicitrequiredpolicy to minified release, Play, and IAS verification.1 positive + 15 negative/adversarial. Its crafted over-limit cases derive the production constants from the exact synthesizer and hit the first rejected byte for source size, output size, per-entry expansion, and aggregate expansion, plus the first rejected entry count.Exact source
f897c23cbdc4c13fdf3d1049bd07b588889c941f9f5e2ddd0050a55342c508ea37a7ebd5382def2d6d19fac384c445a471ea38db18b7eec525600baa7500809f33243ee47ecb2ec8563fc284ac4de0d6cc94232148c1bb268b104105e723d6a29019230aExact local validation
postMergeVerify, 1,444/1,444 tasks executed in 2 minutes 38 seconds.1 positive + 6 adversarial.1 positive + 15 negative/adversarial.4 positive + 19 negative/adversarial.2 positive + 135 adversarial.4 positive + 123 negative/adversarial.1 positive + 8 negative/adversarial.8 positive + 39 behavioral negative + 645 static adversarial.2 positive + 40 negative/adversarial.7 positive + 84 negative/adversarial; signed-from non-signature payload equality passed.7 positive + 76 negative/adversarial; verification passed again after the ephemeral private key was unlinked.6d19fac38runtime predecessor, a real 550 MiB declaredaggregate-expansion ZIP fixture was rejected before entry reads. The
permanent exact-head suite now covers the configured source/output,
entry-count, per-entry, and aggregate over-limit branches with crafted
fixtures.
Exact-head local artifact candidates
28d73e4c03fe26dc988a71f1caef6a39d2f2e8748dddf1ae242d995381c573d467f0dd27b3fd65eb53d1b736c8fa572ff781afe79fb0f92afc9bf601cb7406b353A73BAAAA2745CEAD1D52CD48E7C3E6E89CE94242DB6B1B1F92A7630073D4E1a099cfa1543f55593bc2ed16a70a7c67fe54b1747bb7301f37fdfd6d91028e29public-certificate modes. The ephemeral private key was then unlinked; the
retained evidence contains only the public test certificate, and no
*.jks,*.keystore,*.p12, or*.keyremains.qualification does not make the signed candidate distributable or
production-signed.
Device regression
Bundletool derived a universal APK from the exact
f897c23cbsigned local AABand signed the installable APK with the local Android debug key. On a wiped,
disposable API 36 emulator, the exact candidate installed as
4.2.0-ias/230. Its first and second cold launches reachedWalletRootActivityin 128 ms and 101 ms, and the PIDs survived 30-second and45-second soaks. Exact fatal app signatures,
FATAL EXCEPTION,E AndroidRuntime, SQLiteException,ExceptionInInitializerError, andCoreClient needs to be initialized firstscans found zero hits.On the preserved-data API 34 emulator, the installed predecessor manifest was
exact
bcce813b6. Its signer matched the exact f897 universal APK, so packagemanager replacement used
adb install -ronly—no uninstall and no data clear.The installed base APK then matched the candidate byte-for-byte at SHA-256
fd57aa310645b7ec521e55937496529e7860b361f3f891fd1106e378a9f0f786,and its manifest identified exact source
f897c23c.The in-place replacement preserved the original first-install timestamp,
package UID
10223, app-data inode319502, database-directory inode319908,and the 39-file private-data inventory. The first cold launch reached
WalletRootActivityin 169 ms and retained PID23496across 11 samples over300 seconds. A second cold launch reached the root activity in 226 ms and
retained PID
23964for 45 seconds. Both crash buffers were empty; fatal app,Room/migration, SQLite, ANR, native-signal, initializer, and exact
CoreClient needs to be initialized firstscans found zero hits.Additional runtime-equivalent device evidence was collected from exact
6d19fac38, the parent off897c23cb. The child changes only test anddocumentation files. Bundletool-derived APKs were installed on clean arm64
Android emulators:
WalletRootActivityin 129 ms and retained one live PID for 30 seconds.WalletRootActivityin 120 ms and retained one live PID for 30 seconds.6d19fac38runs, crash buffers were empty and exact fatalapp signatures,
FATAL EXCEPTION,E AndroidRuntime, SQLiteException,Room/migration failure, native-signal,
ExceptionInInitializerError, andCoreClient needs to be initialized firstscans found zero hits.Your mnemonic is invalidwhile the process remained alive and the crash buffer stayed empty.The API 30/31/36 checks are fresh-install startup/onboarding evidence. The API
34 lane is an exact-final-source, test-signed in-place replacement over
preserved predecessor data. It does not prove a production-Play-signed,
Google-delivered, or physical-device upgrade.
Handled secretless Reown initialization failures remain in the logs, as do
TypeDefinitionsTreeV2.runtime_idfallback warnings for malformed/legacyremote runtime metadata. API 30 also logs handled fresh-keystore recovery
exceptions before removing legacy aliases. The two exact-f897 API 34 logs each
contained nine handled Reown/WalletConnect entries. None terminated the process
or was a Room/database migration failure.
Hosted exact-head validation
readelfsanity.1324572aa1b65a87dd5bde7ad7d4de9dace94b9b2afd2a7e0d733ec8b4a9ac4e; all 522/522 manifest payload hashes, the 524-entry path set, CRCs, sidecar, portability/collision rules, and no-symlink/no-encryption constraints passed an independent audit.1 + 6, synthesis1 + 15, R8 policy4 + 19, and identity2 + 135.The predecessor
bcce813b6Android CI run completed 40 steps successfully and exposed one downstream policy mismatch: its valid non-minified debug AAB had no R8 metadata, while the old verifier required one. Runtime predecessor6d19fac38fixes that exact mismatch without weakening release, Play, or IAS verification. Exact headf897c23cbis its test/documentation-only child and adds the permanent R8 synthesis boundary suite and release meta-guards; it does not change runtime or production source files.All three exact-head hosted workflows are terminal and green. The migration
artifact and the local AAB/APK evidence were independently checked with no
P1/P2 finding. The PR intentionally remains draft and review-blocked; these
results do not authorize merge or distribution.
Distribution boundary
This pull-request validation is intentionally secretless and non-distributable. It proves graceful WalletConnect unavailability, not a successful live pairing. A trusted build with the exact 32-hex WalletConnect project ID may run only after review and merge to protected
develop, followed by a manual workflow dispatch.No Google Play or Internal App Sharing upload occurs from this PR, and no public Android testing link exists yet. Test/debug signing cannot upgrade a Play-installed wallet. Never uninstall a funded wallet to install a test build. Production/Open Testing still requires the authorized Google Play operator and production upload key.