]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/manager/ServiceConfig.java
Prepare build.gradle for kotlin migration
[signal-cli] / src / main / java / org / asamk / signal / manager / ServiceConfig.java
index 55935ced840266dbf0e159561561d9f9336889d6..c68e57731dfe90ba0a1a4bdfcc06baaa1b8a488a 100644 (file)
@@ -6,6 +6,8 @@ import org.whispersystems.libsignal.InvalidKeyException;
 import org.whispersystems.libsignal.ecc.Curve;
 import org.whispersystems.libsignal.ecc.ECPublicKey;
 import org.whispersystems.libsignal.util.guava.Optional;
+import org.whispersystems.signalservice.api.KeyBackupService;
+import org.whispersystems.signalservice.api.SignalServiceAccountManager;
 import org.whispersystems.signalservice.api.account.AccountAttributes;
 import org.whispersystems.signalservice.api.push.TrustStore;
 import org.whispersystems.signalservice.internal.configuration.SignalCdnUrl;
@@ -34,8 +36,9 @@ public class ServiceConfig {
     final static int PREKEY_MINIMUM_COUNT = 20;
     final static int PREKEY_BATCH_SIZE = 100;
     final static int MAX_ATTACHMENT_SIZE = 150 * 1024 * 1024;
-    final static int MAX_ENVELOPE_SIZE = 0;
+    final static long MAX_ENVELOPE_SIZE = 0;
     final static long AVATAR_DOWNLOAD_FAILSAFE_MAX_SIZE = 10 * 1024 * 1024;
+    final static boolean AUTOMATIC_NETWORK_RETRY = true;
 
     final static String CDS_MRENCLAVE = "c98e00a4e3ff977a56afefe7362a27e4961e4f19e211febfbb19b897e6b80b15";
 
@@ -109,6 +112,16 @@ public class ServiceConfig {
         }
     }
 
+    static KeyBackupService createKeyBackupService(SignalServiceAccountManager accountManager) {
+        KeyStore keyStore = ServiceConfig.getIasKeyStore();
+
+        return accountManager.getKeyBackupService(keyStore,
+                ServiceConfig.KEY_BACKUP_ENCLAVE_NAME,
+                ServiceConfig.KEY_BACKUP_SERVICE_ID,
+                ServiceConfig.KEY_BACKUP_MRENCLAVE,
+                10);
+    }
+
     static ECPublicKey getUnidentifiedSenderTrustRoot() {
         try {
             return Curve.decodePoint(UNIDENTIFIED_SENDER_TRUST_ROOT, 0);