apkfuckery/com.discord/smali/okhttp3/internal/g/b.smali

265 lines
6.6 KiB
Smali
Raw Normal View History

2019-02-27 21:13:14 +00:00
.class public final Lokhttp3/internal/g/b;
.super Lokhttp3/internal/g/f;
2019-02-04 20:29:01 +00:00
.source "ConscryptPlatform.java"
2019-02-04 20:08:30 +00:00
# direct methods
.method private constructor <init>()V
.locals 0
2019-02-27 21:13:14 +00:00
invoke-direct {p0}, Lokhttp3/internal/g/f;-><init>()V
2019-02-04 20:08:30 +00:00
return-void
.end method
2019-02-27 21:13:14 +00:00
.method public static BG()Lokhttp3/internal/g/b;
2019-02-04 20:08:30 +00:00
.locals 2
const/4 v0, 0x0
:try_start_0
2019-02-17 02:24:41 +00:00
const-string v1, "org.conscrypt.Conscrypt"
2019-02-04 20:08:30 +00:00
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
invoke-static {}, Lorg/conscrypt/Conscrypt;->isAvailable()Z
move-result v1
if-nez v1, :cond_0
return-object v0
:cond_0
2019-02-27 21:13:14 +00:00
new-instance v1, Lokhttp3/internal/g/b;
2019-02-04 20:08:30 +00:00
2019-02-27 21:13:14 +00:00
invoke-direct {v1}, Lokhttp3/internal/g/b;-><init>()V
2019-02-04 20:08:30 +00:00
:try_end_0
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
return-object v1
:catch_0
return-object v0
.end method
2019-02-17 02:24:41 +00:00
.method private static getProvider()Ljava/security/Provider;
.locals 1
invoke-static {}, Lorg/conscrypt/Conscrypt;->newProviderBuilder()Lorg/conscrypt/Conscrypt$ProviderBuilder;
move-result-object v0
invoke-virtual {v0}, Lorg/conscrypt/Conscrypt$ProviderBuilder;->provideTrustManager()Lorg/conscrypt/Conscrypt$ProviderBuilder;
move-result-object v0
invoke-virtual {v0}, Lorg/conscrypt/Conscrypt$ProviderBuilder;->build()Ljava/security/Provider;
move-result-object v0
return-object v0
.end method
2019-02-04 20:08:30 +00:00
# virtual methods
2019-02-27 21:13:14 +00:00
.method public final BE()Ljavax/net/ssl/SSLContext;
2019-02-04 20:08:30 +00:00
.locals 3
:try_start_0
2019-02-17 02:24:41 +00:00
const-string v0, "TLSv1.3"
2019-02-04 20:08:30 +00:00
2019-02-27 21:13:14 +00:00
invoke-static {}, Lokhttp3/internal/g/b;->getProvider()Ljava/security/Provider;
2019-02-04 20:08:30 +00:00
2019-02-17 02:24:41 +00:00
move-result-object v1
2019-02-04 20:08:30 +00:00
invoke-static {v0, v1}, Ljavax/net/ssl/SSLContext;->getInstance(Ljava/lang/String;Ljava/security/Provider;)Ljavax/net/ssl/SSLContext;
move-result-object v0
:try_end_0
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_0
return-object v0
:catch_0
move-exception v0
2019-02-17 02:24:41 +00:00
:try_start_1
const-string v1, "TLS"
2019-02-27 21:13:14 +00:00
invoke-static {}, Lokhttp3/internal/g/b;->getProvider()Ljava/security/Provider;
2019-02-17 02:24:41 +00:00
move-result-object v2
invoke-static {v1, v2}, Ljavax/net/ssl/SSLContext;->getInstance(Ljava/lang/String;Ljava/security/Provider;)Ljavax/net/ssl/SSLContext;
move-result-object v0
:try_end_1
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_1 .. :try_end_1} :catch_1
return-object v0
:catch_1
2019-02-04 20:08:30 +00:00
new-instance v1, Ljava/lang/IllegalStateException;
const-string v2, "No TLS provider"
invoke-direct {v1, v2, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v1
.end method
.method public final a(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljavax/net/ssl/SSLSocket;",
"Ljava/lang/String;",
"Ljava/util/List<",
"Lokhttp3/u;",
">;)V"
}
.end annotation
invoke-static {p1}, Lorg/conscrypt/Conscrypt;->isConscrypt(Ljavax/net/ssl/SSLSocket;)Z
move-result v0
if-eqz v0, :cond_1
if-eqz p2, :cond_0
const/4 v0, 0x1
invoke-static {p1, v0}, Lorg/conscrypt/Conscrypt;->setUseSessionTickets(Ljavax/net/ssl/SSLSocket;Z)V
invoke-static {p1, p2}, Lorg/conscrypt/Conscrypt;->setHostname(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;)V
:cond_0
2019-02-27 21:13:14 +00:00
invoke-static {p3}, Lokhttp3/internal/g/f;->af(Ljava/util/List;)Ljava/util/List;
2019-02-04 20:08:30 +00:00
move-result-object p2
const/4 p3, 0x0
new-array p3, p3, [Ljava/lang/String;
invoke-interface {p2, p3}, Ljava/util/List;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object p2
check-cast p2, [Ljava/lang/String;
invoke-static {p1, p2}, Lorg/conscrypt/Conscrypt;->setApplicationProtocols(Ljavax/net/ssl/SSLSocket;[Ljava/lang/String;)V
return-void
:cond_1
2019-02-27 21:13:14 +00:00
invoke-super {p0, p1, p2, p3}, Lokhttp3/internal/g/f;->a(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
2019-02-04 20:08:30 +00:00
return-void
.end method
.method public final b(Ljavax/net/ssl/SSLSocketFactory;)Ljavax/net/ssl/X509TrustManager;
.locals 2
2019-02-17 02:24:41 +00:00
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
2019-02-04 20:08:30 +00:00
invoke-static {p1}, Lorg/conscrypt/Conscrypt;->isConscrypt(Ljavax/net/ssl/SSLSocketFactory;)Z
move-result v0
if-nez v0, :cond_0
2019-02-27 21:13:14 +00:00
invoke-super {p0, p1}, Lokhttp3/internal/g/f;->b(Ljavax/net/ssl/SSLSocketFactory;)Ljavax/net/ssl/X509TrustManager;
2019-02-04 20:08:30 +00:00
move-result-object p1
return-object p1
:cond_0
:try_start_0
const-class v0, Ljava/lang/Object;
const-string v1, "sslParameters"
2019-02-27 21:13:14 +00:00
invoke-static {p1, v0, v1}, Lokhttp3/internal/g/b;->a(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
2019-02-04 20:08:30 +00:00
move-result-object p1
if-eqz p1, :cond_1
const-class v0, Ljavax/net/ssl/X509TrustManager;
const-string v1, "x509TrustManager"
2019-02-27 21:13:14 +00:00
invoke-static {p1, v0, v1}, Lokhttp3/internal/g/b;->a(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
2019-02-04 20:08:30 +00:00
move-result-object p1
check-cast p1, Ljavax/net/ssl/X509TrustManager;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
return-object p1
:cond_1
const/4 p1, 0x0
return-object p1
:catch_0
move-exception p1
new-instance v0, Ljava/lang/UnsupportedOperationException;
const-string v1, "clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on Conscrypt"
invoke-direct {v0, v1, p1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v0
.end method
.method public final c(Ljavax/net/ssl/SSLSocketFactory;)V
.locals 1
invoke-static {p1}, Lorg/conscrypt/Conscrypt;->isConscrypt(Ljavax/net/ssl/SSLSocketFactory;)Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x1
invoke-static {p1, v0}, Lorg/conscrypt/Conscrypt;->setUseEngineSocket(Ljavax/net/ssl/SSLSocketFactory;Z)V
:cond_0
return-void
.end method
.method public final e(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
.locals 1
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
invoke-static {p1}, Lorg/conscrypt/Conscrypt;->isConscrypt(Ljavax/net/ssl/SSLSocket;)Z
move-result v0
if-eqz v0, :cond_0
invoke-static {p1}, Lorg/conscrypt/Conscrypt;->getApplicationProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
move-result-object p1
return-object p1
:cond_0
2019-02-27 21:13:14 +00:00
invoke-super {p0, p1}, Lokhttp3/internal/g/f;->e(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
2019-02-04 20:08:30 +00:00
move-result-object p1
return-object p1
.end method