- 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
58 lines
2.0 KiB
Java
58 lines
2.0 KiB
Java
package okhttp3.internal.platform;
|
|
|
|
import android.net.ssl.SSLSockets;
|
|
import java.io.IOException;
|
|
import java.util.List;
|
|
import javax.net.ssl.SSLParameters;
|
|
import javax.net.ssl.SSLSocket;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class Android10Platform extends AndroidPlatform {
|
|
public Android10Platform(Class cls) {
|
|
super(cls, null, null, null, null, null);
|
|
}
|
|
|
|
@Override // okhttp3.internal.platform.AndroidPlatform, okhttp3.internal.platform.Platform
|
|
public void configureTlsExtensions(SSLSocket sSLSocket, String str, List list) {
|
|
try {
|
|
enableSessionTickets(sSLSocket);
|
|
SSLParameters sSLParameters = sSLSocket.getSSLParameters();
|
|
sSLParameters.setApplicationProtocols((String[]) Platform.alpnProtocolNames(list).toArray(new String[0]));
|
|
sSLSocket.setSSLParameters(sSLParameters);
|
|
} catch (IllegalArgumentException e) {
|
|
throw new IOException("Android internal error", e);
|
|
}
|
|
}
|
|
|
|
public final void enableSessionTickets(SSLSocket sSLSocket) {
|
|
boolean isSupportedSocket;
|
|
isSupportedSocket = SSLSockets.isSupportedSocket(sSLSocket);
|
|
if (isSupportedSocket) {
|
|
SSLSockets.setUseSessionTickets(sSLSocket, true);
|
|
}
|
|
}
|
|
|
|
@Override // okhttp3.internal.platform.AndroidPlatform, okhttp3.internal.platform.Platform
|
|
public String getSelectedProtocol(SSLSocket sSLSocket) {
|
|
String applicationProtocol;
|
|
applicationProtocol = sSLSocket.getApplicationProtocol();
|
|
if (applicationProtocol == null || applicationProtocol.isEmpty()) {
|
|
return null;
|
|
}
|
|
return applicationProtocol;
|
|
}
|
|
|
|
public static Platform buildIfSupported() {
|
|
if (!Platform.isAndroid()) {
|
|
return null;
|
|
}
|
|
try {
|
|
if (AndroidPlatform.getSdkInt() >= 29) {
|
|
return new Android10Platform(Class.forName("com.android.org.conscrypt.SSLParametersImpl"));
|
|
}
|
|
} catch (ReflectiveOperationException unused) {
|
|
}
|
|
return null;
|
|
}
|
|
}
|