what-the-bank/sources/okhttp3/OkHttpClient.java

1152 lines
44 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package okhttp3;
import com.huawei.hms.android.HwBuildEx;
import java.net.Proxy;
import java.net.ProxySelector;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import javax.net.SocketFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
import o.C14881gav;
import o.C14953gcr;
import o.C14957gcv;
import o.InterfaceC14894gbR;
import okhttp3.Call;
import okhttp3.EventListener;
import okhttp3.Interceptor;
import okhttp3.WebSocket;
import okhttp3.internal.Util;
import okhttp3.internal.concurrent.TaskRunner;
import okhttp3.internal.connection.RealCall;
import okhttp3.internal.connection.RouteDatabase;
import okhttp3.internal.platform.Platform;
import okhttp3.internal.proxy.NullProxySelector;
import okhttp3.internal.tls.CertificateChainCleaner;
import okhttp3.internal.tls.OkHostnameVerifier;
import okhttp3.internal.ws.RealWebSocket;
/* loaded from: classes.dex */
public class OkHttpClient implements Cloneable, Call.Factory, WebSocket.Factory {
private final Authenticator authenticator;
private final Cache cache;
private final int callTimeoutMillis;
private final CertificateChainCleaner certificateChainCleaner;
private final CertificatePinner certificatePinner;
private final int connectTimeoutMillis;
private final ConnectionPool connectionPool;
private final List<ConnectionSpec> connectionSpecs;
private final CookieJar cookieJar;
private final Dispatcher dispatcher;
private final Dns dns;
private final EventListener.Factory eventListenerFactory;
private final boolean followRedirects;
private final boolean followSslRedirects;
private final HostnameVerifier hostnameVerifier;
private final List<Interceptor> interceptors;
private final long minWebSocketMessageToCompress;
private final List<Interceptor> networkInterceptors;
private final int pingIntervalMillis;
private final List<Protocol> protocols;
private final Proxy proxy;
private final Authenticator proxyAuthenticator;
private final ProxySelector proxySelector;
private final int readTimeoutMillis;
private final boolean retryOnConnectionFailure;
private final RouteDatabase routeDatabase;
private final SocketFactory socketFactory;
private final SSLSocketFactory sslSocketFactoryOrNull;
private final int writeTimeoutMillis;
private final X509TrustManager x509TrustManager;
public static final Companion Companion = new Companion(null);
private static final List<Protocol> DEFAULT_PROTOCOLS = Util.immutableListOf(Protocol.HTTP_2, Protocol.HTTP_1_1);
private static final List<ConnectionSpec> DEFAULT_CONNECTION_SPECS = Util.immutableListOf(ConnectionSpec.MODERN_TLS, ConnectionSpec.CLEARTEXT);
public OkHttpClient(Builder builder) {
NullProxySelector proxySelector$okhttp;
C14957gcv.e(builder, "");
this.dispatcher = builder.getDispatcher$okhttp();
this.connectionPool = builder.getConnectionPool$okhttp();
this.interceptors = Util.toImmutableList(builder.getInterceptors$okhttp());
this.networkInterceptors = Util.toImmutableList(builder.getNetworkInterceptors$okhttp());
this.eventListenerFactory = builder.getEventListenerFactory$okhttp();
this.retryOnConnectionFailure = builder.getRetryOnConnectionFailure$okhttp();
this.authenticator = builder.getAuthenticator$okhttp();
this.followRedirects = builder.getFollowRedirects$okhttp();
this.followSslRedirects = builder.getFollowSslRedirects$okhttp();
this.cookieJar = builder.getCookieJar$okhttp();
this.cache = builder.getCache$okhttp();
this.dns = builder.getDns$okhttp();
this.proxy = builder.getProxy$okhttp();
if (builder.getProxy$okhttp() != null) {
proxySelector$okhttp = NullProxySelector.INSTANCE;
} else {
proxySelector$okhttp = builder.getProxySelector$okhttp();
proxySelector$okhttp = proxySelector$okhttp == null ? ProxySelector.getDefault() : proxySelector$okhttp;
if (proxySelector$okhttp == null) {
proxySelector$okhttp = NullProxySelector.INSTANCE;
}
}
this.proxySelector = proxySelector$okhttp;
this.proxyAuthenticator = builder.getProxyAuthenticator$okhttp();
this.socketFactory = builder.getSocketFactory$okhttp();
List<ConnectionSpec> connectionSpecs$okhttp = builder.getConnectionSpecs$okhttp();
this.connectionSpecs = connectionSpecs$okhttp;
this.protocols = builder.getProtocols$okhttp();
this.hostnameVerifier = builder.getHostnameVerifier$okhttp();
this.callTimeoutMillis = builder.getCallTimeout$okhttp();
this.connectTimeoutMillis = builder.getConnectTimeout$okhttp();
this.readTimeoutMillis = builder.getReadTimeout$okhttp();
this.writeTimeoutMillis = builder.getWriteTimeout$okhttp();
this.pingIntervalMillis = builder.getPingInterval$okhttp();
this.minWebSocketMessageToCompress = builder.getMinWebSocketMessageToCompress$okhttp();
RouteDatabase routeDatabase$okhttp = builder.getRouteDatabase$okhttp();
this.routeDatabase = routeDatabase$okhttp == null ? new RouteDatabase() : routeDatabase$okhttp;
List<ConnectionSpec> list = connectionSpecs$okhttp;
if (!(list instanceof Collection) || !list.isEmpty()) {
Iterator<T> it = list.iterator();
while (it.hasNext()) {
if (((ConnectionSpec) it.next()).isTls()) {
if (builder.getSslSocketFactoryOrNull$okhttp() != null) {
this.sslSocketFactoryOrNull = builder.getSslSocketFactoryOrNull$okhttp();
CertificateChainCleaner certificateChainCleaner$okhttp = builder.getCertificateChainCleaner$okhttp();
C14957gcv.e(certificateChainCleaner$okhttp);
this.certificateChainCleaner = certificateChainCleaner$okhttp;
X509TrustManager x509TrustManagerOrNull$okhttp = builder.getX509TrustManagerOrNull$okhttp();
C14957gcv.e(x509TrustManagerOrNull$okhttp);
this.x509TrustManager = x509TrustManagerOrNull$okhttp;
CertificatePinner certificatePinner$okhttp = builder.getCertificatePinner$okhttp();
C14957gcv.e(certificateChainCleaner$okhttp);
this.certificatePinner = certificatePinner$okhttp.withCertificateChainCleaner$okhttp(certificateChainCleaner$okhttp);
} else {
X509TrustManager platformTrustManager = Platform.Companion.get().platformTrustManager();
this.x509TrustManager = platformTrustManager;
Platform platform = Platform.Companion.get();
C14957gcv.e(platformTrustManager);
this.sslSocketFactoryOrNull = platform.newSslSocketFactory(platformTrustManager);
CertificateChainCleaner.Companion companion = CertificateChainCleaner.Companion;
C14957gcv.e(platformTrustManager);
CertificateChainCleaner certificateChainCleaner = companion.get(platformTrustManager);
this.certificateChainCleaner = certificateChainCleaner;
CertificatePinner certificatePinner$okhttp2 = builder.getCertificatePinner$okhttp();
C14957gcv.e(certificateChainCleaner);
this.certificatePinner = certificatePinner$okhttp2.withCertificateChainCleaner$okhttp(certificateChainCleaner);
}
verifyClientState();
}
}
}
this.sslSocketFactoryOrNull = null;
this.certificateChainCleaner = null;
this.x509TrustManager = null;
this.certificatePinner = CertificatePinner.DEFAULT;
verifyClientState();
}
public Object clone() {
return super.clone();
}
public final SSLSocketFactory sslSocketFactory() {
SSLSocketFactory sSLSocketFactory = this.sslSocketFactoryOrNull;
if (sSLSocketFactory != null) {
return sSLSocketFactory;
}
throw new IllegalStateException("CLEARTEXT-only client");
}
public OkHttpClient() {
this(new Builder());
}
private final void verifyClientState() {
if (!(!this.interceptors.contains(null))) {
throw new IllegalStateException(C14957gcv.c("Null interceptor: ", interceptors()).toString());
}
if (!(!this.networkInterceptors.contains(null))) {
throw new IllegalStateException(C14957gcv.c("Null network interceptor: ", networkInterceptors()).toString());
}
List<ConnectionSpec> list = this.connectionSpecs;
if (!(list instanceof Collection) || !list.isEmpty()) {
Iterator<T> it = list.iterator();
while (it.hasNext()) {
if (((ConnectionSpec) it.next()).isTls()) {
if (this.sslSocketFactoryOrNull == null) {
throw new IllegalStateException("sslSocketFactory == null".toString());
}
if (this.certificateChainCleaner == null) {
throw new IllegalStateException("certificateChainCleaner == null".toString());
}
if (this.x509TrustManager == null) {
throw new IllegalStateException("x509TrustManager == null".toString());
}
return;
}
}
}
if (this.sslSocketFactoryOrNull != null) {
throw new IllegalStateException("Check failed.".toString());
}
if (this.certificateChainCleaner != null) {
throw new IllegalStateException("Check failed.".toString());
}
if (this.x509TrustManager != null) {
throw new IllegalStateException("Check failed.".toString());
}
if (!C14957gcv.b(this.certificatePinner, CertificatePinner.DEFAULT)) {
throw new IllegalStateException("Check failed.".toString());
}
}
@Override // okhttp3.Call.Factory
public Call newCall(Request request) {
C14957gcv.e(request, "");
return new RealCall(this, request, false);
}
@Override // okhttp3.WebSocket.Factory
public WebSocket newWebSocket(Request request, WebSocketListener webSocketListener) {
C14957gcv.e(request, "");
C14957gcv.e(webSocketListener, "");
RealWebSocket realWebSocket = new RealWebSocket(TaskRunner.INSTANCE, request, webSocketListener, new Random(), this.pingIntervalMillis, null, this.minWebSocketMessageToCompress);
realWebSocket.connect(this);
return realWebSocket;
}
public Builder newBuilder() {
return new Builder(this);
}
/* renamed from: -deprecated_sslSocketFactory, reason: not valid java name */
public final SSLSocketFactory m465deprecated_sslSocketFactory() {
return sslSocketFactory();
}
/* loaded from: classes.dex */
public static final class Builder {
private Authenticator authenticator;
private Cache cache;
private int callTimeout;
private CertificateChainCleaner certificateChainCleaner;
private CertificatePinner certificatePinner;
private int connectTimeout;
private ConnectionPool connectionPool;
private List<ConnectionSpec> connectionSpecs;
private CookieJar cookieJar;
private Dispatcher dispatcher;
private Dns dns;
private EventListener.Factory eventListenerFactory;
private boolean followRedirects;
private boolean followSslRedirects;
private HostnameVerifier hostnameVerifier;
private final List<Interceptor> interceptors;
private long minWebSocketMessageToCompress;
private final List<Interceptor> networkInterceptors;
private int pingInterval;
private List<? extends Protocol> protocols;
private Proxy proxy;
private Authenticator proxyAuthenticator;
private ProxySelector proxySelector;
private int readTimeout;
private boolean retryOnConnectionFailure;
private RouteDatabase routeDatabase;
private SocketFactory socketFactory;
private SSLSocketFactory sslSocketFactoryOrNull;
private int writeTimeout;
private X509TrustManager x509TrustManagerOrNull;
public Builder() {
this.dispatcher = new Dispatcher();
this.connectionPool = new ConnectionPool();
this.interceptors = new ArrayList();
this.networkInterceptors = new ArrayList();
this.eventListenerFactory = Util.asFactory(EventListener.NONE);
this.retryOnConnectionFailure = true;
this.authenticator = Authenticator.NONE;
this.followRedirects = true;
this.followSslRedirects = true;
this.cookieJar = CookieJar.NO_COOKIES;
this.dns = Dns.SYSTEM;
this.proxyAuthenticator = Authenticator.NONE;
SocketFactory socketFactory = SocketFactory.getDefault();
C14957gcv.c(socketFactory, "");
this.socketFactory = socketFactory;
this.connectionSpecs = OkHttpClient.Companion.getDEFAULT_CONNECTION_SPECS$okhttp();
this.protocols = OkHttpClient.Companion.getDEFAULT_PROTOCOLS$okhttp();
this.hostnameVerifier = OkHostnameVerifier.INSTANCE;
this.certificatePinner = CertificatePinner.DEFAULT;
this.connectTimeout = HwBuildEx.VersionCodes.CUR_DEVELOPMENT;
this.readTimeout = HwBuildEx.VersionCodes.CUR_DEVELOPMENT;
this.writeTimeout = HwBuildEx.VersionCodes.CUR_DEVELOPMENT;
this.minWebSocketMessageToCompress = RealWebSocket.DEFAULT_MINIMUM_DEFLATE_SIZE;
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public Builder(OkHttpClient okHttpClient) {
this();
C14957gcv.e(okHttpClient, "");
this.dispatcher = okHttpClient.dispatcher();
this.connectionPool = okHttpClient.connectionPool();
C14881gav.d(this.interceptors, okHttpClient.interceptors());
C14881gav.d(this.networkInterceptors, okHttpClient.networkInterceptors());
this.eventListenerFactory = okHttpClient.eventListenerFactory();
this.retryOnConnectionFailure = okHttpClient.retryOnConnectionFailure();
this.authenticator = okHttpClient.authenticator();
this.followRedirects = okHttpClient.followRedirects();
this.followSslRedirects = okHttpClient.followSslRedirects();
this.cookieJar = okHttpClient.cookieJar();
this.cache = okHttpClient.cache();
this.dns = okHttpClient.dns();
this.proxy = okHttpClient.proxy();
this.proxySelector = okHttpClient.proxySelector();
this.proxyAuthenticator = okHttpClient.proxyAuthenticator();
this.socketFactory = okHttpClient.socketFactory();
this.sslSocketFactoryOrNull = okHttpClient.sslSocketFactoryOrNull;
this.x509TrustManagerOrNull = okHttpClient.x509TrustManager();
this.connectionSpecs = okHttpClient.connectionSpecs();
this.protocols = okHttpClient.protocols();
this.hostnameVerifier = okHttpClient.hostnameVerifier();
this.certificatePinner = okHttpClient.certificatePinner();
this.certificateChainCleaner = okHttpClient.certificateChainCleaner();
this.callTimeout = okHttpClient.callTimeoutMillis();
this.connectTimeout = okHttpClient.connectTimeoutMillis();
this.readTimeout = okHttpClient.readTimeoutMillis();
this.writeTimeout = okHttpClient.writeTimeoutMillis();
this.pingInterval = okHttpClient.pingIntervalMillis();
this.minWebSocketMessageToCompress = okHttpClient.minWebSocketMessageToCompress();
this.routeDatabase = okHttpClient.getRouteDatabase();
}
public final Builder dispatcher(Dispatcher dispatcher) {
C14957gcv.e(dispatcher, "");
setDispatcher$okhttp(dispatcher);
return this;
}
public final Builder connectionPool(ConnectionPool connectionPool) {
C14957gcv.e(connectionPool, "");
setConnectionPool$okhttp(connectionPool);
return this;
}
public final Builder addInterceptor(Interceptor interceptor) {
C14957gcv.e(interceptor, "");
getInterceptors$okhttp().add(interceptor);
return this;
}
/* renamed from: -addInterceptor, reason: not valid java name */
public final Builder m467addInterceptor(final InterfaceC14894gbR<? super Interceptor.Chain, Response> interfaceC14894gbR) {
C14957gcv.e(interfaceC14894gbR, "");
return addInterceptor(new Interceptor(interfaceC14894gbR) { // from class: okhttp3.OkHttpClient$Builder$addInterceptor$2
final InterfaceC14894gbR<Interceptor.Chain, Response> $block;
@Override // okhttp3.Interceptor
public final Response intercept(Interceptor.Chain chain) {
C14957gcv.e(chain, "");
return this.$block.invoke(chain);
}
/* JADX WARN: Multi-variable type inference failed */
{
this.$block = interfaceC14894gbR;
}
});
}
public final Builder addNetworkInterceptor(Interceptor interceptor) {
C14957gcv.e(interceptor, "");
getNetworkInterceptors$okhttp().add(interceptor);
return this;
}
/* renamed from: -addNetworkInterceptor, reason: not valid java name */
public final Builder m468addNetworkInterceptor(final InterfaceC14894gbR<? super Interceptor.Chain, Response> interfaceC14894gbR) {
C14957gcv.e(interfaceC14894gbR, "");
return addNetworkInterceptor(new Interceptor(interfaceC14894gbR) { // from class: okhttp3.OkHttpClient$Builder$addNetworkInterceptor$2
final InterfaceC14894gbR<Interceptor.Chain, Response> $block;
@Override // okhttp3.Interceptor
public final Response intercept(Interceptor.Chain chain) {
C14957gcv.e(chain, "");
return this.$block.invoke(chain);
}
/* JADX WARN: Multi-variable type inference failed */
{
this.$block = interfaceC14894gbR;
}
});
}
public final Builder eventListener(EventListener eventListener) {
C14957gcv.e(eventListener, "");
setEventListenerFactory$okhttp(Util.asFactory(eventListener));
return this;
}
public final Builder eventListenerFactory(EventListener.Factory factory) {
C14957gcv.e(factory, "");
setEventListenerFactory$okhttp(factory);
return this;
}
public final Builder retryOnConnectionFailure(boolean z) {
setRetryOnConnectionFailure$okhttp(z);
return this;
}
public final Builder authenticator(Authenticator authenticator) {
C14957gcv.e(authenticator, "");
setAuthenticator$okhttp(authenticator);
return this;
}
public final Builder followRedirects(boolean z) {
setFollowRedirects$okhttp(z);
return this;
}
public final Builder followSslRedirects(boolean z) {
setFollowSslRedirects$okhttp(z);
return this;
}
public final Builder cookieJar(CookieJar cookieJar) {
C14957gcv.e(cookieJar, "");
setCookieJar$okhttp(cookieJar);
return this;
}
public final Builder cache(Cache cache) {
setCache$okhttp(cache);
return this;
}
public final Builder dns(Dns dns) {
C14957gcv.e(dns, "");
if (!C14957gcv.b(dns, getDns$okhttp())) {
setRouteDatabase$okhttp(null);
}
setDns$okhttp(dns);
return this;
}
public final Builder proxy(Proxy proxy) {
if (!C14957gcv.b(proxy, getProxy$okhttp())) {
setRouteDatabase$okhttp(null);
}
setProxy$okhttp(proxy);
return this;
}
public final Builder proxySelector(ProxySelector proxySelector) {
C14957gcv.e(proxySelector, "");
if (!C14957gcv.b(proxySelector, getProxySelector$okhttp())) {
setRouteDatabase$okhttp(null);
}
setProxySelector$okhttp(proxySelector);
return this;
}
public final Builder proxyAuthenticator(Authenticator authenticator) {
C14957gcv.e(authenticator, "");
if (!C14957gcv.b(authenticator, getProxyAuthenticator$okhttp())) {
setRouteDatabase$okhttp(null);
}
setProxyAuthenticator$okhttp(authenticator);
return this;
}
public final Builder socketFactory(SocketFactory socketFactory) {
C14957gcv.e(socketFactory, "");
if (!(!(socketFactory instanceof SSLSocketFactory))) {
throw new IllegalArgumentException("socketFactory instanceof SSLSocketFactory".toString());
}
if (!C14957gcv.b(socketFactory, getSocketFactory$okhttp())) {
setRouteDatabase$okhttp(null);
}
setSocketFactory$okhttp(socketFactory);
return this;
}
public final Builder sslSocketFactory(SSLSocketFactory sSLSocketFactory) {
C14957gcv.e(sSLSocketFactory, "");
if (!C14957gcv.b(sSLSocketFactory, getSslSocketFactoryOrNull$okhttp())) {
setRouteDatabase$okhttp(null);
}
setSslSocketFactoryOrNull$okhttp(sSLSocketFactory);
X509TrustManager trustManager = Platform.Companion.get().trustManager(sSLSocketFactory);
if (trustManager == null) {
StringBuilder sb = new StringBuilder("Unable to extract the trust manager on ");
sb.append(Platform.Companion.get());
sb.append(", sslSocketFactory is ");
sb.append(sSLSocketFactory.getClass());
throw new IllegalStateException(sb.toString());
}
setX509TrustManagerOrNull$okhttp(trustManager);
Platform platform = Platform.Companion.get();
X509TrustManager x509TrustManagerOrNull$okhttp = getX509TrustManagerOrNull$okhttp();
C14957gcv.e(x509TrustManagerOrNull$okhttp);
setCertificateChainCleaner$okhttp(platform.buildCertificateChainCleaner(x509TrustManagerOrNull$okhttp));
return this;
}
public final Builder sslSocketFactory(SSLSocketFactory sSLSocketFactory, X509TrustManager x509TrustManager) {
C14957gcv.e(sSLSocketFactory, "");
C14957gcv.e(x509TrustManager, "");
if (!C14957gcv.b(sSLSocketFactory, getSslSocketFactoryOrNull$okhttp()) || !C14957gcv.b(x509TrustManager, getX509TrustManagerOrNull$okhttp())) {
setRouteDatabase$okhttp(null);
}
setSslSocketFactoryOrNull$okhttp(sSLSocketFactory);
setCertificateChainCleaner$okhttp(CertificateChainCleaner.Companion.get(x509TrustManager));
setX509TrustManagerOrNull$okhttp(x509TrustManager);
return this;
}
public final Builder connectionSpecs(List<ConnectionSpec> list) {
C14957gcv.e(list, "");
if (!C14957gcv.b(list, getConnectionSpecs$okhttp())) {
setRouteDatabase$okhttp(null);
}
setConnectionSpecs$okhttp(Util.toImmutableList(list));
return this;
}
public final Builder protocols(List<? extends Protocol> list) {
C14957gcv.e(list, "");
List<? extends Protocol> list2 = list;
C14957gcv.e(list2, "");
ArrayList arrayList = new ArrayList(list2);
if (!arrayList.contains(Protocol.H2_PRIOR_KNOWLEDGE) && !arrayList.contains(Protocol.HTTP_1_1)) {
throw new IllegalArgumentException(C14957gcv.c("protocols must contain h2_prior_knowledge or http/1.1: ", arrayList).toString());
}
if (arrayList.contains(Protocol.H2_PRIOR_KNOWLEDGE) && arrayList.size() > 1) {
throw new IllegalArgumentException(C14957gcv.c("protocols containing h2_prior_knowledge cannot use other protocols: ", arrayList).toString());
}
if (!(!arrayList.contains(Protocol.HTTP_1_0))) {
throw new IllegalArgumentException(C14957gcv.c("protocols must not contain http/1.0: ", arrayList).toString());
}
if (!(true ^ arrayList.contains(null))) {
throw new IllegalArgumentException("protocols must not contain null".toString());
}
arrayList.remove(Protocol.SPDY_3);
if (!C14957gcv.b(arrayList, getProtocols$okhttp())) {
setRouteDatabase$okhttp(null);
}
List<? extends Protocol> unmodifiableList = Collections.unmodifiableList(arrayList);
C14957gcv.c(unmodifiableList, "");
setProtocols$okhttp(unmodifiableList);
return this;
}
public final Builder hostnameVerifier(HostnameVerifier hostnameVerifier) {
C14957gcv.e(hostnameVerifier, "");
if (!C14957gcv.b(hostnameVerifier, getHostnameVerifier$okhttp())) {
setRouteDatabase$okhttp(null);
}
setHostnameVerifier$okhttp(hostnameVerifier);
return this;
}
public final Builder certificatePinner(CertificatePinner certificatePinner) {
C14957gcv.e(certificatePinner, "");
if (!C14957gcv.b(certificatePinner, getCertificatePinner$okhttp())) {
setRouteDatabase$okhttp(null);
}
setCertificatePinner$okhttp(certificatePinner);
return this;
}
public final Builder callTimeout(long j, TimeUnit timeUnit) {
C14957gcv.e(timeUnit, "");
setCallTimeout$okhttp(Util.checkDuration("timeout", j, timeUnit));
return this;
}
public final Builder callTimeout(Duration duration) {
C14957gcv.e(duration, "");
callTimeout(duration.toMillis(), TimeUnit.MILLISECONDS);
return this;
}
public final Builder connectTimeout(long j, TimeUnit timeUnit) {
C14957gcv.e(timeUnit, "");
setConnectTimeout$okhttp(Util.checkDuration("timeout", j, timeUnit));
return this;
}
public final Builder connectTimeout(Duration duration) {
C14957gcv.e(duration, "");
connectTimeout(duration.toMillis(), TimeUnit.MILLISECONDS);
return this;
}
public final Builder readTimeout(long j, TimeUnit timeUnit) {
C14957gcv.e(timeUnit, "");
setReadTimeout$okhttp(Util.checkDuration("timeout", j, timeUnit));
return this;
}
public final Builder readTimeout(Duration duration) {
C14957gcv.e(duration, "");
readTimeout(duration.toMillis(), TimeUnit.MILLISECONDS);
return this;
}
public final Builder writeTimeout(long j, TimeUnit timeUnit) {
C14957gcv.e(timeUnit, "");
setWriteTimeout$okhttp(Util.checkDuration("timeout", j, timeUnit));
return this;
}
public final Builder writeTimeout(Duration duration) {
C14957gcv.e(duration, "");
writeTimeout(duration.toMillis(), TimeUnit.MILLISECONDS);
return this;
}
public final Builder pingInterval(long j, TimeUnit timeUnit) {
C14957gcv.e(timeUnit, "");
setPingInterval$okhttp(Util.checkDuration("interval", j, timeUnit));
return this;
}
public final Builder pingInterval(Duration duration) {
C14957gcv.e(duration, "");
pingInterval(duration.toMillis(), TimeUnit.MILLISECONDS);
return this;
}
public final Builder minWebSocketMessageToCompress(long j) {
if (j < 0) {
throw new IllegalArgumentException(C14957gcv.c("minWebSocketMessageToCompress must be positive: ", Long.valueOf(j)).toString());
}
setMinWebSocketMessageToCompress$okhttp(j);
return this;
}
public final OkHttpClient build() {
return new OkHttpClient(this);
}
public final void setX509TrustManagerOrNull$okhttp(X509TrustManager x509TrustManager) {
this.x509TrustManagerOrNull = x509TrustManager;
}
public final void setWriteTimeout$okhttp(int i) {
this.writeTimeout = i;
}
public final void setSslSocketFactoryOrNull$okhttp(SSLSocketFactory sSLSocketFactory) {
this.sslSocketFactoryOrNull = sSLSocketFactory;
}
public final void setSocketFactory$okhttp(SocketFactory socketFactory) {
C14957gcv.e(socketFactory, "");
this.socketFactory = socketFactory;
}
public final void setRouteDatabase$okhttp(RouteDatabase routeDatabase) {
this.routeDatabase = routeDatabase;
}
public final void setRetryOnConnectionFailure$okhttp(boolean z) {
this.retryOnConnectionFailure = z;
}
public final void setReadTimeout$okhttp(int i) {
this.readTimeout = i;
}
public final void setProxySelector$okhttp(ProxySelector proxySelector) {
this.proxySelector = proxySelector;
}
public final void setProxyAuthenticator$okhttp(Authenticator authenticator) {
C14957gcv.e(authenticator, "");
this.proxyAuthenticator = authenticator;
}
public final void setProxy$okhttp(Proxy proxy) {
this.proxy = proxy;
}
public final void setProtocols$okhttp(List<? extends Protocol> list) {
C14957gcv.e(list, "");
this.protocols = list;
}
public final void setPingInterval$okhttp(int i) {
this.pingInterval = i;
}
public final void setMinWebSocketMessageToCompress$okhttp(long j) {
this.minWebSocketMessageToCompress = j;
}
public final void setHostnameVerifier$okhttp(HostnameVerifier hostnameVerifier) {
C14957gcv.e(hostnameVerifier, "");
this.hostnameVerifier = hostnameVerifier;
}
public final void setFollowSslRedirects$okhttp(boolean z) {
this.followSslRedirects = z;
}
public final void setFollowRedirects$okhttp(boolean z) {
this.followRedirects = z;
}
public final void setEventListenerFactory$okhttp(EventListener.Factory factory) {
C14957gcv.e(factory, "");
this.eventListenerFactory = factory;
}
public final void setDns$okhttp(Dns dns) {
C14957gcv.e(dns, "");
this.dns = dns;
}
public final void setDispatcher$okhttp(Dispatcher dispatcher) {
C14957gcv.e(dispatcher, "");
this.dispatcher = dispatcher;
}
public final void setCookieJar$okhttp(CookieJar cookieJar) {
C14957gcv.e(cookieJar, "");
this.cookieJar = cookieJar;
}
public final void setConnectionSpecs$okhttp(List<ConnectionSpec> list) {
C14957gcv.e(list, "");
this.connectionSpecs = list;
}
public final void setConnectionPool$okhttp(ConnectionPool connectionPool) {
C14957gcv.e(connectionPool, "");
this.connectionPool = connectionPool;
}
public final void setConnectTimeout$okhttp(int i) {
this.connectTimeout = i;
}
public final void setCertificatePinner$okhttp(CertificatePinner certificatePinner) {
C14957gcv.e(certificatePinner, "");
this.certificatePinner = certificatePinner;
}
public final void setCertificateChainCleaner$okhttp(CertificateChainCleaner certificateChainCleaner) {
this.certificateChainCleaner = certificateChainCleaner;
}
public final void setCallTimeout$okhttp(int i) {
this.callTimeout = i;
}
public final void setCache$okhttp(Cache cache) {
this.cache = cache;
}
public final void setAuthenticator$okhttp(Authenticator authenticator) {
C14957gcv.e(authenticator, "");
this.authenticator = authenticator;
}
public final List<Interceptor> networkInterceptors() {
return this.networkInterceptors;
}
public final List<Interceptor> interceptors() {
return this.interceptors;
}
public final X509TrustManager getX509TrustManagerOrNull$okhttp() {
return this.x509TrustManagerOrNull;
}
public final int getWriteTimeout$okhttp() {
return this.writeTimeout;
}
public final SSLSocketFactory getSslSocketFactoryOrNull$okhttp() {
return this.sslSocketFactoryOrNull;
}
public final SocketFactory getSocketFactory$okhttp() {
return this.socketFactory;
}
public final RouteDatabase getRouteDatabase$okhttp() {
return this.routeDatabase;
}
public final boolean getRetryOnConnectionFailure$okhttp() {
return this.retryOnConnectionFailure;
}
public final int getReadTimeout$okhttp() {
return this.readTimeout;
}
public final ProxySelector getProxySelector$okhttp() {
return this.proxySelector;
}
public final Authenticator getProxyAuthenticator$okhttp() {
return this.proxyAuthenticator;
}
public final Proxy getProxy$okhttp() {
return this.proxy;
}
public final List<Protocol> getProtocols$okhttp() {
return this.protocols;
}
public final int getPingInterval$okhttp() {
return this.pingInterval;
}
public final List<Interceptor> getNetworkInterceptors$okhttp() {
return this.networkInterceptors;
}
public final long getMinWebSocketMessageToCompress$okhttp() {
return this.minWebSocketMessageToCompress;
}
public final List<Interceptor> getInterceptors$okhttp() {
return this.interceptors;
}
public final HostnameVerifier getHostnameVerifier$okhttp() {
return this.hostnameVerifier;
}
public final boolean getFollowSslRedirects$okhttp() {
return this.followSslRedirects;
}
public final boolean getFollowRedirects$okhttp() {
return this.followRedirects;
}
public final EventListener.Factory getEventListenerFactory$okhttp() {
return this.eventListenerFactory;
}
public final Dns getDns$okhttp() {
return this.dns;
}
public final Dispatcher getDispatcher$okhttp() {
return this.dispatcher;
}
public final CookieJar getCookieJar$okhttp() {
return this.cookieJar;
}
public final List<ConnectionSpec> getConnectionSpecs$okhttp() {
return this.connectionSpecs;
}
public final ConnectionPool getConnectionPool$okhttp() {
return this.connectionPool;
}
public final int getConnectTimeout$okhttp() {
return this.connectTimeout;
}
public final CertificatePinner getCertificatePinner$okhttp() {
return this.certificatePinner;
}
public final CertificateChainCleaner getCertificateChainCleaner$okhttp() {
return this.certificateChainCleaner;
}
public final int getCallTimeout$okhttp() {
return this.callTimeout;
}
public final Cache getCache$okhttp() {
return this.cache;
}
public final Authenticator getAuthenticator$okhttp() {
return this.authenticator;
}
}
/* loaded from: classes.dex */
public static final class Companion {
private Companion() {
}
public final List<Protocol> getDEFAULT_PROTOCOLS$okhttp() {
return OkHttpClient.DEFAULT_PROTOCOLS;
}
public final List<ConnectionSpec> getDEFAULT_CONNECTION_SPECS$okhttp() {
return OkHttpClient.DEFAULT_CONNECTION_SPECS;
}
public /* synthetic */ Companion(C14953gcr c14953gcr) {
this();
}
}
public final X509TrustManager x509TrustManager() {
return this.x509TrustManager;
}
public final int writeTimeoutMillis() {
return this.writeTimeoutMillis;
}
public final SocketFactory socketFactory() {
return this.socketFactory;
}
public final boolean retryOnConnectionFailure() {
return this.retryOnConnectionFailure;
}
public final int readTimeoutMillis() {
return this.readTimeoutMillis;
}
public final ProxySelector proxySelector() {
return this.proxySelector;
}
public final Authenticator proxyAuthenticator() {
return this.proxyAuthenticator;
}
public final Proxy proxy() {
return this.proxy;
}
public final List<Protocol> protocols() {
return this.protocols;
}
public final int pingIntervalMillis() {
return this.pingIntervalMillis;
}
public final List<Interceptor> networkInterceptors() {
return this.networkInterceptors;
}
public final long minWebSocketMessageToCompress() {
return this.minWebSocketMessageToCompress;
}
public final List<Interceptor> interceptors() {
return this.interceptors;
}
public final HostnameVerifier hostnameVerifier() {
return this.hostnameVerifier;
}
public final RouteDatabase getRouteDatabase() {
return this.routeDatabase;
}
public final boolean followSslRedirects() {
return this.followSslRedirects;
}
public final boolean followRedirects() {
return this.followRedirects;
}
public final EventListener.Factory eventListenerFactory() {
return this.eventListenerFactory;
}
public final Dns dns() {
return this.dns;
}
public final Dispatcher dispatcher() {
return this.dispatcher;
}
public final CookieJar cookieJar() {
return this.cookieJar;
}
public final List<ConnectionSpec> connectionSpecs() {
return this.connectionSpecs;
}
public final ConnectionPool connectionPool() {
return this.connectionPool;
}
public final int connectTimeoutMillis() {
return this.connectTimeoutMillis;
}
public final CertificatePinner certificatePinner() {
return this.certificatePinner;
}
public final CertificateChainCleaner certificateChainCleaner() {
return this.certificateChainCleaner;
}
public final int callTimeoutMillis() {
return this.callTimeoutMillis;
}
public final Cache cache() {
return this.cache;
}
public final Authenticator authenticator() {
return this.authenticator;
}
/* renamed from: -deprecated_writeTimeoutMillis, reason: not valid java name */
public final int m466deprecated_writeTimeoutMillis() {
return this.writeTimeoutMillis;
}
/* renamed from: -deprecated_socketFactory, reason: not valid java name */
public final SocketFactory m464deprecated_socketFactory() {
return this.socketFactory;
}
/* renamed from: -deprecated_retryOnConnectionFailure, reason: not valid java name */
public final boolean m463deprecated_retryOnConnectionFailure() {
return this.retryOnConnectionFailure;
}
/* renamed from: -deprecated_readTimeoutMillis, reason: not valid java name */
public final int m462deprecated_readTimeoutMillis() {
return this.readTimeoutMillis;
}
/* renamed from: -deprecated_proxySelector, reason: not valid java name */
public final ProxySelector m461deprecated_proxySelector() {
return this.proxySelector;
}
/* renamed from: -deprecated_proxyAuthenticator, reason: not valid java name */
public final Authenticator m460deprecated_proxyAuthenticator() {
return this.proxyAuthenticator;
}
/* renamed from: -deprecated_proxy, reason: not valid java name */
public final Proxy m459deprecated_proxy() {
return this.proxy;
}
/* renamed from: -deprecated_protocols, reason: not valid java name */
public final List<Protocol> m458deprecated_protocols() {
return this.protocols;
}
/* renamed from: -deprecated_pingIntervalMillis, reason: not valid java name */
public final int m457deprecated_pingIntervalMillis() {
return this.pingIntervalMillis;
}
/* renamed from: -deprecated_networkInterceptors, reason: not valid java name */
public final List<Interceptor> m456deprecated_networkInterceptors() {
return this.networkInterceptors;
}
/* renamed from: -deprecated_interceptors, reason: not valid java name */
public final List<Interceptor> m455deprecated_interceptors() {
return this.interceptors;
}
/* renamed from: -deprecated_hostnameVerifier, reason: not valid java name */
public final HostnameVerifier m454deprecated_hostnameVerifier() {
return this.hostnameVerifier;
}
/* renamed from: -deprecated_followSslRedirects, reason: not valid java name */
public final boolean m453deprecated_followSslRedirects() {
return this.followSslRedirects;
}
/* renamed from: -deprecated_followRedirects, reason: not valid java name */
public final boolean m452deprecated_followRedirects() {
return this.followRedirects;
}
/* renamed from: -deprecated_eventListenerFactory, reason: not valid java name */
public final EventListener.Factory m451deprecated_eventListenerFactory() {
return this.eventListenerFactory;
}
/* renamed from: -deprecated_dns, reason: not valid java name */
public final Dns m450deprecated_dns() {
return this.dns;
}
/* renamed from: -deprecated_dispatcher, reason: not valid java name */
public final Dispatcher m449deprecated_dispatcher() {
return this.dispatcher;
}
/* renamed from: -deprecated_cookieJar, reason: not valid java name */
public final CookieJar m448deprecated_cookieJar() {
return this.cookieJar;
}
/* renamed from: -deprecated_connectionSpecs, reason: not valid java name */
public final List<ConnectionSpec> m447deprecated_connectionSpecs() {
return this.connectionSpecs;
}
/* renamed from: -deprecated_connectionPool, reason: not valid java name */
public final ConnectionPool m446deprecated_connectionPool() {
return this.connectionPool;
}
/* renamed from: -deprecated_connectTimeoutMillis, reason: not valid java name */
public final int m445deprecated_connectTimeoutMillis() {
return this.connectTimeoutMillis;
}
/* renamed from: -deprecated_certificatePinner, reason: not valid java name */
public final CertificatePinner m444deprecated_certificatePinner() {
return this.certificatePinner;
}
/* renamed from: -deprecated_callTimeoutMillis, reason: not valid java name */
public final int m443deprecated_callTimeoutMillis() {
return this.callTimeoutMillis;
}
/* renamed from: -deprecated_cache, reason: not valid java name */
public final Cache m442deprecated_cache() {
return this.cache;
}
/* renamed from: -deprecated_authenticator, reason: not valid java name */
public final Authenticator m441deprecated_authenticator() {
return this.authenticator;
}
}