Skip to content

Commit

Permalink
Update libsignal-service
Browse files Browse the repository at this point in the history
  • Loading branch information
AsamK committed May 9, 2024
1 parent fb81bf1 commit 8f756cd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
5 changes: 4 additions & 1 deletion graalvm-config-dir/jni-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"name":"java.lang.Class",
"methods":[{"name":"getCanonicalName","parameterTypes":[] }]
"methods":[{"name":"getCanonicalName","parameterTypes":[] }, {"name":"getClassLoader","parameterTypes":[] }]
},
{
"name":"java.lang.ClassLoader",
Expand Down Expand Up @@ -62,6 +62,9 @@
"name":"java.util.UUID",
"methods":[{"name":"<init>","parameterTypes":["long","long"] }, {"name":"getLeastSignificantBits","parameterTypes":[] }, {"name":"getMostSignificantBits","parameterTypes":[] }]
},
{
"name":"jdk.internal.loader.ClassLoaders$AppClassLoader"
},
{
"name":"jdk.internal.loader.ClassLoaders$PlatformClassLoader"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.whispersystems.signalservice.api.util.UptimeSleepTimer;
import org.whispersystems.signalservice.api.websocket.WebSocketFactory;
import org.whispersystems.signalservice.internal.push.PushServiceSocket;
import org.whispersystems.signalservice.internal.websocket.LibSignalNetwork;
import org.whispersystems.signalservice.internal.websocket.OkHttpWebSocketConnection;
import org.whispersystems.signalservice.internal.websocket.WebSocketConnection;

import java.util.List;
Expand All @@ -49,7 +51,7 @@ public class SignalDependencies {
private ClientZkOperations clientZkOperations;

private PushServiceSocket pushServiceSocket;
private Network libSignalNetwork;
private LibSignalNetwork libSignalNetwork;
private SignalWebSocket signalWebSocket;
private SignalServiceMessageReceiver messageReceiver;
private SignalServiceMessageSender messageSender;
Expand Down Expand Up @@ -106,9 +108,10 @@ public PushServiceSocket getPushServiceSocket() {
ServiceConfig.AUTOMATIC_NETWORK_RETRY));
}

public Network getLibSignalNetwork() {
public LibSignalNetwork getLibSignalNetwork() {
return getOrCreate(() -> libSignalNetwork,
() -> libSignalNetwork = new Network(serviceEnvironmentConfig.netEnvironment()));
() -> libSignalNetwork = new LibSignalNetwork(new Network(serviceEnvironmentConfig.netEnvironment(),
userAgent), serviceEnvironmentConfig.signalServiceConfiguration()));
}

public SignalServiceAccountManager getAccountManager() {
Expand Down Expand Up @@ -159,7 +162,7 @@ public SignalWebSocket getSignalWebSocket() {
final var webSocketFactory = new WebSocketFactory() {
@Override
public WebSocketConnection createWebSocket() {
return new WebSocketConnection("normal",
return new OkHttpWebSocketConnection("normal",
serviceEnvironmentConfig.signalServiceConfiguration(),
Optional.of(credentialsProvider),
userAgent,
Expand All @@ -169,7 +172,7 @@ public WebSocketConnection createWebSocket() {

@Override
public WebSocketConnection createUnidentifiedWebSocket() {
return new WebSocketConnection("unidentified",
return new OkHttpWebSocketConnection("unidentified",
serviceEnvironmentConfig.signalServiceConfiguration(),
Optional.empty(),
userAgent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.whispersystems.signalservice.api.util.SleepTimer;
import org.whispersystems.signalservice.api.websocket.HealthMonitor;
import org.whispersystems.signalservice.api.websocket.WebSocketConnectionState;
import org.whispersystems.signalservice.internal.websocket.WebSocketConnection;
import org.whispersystems.signalservice.internal.websocket.OkHttpWebSocketConnection;

import java.util.Arrays;
import java.util.concurrent.TimeUnit;
Expand All @@ -25,7 +25,7 @@ final class SignalWebSocketHealthMonitor implements HealthMonitor {

private static final Logger logger = LoggerFactory.getLogger(SignalWebSocketHealthMonitor.class);

private static final long KEEP_ALIVE_SEND_CADENCE = TimeUnit.SECONDS.toMillis(WebSocketConnection.KEEPALIVE_FREQUENCY_SECONDS);
private static final long KEEP_ALIVE_SEND_CADENCE = TimeUnit.SECONDS.toMillis(OkHttpWebSocketConnection.KEEPALIVE_FREQUENCY_SECONDS);
private static final long MAX_TIME_SINCE_SUCCESSFUL_KEEP_ALIVE = KEEP_ALIVE_SEND_CADENCE * 3;

private SignalWebSocket signalWebSocket;
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencyResolutionManagement {
library("slf4j.jul", "org.slf4j", "jul-to-slf4j").versionRef("slf4j")
library("logback", "ch.qos.logback", "logback-classic").version("1.5.6")

library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_101")
library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_102")
library("sqlite", "org.xerial", "sqlite-jdbc").version("3.45.3.0")
library("hikari", "com.zaxxer", "HikariCP").version("5.1.0")
library("junit.jupiter", "org.junit.jupiter", "junit-jupiter").version("5.10.2")
Expand Down

0 comments on commit 8f756cd

Please sign in to comment.