Skip to content

[Draft] Update libsignal (unofficial_90)

Finn requested to merge libsignal-service-java-unofficial-90 into main

This is going to be a beast. Not building at time of writing.

  • Upstream changes drop support for java < 17, so after merging this signald will also drop support for java < 17
  • For an idea of what this will ultimately include, check the library diff

Open questions:

  • What happened to Base64UrlSafe? It looks like it was used to encode/decode group links, and it disappeared without an apparent replacement. If i can't find an answer here I'm going to just use normal Base64 for now. - signal-cli just uses Base64 for group link encoding and decoding.
  • what is core-util-jvm? Looks like a new package that the library's author (AsamK) created, but I haven't fully figured it out. I'm building it in CI with the library, and had to set it as a dependency of signald to get a bunch of imports to work.
  • what is Kyber? it seems like signald will need to track a variety of keys and possibly other values for it. a friend drew my attention to the recent Signal blog post about Quantum Resistance that mentions CRYSTALS-Kyber as the "key encapsulation mechanism" so that's probably what this is.
  • What happen to ProfileKeyCredential? ExpiringProfileKeyCredential still exists, maybe all profile keys are ephemeral now?
  • what is a reporting token? It's a new property of SignalServiceEnvelope that I'm setting to null for now
  • How does contact discovery work now? accountManager.getRegisteredUsers() doesn't exist anymore
  • What happened to SKDMs? messageSender.processSenderKeyDistributionMessage() doesn't exist anymore. (sendSenderKeyDistributionMessage() does exist though so this is probably just a rename or move)

Known outstanding tasks:

  • find a darwin runner (something is in the works)
  • build sql migration for new group credential type (status: sqlite done)
  • figure out account creation (status: linking works, registration works up to the point of issuing the SMS code)
  • support for edit messages (status: receive support added, send tracked in #380)
  • support for "bodyranges" which seems to be what they call text formatting (status: receive support added, send tracked in #381)
  • verify that group invite links are generated correctly (unclear if I broke detection of when they need to be generated)
  • Rewrite incoming message code (api changed)
  • update calls to sendGroupDataMessage (two new arguments - edit message and partial listener, both of which can be null)
  • Update all UnidentifiedAccess construction to include new isForStory boolean (hard coded to false, Signal Android does this too)
  • Fix contact discovery
  • Add database support for Kyber keys (status: sqlite done)
  • Fix incoming message handling (misc key change stuff that i think requires handling differently)
  • Fix sessions not existing

This list covers most of the currently outstanding compile errors. It may grow once I'm able to get the whole thing built and test it out. Some of these, especially the new protocol features, will probably not be added in this MR but need to be broken into issues when it merges.

Edited by Finn

Merge request reports