Skip to content

fix: android consumer-rules - #145

Open
ovitrif wants to merge 14 commits into
masterfrom
fix/r8-keep-fieldorder
Open

fix: android consumer-rules#145
ovitrif wants to merge 14 commits into
masterfrom
fix/r8-keep-fieldorder

Conversation

@ovitrif

@ovitrif ovitrif commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Fixes #140

Follow-up to #139.

The Android AAR ships consumer keep rules for UniFFI/JNA so a minified app can resolve JNI names and lay out JNA structs.

Library publish packages proguard.txt in the AAR. Minified-app R8 belongs in the consuming app.

Description

  • Keeps com.sun.jna.* so libjnidispatch can resolve JNI names on Native, Structure, and CallbackReference.
  • Keeps classes that extend com.sun.jna.*, including com.sun.jna.ptr ByReference types used as UniFFI callback out-params.
  • Keeps com.sun.jna.Structure$FieldOrder and annotated com.synonym.bitkitcore struct classes, fields, and constructors.
  • Fails bundleReleaseAar when the AAR is missing a non-empty proguard.txt.
  • Fixes changelog by backfilling entries from releases.

Out of scope

  • Running R8 in this repo.

Preview

N/A — Android consumer keep rules only.

QA Notes

  • Validated by running a minified Bitkit devRelease on Pixel_10_Pro_XL (16KB) with this artifact served via mavenLocal: terms, skip intro, new wallet, home with savings and spending at ₿0. No JNI/JNA crash.
  • That build dropped the app keep for com.synonym.bitkitcore.** and the app-wide FieldOrder, Structure, and Callback keeps.
  • Release AAR contains a non-empty proguard.txt with those consumer keep rules.

Release

@ovitrif
ovitrif requested a review from ben-kaufman August 26, 2026 20:17
Comment thread bindings/android/lib/consumer-rules.pro
Comment thread bindings/android/lib/build.gradle.kts Outdated
Comment thread bindings/android/lib/build.gradle.kts Outdated
@ovitrif
ovitrif marked this pull request as draft August 26, 2026 20:39
@ovitrif
ovitrif requested a review from ben-kaufman August 26, 2026 20:50
@ovitrif ovitrif changed the title fix: keep JNA FieldOrder annotations under R8 fix: keep JNA JNI symbols in Android consumer rules Aug 26, 2026
@ovitrif ovitrif changed the title fix: keep JNA JNI symbols in Android consumer rules fix: android consumer-rules Aug 26, 2026
@ovitrif
ovitrif marked this pull request as ready for review August 26, 2026 21:42
Comment thread bindings/android/lib/consumer-rules.pro
@ovitrif
ovitrif requested a review from ben-kaufman August 26, 2026 22:04
@ovitrif ovitrif self-assigned this Aug 26, 2026
@ovitrif
ovitrif requested a review from coreyphillips August 27, 2026 11:33
@ovitrif

This comment was marked as resolved.

Comment thread bindings/android/gradle.properties Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md
@ovitrif
ovitrif force-pushed the fix/r8-keep-fieldorder branch from 303a066 to 844fa90 Compare August 27, 2026 17:43
@ovitrif
ovitrif changed the base branch from master to feat/watcher-receive-address August 27, 2026 17:43
Base automatically changed from feat/watcher-receive-address to master August 27, 2026 17:47
@ovitrif
ovitrif requested a review from ben-kaufman August 27, 2026 17:51
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.

add android r8 consumer keep rules

2 participants