From e88726e9e531d37766e830d0f9c1c92a421ba4e9 Mon Sep 17 00:00:00 2001 From: Angelos Veglektsis Date: Fri, 9 Oct 2026 19:45:08 +0300 Subject: [PATCH] gl-sdk: generate Kotlin bindings with a gobley build that fixes 32-bit ARM gobley 0.3.7 declares u8/u16 FFI returns as Byte/Short with JNA direct mapping. Rust zero-extends them and ART's compiled JNI stubs on 32-bit ARM don't re-extend small return values, so once an app is AOT-compiled the checksum check fails with "UniFFI API checksum mismatch" on armeabi-v7a devices (gobley/gobley#252). Install gobley-uniffi-bindgen from a pinned revision carrying the fix proposed in gobley/gobley#297, into target/gobley so a crates.io copy already installed isn't used instead. --- build/.tasks.yml | 10 ++++++++-- libs/gl-sdk/CHANGELOG.md | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build/.tasks.yml b/build/.tasks.yml index e272fb03c..957941323 100644 --- a/build/.tasks.yml +++ b/build/.tasks.yml @@ -18,9 +18,15 @@ tasks: vars: OS_NAME: sh: uname | tr '[:upper:]' '[:lower:]' + # gobley 0.3.7 misreads u8/u16 return values on 32-bit ARM Android, which fails the UniFFI + # checksum check once the app is AOT-compiled (https://github.com/gobley/gobley/issues/252). + # This revision carries the fix proposed upstream in https://github.com/gobley/gobley/pull/297. + GOBLEY_GIT: https://github.com/angelix/gobley + GOBLEY_REV: 40cef27c59829ca97a71945928028f9ab4880305 + GOBLEY_ROOT: target/gobley cmds: - - cargo install --bin gobley-uniffi-bindgen gobley-uniffi-bindgen@0.3.7 - - gobley-uniffi-bindgen --config ./libs/gl-sdk/uniffi.kotlin-multiplatform.toml --library ./target/aarch64-linux-android/debug/libglsdk.a --out-dir target/release/kotlin-multiplatform + - cargo install --locked --git {{.GOBLEY_GIT}} --rev {{.GOBLEY_REV}} --root {{.GOBLEY_ROOT}} --bin gobley-uniffi-bindgen gobley-uniffi-bindgen + - "{{.GOBLEY_ROOT}}/bin/gobley-uniffi-bindgen --config ./libs/gl-sdk/uniffi.kotlin-multiplatform.toml --library ./target/aarch64-linux-android/debug/libglsdk.a --out-dir target/release/kotlin-multiplatform" - cp -a ./target/release/kotlin-multiplatform/* libs/gl-sdk-android/lib/src/ - mkdir -p libs/gl-sdk-android/lib/src/lib/ios-arm64 - mkdir -p libs/gl-sdk-android/lib/src/lib/ios-simulator-arm64 diff --git a/libs/gl-sdk/CHANGELOG.md b/libs/gl-sdk/CHANGELOG.md index 27a9ee84d..4e6d3e589 100644 --- a/libs/gl-sdk/CHANGELOG.md +++ b/libs/gl-sdk/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased +### Fixed + +- Kotlin: `UniFFI API checksum mismatch` on 32-bit ARM Android once the app is AOT-compiled. The bindings are generated with a gobley build that reads `u8`/`u16` return values correctly ([gobley#252](https://github.com/gobley/gobley/issues/252)). + ### Added - `Scheduler.lightning_available(node_id)` — asks whether the Lightning account backed by `node_id` may be surfaced to the user. Intended as a feature gate for applications that offer Lightning alongside other account types. Callable before `register()` and without credentials, since the decision has to be made before a node exists. The answer is monotonic: once the node is registered it is reported as available and stays that way, whatever the node's status or the provider's capacity. Before registration the answer is advisory; treat an error as "unknown" rather than as a negative answer. Greenlight currently reports every unregistered account as unavailable while the backing Lightning Service Provider integration is being built.