Previously we'd had jammy's 3.12, but that's missing some things we
use. Newer releases exist, but this is the one we've been using in
node/Dockerfile for a while, so if there's a problem we should update
both.
Adds support for callbacks with results to the JNI bridge, similar to
what f2eafbe6f8 did for the C bridge.
This does require introducing an "internal" version of PreKeyStore
that has simpler signatures for its callbacks; previously, the Java
objects for bridge_handle types were constructed on the Rust side of
the bridge, but that's not how bridge_fn works, and so it's not how
bridge_callbacks works. The additional overhead should not be
prohibitive.
When set, and when not using a transparent proxy, unauth chat
connections will be made over H2 instead of HTTP/1.1. Auth connections
will not be affected.
This required some changes to jni::ResultTypeInfo, because we no
longer have tokens available for the JNI types of a bridged function
to use with the jni_args! macro. Instead, we record signatures for
each type that might appear as a callback argument and use
const_str::concat to put them together.
This does not currently attempt to autogenerate the Java interface on
the other side of the bridge; given the way gen_java_decl builds on
top of cbindgen, this is likely tricky but not impossible. Something
to possibly add later.
This only applies to chat connections (including registration), and
for the time being is specifically looking for self-signed
certificates. Even though self-signed certificates can occur on any
network access, there should always be a chat connection early enough
in the app lifetime to identify the problem. (Other connections will
still log the error appropriately.)
If an incoming message notification comes in after the Java connection
object or listener has been GC'd, the ack handle would be leaked; now
it's properly cleaned up even on early exit.