package K4;

import com.google.android.gms.internal.measurement.C1;
import java.net.ProxySelector;
import java.util.List;
import java.util.Objects;
import javax.net.SocketFactory;
import javax.net.ssl.SSLSocketFactory;
import r4.AbstractC0983h;

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

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final W4.c f1075d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final e f1076e;

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

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final o f1079h;
    public final List i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final List f1080j;

    public a(String str, int i, b bVar, SocketFactory socketFactory, SSLSocketFactory sSLSocketFactory, W4.c cVar, e eVar, b bVar2, List list, List list2, ProxySelector proxySelector) {
        AbstractC0983h.e("uriHost", str);
        AbstractC0983h.e("dns", bVar);
        AbstractC0983h.e("socketFactory", socketFactory);
        AbstractC0983h.e("proxyAuthenticator", bVar2);
        AbstractC0983h.e("protocols", list);
        AbstractC0983h.e("connectionSpecs", list2);
        AbstractC0983h.e("proxySelector", proxySelector);
        this.f1072a = bVar;
        this.f1073b = socketFactory;
        this.f1074c = sSLSocketFactory;
        this.f1075d = cVar;
        this.f1076e = eVar;
        this.f1077f = bVar2;
        this.f1078g = proxySelector;
        n nVar = new n();
        String str2 = sSLSocketFactory != null ? "https" : "http";
        if (str2.equalsIgnoreCase("http")) {
            nVar.f1149a = "http";
        } else {
            if (!str2.equalsIgnoreCase("https")) {
                throw new IllegalArgumentException(AbstractC0983h.h("unexpected scheme: ", str2));
            }
            nVar.f1149a = "https";
        }
        String strC = C1.C(b.e(str, 0, 0, 7));
        if (strC == null) {
            throw new IllegalArgumentException(AbstractC0983h.h("unexpected host: ", str));
        }
        nVar.f1152d = strC;
        if (1 > i || i >= 65536) {
            throw new IllegalArgumentException(AbstractC0983h.h("unexpected port: ", Integer.valueOf(i)).toString());
        }
        nVar.f1153e = i;
        this.f1079h = nVar.a();
        this.i = L4.b.u(list);
        this.f1080j = L4.b.u(list2);
    }

    public final boolean a(a aVar) {
        AbstractC0983h.e("that", aVar);
        return AbstractC0983h.a(this.f1072a, aVar.f1072a) && AbstractC0983h.a(this.f1077f, aVar.f1077f) && AbstractC0983h.a(this.i, aVar.i) && AbstractC0983h.a(this.f1080j, aVar.f1080j) && AbstractC0983h.a(this.f1078g, aVar.f1078g) && AbstractC0983h.a(this.f1074c, aVar.f1074c) && AbstractC0983h.a(this.f1075d, aVar.f1075d) && AbstractC0983h.a(this.f1076e, aVar.f1076e) && this.f1079h.f1162e == aVar.f1079h.f1162e;
    }

    public final boolean equals(Object obj) {
        if (!(obj instanceof a)) {
            return false;
        }
        a aVar = (a) obj;
        return AbstractC0983h.a(this.f1079h, aVar.f1079h) && a(aVar);
    }

    public final int hashCode() {
        return Objects.hashCode(this.f1076e) + ((Objects.hashCode(this.f1075d) + ((Objects.hashCode(this.f1074c) + ((this.f1078g.hashCode() + ((this.f1080j.hashCode() + ((this.i.hashCode() + ((this.f1077f.hashCode() + ((this.f1072a.hashCode() + ((this.f1079h.f1165h.hashCode() + 527) * 31)) * 31)) * 31)) * 31)) * 31)) * 961)) * 31)) * 31);
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("Address{");
        o oVar = this.f1079h;
        sb.append(oVar.f1161d);
        sb.append(':');
        sb.append(oVar.f1162e);
        sb.append(", ");
        sb.append(AbstractC0983h.h("proxySelector=", this.f1078g));
        sb.append('}');
        return sb.toString();
    }
}
