Skip to content

build: clean up R8 keep rules and fix onramp error reporting#732

Merged
bmc08gt merged 5 commits into
code/cashfrom
chore/r8-rules-cleanup
May 19, 2026
Merged

build: clean up R8 keep rules and fix onramp error reporting#732
bmc08gt merged 5 commits into
code/cashfrom
chore/r8-rules-cleanup

Conversation

@bmc08gt
Copy link
Copy Markdown
Collaborator

@bmc08gt bmc08gt commented May 19, 2026

Summary

  • Remove overly broad R8 keep rules (com.flipcash.services.**, com.getcode.opencode.**, com.google.protobuf.**, org.json.**) that are redundant with hierarchy-based rules and library consumer rules, enabling R8 to shrink and optimize more of the codebase
  • Tighten JNA keep with allowoptimization, delete unused ed25519 proguard template, enable strict full mode
  • Widen exception keep from java.lang.Exception to java.lang.Throwable so CodeServerError and CoinbaseOnRampWebError subclasses appear with real names in Bugsnag instead of obfuscated (ek0)
  • Pass error data as the Throwable message so Bugsnag displays the JSON error body
  • Add AssetNotTradableInRegion error type for ERROR_CODE_ASSET_NOT_TRADABLE with region mismatch UI alert

bmc08gt added 3 commits May 19, 2026 10:53
Remove overly broad keep rules that prevent R8 from shrinking and
optimizing large portions of the codebase:

- Remove blanket keeps on com.flipcash.services.** and
  com.getcode.opencode.** (covered by hierarchy-based gRPC/Protobuf
  rules and kotlinx-serialization consumer rules)
- Remove -keep class com.google.protobuf.** (Protobuf ships its own
  consumer rules; GeneratedMessageLite hierarchy rules remain)
- Remove rules redundant with proguard-android-optimize.txt (native
  methods, R$* fields, SourceFile/LineNumberTable attributes)
- Remove no-op org.json.** keeps (framework class, not in APK)
- Remove -verbose and dead commented-out line
- Tighten JNA keep with allowoptimization in consumer-rules.pro
- Delete unused ed25519 proguard-rules.pro template
- Remove android.r8.strictFullModeForKeepRules=false to enable strict
  full mode (default)
- Widen exception keep from java.lang.Exception to java.lang.Throwable
  to cover CodeServerError and CoinbaseOnRampWebError subclasses
…egion error

Pass data string as the Throwable message so Bugsnag displays the
error body (JSON with errorCode and errorMessage) instead of blank.

Also add AssetNotTradableInRegion error type for
ERROR_CODE_ASSET_NOT_TRADABLE from the Coinbase onramp SDK.
Display the existing region mismatch error dialog when the Coinbase
onramp returns ERROR_CODE_ASSET_NOT_TRADABLE.
@github-actions github-actions Bot added area: crypto Solana, keys, encryption, signing area: network gRPC, connectivity, API, exchange rates area: onramp Deposit, purchase, Coinbase, fiat on-ramp area: build-system Gradle, convention plugins, build-logic labels May 19, 2026
@bmc08gt bmc08gt changed the title Clean up R8 keep rules and fix onramp error reporting build: clean up R8 keep rules and fix onramp error reporting May 19, 2026
androidx.biometric:biometric:1.4.0-alpha07 requires compileSdk 36.1+.
Align library modules with the app module which already uses 37.
@github-actions github-actions Bot added the type: build Build system, Gradle, dependencies label May 19, 2026
Replace Android.kt (buildSrc) with android-compileSdk, android-minSdk,
android-targetSdk, and android-java entries in libs.versions.toml.

This makes the values accessible from both build-logic convention
plugins and module build scripts, eliminating the duplicate hardcoded
values in AndroidLibraryConventionPlugin.
@bmc08gt bmc08gt merged commit f7ab26b into code/cash May 19, 2026
2 checks passed
@bmc08gt bmc08gt deleted the chore/r8-rules-cleanup branch May 19, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic area: crypto Solana, keys, encryption, signing area: network gRPC, connectivity, API, exchange rates area: onramp Deposit, purchase, Coinbase, fiat on-ramp type: build Build system, Gradle, dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant