448 lines
13 KiB
Smali
448 lines
13 KiB
Smali
.class public final Lokhttp3/internal/platform/OpenJSSEPlatform;
|
|
.super Lokhttp3/internal/platform/Platform;
|
|
.source "OpenJSSEPlatform.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lokhttp3/internal/platform/OpenJSSEPlatform$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/SourceDebugExtension;
|
|
value = "SMAP\nOpenJSSEPlatform.kt\nKotlin\n*S Kotlin\n*F\n+ 1 OpenJSSEPlatform.kt\nokhttp3/internal/platform/OpenJSSEPlatform\n+ 2 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n*L\n1#1,101:1\n37#2,2:102\n*E\n*S KotlinDebug\n*F\n+ 1 OpenJSSEPlatform.kt\nokhttp3/internal/platform/OpenJSSEPlatform\n*L\n68#1,2:102\n*E\n"
|
|
.end annotation
|
|
|
|
.annotation runtime Lkotlin/Metadata;
|
|
bv = {}
|
|
d1 = {
|
|
"\u0000F\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0006\u0018\u0000 \u00192\u00020\u0001:\u0001\u0019B\t\u0008\u0002\u00a2\u0006\u0004\u0008\u0017\u0010\u0018J\u0008\u0010\u0003\u001a\u00020\u0002H\u0016J\u0008\u0010\u0005\u001a\u00020\u0004H\u0016J\u0012\u0010\u0008\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0007\u001a\u00020\u0006H\u0016J-\u0010\u0012\u001a\u00020\u00112\u0006\u0010\n\u001a\u00020\t2\u0008\u0010\u000c\u001a\u0004\u0018\u00010\u000b2\u0011\u0010\u0010\u001a\r\u0012\t\u0012\u00070\u000e\u00a2\u0006\u0002\u0008\u000f0\rH\u0016J\u0012\u0010\u0013\u001a\u0004\u0018\u00010\u000b2\u0006\u0010\n\u001a\u00020\tH\u0016R\u0014\u0010\u0015\u001a\u00020\u00148\u0002X\u0082\u0004\u00a2\u0006\u0006\n\u0004\u0008\u0015\u0010\u0016\u00a8\u0006\u001a"
|
|
}
|
|
d2 = {
|
|
"Lokhttp3/internal/platform/OpenJSSEPlatform;",
|
|
"Lokhttp3/internal/platform/Platform;",
|
|
"Ljavax/net/ssl/SSLContext;",
|
|
"newSSLContext",
|
|
"Ljavax/net/ssl/X509TrustManager;",
|
|
"platformTrustManager",
|
|
"Ljavax/net/ssl/SSLSocketFactory;",
|
|
"sslSocketFactory",
|
|
"trustManager",
|
|
"Ljavax/net/ssl/SSLSocket;",
|
|
"sslSocket",
|
|
"",
|
|
"hostname",
|
|
"",
|
|
"Lokhttp3/Protocol;",
|
|
"Lkotlin/jvm/JvmSuppressWildcards;",
|
|
"protocols",
|
|
"Lkotlin/d1;",
|
|
"configureTlsExtensions",
|
|
"getSelectedProtocol",
|
|
"Ljava/security/Provider;",
|
|
"provider",
|
|
"Ljava/security/Provider;",
|
|
"<init>",
|
|
"()V",
|
|
"Companion",
|
|
"okhttp"
|
|
}
|
|
k = 0x1
|
|
mv = {
|
|
0x1,
|
|
0x4,
|
|
0x0
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final Companion:Lokhttp3/internal/platform/OpenJSSEPlatform$Companion;
|
|
|
|
.field private static final isSupported:Z
|
|
|
|
|
|
# instance fields
|
|
.field private final provider:Ljava/security/Provider;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 3
|
|
|
|
new-instance v0, Lokhttp3/internal/platform/OpenJSSEPlatform$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lokhttp3/internal/platform/OpenJSSEPlatform$Companion;-><init>(Lkotlin/jvm/internal/u;)V
|
|
|
|
sput-object v0, Lokhttp3/internal/platform/OpenJSSEPlatform;->Companion:Lokhttp3/internal/platform/OpenJSSEPlatform$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:try_start_0
|
|
const-string v2, "org.openjsse.net.ssl.OpenJSSE"
|
|
|
|
.line 1
|
|
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v2, v1, v0}, Ljava/lang/Class;->forName(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;
|
|
:try_end_0
|
|
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
.line 2
|
|
:catch_0
|
|
sput-boolean v1, Lokhttp3/internal/platform/OpenJSSEPlatform;->isSupported:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Lokhttp3/internal/platform/Platform;-><init>()V
|
|
|
|
.line 2
|
|
new-instance v0, Lorg/openjsse/net/ssl/OpenJSSE;
|
|
|
|
invoke-direct {v0}, Lorg/openjsse/net/ssl/OpenJSSE;-><init>()V
|
|
|
|
check-cast v0, Ljava/security/Provider;
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/platform/OpenJSSEPlatform;->provider:Ljava/security/Provider;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/u;)V
|
|
.locals 0
|
|
|
|
.line 3
|
|
invoke-direct {p0}, Lokhttp3/internal/platform/OpenJSSEPlatform;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$isSupported$cp()Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
sget-boolean v0, Lokhttp3/internal/platform/OpenJSSEPlatform;->isSupported:Z
|
|
|
|
return v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
|
|
.locals 2
|
|
.param p1 # Ljavax/net/ssl/SSLSocket;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Lorg/jetbrains/annotations/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Ljava/util/List;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljavax/net/ssl/SSLSocket;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/List<",
|
|
"Lokhttp3/Protocol;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "sslSocket"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "protocols"
|
|
|
|
invoke-static {p3, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 1
|
|
instance-of v0, p1, Lorg/openjsse/javax/net/ssl/SSLSocket;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
check-cast p1, Lorg/openjsse/javax/net/ssl/SSLSocket;
|
|
|
|
invoke-virtual {p1}, Lorg/openjsse/javax/net/ssl/SSLSocket;->getSSLParameters()Ljavax/net/ssl/SSLParameters;
|
|
|
|
move-result-object p2
|
|
|
|
.line 3
|
|
instance-of v0, p2, Lorg/openjsse/javax/net/ssl/SSLParameters;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 4
|
|
sget-object v0, Lokhttp3/internal/platform/Platform;->Companion:Lokhttp3/internal/platform/Platform$Companion;
|
|
|
|
invoke-virtual {v0, p3}, Lokhttp3/internal/platform/Platform$Companion;->alpnProtocolNames(Ljava/util/List;)Ljava/util/List;
|
|
|
|
move-result-object p3
|
|
|
|
.line 5
|
|
move-object v0, p2
|
|
|
|
check-cast v0, Lorg/openjsse/javax/net/ssl/SSLParameters;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
new-array v1, v1, [Ljava/lang/String;
|
|
|
|
.line 6
|
|
invoke-interface {p3, v1}, Ljava/util/Collection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object p3
|
|
|
|
const-string v1, "null cannot be cast to non-null type kotlin.Array<T>"
|
|
|
|
invoke-static {p3, v1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
check-cast p3, [Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, p3}, Lorg/openjsse/javax/net/ssl/SSLParameters;->setApplicationProtocols([Ljava/lang/String;)V
|
|
|
|
.line 7
|
|
invoke-virtual {p1, p2}, Lorg/openjsse/javax/net/ssl/SSLSocket;->setSSLParameters(Ljavax/net/ssl/SSLParameters;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 8
|
|
:cond_0
|
|
invoke-super {p0, p1, p2, p3}, Lokhttp3/internal/platform/Platform;->configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
|
|
.locals 1
|
|
.param p1 # Ljavax/net/ssl/SSLSocket;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Lorg/jetbrains/annotations/Nullable;
|
|
.end annotation
|
|
|
|
const-string v0, "sslSocket"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 1
|
|
instance-of v0, p1, Lorg/openjsse/javax/net/ssl/SSLSocket;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 2
|
|
check-cast p1, Lorg/openjsse/javax/net/ssl/SSLSocket;
|
|
|
|
invoke-virtual {p1}, Lorg/openjsse/javax/net/ssl/SSLSocket;->getApplicationProtocol()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Ljava/lang/String;->hashCode()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const-string v0, ""
|
|
|
|
.line 3
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
:goto_0
|
|
const/4 p1, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
.line 4
|
|
:cond_2
|
|
invoke-super {p0, p1}, Lokhttp3/internal/platform/Platform;->getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_3
|
|
:goto_1
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public newSSLContext()Ljavax/net/ssl/SSLContext;
|
|
.locals 2
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lokhttp3/internal/platform/OpenJSSEPlatform;->provider:Ljava/security/Provider;
|
|
|
|
const-string v1, "TLSv1.3"
|
|
|
|
invoke-static {v1, v0}, Ljavax/net/ssl/SSLContext;->getInstance(Ljava/lang/String;Ljava/security/Provider;)Ljavax/net/ssl/SSLContext;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "SSLContext.getInstance(\"TLSv1.3\", provider)"
|
|
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/f0;->o(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public platformTrustManager()Ljavax/net/ssl/X509TrustManager;
|
|
.locals 4
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {}, Ljavax/net/ssl/TrustManagerFactory;->getDefaultAlgorithm()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/platform/OpenJSSEPlatform;->provider:Ljava/security/Provider;
|
|
|
|
.line 2
|
|
invoke-static {v0, v1}, Ljavax/net/ssl/TrustManagerFactory;->getInstance(Ljava/lang/String;Ljava/security/Provider;)Ljavax/net/ssl/TrustManagerFactory;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 3
|
|
invoke-virtual {v0, v1}, Ljavax/net/ssl/TrustManagerFactory;->init(Ljava/security/KeyStore;)V
|
|
|
|
const-string v1, "factory"
|
|
|
|
.line 4
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/f0;->o(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljavax/net/ssl/TrustManagerFactory;->getTrustManagers()[Ljavax/net/ssl/TrustManager;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lkotlin/jvm/internal/f0;->m(Ljava/lang/Object;)V
|
|
|
|
.line 5
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-ne v1, v2, :cond_0
|
|
|
|
aget-object v1, v0, v3
|
|
|
|
instance-of v1, v1, Ljavax/net/ssl/X509TrustManager;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v2, v3
|
|
|
|
:goto_0
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 6
|
|
aget-object v0, v0, v3
|
|
|
|
const-string v1, "null cannot be cast to non-null type javax.net.ssl.X509TrustManager"
|
|
|
|
invoke-static {v0, v1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
check-cast v0, Ljavax/net/ssl/X509TrustManager;
|
|
|
|
return-object v0
|
|
|
|
:cond_1
|
|
const-string v1, "Unexpected default trust managers: "
|
|
|
|
.line 7
|
|
invoke-static {v1}, Landroid/support/v4/media/d;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v0}, Ljava/util/Arrays;->toString([Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v2, "java.util.Arrays.toString(this)"
|
|
|
|
invoke-static {v0, v2}, Lkotlin/jvm/internal/f0;->o(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 8
|
|
new-instance v1, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public trustManager(Ljavax/net/ssl/SSLSocketFactory;)Ljavax/net/ssl/X509TrustManager;
|
|
.locals 1
|
|
.param p1 # Ljavax/net/ssl/SSLSocketFactory;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Lorg/jetbrains/annotations/Nullable;
|
|
.end annotation
|
|
|
|
const-string v0, "sslSocketFactory"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 1
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
const-string v0, "clientBuilder.sslSocketFactory(SSLSocketFactory) not supported with OpenJSSE"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|