package g;

import g.s;
import java.net.Proxy;
import java.net.ProxySelector;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nullable;
import javax.net.SocketFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSocketFactory;

/* JADX INFO: loaded from: classes.dex */
public final class a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final s f6048a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final m f6049b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final SocketFactory f6050c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final b f6051d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final List<x> f6052e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final List<i> f6053f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final ProxySelector f6054g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    @Nullable
    public final Proxy f6055h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    @Nullable
    public final SSLSocketFactory f6056i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    @Nullable
    public final HostnameVerifier f6057j;

    @Nullable
    public final f k;

    public a(String str, int i2, m mVar, SocketFactory socketFactory, @Nullable SSLSocketFactory sSLSocketFactory, @Nullable HostnameVerifier hostnameVerifier, @Nullable f fVar, b bVar, @Nullable Proxy proxy, List<x> list, List<i> list2, ProxySelector proxySelector) {
        s.a aVar = new s.a();
        String str2 = "https";
        String str3 = sSLSocketFactory != null ? "https" : "http";
        if (str3.equalsIgnoreCase("http")) {
            str2 = "http";
        } else if (!str3.equalsIgnoreCase("https")) {
            throw new IllegalArgumentException(a.b.c.a.a.p("unexpected scheme: ", str3));
        }
        aVar.f6449a = str2;
        Objects.requireNonNull(str, "host == null");
        String strB = g.i0.c.b(s.l(str, 0, str.length(), false));
        if (strB == null) {
            throw new IllegalArgumentException(a.b.c.a.a.p("unexpected host: ", str));
        }
        aVar.f6452d = strB;
        if (i2 <= 0 || i2 > 65535) {
            throw new IllegalArgumentException(a.b.c.a.a.o("unexpected port: ", i2));
        }
        aVar.f6453e = i2;
        this.f6048a = aVar.a();
        Objects.requireNonNull(mVar, "dns == null");
        this.f6049b = mVar;
        Objects.requireNonNull(socketFactory, "socketFactory == null");
        this.f6050c = socketFactory;
        Objects.requireNonNull(bVar, "proxyAuthenticator == null");
        this.f6051d = bVar;
        Objects.requireNonNull(list, "protocols == null");
        this.f6052e = g.i0.c.n(list);
        Objects.requireNonNull(list2, "connectionSpecs == null");
        this.f6053f = g.i0.c.n(list2);
        Objects.requireNonNull(proxySelector, "proxySelector == null");
        this.f6054g = proxySelector;
        this.f6055h = null;
        this.f6056i = sSLSocketFactory;
        this.f6057j = hostnameVerifier;
        this.k = fVar;
    }

    public boolean a(a aVar) {
        return this.f6049b.equals(aVar.f6049b) && this.f6051d.equals(aVar.f6051d) && this.f6052e.equals(aVar.f6052e) && this.f6053f.equals(aVar.f6053f) && this.f6054g.equals(aVar.f6054g) && g.i0.c.k(this.f6055h, aVar.f6055h) && g.i0.c.k(this.f6056i, aVar.f6056i) && g.i0.c.k(this.f6057j, aVar.f6057j) && g.i0.c.k(this.k, aVar.k) && this.f6048a.f6444f == aVar.f6048a.f6444f;
    }

    public boolean equals(@Nullable Object obj) {
        if (obj instanceof a) {
            a aVar = (a) obj;
            if (this.f6048a.equals(aVar.f6048a) && a(aVar)) {
                return true;
            }
        }
        return false;
    }

    public int hashCode() {
        int iHashCode = (this.f6054g.hashCode() + ((this.f6053f.hashCode() + ((this.f6052e.hashCode() + ((this.f6051d.hashCode() + ((this.f6049b.hashCode() + ((this.f6048a.hashCode() + 527) * 31)) * 31)) * 31)) * 31)) * 31)) * 31;
        Proxy proxy = this.f6055h;
        int iHashCode2 = (iHashCode + (proxy != null ? proxy.hashCode() : 0)) * 31;
        SSLSocketFactory sSLSocketFactory = this.f6056i;
        int iHashCode3 = (iHashCode2 + (sSLSocketFactory != null ? sSLSocketFactory.hashCode() : 0)) * 31;
        HostnameVerifier hostnameVerifier = this.f6057j;
        int iHashCode4 = (iHashCode3 + (hostnameVerifier != null ? hostnameVerifier.hashCode() : 0)) * 31;
        f fVar = this.k;
        return iHashCode4 + (fVar != null ? fVar.hashCode() : 0);
    }

    public String toString() {
        Object obj;
        StringBuilder sbC = a.b.c.a.a.C("Address{");
        sbC.append(this.f6048a.f6443e);
        sbC.append(":");
        sbC.append(this.f6048a.f6444f);
        if (this.f6055h != null) {
            sbC.append(", proxy=");
            obj = this.f6055h;
        } else {
            sbC.append(", proxySelector=");
            obj = this.f6054g;
        }
        sbC.append(obj);
        sbC.append("}");
        return sbC.toString();
    }
}
