- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
70 lines
2.4 KiB
Java
70 lines
2.4 KiB
Java
package okhttp3.internal.platform;
|
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.Provider;
|
|
import java.util.List;
|
|
import javax.net.ssl.SSLContext;
|
|
import javax.net.ssl.SSLSocket;
|
|
import javax.net.ssl.SSLSocketFactory;
|
|
import org.conscrypt.Conscrypt;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class ConscryptPlatform extends Platform {
|
|
public final Provider getProvider() {
|
|
return Conscrypt.newProviderBuilder().provideTrustManager().build();
|
|
}
|
|
|
|
@Override // okhttp3.internal.platform.Platform
|
|
public void configureTlsExtensions(SSLSocket sSLSocket, String str, List list) {
|
|
if (Conscrypt.isConscrypt(sSLSocket)) {
|
|
if (str != null) {
|
|
Conscrypt.setUseSessionTickets(sSLSocket, true);
|
|
Conscrypt.setHostname(sSLSocket, str);
|
|
}
|
|
Conscrypt.setApplicationProtocols(sSLSocket, (String[]) Platform.alpnProtocolNames(list).toArray(new String[0]));
|
|
return;
|
|
}
|
|
super.configureTlsExtensions(sSLSocket, str, list);
|
|
}
|
|
|
|
@Override // okhttp3.internal.platform.Platform
|
|
public String getSelectedProtocol(SSLSocket sSLSocket) {
|
|
if (Conscrypt.isConscrypt(sSLSocket)) {
|
|
return Conscrypt.getApplicationProtocol(sSLSocket);
|
|
}
|
|
return super.getSelectedProtocol(sSLSocket);
|
|
}
|
|
|
|
@Override // okhttp3.internal.platform.Platform
|
|
public SSLContext getSSLContext() {
|
|
try {
|
|
return SSLContext.getInstance("TLSv1.3", getProvider());
|
|
} catch (NoSuchAlgorithmException e) {
|
|
try {
|
|
return SSLContext.getInstance("TLS", getProvider());
|
|
} catch (NoSuchAlgorithmException unused) {
|
|
throw new IllegalStateException("No TLS provider", e);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static ConscryptPlatform buildIfSupported() {
|
|
try {
|
|
Class.forName("org.conscrypt.Conscrypt");
|
|
if (Conscrypt.isAvailable()) {
|
|
return new ConscryptPlatform();
|
|
}
|
|
return null;
|
|
} catch (ClassNotFoundException unused) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
@Override // okhttp3.internal.platform.Platform
|
|
public void configureSslSocketFactory(SSLSocketFactory sSLSocketFactory) {
|
|
if (Conscrypt.isConscrypt(sSLSocketFactory)) {
|
|
Conscrypt.setUseEngineSocket(sSLSocketFactory, true);
|
|
}
|
|
}
|
|
}
|