org.whispersystems.signalservice.internal.configuration.SignalContactDiscoveryUrl Java Examples

The following examples show how to use org.whispersystems.signalservice.internal.configuration.SignalContactDiscoveryUrl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ServiceConfig.java    From signal-cli with GNU General Public License v3.0 6 votes vote down vote up
public static SignalServiceConfiguration createDefaultServiceConfiguration(String userAgent) {
    final Interceptor userAgentInterceptor = chain ->
            chain.proceed(chain.request().newBuilder()
                    .header("User-Agent", userAgent)
                    .build());

    final List<Interceptor> interceptors = Collections.singletonList(userAgentInterceptor);

    final byte[] zkGroupServerPublicParams;
    try {
        zkGroupServerPublicParams = Base64.decode(zkGroupServerPublicParamsHex);
    } catch (IOException e) {
        throw new AssertionError(e);
    }

    return new SignalServiceConfiguration(
            new SignalServiceUrl[]{new SignalServiceUrl(URL, TRUST_STORE)},
            makeSignalCdnUrlMapFor(new SignalCdnUrl[]{new SignalCdnUrl(CDN_URL, TRUST_STORE)}, new SignalCdnUrl[]{new SignalCdnUrl(CDN2_URL, TRUST_STORE)}),
            new SignalContactDiscoveryUrl[0],
            new SignalKeyBackupServiceUrl[]{new SignalKeyBackupServiceUrl(SIGNAL_KEY_BACKUP_URL, TRUST_STORE)},
            new SignalStorageUrl[]{new SignalStorageUrl(STORAGE_URL, TRUST_STORE)},
            interceptors,
            dns,
            zkGroupServerPublicParams
    );
}