Platform.smali
.class public Lcom/squareup/okhttp/internal/Platform;
.super Ljava/lang/Object;
.source "Platform.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/squareup/okhttp/internal/Platform$JettyNegoProvider;,
Lcom/squareup/okhttp/internal/Platform$JdkWithJettyBootPlatform;,
Lcom/squareup/okhttp/internal/Platform$Android;
}
.end annotation
# static fields
.field private static final PLATFORM:Lcom/squareup/okhttp/internal/Platform;
# direct methods
.method static constructor <clinit>()V
.registers 1
.line 1
invoke-static {}, Lcom/squareup/okhttp/internal/Platform;->findPlatform()Lcom/squareup/okhttp/internal/Platform;
move-result-object v0
sput-object v0, Lcom/squareup/okhttp/internal/Platform;->PLATFORM:Lcom/squareup/okhttp/internal/Platform;
return-void
.end method
.method public constructor <init>()V
.registers 1
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method static concatLengthPrefixed(Ljava/util/List;)[B
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Lcom/squareup/okhttp/Protocol;",
">;)[B"
}
.end annotation
.line 1
new-instance v0, Lokio/Buffer;
invoke-direct {v0}, Lokio/Buffer;-><init>()V
.line 2
invoke-interface {p0}, Ljava/util/List;->size()I
move-result v1
const/4 v2, 0x0
:goto_a
if-ge v2, v1, :cond_2c
.line 3
invoke-interface {p0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Lcom/squareup/okhttp/Protocol;
.line 4
sget-object v4, Lcom/squareup/okhttp/Protocol;->HTTP_1_0:Lcom/squareup/okhttp/Protocol;
if-ne v3, v4, :cond_17
goto :goto_29
.line 5
:cond_17
invoke-virtual {v3}, Lcom/squareup/okhttp/Protocol;->toString()Ljava/lang/String;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/String;->length()I
move-result v4
invoke-virtual {v0, v4}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
.line 6
invoke-virtual {v3}, Lcom/squareup/okhttp/Protocol;->toString()Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v3}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
:goto_29
add-int/lit8 v2, v2, 0x1
goto :goto_a
.line 7
:cond_2c
invoke-virtual {v0}, Lokio/Buffer;->readByteArray()[B
move-result-object p0
return-object p0
.end method
.method private static findPlatform()Lcom/squareup/okhttp/internal/Platform;
.registers 12
const-string v0, "com.android.org.conscrypt.OpenSSLSocketImpl"
const/4 v1, 0x1
const/4 v2, 0x0
.line 1
:try_start_4
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
:try_end_7
.catch Ljava/lang/ClassNotFoundException; {:try_start_4 .. :try_end_7} :catch_8
goto :goto_d
:catch_8
const-string v0, "org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl"
.line 2
:try_start_a
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
.line 3
:goto_d
new-instance v4, Lcom/squareup/okhttp/internal/OptionalMethod;
const-string v0, "setUseSessionTickets"
new-array v3, v1, [Ljava/lang/Class;
sget-object v5, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;
aput-object v5, v3, v2
const/4 v5, 0x0
invoke-direct {v4, v5, v0, v3}, Lcom/squareup/okhttp/internal/OptionalMethod;-><init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V
.line 4
new-instance v0, Lcom/squareup/okhttp/internal/OptionalMethod;
const-string v3, "setHostname"
new-array v6, v1, [Ljava/lang/Class;
const-class v7, Ljava/lang/String;
aput-object v7, v6, v2
invoke-direct {v0, v5, v3, v6}, Lcom/squareup/okhttp/internal/OptionalMethod;-><init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V
:try_end_28
.catch Ljava/lang/ClassNotFoundException; {:try_start_a .. :try_end_28} :catch_78
const-string v3, "android.net.TrafficStats"
.line 5
:try_start_2a
invoke-static {v3}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v3
const-string v6, "tagSocket"
.line 6
new-array v7, v1, [Ljava/lang/Class;
const-class v8, Ljava/net/Socket;
aput-object v8, v7, v2
invoke-virtual {v3, v6, v7}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v6
:try_end_3a
.catch Ljava/lang/ClassNotFoundException; {:try_start_2a .. :try_end_3a} :catch_6a
.catch Ljava/lang/NoSuchMethodException; {:try_start_2a .. :try_end_3a} :catch_6a
:try_start_3a
const-string v7, "untagSocket"
.line 7
new-array v8, v1, [Ljava/lang/Class;
const-class v9, Ljava/net/Socket;
aput-object v9, v8, v2
invoke-virtual {v3, v7, v8}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v3
:try_end_46
.catch Ljava/lang/ClassNotFoundException; {:try_start_3a .. :try_end_46} :catch_67
.catch Ljava/lang/NoSuchMethodException; {:try_start_3a .. :try_end_46} :catch_67
const-string v7, "android.net.Network"
.line 8
:try_start_48
invoke-static {v7}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
.line 9
new-instance v7, Lcom/squareup/okhttp/internal/OptionalMethod;
const-class v8, [B
const-string v9, "getAlpnSelectedProtocol"
new-array v10, v2, [Ljava/lang/Class;
invoke-direct {v7, v8, v9, v10}, Lcom/squareup/okhttp/internal/OptionalMethod;-><init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V
:try_end_56
.catch Ljava/lang/ClassNotFoundException; {:try_start_48 .. :try_end_56} :catch_65
.catch Ljava/lang/NoSuchMethodException; {:try_start_48 .. :try_end_56} :catch_65
.line 10
:try_start_56
new-instance v8, Lcom/squareup/okhttp/internal/OptionalMethod;
const-string v9, "setAlpnProtocols"
new-array v10, v1, [Ljava/lang/Class;
const-class v11, [B
aput-object v11, v10, v2
invoke-direct {v8, v5, v9, v10}, Lcom/squareup/okhttp/internal/OptionalMethod;-><init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V
:try_end_63
.catch Ljava/lang/ClassNotFoundException; {:try_start_56 .. :try_end_63} :catch_6d
.catch Ljava/lang/NoSuchMethodException; {:try_start_56 .. :try_end_63} :catch_6d
move-object v5, v8
goto :goto_6d
:catch_65
move-object v7, v5
goto :goto_6d
:catch_67
move-object v3, v5
move-object v7, v3
goto :goto_6d
:catch_6a
move-object v3, v5
move-object v6, v3
move-object v7, v6
:catch_6d
:goto_6d
move-object v9, v5
move-object v8, v7
move-object v7, v3
.line 11
:try_start_70
new-instance v10, Lcom/squareup/okhttp/internal/Platform$Android;
move-object v3, v10
move-object v5, v0
invoke-direct/range {v3 .. v9}, Lcom/squareup/okhttp/internal/Platform$Android;-><init>(Lcom/squareup/okhttp/internal/OptionalMethod;Lcom/squareup/okhttp/internal/OptionalMethod;Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;Lcom/squareup/okhttp/internal/OptionalMethod;Lcom/squareup/okhttp/internal/OptionalMethod;)V
:try_end_77
.catch Ljava/lang/ClassNotFoundException; {:try_start_70 .. :try_end_77} :catch_78
return-object v10
:catch_78
:try_start_78
const-string v0, "org.eclipse.jetty.alpn.ALPN"
:try_end_7a
.catch Ljava/lang/ClassNotFoundException; {:try_start_78 .. :try_end_7a} :catch_ed
.catch Ljava/lang/NoSuchMethodException; {:try_start_78 .. :try_end_7a} :catch_ed
const-string v3, "org.eclipse.jetty.alpn.ALPN"
.line 12
:try_start_7c
invoke-static {v3}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v3
.line 13
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v5, "$Provider"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v4}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v4
.line 14
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v5, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v6, "$ClientProvider"
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v5}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v10
.line 15
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v5, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v0, "$ServerProvider"
invoke-virtual {v5, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v11
const-string v0, "put"
const/4 v5, 0x2
.line 16
new-array v5, v5, [Ljava/lang/Class;
const-class v6, Ljavax/net/ssl/SSLSocket;
aput-object v6, v5, v2
aput-object v4, v5, v1
invoke-virtual {v3, v0, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v7
const-string v0, "get"
.line 17
new-array v4, v1, [Ljava/lang/Class;
const-class v5, Ljavax/net/ssl/SSLSocket;
aput-object v5, v4, v2
invoke-virtual {v3, v0, v4}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v8
const-string v0, "remove"
.line 18
new-array v1, v1, [Ljava/lang/Class;
const-class v4, Ljavax/net/ssl/SSLSocket;
aput-object v4, v1, v2
invoke-virtual {v3, v0, v1}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v9
.line 19
new-instance v0, Lcom/squareup/okhttp/internal/Platform$JdkWithJettyBootPlatform;
move-object v6, v0
invoke-direct/range {v6 .. v11}, Lcom/squareup/okhttp/internal/Platform$JdkWithJettyBootPlatform;-><init>(Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;Ljava/lang/Class;Ljava/lang/Class;)V
:try_end_ec
.catch Ljava/lang/ClassNotFoundException; {:try_start_7c .. :try_end_ec} :catch_ed
.catch Ljava/lang/NoSuchMethodException; {:try_start_7c .. :try_end_ec} :catch_ed
return-object v0
.line 20
:catch_ed
new-instance v0, Lcom/squareup/okhttp/internal/Platform;
invoke-direct {v0}, Lcom/squareup/okhttp/internal/Platform;-><init>()V
return-object v0
.end method
.method public static get()Lcom/squareup/okhttp/internal/Platform;
.registers 1
.line 1
sget-object v0, Lcom/squareup/okhttp/internal/Platform;->PLATFORM:Lcom/squareup/okhttp/internal/Platform;
return-object v0
.end method
# virtual methods
.method public afterHandshake(Ljavax/net/ssl/SSLSocket;)V
.registers 2
return-void
.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<",
"Lcom/squareup/okhttp/Protocol;",
">;)V"
}
.end annotation
return-void
.end method
.method public connectSocket(Ljava/net/Socket;Ljava/net/InetSocketAddress;I)V
.registers 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 1
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 v0, "OkHttp"
return-object v0
.end method
.method public getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
.registers 2
const/4 p1, 0x0
return-object p1
.end method
.method public logW(Ljava/lang/String;)V
.registers 3
.line 1
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
invoke-virtual {v0, p1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
return-void
.end method
.method public tagSocket(Ljava/net/Socket;)V
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/net/SocketException;
}
.end annotation
return-void
.end method
.method public untagSocket(Ljava/net/Socket;)V
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/net/SocketException;
}
.end annotation
return-void
.end method