Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
target/
__pycache__/
*.pyc
bindings/android/native-debug-symbols.zip
# The xcframework's static libraries exceed GitHub's 100 MB file limit. They are
# already shipped, compressed, inside BitkitCore.xcframework.zip, which is what
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- The Android AAR now ships targeted R8 consumer keep rules for the UniFFI/JNA FFI surface, so consuming apps can enable R8 full mode without extra keep rules for this library.
- Add a generic hardware-wallet catalog with Foundation Passport support, multipart UR QR encoding and decoding, Passport single-signature account export parsing, and signed PSBT finalization across the UniFFI bindings.
- Swap status updates now reconcile against Boltz's REST status whenever a swap is (re)subscribed, both on `boltz_start_swap_updates` and when `boltz_create_reverse_swap` adds a swap to a running stream. A confirmed reverse-swap lockup is therefore caught up and auto-claimed even when its live WebSocket event was missed (for example because the updates stream was down while the lockup confirmed), instead of the swap silently stalling until a manual claim. No FFI signature change.
- `onchain_broadcast_raw_tx` now returns the transaction's canonical txid, computed locally in Rust, and treats Electrum "already known / already in mempool / already in block chain" responses as success (returning that same txid). This lets native apps complete Blocktank funding bookkeeping when they retry a broadcast after an ambiguous network failure, without relying on a signer-provided txid. Genuine connectivity failures and unrelated broadcast rejections remain typed `BroadcastError`s, and there is no FFI signature change.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bitkitcore"
version = "0.5.8"
version = "0.5.9"
edition = "2021"

[lib]
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import PackageDescription

let tag = "v0.5.8"
let checksum = "a29cedc9c42c8af43d1f158595d71a672102568d08da631ab6b12779ecee28e3"
let tag = "v0.5.9"
let checksum = "31a298c85a783224d4b4050746c283b57e321585c979368f20bb3d5757f8ea04"
let url = "https://github.com/synonymdev/bitkit-core/releases/download/\(tag)/BitkitCore.xcframework.zip"

let package = Package(
Expand Down
2 changes: 1 addition & 1 deletion bindings/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
group=com.synonym
version=0.5.8
version=0.5.9
46 changes: 45 additions & 1 deletion bindings/android/lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import java.io.ByteArrayOutputStream
import java.io.File
import java.util.zip.ZipFile

plugins {
id("com.android.library")
Expand Down Expand Up @@ -158,8 +159,51 @@ val validateReleaseNativeLibraries by tasks.registering {
}
}

val validateConsumerKeepRules by tasks.registering {
group = "verification"
description = "Validates Android consumer keep rules exist for R8."

val consumerRules = layout.projectDirectory.file("consumer-rules.pro")
inputs.file(consumerRules)

doLast {
val file = consumerRules.asFile
if (!file.isFile || file.readText().isBlank()) {
throw GradleException("Android consumer keep rules missing at '${file.path}'")
}
}
}

tasks.matching { it.name == "bundleReleaseAar" || it.name.startsWith("publish") }.configureEach {
dependsOn(validateReleaseNativeLibraries)
dependsOn(validateReleaseNativeLibraries, validateConsumerKeepRules)
}

tasks.matching { it.name == "bundleReleaseAar" }.configureEach {
doLast {
val aars = layout.buildDirectory.dir("outputs/aar").get().asFile
.listFiles()
?.filter { it.isFile && it.name.endsWith(".aar") && it.name.contains("release") }
.orEmpty()

if (aars.isEmpty()) {
throw GradleException("Release AAR missing after bundleReleaseAar")
}

aars.forEach { aar ->
ZipFile(aar).use { zip ->
val entry = zip.getEntry("proguard.txt")
?: throw GradleException(
"Release AAR is missing consumer keep rules (proguard.txt): '${aar.path}'"
)
val text = zip.getInputStream(entry).bufferedReader().readText()
if (text.isBlank()) {
throw GradleException(
"Release AAR consumer keep rules are empty: '${aar.path}'"
)
}
}
}
}
}

afterEvaluate {
Expand Down
31 changes: 31 additions & 0 deletions bindings/android/lib/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Consumer keep rules for bitkit-core Android bindings.
# Packaged into the AAR and applied automatically when a consuming app enables R8.

# JNA reads @Structure.FieldOrder and public fields by name, and constructs
# Structure, Structure$ByValue, and Structure$ByReference types reflectively.
-keepclassmembers class com.synonym.bitkitcore.** extends com.sun.jna.Structure {
<fields>;
<init>(...);
}

# JNA looks up Callback methods by name when building native function pointers.
-keepclassmembers class com.synonym.bitkitcore.** implements com.sun.jna.Callback {
<methods>;
}

# Native.register maps remaining native methods by exact C symbol name.
-keepclasseswithmembers,allowshrinking,includedescriptorclasses class com.synonym.bitkitcore.UniffiLib {
native <methods>;
}
-keepclasseswithmembers,allowshrinking,includedescriptorclasses class com.synonym.bitkitcore.IntegrityCheckingUniffiLib {
native <methods>;
}

# @Structure.FieldOrder is read at runtime.
-keepattributes RuntimeVisibleAnnotations
Comment thread
ovitrif marked this conversation as resolved.

# JNA's AAR references desktop AWT types that are absent on Android.
-dontwarn java.awt.Component
-dontwarn java.awt.GraphicsEnvironment
-dontwarn java.awt.HeadlessException
-dontwarn java.awt.Window
Loading