CrackMe.apk
Download file
package okhttp3.internal.connection;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.ProtocolException;
import java.net.UnknownServiceException;
import java.security.cert.CertificateException;
import java.util.Arrays;
import java.util.List;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSocket;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import okhttp3.ConnectionSpec;
@Metadata(bv = {1, 0, 3}, d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u0001B\u0013\u0012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003¢\u0006\u0002\u0010\u0005J\u000e\u0010\u000b\u001a\u00020\u00042\u0006\u0010\f\u001a\u00020\rJ\u000e\u0010\u000e\u001a\u00020\u00072\u0006\u0010\u000f\u001a\u00020\u0010J\u0010\u0010\b\u001a\u00020\u00072\u0006\u0010\u0011\u001a\u00020\rH\u0002R\u0014\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003X\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0007X\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\nX\u000e¢\u0006\u0002\n\u0000¨\u0006\u0012"}, d2 = {"Lokhttp3/internal/connection/ConnectionSpecSelector;", "", "connectionSpecs", "", "Lokhttp3/ConnectionSpec;", "(Ljava/util/List;)V", "isFallback", "", "isFallbackPossible", "nextModeIndex", "", "configureSecureSocket", "sslSocket", "Ljavax/net/ssl/SSLSocket;", "connectionFailed", "e", "Ljava/io/IOException;", "socket", "okhttp"}, k = 1, mv = {1, 4, 0})
/* compiled from: ConnectionSpecSelector.kt */
public final class ConnectionSpecSelector {
private final List<ConnectionSpec> connectionSpecs;
private boolean isFallback;
private boolean isFallbackPossible;
private int nextModeIndex;
public ConnectionSpecSelector(List<ConnectionSpec> list) {
Intrinsics.checkNotNullParameter(list, "connectionSpecs");
this.connectionSpecs = list;
}
public final ConnectionSpec configureSecureSocket(SSLSocket sSLSocket) throws IOException {
Intrinsics.checkNotNullParameter(sSLSocket, "sslSocket");
ConnectionSpec connectionSpec = null;
ConnectionSpec connectionSpec2 = null;
int i = this.nextModeIndex;
int size = this.connectionSpecs.size();
while (true) {
if (i >= size) {
break;
}
ConnectionSpec connectionSpec3 = this.connectionSpecs.get(i);
if (connectionSpec3.isCompatible(sSLSocket)) {
this.nextModeIndex = i + 1;
connectionSpec = connectionSpec3;
break;
}
i++;
}
if (connectionSpec != null) {
this.isFallbackPossible = isFallbackPossible(sSLSocket);
connectionSpec.apply$okhttp(sSLSocket, this.isFallback);
return connectionSpec;
}
StringBuilder sb = new StringBuilder();
sb.append("Unable to find acceptable protocols. isFallback=");
sb.append(this.isFallback);
sb.append(',');
sb.append(" modes=");
sb.append(this.connectionSpecs);
sb.append(',');
sb.append(" supported protocols=");
String[] enabledProtocols = sSLSocket.getEnabledProtocols();
Intrinsics.checkNotNull(enabledProtocols);
String arrays = Arrays.toString(enabledProtocols);
Intrinsics.checkNotNullExpressionValue(arrays, "java.util.Arrays.toString(this)");
sb.append(arrays);
throw new UnknownServiceException(sb.toString());
}
public final boolean connectionFailed(IOException iOException) {
Intrinsics.checkNotNullParameter(iOException, "e");
this.isFallback = true;
if (this.isFallbackPossible && !(iOException instanceof ProtocolException) && !(iOException instanceof InterruptedIOException) && ((!(iOException instanceof SSLHandshakeException) || !(iOException.getCause() instanceof CertificateException)) && !(iOException instanceof SSLPeerUnverifiedException) && (iOException instanceof SSLException))) {
return true;
}
return false;
}
private final boolean isFallbackPossible(SSLSocket sSLSocket) {
int size = this.connectionSpecs.size();
for (int i = this.nextModeIndex; i < size; i++) {
if (this.connectionSpecs.get(i).isCompatible(sSLSocket)) {
return true;
}
}
return false;
}
}
Download file