0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +02:00
Commit Graph

20 Commits

Author SHA1 Message Date
Jordan Rose
44261bb623 Use the 64-bit curve25519-dalek backend even on 32-bit Android 2023-11-01 10:11:30 -07:00
Jordan Rose
e8c82fe4b7 build_jni.sh: Allow building just one Android slice at a time 2023-10-04 16:02:45 -07:00
Jordan Rose
3810154436 Automate the Android and Server publishing to Sonatype 2023-08-25 12:33:56 -07:00
Jordan Rose
9aad792fc6
Update all the RustCrypto crates 2023-08-25 11:28:49 -07:00
moiseev-signal
716e683324
Update dependencies following curve25519-dalek 4.0.0 release
Co-authored-by: Jordan Rose <jrose@signal.org>
2023-08-09 15:04:41 -07:00
Rolfe Schmidt
ff09619432 Add Kyber KEM and implement PQXDH protocol
Co-authored-by: Jordan Rose <jrose@signal.org>
Co-authored-by: Max Moiseev <moiseev@signal.org>
2023-05-09 16:44:40 -07:00
Jordan Rose
5b3d8bb731 Remove Android 19 support 2023-01-26 12:59:06 -08:00
Jordan Rose
bce62c7bfd Android: Build on platforms other than Linux
Right now the Android SDK never contains more than one prebuilt
toolchain, so we can glob to find the one that's installed.
2022-12-05 10:02:54 -08:00
Jordan Rose
f456227f17 Java: drop cargo-ndk for building for Android
We can provide the necessary information in environment variables and
save a host dependency.
2022-07-25 17:11:36 -07:00
Jordan Rose
d404b3cec5 Build boring-sys with OPENSSL_SMALL for both iOS and Android
This trades speed for size around certain elliptic curve operations in
BoringSSL. We're using boring mostly for verifying certificates, not
the many many curve operations we do on a per-message basis, so for
now the code size is more important.
2022-06-17 11:28:10 -07:00
Jordan Rose
7931bf0812 java: Build a separate libsignal-server artifact
Reorganize the Gradle build with three targets:

- signal-client-java (client/)
- signal-client-android (android/)
- libsignal-server (server/)

plus an additional shared/ directory for sources shared between
client/ and server/.

This maintains the distinction between signal-client-java (the Java
parts, plus a Linux libsignal_jni.so for running tests outside of the
Android emulator) and signal-client-android (contains the Android JNI
libraries, plus any Android-specific code, which for now is just
AndroidSignalProtocolLogger, which the app doesn't even use).

The new libsignal-server is built very similarly to
signal-client-java, but only contains the Java sources relevant for
the server...plus the base org.whispersystems.libsignal classes from
the original libsignal-protocol-java, because some of them are
referenced directly in our generated Native.java. (We can improve on
this in the future.) The "testable" artifact that includes macOS and
Windows versions of libsignal_jni.so is now only built for
libsignal-server, not signal-client-java; our Android development
happens on Linux, but server development happens on multiple
platforms.

Tests were recently reorganized into a top-level tests/ directory, but
now there's been another reorganization:

- client/src/test/ - tests to run on any clients
- android/src/androidTest/ - tests to run only on Android devices /
  emulators (currently none)
- server/src/test/ - tests to run specifically for the server
  (currently none)
- shared/test/ - does not exist to avoid running the same tests twice

There are no tests to run "only not on Android devices", and it's
currently assumed that all server functionality is tested by the
client tests. The Android device tests run all the client tests as
well (by direct path reference). This may not be the "best" Gradle
layout, but it's at least straightforward to read the Gradle files.

For now there's still only one native library built for both
signal-client-java and libsignal-server, but that could change in the
future.
2022-03-10 09:14:55 -08:00
Jordan Rose
a00cfd1e90 GitHub: When a release is tagged, build and publish JNI artifacts
This will be used to build a "testable" signal-client-java.jar that
includes native libraries for macOS and Windows in addition to Linux.
This is something zkgroup already has; in particular it allows
developers working on the server to use the zkgroup APIs even if they
run macOS or Windows on their individual machines.
2021-11-01 12:53:56 -07:00
Jordan Rose
0bc74b32e2 Java: optimize for size over speed
This knocks about 10% off of the built binary for Android (per slice),
to balance out the increased size from the new toolchain and stdlib.
Applying the same `opt-level=s` option for `cargo bench` (on desktop)
gives a roughly 1% slowdown, a trade-off that's worth it.
2021-10-06 12:29:50 -07:00
Jordan Rose
eab0e57640 Java: don't eagerly strip libsignal_client.so; let gradle do it for us
This is a step towards saving the debug info somewhere for the builds
we actually ship.
2021-08-30 12:33:18 -07:00
Jordan Rose
0e19342801 Build libsignal_jni.so with LTO when using it from Java
When building a cdylib, Rust currently doesn't export public symbols
on Linux if they come from a dependency. However, enabling LTO gets
around this by performing the filtering step after the merging.

https://github.com/rust-lang/rfcs/issues/2771
2020-12-10 11:29:42 -08:00
Jordan Rose
d05089e6e8 Java: get local tests working on Mac as well 2020-12-08 17:24:03 -08:00
Jordan Rose
725ded881b Java: Generate debug symbols for the native Rust library 2020-12-04 11:35:03 -08:00
Jack Lloyd
dd57254f8f Move makefile and docker file into java subdir 2020-11-06 16:40:54 -05:00
Jack Lloyd
cc201de173 Add Docker based build for Java .jars 2020-11-05 17:59:09 -05:00
Jack Lloyd
d5fd5ddf76 Use a script instead of make for building the JNI native libraries 2020-11-05 17:59:09 -05:00