NetMirror.apk
Download file
package Z2;
import D2.h;
import java.security.GeneralSecurityException;
import java.security.cert.X509Certificate;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.net.ssl.SSLPeerUnverifiedException;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* JADX INFO: loaded from: classes.dex */
public final class a extends c {
/* JADX INFO: renamed from: c, reason: collision with root package name */
public static final C0047a f2843c = new C0047a(null);
/* JADX INFO: renamed from: b, reason: collision with root package name */
private final e f2844b;
/* JADX INFO: renamed from: Z2.a$a, reason: collision with other inner class name */
public static final class C0047a {
private C0047a() {
}
public /* synthetic */ C0047a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
public a(e eVar) {
h.f(eVar, "trustRootIndex");
this.f2844b = eVar;
}
private final boolean b(X509Certificate x509Certificate, X509Certificate x509Certificate2) {
if (!h.b(x509Certificate.getIssuerDN(), x509Certificate2.getSubjectDN())) {
return false;
}
try {
x509Certificate.verify(x509Certificate2.getPublicKey());
return true;
} catch (GeneralSecurityException unused) {
return false;
}
}
@Override // Z2.c
public List a(List list, String str) throws SSLPeerUnverifiedException {
h.f(list, "chain");
h.f(str, "hostname");
ArrayDeque arrayDeque = new ArrayDeque(list);
ArrayList arrayList = new ArrayList();
Object objRemoveFirst = arrayDeque.removeFirst();
h.e(objRemoveFirst, "queue.removeFirst()");
arrayList.add(objRemoveFirst);
boolean z3 = false;
for (int i3 = 0; i3 < 9; i3++) {
Object obj = arrayList.get(arrayList.size() - 1);
if (obj == null) {
throw new NullPointerException("null cannot be cast to non-null type java.security.cert.X509Certificate");
}
X509Certificate x509Certificate = (X509Certificate) obj;
X509Certificate x509CertificateA = this.f2844b.a(x509Certificate);
if (x509CertificateA == null) {
Iterator it = arrayDeque.iterator();
h.e(it, "queue.iterator()");
while (it.hasNext()) {
Object next = it.next();
if (next == null) {
throw new NullPointerException("null cannot be cast to non-null type java.security.cert.X509Certificate");
}
X509Certificate x509Certificate2 = (X509Certificate) next;
if (b(x509Certificate, x509Certificate2)) {
it.remove();
arrayList.add(x509Certificate2);
}
}
if (z3) {
return arrayList;
}
throw new SSLPeerUnverifiedException("Failed to find a trusted cert that signed " + x509Certificate);
}
if (arrayList.size() > 1 || !h.b(x509Certificate, x509CertificateA)) {
arrayList.add(x509CertificateA);
}
if (b(x509CertificateA, x509CertificateA)) {
return arrayList;
}
z3 = true;
}
throw new SSLPeerUnverifiedException("Certificate chain too long: " + arrayList);
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
return (obj instanceof a) && h.b(((a) obj).f2844b, this.f2844b);
}
public int hashCode() {
return this.f2844b.hashCode();
}
}
⚠️ This content was hidden by an advertisement filtering extension in your browser. Please disable it and reload the page to access the decompiled content.
We only display one small text ad to keep this service free. Here's what it looks like:
Read the Docs for Business: You write the docs. We do the rest.
Try it today!Ad by EthicalAds
Download file