Repository navigation
Conversation
…t 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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #748.
Problem
On 32-bit ARM Android (
armeabi-v7a), loading the gl-sdk Kotlin bindings throwsUniFFI API checksum mismatchonce the app is AOT-compiled. That covers release builds installed from Google Play (cloud profiles / background dexopt). Debug builds and plainadb installs run interpreted and don't hit it.gobley 0.3.7 maps the FFI with JNA direct mapping and declares
u8/u16returns asByte/Short. Rust zero-extends them, and ART's compiled JNI stubs on 32-bit ARM don't re-extend small return values. So, for example,uniffi_glsdk_checksum_func_parse_inputreads as0x0000C023instead of-16349. This is gobley/gobley#252, the same bug uniffi fixed in mozilla/uniffi-rs#2740.Change
task build:kotlininstallsgobley-uniffi-bindgenfrom a pinned revision of https://github.com/angelix/gobley carrying the fix proposed upstream in gobley/gobley#297. That fix ports mozilla/uniffi-rs#2897 and #2935:u8/u16returns are read asIntand narrowed, and checksums are compared masked to 16 bits.target/gobleyand is invoked from there, so a crates.io 0.3.7 already installed on the runner isn't used instead.glsdk.hare unchanged.Testing
Android 7.1.1
armeabi-v7aemulator, gl-sdkv0.3.0built withcargo ndk -t armv7-linux-androideabi, bindings generated with the pinned gobley. The generated checksums match the publishedglsdk-android0.3.0 (49/49).com.blockstream.glsdk.IntegrityCheckingUniffiLibloaded viadalvikvm:--compiler-filter=speed)uniffiCheckApiChecksums (glsdk.android.kt:1182), the same frames as the production crashIn the full app (Blockstream Green on the same emulator, AOT-compiled with
speed), built against theseglsdk-androidand LWK bindings, the wallet logs in and the app shows no "Lightning unavailable" alert, which it raises when glsdk fails to initialize. The stock build crashes at login.