signalapp / libsignal

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[question][feature request] Kotlin multiplatform support ?

SimpleApp opened this issue · comments

I'm currently investigating using Kotlin Multiplatform for a project that would require signal encryption. Is this platform supported / is there a way to have libsignal build for this platform (even if not officially supported) ?

Not very well, I'm afraid. The Java build is heavily dependent on JNI to integrate between Java and Rust, and while that's fine for use from Kotlin in a JVM environment, it won't help with any other platform.

Unofficially, your best bet to get something running would probably be to build the C library used for interoperating with Swift, and then invoke that using…uh, whatever Kotlin Multiplatform uses to talk to C libraries, I don't have experience there. However, we don't treat the interface of the C library as anything stable, so you'd have to be very careful pulling in new versions of the library.

Alternately, you can write your own wrapper around the Rust libsignal-protocol library, but that requires writing some Rust yourself.

Signal only officially supports the use of libsignal in its own apps, but if you choose to go down any of these paths feel free to ask questions on the unofficial community forums.