.class public final Lb/a/b/c;
.super Lb/a/c/g;

# interfaces
.implements Lb/l;


# instance fields
.field public a:I

.field public final b:Ljava/util/List;

.field public volatile c:Lb/a/c/e;

.field public d:J

.field public e:Z

.field public f:Lc/d;

.field public g:Ljava/net/Socket;

.field public h:Lc/e;

.field public i:I

.field private final k:Lb/al;

.field private l:Ljava/net/Socket;

.field private m:Lb/t;

.field private n:Lb/ae;


# direct methods
.method public constructor <init>(Lb/al;)V
    .locals 2

    invoke-direct {p0}, Lb/a/c/g;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lb/a/b/c;->b:Ljava/util/List;

    const-wide v0, 0x7fffffffffffffffL

    iput-wide v0, p0, Lb/a/b/c;->d:J

    iput-object p1, p0, Lb/a/b/c;->k:Lb/al;

    return-void
.end method

.method private a(IILb/af;Lb/w;)Lb/af;
    .locals 8

    const/4 v2, 0x0

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "CONNECT "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const/4 v1, 0x1

    invoke-static {p4, v1}, Lb/a/c;->a(Lb/w;Z)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " HTTP/1.1"

    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 v3

    :cond_0
    new-instance v4, Lb/a/d/c;

    iget-object v0, p0, Lb/a/b/c;->h:Lc/e;

    iget-object v1, p0, Lb/a/b/c;->f:Lc/d;

    invoke-direct {v4, v2, v2, v0, v1}, Lb/a/d/c;-><init>(Lb/ac;Lb/a/b/g;Lc/e;Lc/d;)V

    iget-object v0, p0, Lb/a/b/c;->h:Lc/e;

    invoke-interface {v0}, Lc/e;->a()Lc/o;

    move-result-object v0

    int-to-long v6, p1

    sget-object v1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-virtual {v0, v6, v7, v1}, Lc/o;->a(JLjava/util/concurrent/TimeUnit;)Lc/o;

    iget-object v0, p0, Lb/a/b/c;->f:Lc/d;

    invoke-interface {v0}, Lc/d;->a()Lc/o;

    move-result-object v0

    int-to-long v6, p2

    sget-object v1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-virtual {v0, v6, v7, v1}, Lc/o;->a(JLjava/util/concurrent/TimeUnit;)Lc/o;

    invoke-virtual {p3}, Lb/af;->c()Lb/u;

    move-result-object v0

    invoke-virtual {v4, v0, v3}, Lb/a/d/c;->a(Lb/u;Ljava/lang/String;)V

    invoke-virtual {v4}, Lb/a/d/c;->a()V

    invoke-virtual {v4}, Lb/a/d/c;->e()Lb/aj;

    move-result-object v0

    invoke-virtual {v0, p3}, Lb/aj;->a(Lb/af;)Lb/aj;

    move-result-object v0

    invoke-virtual {v0}, Lb/aj;->a()Lb/ai;

    move-result-object v5

    invoke-static {v5}, Lb/a/d/m;->a(Lb/ai;)J

    move-result-wide v0

    const-wide/16 v6, -0x1

    cmp-long v6, v0, v6

    if-nez v6, :cond_1

    const-wide/16 v0, 0x0

    :cond_1
    invoke-virtual {v4, v0, v1}, Lb/a/d/c;->b(J)Lc/n;

    move-result-object v0

    const v1, 0x7fffffff

    sget-object v4, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-static {v0, v1, v4}, Lb/a/c;->b(Lc/n;ILjava/util/concurrent/TimeUnit;)Z

    invoke-interface {v0}, Lc/n;->close()V

    invoke-virtual {v5}, Lb/ai;->c()I

    move-result v0

    sparse-switch v0, :sswitch_data_0

    new-instance v0, Ljava/io/IOException;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Unexpected response code for CONNECT: "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v5}, Lb/ai;->c()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    :sswitch_0
    iget-object v0, p0, Lb/a/b/c;->h:Lc/e;

    invoke-interface {v0}, Lc/e;->b()Lc/c;

    move-result-object v0

    invoke-virtual {v0}, Lc/c;->h()Z

    move-result v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lb/a/b/c;->f:Lc/d;

    invoke-interface {v0}, Lc/d;->b()Lc/c;

    move-result-object v0

    invoke-virtual {v0}, Lc/c;->h()Z

    move-result v0

    if-nez v0, :cond_3

    :cond_2
    new-instance v0, Ljava/io/IOException;

    const-string v1, "TLS tunnel buffered too many bytes!"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_3
    move-object p3, v2

    :goto_0
    return-object p3

    :sswitch_1
    iget-object v0, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v0}, Lb/al;->a()Lb/a;

    move-result-object v0

    invoke-virtual {v0}, Lb/a;->g()Lb/b;

    move-result-object v0

    iget-object v1, p0, Lb/a/b/c;->k:Lb/al;

    invoke-interface {v0, v1, v5}, Lb/b;->a(Lb/al;Lb/ai;)Lb/af;

    move-result-object p3

    if-nez p3, :cond_4

    new-instance v0, Ljava/io/IOException;

    const-string v1, "Failed to authenticate with proxy"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_4
    const-string v0, "close"

    const-string v1, "Connection"

    invoke-virtual {v5, v1}, Lb/ai;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_0

    :sswitch_data_0
    .sparse-switch
        0xc8 -> :sswitch_0
        0x197 -> :sswitch_1
    .end sparse-switch
.end method

.method private a(II)V
    .locals 4

    iget-object v0, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v0}, Lb/al;->b()Ljava/net/Proxy;

    move-result-object v1

    iget-object v0, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v0}, Lb/al;->a()Lb/a;

    move-result-object v0

    invoke-virtual {v1}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type;

    move-result-object v2

    sget-object v3, Ljava/net/Proxy$Type;->DIRECT:Ljava/net/Proxy$Type;

    if-eq v2, v3, :cond_0

    invoke-virtual {v1}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type;

    move-result-object v2

    sget-object v3, Ljava/net/Proxy$Type;->HTTP:Ljava/net/Proxy$Type;

    if-ne v2, v3, :cond_1

    :cond_0
    invoke-virtual {v0}, Lb/a;->i()Ljavax/net/SocketFactory;

    move-result-object v0

    invoke-virtual {v0}, Ljavax/net/SocketFactory;->createSocket()Ljava/net/Socket;

    move-result-object v0

    :goto_0
    iput-object v0, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    iget-object v0, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    invoke-virtual {v0, p2}, Ljava/net/Socket;->setSoTimeout(I)V

    :try_start_0
    invoke-static {}, Lb/a/f/a;->a()Lb/a/f/a;

    move-result-object v0

    iget-object v1, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    iget-object v2, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v2}, Lb/al;->d()Ljava/net/InetSocketAddress;

    move-result-object v2

    invoke-virtual {v0, v1, v2, p1}, Lb/a/f/a;->a(Ljava/net/Socket;Ljava/net/InetSocketAddress;I)V
    :try_end_0
    .catch Ljava/net/ConnectException; {:try_start_0 .. :try_end_0} :catch_0

    iget-object v0, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    invoke-static {v0}, Lc/l;->b(Ljava/net/Socket;)Lc/n;

    move-result-object v0

    invoke-static {v0}, Lc/l;->a(Lc/n;)Lc/e;

    move-result-object v0

    iput-object v0, p0, Lb/a/b/c;->h:Lc/e;

    iget-object v0, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    invoke-static {v0}, Lc/l;->a(Ljava/net/Socket;)Lc/m;

    move-result-object v0

    invoke-static {v0}, Lc/l;->a(Lc/m;)Lc/d;

    move-result-object v0

    iput-object v0, p0, Lb/a/b/c;->f:Lc/d;

    return-void

    :cond_1
    new-instance v0, Ljava/net/Socket;

    invoke-direct {v0, v1}, Ljava/net/Socket;-><init>(Ljava/net/Proxy;)V

    goto :goto_0

    :catch_0
    move-exception v0

    new-instance v0, Ljava/net/ConnectException;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Failed to connect to "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v2}, Lb/al;->d()Ljava/net/InetSocketAddress;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/net/ConnectException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method private a(IIILb/a/b/b;)V
    .locals 5

    const/4 v4, 0x0

    new-instance v0, Lb/ag;

    invoke-direct {v0}, Lb/ag;-><init>()V

    iget-object v1, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v1}, Lb/al;->a()Lb/a;

    move-result-object v1

    invoke-virtual {v1}, Lb/a;->k()Lb/w;

    move-result-object v1

    invoke-virtual {v0, v1}, Lb/ag;->a(Lb/w;)Lb/ag;

    move-result-object v0

    const-string v1, "Host"

    iget-object v2, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v2}, Lb/al;->a()Lb/a;

    move-result-object v2

    invoke-virtual {v2}, Lb/a;->k()Lb/w;

    move-result-object v2

    const/4 v3, 0x1

    invoke-static {v2, v3}, Lb/a/c;->a(Lb/w;Z)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lb/ag;->a(Ljava/lang/String;Ljava/lang/String;)Lb/ag;

    move-result-object v0

    const-string v1, "Proxy-Connection"

    const-string v2, "Keep-Alive"

    invoke-virtual {v0, v1, v2}, Lb/ag;->a(Ljava/lang/String;Ljava/lang/String;)Lb/ag;

    move-result-object v0

    const-string v1, "User-Agent"

    invoke-static {}, Lb/a/d;->a()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lb/ag;->a(Ljava/lang/String;Ljava/lang/String;)Lb/ag;

    move-result-object v0

    invoke-virtual {v0}, Lb/ag;->a()Lb/af;

    move-result-object v0

    invoke-virtual {v0}, Lb/af;->g()Lb/w;

    move-result-object v2

    const/4 v1, 0x0

    :goto_0
    add-int/lit8 v1, v1, 0x1

    const/16 v3, 0x15

    if-le v1, v3, :cond_0

    new-instance v0, Ljava/net/ProtocolException;

    const-string v1, "Too many tunnel connections attempted: 21"

    invoke-direct {v0, v1}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    invoke-direct {p0, p1, p2}, Lb/a/b/c;->a(II)V

    invoke-direct {p0, p2, p3, v0, v2}, Lb/a/b/c;->a(IILb/af;Lb/w;)Lb/af;

    move-result-object v0

    if-eqz v0, :cond_1

    iget-object v3, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    invoke-static {v3}, Lb/a/c;->a(Ljava/net/Socket;)V

    iput-object v4, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    iput-object v4, p0, Lb/a/b/c;->f:Lc/d;

    iput-object v4, p0, Lb/a/b/c;->h:Lc/e;

    goto :goto_0

    :cond_1
    invoke-direct {p0, p4}, Lb/a/b/c;->a(Lb/a/b/b;)V

    return-void
.end method

.method private a(Lb/a/b/b;)V
    .locals 11

    const/4 v9, 0x0

    const/4 v1, 0x0

    const/4 v8, 0x1

    iget-object v0, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v0}, Lb/al;->a()Lb/a;

    move-result-object v0

    invoke-virtual {v0}, Lb/a;->j()Ljavax/net/ssl/SSLSocketFactory;

    move-result-object v0

    if-eqz v0, :cond_8

    iget-object v0, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v0}, Lb/al;->a()Lb/a;

    move-result-object v2

    invoke-virtual {v2}, Lb/a;->j()Ljavax/net/ssl/SSLSocketFactory;

    move-result-object v0

    :try_start_0
    iget-object v3, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    invoke-virtual {v2}, Lb/a;->k()Lb/w;

    move-result-object v4

    invoke-virtual {v4}, Lb/w;->g()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2}, Lb/a;->k()Lb/w;

    move-result-object v5

    invoke-virtual {v5}, Lb/w;->j()I

    move-result v5

    const/4 v6, 0x1

    invoke-virtual {v0, v3, v4, v5, v6}, Ljavax/net/ssl/SSLSocketFactory;->createSocket(Ljava/net/Socket;Ljava/lang/String;IZ)Ljava/net/Socket;

    move-result-object v0

    check-cast v0, Ljavax/net/ssl/SSLSocket;
    :try_end_0
    .catch Ljava/lang/AssertionError; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :try_start_1
    invoke-virtual {p1, v0}, Lb/a/b/b;->a(Ljavax/net/ssl/SSLSocket;)Lb/n;

    move-result-object v3

    invoke-virtual {v3}, Lb/n;->c()Z

    move-result v4

    if-eqz v4, :cond_0

    invoke-static {}, Lb/a/f/a;->a()Lb/a/f/a;

    move-result-object v4

    invoke-virtual {v2}, Lb/a;->k()Lb/w;

    move-result-object v5

    invoke-virtual {v5}, Lb/w;->g()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v2}, Lb/a;->e()Ljava/util/List;

    move-result-object v6

    invoke-virtual {v4, v0, v5, v6}, Lb/a/f/a;->a(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V

    :cond_0
    invoke-virtual {v0}, Ljavax/net/ssl/SSLSocket;->startHandshake()V

    invoke-virtual {v0}, Ljavax/net/ssl/SSLSocket;->getSession()Ljavax/net/ssl/SSLSession;

    move-result-object v4

    invoke-static {v4}, Lb/t;->a(Ljavax/net/ssl/SSLSession;)Lb/t;

    move-result-object v4

    invoke-virtual {v2}, Lb/a;->d()Ljavax/net/ssl/HostnameVerifier;

    move-result-object v5

    invoke-virtual {v2}, Lb/a;->k()Lb/w;

    move-result-object v6

    invoke-virtual {v6}, Lb/w;->g()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v0}, Ljavax/net/ssl/SSLSocket;->getSession()Ljavax/net/ssl/SSLSession;

    move-result-object v7

    invoke-interface {v5, v6, v7}, Ljavax/net/ssl/HostnameVerifier;->verify(Ljava/lang/String;Ljavax/net/ssl/SSLSession;)Z

    move-result v5

    if-nez v5, :cond_2

    invoke-virtual {v4}, Lb/t;->b()Ljava/util/List;

    move-result-object v1

    const/4 v3, 0x0

    invoke-interface {v1, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/security/cert/X509Certificate;

    new-instance v3, Ljavax/net/ssl/SSLPeerUnverifiedException;

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "Hostname "

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2}, Lb/a;->k()Lb/w;

    move-result-object v2

    invoke-virtual {v2}, Lb/w;->g()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v4, " not verified:\n    certificate: "

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-static {v1}, Lb/h;->a(Ljava/security/cert/Certificate;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v4, "\n    DN: "

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v1}, Ljava/security/cert/X509Certificate;->getSubjectDN()Ljava/security/Principal;

    move-result-object v4

    invoke-interface {v4}, Ljava/security/Principal;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v4, "\n    subjectAltNames: "

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-static {v1}, Lb/a/g/c;->a(Ljava/security/cert/X509Certificate;)Ljava/util/List;

    move-result-object v1

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v3, v1}, Ljavax/net/ssl/SSLPeerUnverifiedException;-><init>(Ljava/lang/String;)V

    throw v3
    :try_end_1
    .catch Ljava/lang/AssertionError; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    :catch_0
    move-exception v1

    move-object v10, v1

    move-object v1, v0

    move-object v0, v10

    :goto_0
    :try_start_2
    invoke-static {v0}, Lb/a/c;->a(Ljava/lang/AssertionError;)Z

    move-result v2

    if-eqz v2, :cond_7

    new-instance v2, Ljava/io/IOException;

    invoke-direct {v2, v0}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V

    throw v2
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :catchall_0
    move-exception v0

    move-object v10, v1

    move-object v1, v0

    move-object v0, v10

    :goto_1
    if-eqz v0, :cond_1

    invoke-static {}, Lb/a/f/a;->a()Lb/a/f/a;

    move-result-object v2

    invoke-virtual {v2, v0}, Lb/a/f/a;->a(Ljavax/net/ssl/SSLSocket;)V

    :cond_1
    invoke-static {v0}, Lb/a/c;->a(Ljava/net/Socket;)V

    throw v1

    :cond_2
    :try_start_3
    invoke-virtual {v2}, Lb/a;->a()Lb/h;

    move-result-object v5

    invoke-virtual {v2}, Lb/a;->k()Lb/w;

    move-result-object v2

    invoke-virtual {v2}, Lb/w;->g()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v4}, Lb/t;->b()Ljava/util/List;

    move-result-object v6

    invoke-virtual {v5, v2, v6}, Lb/h;->a(Ljava/lang/String;Ljava/util/List;)V

    invoke-virtual {v3}, Lb/n;->c()Z

    move-result v2

    if-eqz v2, :cond_3

    invoke-static {}, Lb/a/f/a;->a()Lb/a/f/a;

    move-result-object v1

    invoke-virtual {v1, v0}, Lb/a/f/a;->b(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;

    move-result-object v1

    :cond_3
    iput-object v0, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    iget-object v2, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-static {v2}, Lc/l;->b(Ljava/net/Socket;)Lc/n;

    move-result-object v2

    invoke-static {v2}, Lc/l;->a(Lc/n;)Lc/e;

    move-result-object v2

    iput-object v2, p0, Lb/a/b/c;->h:Lc/e;

    iget-object v2, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-static {v2}, Lc/l;->a(Ljava/net/Socket;)Lc/m;

    move-result-object v2

    invoke-static {v2}, Lc/l;->a(Lc/m;)Lc/d;

    move-result-object v2

    iput-object v2, p0, Lb/a/b/c;->f:Lc/d;

    iput-object v4, p0, Lb/a/b/c;->m:Lb/t;

    if-eqz v1, :cond_6

    invoke-static {v1}, Lb/ae;->a(Ljava/lang/String;)Lb/ae;

    move-result-object v1

    :goto_2
    iput-object v1, p0, Lb/a/b/c;->n:Lb/ae;
    :try_end_3
    .catch Ljava/lang/AssertionError; {:try_start_3 .. :try_end_3} :catch_0
    .catchall {:try_start_3 .. :try_end_3} :catchall_1

    if-eqz v0, :cond_4

    invoke-static {}, Lb/a/f/a;->a()Lb/a/f/a;

    move-result-object v1

    invoke-virtual {v1, v0}, Lb/a/f/a;->a(Ljavax/net/ssl/SSLSocket;)V

    :cond_4
    :goto_3
    iget-object v0, p0, Lb/a/b/c;->n:Lb/ae;

    sget-object v1, Lb/ae;->d:Lb/ae;

    if-eq v0, v1, :cond_5

    iget-object v0, p0, Lb/a/b/c;->n:Lb/ae;

    sget-object v1, Lb/ae;->c:Lb/ae;

    if-ne v0, v1, :cond_9

    :cond_5
    iget-object v0, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-virtual {v0, v9}, Ljava/net/Socket;->setSoTimeout(I)V

    new-instance v0, Lb/a/c/f;

    invoke-direct {v0, v8}, Lb/a/c/f;-><init>(Z)V

    iget-object v1, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    iget-object v2, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v2}, Lb/al;->a()Lb/a;

    move-result-object v2

    invoke-virtual {v2}, Lb/a;->k()Lb/w;

    move-result-object v2

    invoke-virtual {v2}, Lb/w;->g()Ljava/lang/String;

    move-result-object v2

    iget-object v3, p0, Lb/a/b/c;->h:Lc/e;

    iget-object v4, p0, Lb/a/b/c;->f:Lc/d;

    invoke-virtual {v0, v1, v2, v3, v4}, Lb/a/c/f;->a(Ljava/net/Socket;Ljava/lang/String;Lc/e;Lc/d;)Lb/a/c/f;

    move-result-object v0

    iget-object v1, p0, Lb/a/b/c;->n:Lb/ae;

    invoke-virtual {v0, v1}, Lb/a/c/f;->a(Lb/ae;)Lb/a/c/f;

    move-result-object v0

    invoke-virtual {v0, p0}, Lb/a/c/f;->a(Lb/a/c/g;)Lb/a/c/f;

    move-result-object v0

    invoke-virtual {v0}, Lb/a/c/f;->a()Lb/a/c/e;

    move-result-object v0

    invoke-virtual {v0}, Lb/a/c/e;->f()V

    invoke-virtual {v0}, Lb/a/c/e;->e()I

    move-result v1

    iput v1, p0, Lb/a/b/c;->a:I

    iput-object v0, p0, Lb/a/b/c;->c:Lb/a/c/e;

    :goto_4
    return-void

    :cond_6
    :try_start_4
    sget-object v1, Lb/ae;->b:Lb/ae;
    :try_end_4
    .catch Ljava/lang/AssertionError; {:try_start_4 .. :try_end_4} :catch_0
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    goto :goto_2

    :cond_7
    :try_start_5
    throw v0
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    :cond_8
    sget-object v0, Lb/ae;->b:Lb/ae;

    iput-object v0, p0, Lb/a/b/c;->n:Lb/ae;

    iget-object v0, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    iput-object v0, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    goto :goto_3

    :cond_9
    iput v8, p0, Lb/a/b/c;->a:I

    goto :goto_4

    :catch_1
    move-exception v0

    goto/16 :goto_0

    :catchall_1
    move-exception v1

    goto/16 :goto_1
.end method


# virtual methods
.method public final a()Lb/al;
    .locals 1

    iget-object v0, p0, Lb/a/b/c;->k:Lb/al;

    return-object v0
.end method

.method public final a(IIILjava/util/List;Z)V
    .locals 5

    const/4 v1, 0x0

    iget-object v0, p0, Lb/a/b/c;->n:Lb/ae;

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "already connected"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    new-instance v3, Lb/a/b/b;

    invoke-direct {v3, p4}, Lb/a/b/b;-><init>(Ljava/util/List;)V

    iget-object v0, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v0}, Lb/al;->a()Lb/a;

    move-result-object v0

    invoke-virtual {v0}, Lb/a;->j()Ljavax/net/ssl/SSLSocketFactory;

    move-result-object v0

    if-nez v0, :cond_6

    sget-object v0, Lb/n;->a:Lb/n;

    invoke-interface {p4, v0}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_1

    new-instance v0, Lb/a/b/e;

    new-instance v1, Ljava/net/UnknownServiceException;

    const-string v2, "CLEARTEXT communication not enabled for client"

    invoke-direct {v1, v2}, Ljava/net/UnknownServiceException;-><init>(Ljava/lang/String;)V

    invoke-direct {v0, v1}, Lb/a/b/e;-><init>(Ljava/io/IOException;)V

    throw v0

    :cond_1
    iget-object v0, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v0}, Lb/al;->a()Lb/a;

    move-result-object v0

    invoke-virtual {v0}, Lb/a;->k()Lb/w;

    move-result-object v0

    invoke-virtual {v0}, Lb/w;->g()Ljava/lang/String;

    move-result-object v0

    invoke-static {}, Lb/a/f/a;->a()Lb/a/f/a;

    move-result-object v2

    invoke-virtual {v2, v0}, Lb/a/f/a;->a(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_6

    new-instance v1, Lb/a/b/e;

    new-instance v2, Ljava/net/UnknownServiceException;

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "CLEARTEXT communication to "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v3, " not permitted by network security policy"

    invoke-virtual {v0, v3}, 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 v0

    invoke-direct {v2, v0}, Ljava/net/UnknownServiceException;-><init>(Ljava/lang/String;)V

    invoke-direct {v1, v2}, Lb/a/b/e;-><init>(Ljava/io/IOException;)V

    throw v1

    :cond_2
    :goto_0
    iget-object v2, p0, Lb/a/b/c;->n:Lb/ae;

    if-nez v2, :cond_7

    :try_start_0
    iget-object v2, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v2}, Lb/al;->c()Z

    move-result v2

    if-eqz v2, :cond_4

    invoke-direct {p0, p1, p2, p3, v3}, Lb/a/b/c;->a(IIILb/a/b/b;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v2

    iget-object v4, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-static {v4}, Lb/a/c;->a(Ljava/net/Socket;)V

    iget-object v4, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    invoke-static {v4}, Lb/a/c;->a(Ljava/net/Socket;)V

    iput-object v1, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    iput-object v1, p0, Lb/a/b/c;->l:Ljava/net/Socket;

    iput-object v1, p0, Lb/a/b/c;->h:Lc/e;

    iput-object v1, p0, Lb/a/b/c;->f:Lc/d;

    iput-object v1, p0, Lb/a/b/c;->m:Lb/t;

    iput-object v1, p0, Lb/a/b/c;->n:Lb/ae;

    if-nez v0, :cond_5

    new-instance v0, Lb/a/b/e;

    invoke-direct {v0, v2}, Lb/a/b/e;-><init>(Ljava/io/IOException;)V

    :goto_1
    if-eqz p5, :cond_3

    invoke-virtual {v3, v2}, Lb/a/b/b;->a(Ljava/io/IOException;)Z

    move-result v2

    if-nez v2, :cond_2

    :cond_3
    throw v0

    :cond_4
    :try_start_1
    invoke-direct {p0, p1, p2}, Lb/a/b/c;->a(II)V

    invoke-direct {p0, v3}, Lb/a/b/c;->a(Lb/a/b/b;)V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    :cond_5
    invoke-virtual {v0, v2}, Lb/a/b/e;->a(Ljava/io/IOException;)V

    goto :goto_1

    :cond_6
    move-object v0, v1

    goto :goto_0

    :cond_7
    return-void
.end method

.method public final a(Lb/a/c/e;)V
    .locals 1

    invoke-virtual {p1}, Lb/a/c/e;->e()I

    move-result v0

    iput v0, p0, Lb/a/b/c;->a:I

    return-void
.end method

.method public final a(Lb/a/c/i;)V
    .locals 1

    sget-object v0, Lb/a/c/a;->n:Lb/a/c/a;

    invoke-virtual {p1, v0}, Lb/a/c/i;->b(Lb/a/c/a;)V

    return-void
.end method

.method public final a(Z)Z
    .locals 5

    const/4 v0, 0x1

    const/4 v1, 0x0

    iget-object v2, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-virtual {v2}, Ljava/net/Socket;->isClosed()Z

    move-result v2

    if-nez v2, :cond_0

    iget-object v2, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-virtual {v2}, Ljava/net/Socket;->isInputShutdown()Z

    move-result v2

    if-nez v2, :cond_0

    iget-object v2, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-virtual {v2}, Ljava/net/Socket;->isOutputShutdown()Z

    move-result v2

    if-eqz v2, :cond_2

    :cond_0
    move v0, v1

    :cond_1
    move v1, v0

    :goto_0
    return v1

    :cond_2
    iget-object v2, p0, Lb/a/b/c;->c:Lb/a/c/e;

    if-eqz v2, :cond_3

    iget-object v2, p0, Lb/a/b/c;->c:Lb/a/c/e;

    invoke-virtual {v2}, Lb/a/c/e;->d()Z

    move-result v2

    if-eqz v2, :cond_1

    goto :goto_0

    :cond_3
    if-eqz p1, :cond_1

    :try_start_0
    iget-object v2, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-virtual {v2}, Ljava/net/Socket;->getSoTimeout()I
    :try_end_0
    .catch Ljava/net/SocketTimeoutException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    move-result v3

    :try_start_1
    iget-object v2, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    const/4 v4, 0x1

    invoke-virtual {v2, v4}, Ljava/net/Socket;->setSoTimeout(I)V

    iget-object v2, p0, Lb/a/b/c;->h:Lc/e;

    invoke-interface {v2}, Lc/e;->h()Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result v2

    if-eqz v2, :cond_4

    :try_start_2
    iget-object v2, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-virtual {v2, v3}, Ljava/net/Socket;->setSoTimeout(I)V

    goto :goto_0

    :catch_0
    move-exception v1

    move v1, v0

    goto :goto_0

    :cond_4
    iget-object v2, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-virtual {v2, v3}, Ljava/net/Socket;->setSoTimeout(I)V

    move v1, v0

    goto :goto_0

    :catchall_0
    move-exception v2

    iget-object v4, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    invoke-virtual {v4, v3}, Ljava/net/Socket;->setSoTimeout(I)V

    throw v2
    :try_end_2
    .catch Ljava/net/SocketTimeoutException; {:try_start_2 .. :try_end_2} :catch_0
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1

    :catch_1
    move-exception v0

    goto :goto_0
.end method

.method public final b()Lb/t;
    .locals 1

    iget-object v0, p0, Lb/a/b/c;->m:Lb/t;

    return-object v0
.end method

.method public final c()Z
    .locals 1

    iget-object v0, p0, Lb/a/b/c;->c:Lb/a/c/e;

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public final d()Ljava/net/Socket;
    .locals 1

    iget-object v0, p0, Lb/a/b/c;->g:Ljava/net/Socket;

    return-object v0
.end method

.method public final toString()Ljava/lang/String;
    .locals 2

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Connection{"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v1}, Lb/al;->a()Lb/a;

    move-result-object v1

    invoke-virtual {v1}, Lb/a;->k()Lb/w;

    move-result-object v1

    invoke-virtual {v1}, Lb/w;->g()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ":"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v1}, Lb/al;->a()Lb/a;

    move-result-object v1

    invoke-virtual {v1}, Lb/a;->k()Lb/w;

    move-result-object v1

    invoke-virtual {v1}, Lb/w;->j()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", proxy="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v1}, Lb/al;->b()Ljava/net/Proxy;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " hostAddress="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lb/a/b/c;->k:Lb/al;

    invoke-virtual {v1}, Lb/al;->d()Ljava/net/InetSocketAddress;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " cipherSuite="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v0, p0, Lb/a/b/c;->m:Lb/t;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lb/a/b/c;->m:Lb/t;

    invoke-virtual {v0}, Lb/t;->a()Lb/k;

    move-result-object v0

    :goto_0
    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " protocol="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lb/a/b/c;->n:Lb/ae;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const/16 v1, 0x7d

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0

    :cond_0
    const-string v0, "none"

    goto :goto_0
.end method
