Skip to content

fix(build): drop Conscrypt to clear the Play 16 KB page size warning - #1712

Merged
HashEngineering merged 1 commit into
feat/kotlin-sdk-phase-1from
fix/remove-conscrypt-16kb
Dec 1, 2026
Merged

HashEngineering merged 1 commit into
feat/kotlin-sdk-phase-1from
fix/remove-conscrypt-16kb

Conversation

@HashEngineering

@HashEngineering HashEngineering commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Play Console flagged 12.0.2 (versionCode 12000205): "Your app could crash on 16 KB devices", naming one library, base/lib/arm64-v8a/libconscrypt_jni.so, as compiled with an NDK older than r28.

Cause

org.conscrypt:conscrypt-android:2.5.3 ships a prebuilt libconscrypt_jni.so built with clang 9.0.8 (around NDK r21). It was added in #1348 to bring TLS 1.3 to Android 9 and lower. Since minSdk was raised to 29, the SDK_INT <= Q guard only matches Android 10, which already has TLS 1.3 in its platform provider, so Conscrypt no longer does anything useful.

Change

  • wallet/build.gradle: remove the conscrypt-android dependency (it was the only path; nothing pulls it in transitively in prodReleaseRuntimeClasspath).
  • WalletApplication.java: remove the Security.insertProviderAt(Conscrypt.newProvider(), 1) block and its imports.
  • wallet/proguard.cfg: remove the Conscrypt -keep rules. Keep -dontwarn org.conscrypt.** and OkHttp's specific -dontwarn lines, since OkHttp still refers to Conscrypt optionally.

Native libraries after the change (prod, arm64-v8a / x86_64)

All remaining libraries have 16 KB LOAD alignment (p_align 0x4000) and were built with NDK r25 or newer:

Library Built with
libdash_sdk_jni.so, libsdklib.so rustc 1.98.1 / clang 21 (NDK r29)
libdashjbls.so, libscrypt.so, libx11.so, libpthread.so clang 21 (NDK r29)
libandroidx.graphics.path.so, libdatastore_shared_counter.so clang 14 (NDK r25), AndroidX; not flagged

useLegacyPackaging is not set, so libs stay uncompressed and 16 KB zip-aligned (AGP 8.13, minSdk 29).

Testing

  • :wallet:compile_testNet3DebugJavaWithJavac passes; mergeProdDebugNativeLibs no longer contains libconscrypt_jni.so.
  • :wallet:test_testNet3DebugUnitTest: 4668 tests, 1 failure (SendCoinsTaskRunnerBIP70Test, a gift-card race test), which passes when run alone (known full-suite flakiness, unrelated to TLS).
  • Not run: an R8 release build, and a sync on an Android 10 device (worth a quick check that TLS works with the platform provider).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Changes
    • The app no longer bundles Conscrypt or explicitly selects it as the TLS provider on Android 9 and earlier. TLS connections on those versions may therefore use the platform’s default provider.

Play flagged lib/arm64-v8a/libconscrypt_jni.so as built with an NDK older
than r28 (conscrypt-android 2.5.3 ships a clang 9 / NDK r21-era binary).
Every other native library is built with NDK r25 or newer and all are
already 16 KB LOAD-aligned.

Conscrypt was added to bring TLS 1.3 to Android 9 and lower. minSdk is now
29, so it only ever ran on Android 10, which has TLS 1.3 in its platform
provider. Remove the dependency, the provider install in WalletApplication
and the -keep rules; keep -dontwarn org.conscrypt.** because OkHttp still
refers to it optionally.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The wallet module removes the Conscrypt dependency, the startup code that registered its security provider on Android Q and earlier, and the related ProGuard keep rules.

Changes: Conscrypt Removal

Layer / File(s) Summary
Remove Conscrypt dependency and provider registration
wallet/build.gradle, wallet/src/de/schildbach/wallet/WalletApplication.java, wallet/proguard.cfg
The wallet module removes the Conscrypt dependency and startup provider registration. The ProGuard keep rules are removed, while the warning-suppression rules remain.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: thepastaclaw

Merge Risk: Minimal · up to ef958

This removes an unneeded TLS provider library flagged by Play Console. Android 10 and later support TLS 1.3 natively, so no regression is expected. Merge-readiness risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: removing the Conscrypt dependency from the wallet module, which the PR does to clear the Play 16 KB page size warning. The raw summary confirms the dependency removal …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: removing the Conscrypt dependency from the wallet module, which the PR does to clear the Play 16 KB page size warning. The raw summary confirms the dependency removal in build.gradle, proguard.cfg, and WalletApplication.java, and the objectives describe the same goal. The conventional-commit prefix 'fix(build)' is a minor style point and does not affect relevance.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 83a56f7 and ef958b9.

Files selected for processing: 3

  • wallet/build.gradle
  • wallet/proguard.cfg
  • wallet/src/de/schildbach/wallet/WalletApplication.java
Files with no reviewable changes: 2

  • wallet/build.gradle
  • wallet/src/de/schildbach/wallet/WalletApplication.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@thepastaclaw

thepastaclaw commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit ef958b9) · triage: low

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 1 + Phase 2

The Conscrypt removal is correct and limited to the dependency, provider initialization, and obsolete keep rules. The wallet minimum SDK is API 29, where the platform provider supplies TLS 1.3; retained dontwarn rules cover OkHttp's optional Conscrypt references, and CI reports successful check and build jobs for this exact head.

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.2-sol (effort low) — This is a small, well-contained build and application-initialization change that removes an obsolete TLS provider and associated rules, with no direct changes to cryptography, funds movement, or core wallet logic.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 93% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.2-sol — security-auditor (completed, effort medium); agent phase2-reviewer

@HashEngineering

Copy link
Copy Markdown
Collaborator Author

QA ✅ PASS — run 50, build 12000301 (12.0.3-qa01)

Including the case the bundled Conscrypt actually existed for. Commit under test: ef958b96.

The cost, measured rather than estimated

A second APK was built from the base commit alone — 12000210, the same tree without the ten PRs — purely so this could be a measurement:

unsigned size
base (Conscrypt bundled) 333,463,324 B
this build (Conscrypt removed) 328,500,845 B
difference 4,962,479 B

TLS paths confirmed

Three independent paths, on API 36 devices:

  1. Exchange rates — USD conversions render on every device.
  2. Explore → Where to Spend — the live CTX/DashSpend merchant list loads with discount rates (Apple ~1%, Domino's ~2%).
  3. Dash DEX (Maya) → Sell Dash → Select coin — live coin list with live prices (BTC $62,263.36, ADA $0.15, ETH …).

The case that matters: API 29, the app's minSdk floor

A Pixel_4_API_29 AVD was booted (ro.build.version.sdk=29) and this APK installed on it. The app launches normally — no reinstall screen, so the native libraries load at the floor — and a new wallet was created on it. At 20:00:09:

I/ExchangeRatesRepository: exchange rates updated successfully with DashRetailClient

A real in-app HTTPS fetch succeeded at minSdk, with zero SSLHandshakeException, SSLException, CertPathValidatorException or CLEARTEXT errors anywhere in the capture.

The 211 Conscrypt matches in that log are Android's own platform provider — Conscrypt has been the platform TLS provider since Android 10 / API 29 — which is precisely why deleting the bundled copy is safe at this floor. Demonstrated rather than assumed.

Not covered

Coinbase, Uphold and DashConnect. All three need linked-account credentials this environment does not hold. They are the three TLS paths this PR is not proven on, and they are the ones with the least common client stacks — worth someone with accounts running once before this merges.

Build provenance

Build: qa/integration-12.0.3 @ 883e49e4 = feat/kotlin-sdk-phase-1 @ 83a56f72 — the v12.0.2 tag, the commit that shipped to Google Play — plus ten PRs merged in this order: #1686 #1712 #1719 #1548 #1694 #1697 #1713 #1721 #1717 #1718. All ten merged clean. No branch was rebased or updated, by request, so this is each PR as its author left it. The order was settled by trial-merging rather than by GitHub's mergeable flag.

The SDK pin does not move — int36, the same pin 12.0.2 shipped with, and checked rather than assumed: libdash_sdk_jni.so was unpacked from this APK and from the shipped 12.0.2 and compared byte for byte (60,350,088 B, sha256 950faef8a1a6fe2d…, identical). Everything reported above is therefore an app change, not an engine one.

APK: versionCode 12000301, 328,718,680 B, sha256 f5684c4e4ec8f80a5642d2cb2074e17970d1156f7af6034b3b3409e87c2a8ce7, project release key. _testNet3 only — no mainnet or prod arm was built, by request.

Run: QA run 50, testnet, 2026-11-19. Five Android 16 devices plus one at API 29. Unit tests on the merged tree: 5,007 passing, 0 failures.

@HashEngineering

Copy link
Copy Markdown
Collaborator Author

QA run 52 — carried forward unchanged, plus upgrade and unit-test coverage

This PR is in builds 12000303 and 12000304 at commit ef958b96f — byte-identical to the commit run 50 tested, which I verified rather than assumed. Its run 50 results therefore stand as they are, and run 52 did not re-run them.

What run 52 adds for this PR specifically:

  • Three in-place upgrades (12000302 → 12000303 → 12000304) with this PR present: balances, unspent and total outputs, shielded notes, identities and contact requests byte-identical before and after each one.
  • Unit tests on 12000304: 4,779 tests across 330 classes, 0 failures, 0 errors, 1 skipped. 12000303 never had them run; that gap is now closed.
  • No crash, ANR, fatal exception or low-memory kill on any device across the run.

No new finding against this PR.

How this was tested

Builds. 12000303 = feat/kotlin-sdk-phase-1 @ 83a56f723 (the v12.0.2 tag) + Kotlin SDK int42 + dashj-platform 5.1.0-dev.3-20261123.212721-1, with #1686, #1712, #1719, #1548, #1694, #1697, #1713, #1721, #1717, #1718 and #1730 merged at their then-current heads.
12000304 = the same, plus #1736, and with #1725/#1721/#1718/#1714 taken from qa/spv-restart-with-1721-1718 @ 9244f3324 instead of merged separately. APK sha256 96422c3acd8dab7939ab12402d407a5500326f454564aae5b877e6c9e7e2c253.

Devices. Android 16 (API 36) emulators, testnet, release-signed builds. Platform protocol 14.

Unit tests on 12000304: 4,779 tests across 330 classes, 0 failures, 0 errors, 1 skipped.

Both SDK native libraries are byte-identical in size across the two builds, so differences between them come from the PRs and not from the SDK underneath.

Full report: https://github.com/HashEngineering/dash-wallet-qa-report — run 52.

@HashEngineering

Copy link
Copy Markdown
Collaborator Author

QA run 56 — Conscrypt is gone; one observation alongside it

Verified

Conscrypt is absent from the APK: 0 entries matching conscrypt in the release build. The diff is exactly the three places it lived — the dependency line, the ProGuard keep rules, and the Security.insertProviderAt call in WalletApplication. Nothing else in the run touched TLS, and nothing TLS-related misbehaved across six device streams on testnet.

An observation, explicitly not a claim about Play

Running the repo's own check-alignment.sh against the 12000305 APK:

Found 4 unaligned 64-bit libs that need 16KB alignment.
  lib/arm64-v8a/libpthread.so    UNALIGNED (2**12)
  lib/arm64-v8a/libdashjbls.so   UNALIGNED (2**12)
  lib/x86_64/libpthread.so       UNALIGNED (2**12)
  lib/x86_64/libdashjbls.so      UNALIGNED (2**12)

The other 12 of 16 are 2**14. Raw readelf agrees: libdashjbls.so's three LOAD segments all carry Align 0x1000, against 0x4000 for libdash_sdk_jni.so. libpthread.so is a 3,936-byte stub.

I am not claiming this means the Play warning persists. I measured ELF segment alignment in the APK; I did not see what Play Console reports, and I'm told it never flagged these. If the warning you were clearing named Conscrypt specifically, this PR may well be the complete fix and the above is unrelated to it.

Recording it only because the two libraries come from the dashj BLS dependency rather than Conscrypt, so if a 16 KB page-size issue ever does surface, this PR isn't where to look — and a 16 KB-page device would be the thing that settles it either way.


QA run 56, 2026-11-30. Build 12000305 (12.0.3-qa05), branch qa/integration-12.0.3-qa05
off feat/kotlin-sdk-phase-1 @ 19ec4858dd — twelve PRs in ten merges, no conflicts.
Pins: Kotlin SDK 5.1.0-int43-20261126.183836-1, dashj-platform 5.1.0, dashj 24.0.0 — the
same pairing the shipped 12.0.3 builds use. APK sha256
76d464966bcad134c9e5360d8524ae5fb2850b46f6d9e23f83f9d0d08d56a2c3.
Unit tests 4,841 / 330 classes, 2 failures, both reproduced on the bare base.
Devices: Android 16 emulators, testnet at Platform protocol 15.

@HashEngineering HashEngineering self-assigned this Dec 1, 2026
@HashEngineering
HashEngineering merged commit 1405b2b into feat/kotlin-sdk-phase-1 Dec 1, 2026
4 checks passed
@HashEngineering

Copy link
Copy Markdown
Collaborator Author

Correction — the alignment observation above was an artefact of the QA build machine. Disregard it.

My earlier comment reported four 4 KB-aligned libraries in the 12000305 APK and said they came from the dashj BLS dependency. That attribution was wrong, and the libraries are not in any real build. Thanks to the reviewer who pushed back on it.

What actually happened: this QA machine has a local build of dashj-bls-android 1.0.1 sitting in ~/.m2 since March 2025, and the root build.gradle lists mavenLocal() first, so it won over Maven Central.

sha1 / md5 LOAD align
Central's dashj-bls-android-1.0.1.aar 00b6105abc541d36c285b7951973e0521b51ef89 16 KB
the copy in this machine's ~/.m2 9cc61e8f7a766ef46fae544234080fc065ce6bf2 4 KB
libdashjbls.so in my 12000305 APK md5 a3d177a03da90dd2fb1cb32d58e35a5f 4 KB
libdashjbls.so in the shipped 12.0.3 build md5 e5a5faaf89e55624f7e0eca58f412c19 16 KB (0x4000)

The shipped build's library is the published one and is correctly aligned. The pin org.dashj.android:dashj-bls-android:1.0.1 hasn't changed since #574 and resolves to a 16 KB-aligned artifact for anyone who doesn't have that stale local copy.

So there is nothing here for this PR to fix, and nothing for Play to complain about. The Conscrypt removal result in my earlier comment stands unchanged: 0 conscrypt entries in the APK, no TLS trouble across six device streams.

The real finding is about the QA environment, not the code — builds from this machine have been silently using a two-year-old local BLS library — and it's being cleaned up on our side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants