package h5; import java.util.Arrays; import java.util.List; import javax.net.ssl.SSLSocket; /* loaded from: classes2.dex */ public final class o { /* renamed from: e, reason: collision with root package name */ private static final l[] f10237e; /* renamed from: f, reason: collision with root package name */ private static final l[] f10238f; /* renamed from: g, reason: collision with root package name */ public static final o f10239g; /* renamed from: h, reason: collision with root package name */ public static final o f10240h; /* renamed from: i, reason: collision with root package name */ public static final o f10241i; /* renamed from: j, reason: collision with root package name */ public static final o f10242j; /* renamed from: a, reason: collision with root package name */ final boolean f10243a; /* renamed from: b, reason: collision with root package name */ final boolean f10244b; /* renamed from: c, reason: collision with root package name */ final String[] f10245c; /* renamed from: d, reason: collision with root package name */ final String[] f10246d; public static final class a { /* renamed from: a, reason: collision with root package name */ boolean f10247a; /* renamed from: b, reason: collision with root package name */ String[] f10248b; /* renamed from: c, reason: collision with root package name */ String[] f10249c; /* renamed from: d, reason: collision with root package name */ boolean f10250d; public a(o oVar) { this.f10247a = oVar.f10243a; this.f10248b = oVar.f10245c; this.f10249c = oVar.f10246d; this.f10250d = oVar.f10244b; } public o a() { return new o(this); } public a b(l... lVarArr) { if (!this.f10247a) { throw new IllegalStateException("no cipher suites for cleartext connections"); } String[] strArr = new String[lVarArr.length]; for (int i10 = 0; i10 < lVarArr.length; i10++) { strArr[i10] = lVarArr[i10].f10221a; } return c(strArr); } public a c(String... strArr) { if (!this.f10247a) { throw new IllegalStateException("no cipher suites for cleartext connections"); } if (strArr.length == 0) { throw new IllegalArgumentException("At least one cipher suite is required"); } this.f10248b = (String[]) strArr.clone(); return this; } public a d(boolean z10) { if (!this.f10247a) { throw new IllegalStateException("no TLS extensions for cleartext connections"); } this.f10250d = z10; return this; } public a e(q0... q0VarArr) { if (!this.f10247a) { throw new IllegalStateException("no TLS versions for cleartext connections"); } String[] strArr = new String[q0VarArr.length]; for (int i10 = 0; i10 < q0VarArr.length; i10++) { strArr[i10] = q0VarArr[i10].f10275a; } return f(strArr); } public a f(String... strArr) { if (!this.f10247a) { throw new IllegalStateException("no TLS versions for cleartext connections"); } if (strArr.length == 0) { throw new IllegalArgumentException("At least one TLS version is required"); } this.f10249c = (String[]) strArr.clone(); return this; } a(boolean z10) { this.f10247a = z10; } } static { l lVar = l.Z0; l lVar2 = l.f10168d1; l lVar3 = l.f10159a1; l lVar4 = l.f10171e1; l lVar5 = l.f10189k1; l lVar6 = l.f10186j1; l[] lVarArr = {lVar, lVar2, lVar3, lVar4, lVar5, lVar6}; f10237e = lVarArr; l[] lVarArr2 = {lVar, lVar2, lVar3, lVar4, lVar5, lVar6, l.K0, l.L0, l.f10182i0, l.f10185j0, l.G, l.K, l.f10187k}; f10238f = lVarArr2; a b10 = new a(true).b(lVarArr); q0 q0Var = q0.TLS_1_3; q0 q0Var2 = q0.TLS_1_2; f10239g = b10.e(q0Var, q0Var2).d(true).a(); a b11 = new a(true).b(lVarArr2); q0 q0Var3 = q0.TLS_1_0; o a10 = b11.e(q0Var, q0Var2, q0.TLS_1_1, q0Var3).d(true).a(); f10240h = a10; f10241i = new a(a10).e(q0Var3).d(true).a(); f10242j = new a(false).a(); } o(a aVar) { this.f10243a = aVar.f10247a; this.f10245c = aVar.f10248b; this.f10246d = aVar.f10249c; this.f10244b = aVar.f10250d; } private o b(SSLSocket sSLSocket, boolean z10) { String[] x10 = this.f10245c != null ? i5.c.x(l.f10160b, sSLSocket.getEnabledCipherSuites(), this.f10245c) : sSLSocket.getEnabledCipherSuites(); String[] x11 = this.f10246d != null ? i5.c.x(i5.c.f10887q, sSLSocket.getEnabledProtocols(), this.f10246d) : sSLSocket.getEnabledProtocols(); String[] supportedCipherSuites = sSLSocket.getSupportedCipherSuites(); int v10 = i5.c.v(l.f10160b, supportedCipherSuites, "TLS_FALLBACK_SCSV"); if (z10 && v10 != -1) { x10 = i5.c.l(x10, supportedCipherSuites[v10]); } return new a(this).c(x10).f(x11).a(); } void a(SSLSocket sSLSocket, boolean z10) { o b10 = b(sSLSocket, z10); String[] strArr = b10.f10246d; if (strArr != null) { sSLSocket.setEnabledProtocols(strArr); } String[] strArr2 = b10.f10245c; if (strArr2 != null) { sSLSocket.setEnabledCipherSuites(strArr2); } } public List c() { String[] strArr = this.f10245c; if (strArr != null) { return l.b(strArr); } return null; } public boolean d(SSLSocket sSLSocket) { if (!this.f10243a) { return false; } String[] strArr = this.f10246d; if (strArr != null && !i5.c.z(i5.c.f10887q, strArr, sSLSocket.getEnabledProtocols())) { return false; } String[] strArr2 = this.f10245c; return strArr2 == null || i5.c.z(l.f10160b, strArr2, sSLSocket.getEnabledCipherSuites()); } public boolean e() { return this.f10243a; } public boolean equals(Object obj) { if (!(obj instanceof o)) { return false; } if (obj == this) { return true; } o oVar = (o) obj; boolean z10 = this.f10243a; if (z10 != oVar.f10243a) { return false; } if (z10) { return Arrays.equals(this.f10245c, oVar.f10245c) && Arrays.equals(this.f10246d, oVar.f10246d) && this.f10244b == oVar.f10244b; } return true; } public boolean f() { return this.f10244b; } public List g() { String[] strArr = this.f10246d; if (strArr != null) { return q0.a(strArr); } return null; } public int hashCode() { if (this.f10243a) { return ((((Arrays.hashCode(this.f10245c) + 527) * 31) + Arrays.hashCode(this.f10246d)) * 31) + (!this.f10244b ? 1 : 0); } return 17; } public String toString() { if (!this.f10243a) { return "ConnectionSpec()"; } return "ConnectionSpec(cipherSuites=" + (this.f10245c != null ? c().toString() : "[all enabled]") + ", tlsVersions=" + (this.f10246d != null ? g().toString() : "[all enabled]") + ", supportsTlsExtensions=" + this.f10244b + ")"; } }