618 lines
14 KiB
Smali
618 lines
14 KiB
Smali
.class public Lokhttp3/internal/g/f;
|
|
.super Ljava/lang/Object;
|
|
.source "Platform.java"
|
|
|
|
|
|
# static fields
|
|
.field static final buz:Lokhttp3/internal/g/f;
|
|
|
|
.field private static final logger:Ljava/util/logging/Logger;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
invoke-static {}, Lokhttp3/internal/g/a;->De()Lokhttp3/internal/g/f;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
const-string v0, "okhttp.platform"
|
|
|
|
invoke-static {v0}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "conscrypt"
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-static {}, Ljava/security/Security;->getProviders()[Ljava/security/Provider;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
aget-object v0, v0, v1
|
|
|
|
invoke-virtual {v0}, Ljava/security/Provider;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "Conscrypt"
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-static {}, Lokhttp3/internal/g/b;->Dh()Lokhttp3/internal/g/b;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
invoke-static {}, Lokhttp3/internal/g/c;->Di()Lokhttp3/internal/g/c;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
invoke-static {}, Lokhttp3/internal/g/d;->De()Lokhttp3/internal/g/f;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
new-instance v0, Lokhttp3/internal/g/f;
|
|
|
|
invoke-direct {v0}, Lokhttp3/internal/g/f;-><init>()V
|
|
|
|
:goto_1
|
|
sput-object v0, Lokhttp3/internal/g/f;->buz:Lokhttp3/internal/g/f;
|
|
|
|
const-class v0, Lokhttp3/t;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lokhttp3/internal/g/f;->logger:Ljava/util/logging/Logger;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static Dj()Lokhttp3/internal/g/f;
|
|
.locals 1
|
|
|
|
sget-object v0, Lokhttp3/internal/g/f;->buz:Lokhttp3/internal/g/f;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static a(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/lang/Object;",
|
|
"Ljava/lang/Class<",
|
|
"TT;>;",
|
|
"Ljava/lang/String;",
|
|
")TT;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
|
|
:goto_0
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_1
|
|
const-class v1, Ljava/lang/Object;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eq v0, v1, :cond_2
|
|
|
|
:try_start_0
|
|
invoke-virtual {v0, p2}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/reflect/Field;->setAccessible(Z)V
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-virtual {p1, v1}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
:cond_0
|
|
invoke-virtual {p1, v1}, Ljava/lang/Class;->cast(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:cond_1
|
|
:goto_2
|
|
return-object v2
|
|
|
|
:catch_0
|
|
new-instance p0, Ljava/lang/AssertionError;
|
|
|
|
invoke-direct {p0}, Ljava/lang/AssertionError;-><init>()V
|
|
|
|
throw p0
|
|
|
|
:catch_1
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const-string v0, "delegate"
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
const-class v1, Ljava/lang/Object;
|
|
|
|
invoke-static {p0, v1, v0}, Lokhttp3/internal/g/f;->a(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
return-object v2
|
|
.end method
|
|
|
|
.method public static ag(Ljava/util/List;)Ljava/util/List;
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Lokhttp3/u;",
|
|
">;)",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-interface {p0}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {p0}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_1
|
|
|
|
invoke-interface {p0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lokhttp3/u;
|
|
|
|
sget-object v4, Lokhttp3/u;->bph:Lokhttp3/u;
|
|
|
|
if-eq v3, v4, :cond_0
|
|
|
|
invoke-virtual {v3}, Lokhttp3/u;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public Df()Ljavax/net/ssl/SSLContext;
|
|
.locals 3
|
|
|
|
const-string v0, "java.specification.version"
|
|
|
|
invoke-static {v0}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "1.7"
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
:try_start_0
|
|
const-string v0, "TLSv1.2"
|
|
|
|
invoke-static {v0}, Ljavax/net/ssl/SSLContext;->getInstance(Ljava/lang/String;)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
|
|
:cond_0
|
|
:try_start_1
|
|
const-string v0, "TLS"
|
|
|
|
invoke-static {v0}, Ljavax/net/ssl/SSLContext;->getInstance(Ljava/lang/String;)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
|
|
move-exception v0
|
|
|
|
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 a(ILjava/lang/String;Ljava/lang/Throwable;)V
|
|
.locals 1
|
|
.param p3 # Ljava/lang/Throwable;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
const/4 v0, 0x5
|
|
|
|
if-ne p1, v0, :cond_0
|
|
|
|
sget-object p1, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object p1, Ljava/util/logging/Level;->INFO:Ljava/util/logging/Level;
|
|
|
|
:goto_0
|
|
sget-object v0, Lokhttp3/internal/g/f;->logger:Ljava/util/logging/Logger;
|
|
|
|
invoke-virtual {v0, p1, p2, p3}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Ljava/net/Socket;Ljava/net/InetSocketAddress;I)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p1, p2, p3}, Ljava/net/Socket;->connect(Ljava/net/SocketAddress;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
|
|
.locals 0
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljavax/net/ssl/SSLSocket;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/List<",
|
|
"Lokhttp3/u;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method protected b(Ljavax/net/ssl/SSLSocketFactory;)Ljavax/net/ssl/X509TrustManager;
|
|
.locals 3
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
const-string v1, "sun.security.ssl.SSLContextImpl"
|
|
|
|
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "context"
|
|
|
|
invoke-static {p1, v1, v2}, Lokhttp3/internal/g/f;->a(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const-class v1, Ljavax/net/ssl/X509TrustManager;
|
|
|
|
const-string v2, "trustManager"
|
|
|
|
invoke-static {p1, v1, v2}, Lokhttp3/internal/g/f;->a(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljavax/net/ssl/X509TrustManager;
|
|
:try_end_0
|
|
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p1
|
|
|
|
:catch_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public b(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/i/c;
|
|
.locals 1
|
|
|
|
new-instance v0, Lokhttp3/internal/i/a;
|
|
|
|
invoke-virtual {p0, p1}, Lokhttp3/internal/g/f;->c(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/i/e;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Lokhttp3/internal/i/a;-><init>(Lokhttp3/internal/i/e;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public c(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/i/e;
|
|
.locals 1
|
|
|
|
new-instance v0, Lokhttp3/internal/i/b;
|
|
|
|
invoke-interface {p1}, Ljavax/net/ssl/X509TrustManager;->getAcceptedIssuers()[Ljava/security/cert/X509Certificate;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Lokhttp3/internal/i/b;-><init>([Ljava/security/cert/X509Certificate;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public c(Ljavax/net/ssl/SSLSocketFactory;)V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final d(Ljavax/net/ssl/SSLSocketFactory;)Lokhttp3/internal/i/c;
|
|
.locals 3
|
|
|
|
invoke-virtual {p0, p1}, Lokhttp3/internal/g/f;->b(Ljavax/net/ssl/SSLSocketFactory;)Ljavax/net/ssl/X509TrustManager;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p0, v0}, Lokhttp3/internal/g/f;->b(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/i/c;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Unable to extract the trust manager on "
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
sget-object v2, Lokhttp3/internal/g/f;->buz:Lokhttp3/internal/g/f;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ", sslSocketFactory is "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public e(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
|
|
.locals 0
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public ei(Ljava/lang/String;)Ljava/lang/Object;
|
|
.locals 2
|
|
|
|
sget-object v0, Lokhttp3/internal/g/f;->logger:Ljava/util/logging/Logger;
|
|
|
|
sget-object v1, Ljava/util/logging/Level;->FINE:Ljava/util/logging/Level;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
new-instance v0, Ljava/lang/Throwable;
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/Throwable;-><init>(Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public f(Ljavax/net/ssl/SSLSocket;)V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public isCleartextTrafficPermitted(Ljava/lang/String;)Z
|
|
.locals 0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public s(Ljava/lang/String;Ljava/lang/Object;)V
|
|
.locals 1
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_0
|
|
const/4 v0, 0x5
|
|
|
|
check-cast p2, Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {p0, v0, p1, p2}, Lokhttp3/internal/g/f;->a(ILjava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public toString()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|