Platform.smali
.class public Lokhttp3/internal/platform/Platform;
.super Ljava/lang/Object;
# static fields
.field public static final INFO:I = 0x4
.field private static final PLATFORM:Lokhttp3/internal/platform/Platform;
.field public static final WARN:I = 0x5
.field private static final logger:Ljava/util/logging/Logger;
# direct methods
.method static constructor <clinit>()V
.registers 1
invoke-static {}, Lokhttp3/internal/platform/Platform;->findPlatform()Lokhttp3/internal/platform/Platform;
move-result-object v0
sput-object v0, Lokhttp3/internal/platform/Platform;->PLATFORM:Lokhttp3/internal/platform/Platform;
const-class v0, Lokhttp3/OkHttpClient;
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/platform/Platform;->logger:Ljava/util/logging/Logger;
return-void
.end method
.method public constructor <init>()V
.registers 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static alpnProtocolNames(Ljava/util/List;)Ljava/util/List;
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<",
"Lokhttp3/Protocol;",
">;)",
"Ljava/util/List",
"<",
"Ljava/lang/String;",
">;"
}
.end annotation
new-instance v2, Ljava/util/ArrayList;
invoke-interface {p0}, Ljava/util/List;->size()I
move-result v0
invoke-direct {v2, v0}, Ljava/util/ArrayList;-><init>(I)V
const/4 v0, 0x0
invoke-interface {p0}, Ljava/util/List;->size()I
move-result v3
move v1, v0
:goto_f
if-ge v1, v3, :cond_27
invoke-interface {p0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lokhttp3/Protocol;
sget-object v4, Lokhttp3/Protocol;->HTTP_1_0:Lokhttp3/Protocol;
if-ne v0, v4, :cond_1f
:goto_1b
add-int/lit8 v0, v1, 0x1
move v1, v0
goto :goto_f
:cond_1f
invoke-virtual {v0}, Lokhttp3/Protocol;->toString()Ljava/lang/String;
move-result-object v0
invoke-interface {v2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_1b
:cond_27
return-object v2
.end method
.method static concatLengthPrefixed(Ljava/util/List;)[B
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<",
"Lokhttp3/Protocol;",
">;)[B"
}
.end annotation
new-instance v2, Lokio/c;
invoke-direct {v2}, Lokio/c;-><init>()V
const/4 v0, 0x0
invoke-interface {p0}, Ljava/util/List;->size()I
move-result v3
move v1, v0
:goto_b
if-ge v1, v3, :cond_2e
invoke-interface {p0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lokhttp3/Protocol;
sget-object v4, Lokhttp3/Protocol;->HTTP_1_0:Lokhttp3/Protocol;
if-ne v0, v4, :cond_1b
:goto_17
add-int/lit8 v0, v1, 0x1
move v1, v0
goto :goto_b
:cond_1b
invoke-virtual {v0}, Lokhttp3/Protocol;->toString()Ljava/lang/String;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/String;->length()I
move-result v4
invoke-virtual {v2, v4}, Lokio/c;->b(I)Lokio/c;
invoke-virtual {v0}, Lokhttp3/Protocol;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v0}, Lokio/c;->a(Ljava/lang/String;)Lokio/c;
goto :goto_17
:cond_2e
invoke-virtual {v2}, Lokio/c;->t()[B
move-result-object v0
return-object v0
.end method
.method private static findPlatform()Lokhttp3/internal/platform/Platform;
.registers 1
invoke-static {}, Lokhttp3/internal/platform/AndroidPlatform;->buildIfSupported()Lokhttp3/internal/platform/Platform;
move-result-object v0
if-eqz v0, :cond_7
:cond_6
:goto_6
return-object v0
:cond_7
invoke-static {}, Lokhttp3/internal/platform/Jdk9Platform;->buildIfSupported()Lokhttp3/internal/platform/Jdk9Platform;
move-result-object v0
if-nez v0, :cond_6
invoke-static {}, Lokhttp3/internal/platform/JdkWithJettyBootPlatform;->buildIfSupported()Lokhttp3/internal/platform/Platform;
move-result-object v0
if-nez v0, :cond_6
new-instance v0, Lokhttp3/internal/platform/Platform;
invoke-direct {v0}, Lokhttp3/internal/platform/Platform;-><init>()V
goto :goto_6
.end method
.method public static get()Lokhttp3/internal/platform/Platform;
.registers 1
sget-object v0, Lokhttp3/internal/platform/Platform;->PLATFORM:Lokhttp3/internal/platform/Platform;
return-object v0
.end method
.method static readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
.registers 7
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Ljava/lang/Object;",
"Ljava/lang/Class",
"<TT;>;",
"Ljava/lang/String;",
")TT;"
}
.end annotation
const/4 v1, 0x0
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v0
:goto_5
const-class v2, Ljava/lang/Object;
if-eq v0, v2, :cond_31
:try_start_9
invoke-virtual {v0, p2}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v2
const/4 v3, 0x1
invoke-virtual {v2, v3}, Ljava/lang/reflect/Field;->setAccessible(Z)V
invoke-virtual {v2, p0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
if-eqz v2, :cond_1d
invoke-virtual {p1, v2}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z
move-result v3
if-nez v3, :cond_1f
:cond_1d
move-object v0, v1
:goto_1e
return-object v0
:cond_1f
invoke-virtual {p1, v2}, Ljava/lang/Class;->cast(Ljava/lang/Object;)Ljava/lang/Object;
:try_end_22
.catch Ljava/lang/NoSuchFieldException; {:try_start_9 .. :try_end_22} :catch_2b
.catch Ljava/lang/IllegalAccessException; {:try_start_9 .. :try_end_22} :catch_24
move-result-object v0
goto :goto_1e
:catch_24
move-exception v0
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:catch_2b
move-exception v2
invoke-virtual {v0}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;
move-result-object v0
goto :goto_5
:cond_31
const-string/jumbo v0, "delegate"
invoke-virtual {p2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_4a
const-class v0, Ljava/lang/Object;
const-string/jumbo v2, "delegate"
invoke-static {p0, v0, v2}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
if-eqz v0, :cond_4a
invoke-static {v0, p1, p2}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
goto :goto_1e
:cond_4a
move-object v0, v1
goto :goto_1e
.end method
# virtual methods
.method public afterHandshake(Ljavax/net/ssl/SSLSocket;)V
.registers 2
return-void
.end method
.method public buildCertificateChainCleaner(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/tls/CertificateChainCleaner;
.registers 4
new-instance v0, Lokhttp3/internal/tls/BasicCertificateChainCleaner;
invoke-static {p1}, Lokhttp3/internal/tls/TrustRootIndex;->get(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/tls/TrustRootIndex;
move-result-object v1
invoke-direct {v0, v1}, Lokhttp3/internal/tls/BasicCertificateChainCleaner;-><init>(Lokhttp3/internal/tls/TrustRootIndex;)V
return-object v0
.end method
.method public configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljavax/net/ssl/SSLSocket;",
"Ljava/lang/String;",
"Ljava/util/List",
"<",
"Lokhttp3/Protocol;",
">;)V"
}
.end annotation
return-void
.end method
.method public connectSocket(Ljava/net/Socket;Ljava/net/InetSocketAddress;I)V
.registers 4
invoke-virtual {p1, p2, p3}, Ljava/net/Socket;->connect(Ljava/net/SocketAddress;I)V
return-void
.end method
.method public getPrefix()Ljava/lang/String;
.registers 2
const-string/jumbo v0, "OkHttp"
return-object v0
.end method
.method public getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
.registers 3
const/4 v0, 0x0
return-object v0
.end method
.method public getStackTraceForCloseable(Ljava/lang/String;)Ljava/lang/Object;
.registers 4
sget-object v0, Lokhttp3/internal/platform/Platform;->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_10
new-instance v0, Ljava/lang/Throwable;
invoke-direct {v0, p1}, Ljava/lang/Throwable;-><init>(Ljava/lang/String;)V
:goto_f
return-object v0
:cond_10
const/4 v0, 0x0
goto :goto_f
.end method
.method public isCleartextTrafficPermitted(Ljava/lang/String;)Z
.registers 3
const/4 v0, 0x1
return v0
.end method
.method public log(ILjava/lang/String;Ljava/lang/Throwable;)V
.registers 6
const/4 v0, 0x5
if-ne p1, v0, :cond_b
sget-object v0, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;
:goto_5
sget-object v1, Lokhttp3/internal/platform/Platform;->logger:Ljava/util/logging/Logger;
invoke-virtual {v1, v0, p2, p3}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
return-void
:cond_b
sget-object v0, Ljava/util/logging/Level;->INFO:Ljava/util/logging/Level;
goto :goto_5
.end method
.method public logCloseableLeak(Ljava/lang/String;Ljava/lang/Object;)V
.registers 5
if-nez p2, :cond_16
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;
move-result-object v0
const-string/jumbo v1, " To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
:cond_16
const/4 v0, 0x5
check-cast p2, Ljava/lang/Throwable;
invoke-virtual {p0, v0, p1, p2}, Lokhttp3/internal/platform/Platform;->log(ILjava/lang/String;Ljava/lang/Throwable;)V
return-void
.end method
.method public trustManager(Ljavax/net/ssl/SSLSocketFactory;)Ljavax/net/ssl/X509TrustManager;
.registers 6
const/4 v1, 0x0
:try_start_1
const-string/jumbo v0, "sun.security.ssl.SSLContextImpl"
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v0
const-string/jumbo v2, "context"
invoke-static {p1, v0, v2}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
if-nez v0, :cond_13
move-object v0, v1
:goto_12
return-object v0
:cond_13
const-class v2, Ljavax/net/ssl/X509TrustManager;
const-string/jumbo v3, "trustManager"
invoke-static {v0, v2, v3}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljavax/net/ssl/X509TrustManager;
:try_end_1e
.catch Ljava/lang/ClassNotFoundException; {:try_start_1 .. :try_end_1e} :catch_1f
goto :goto_12
:catch_1f
move-exception v0
move-object v0, v1
goto :goto_12
.end method