.class public Lcom/in2wow/sdk/d/c;
.super Ljava/lang/Object;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/in2wow/sdk/d/c$a;,
        Lcom/in2wow/sdk/d/c$b;,
        Lcom/in2wow/sdk/d/c$c;,
        Lcom/in2wow/sdk/d/c$d;,
        Lcom/in2wow/sdk/d/c$e;
    }
.end annotation


# instance fields
.field private a:Ljava/lang/String;

.field private b:Ljava/lang/String;

.field private c:Ljava/lang/String;

.field private d:Z

.field private e:Z

.field private f:I

.field private g:Ljava/net/Socket;

.field private h:Ljava/io/OutputStream;

.field private i:Ljava/io/InputStream;

.field private j:Lcom/in2wow/sdk/d/c$e;

.field private k:Lcom/in2wow/sdk/d/c$d;

.field private l:Lcom/in2wow/sdk/d/c$b;

.field private m:Lcom/in2wow/sdk/d/c$c;


# direct methods
.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Lcom/in2wow/sdk/d/c$e;)V
    .locals 3

    .line 87
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 69
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->a:Ljava/lang/String;

    .line 70
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->b:Ljava/lang/String;

    .line 71
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->c:Ljava/lang/String;

    const/4 v1, 0x0

    .line 72
    iput-boolean v1, p0, Lcom/in2wow/sdk/d/c;->d:Z

    const/4 v2, 0x1

    .line 73
    iput-boolean v2, p0, Lcom/in2wow/sdk/d/c;->e:Z

    .line 75
    iput v1, p0, Lcom/in2wow/sdk/d/c;->f:I

    .line 77
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    .line 78
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->h:Ljava/io/OutputStream;

    .line 79
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->i:Ljava/io/InputStream;

    .line 81
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->j:Lcom/in2wow/sdk/d/c$e;

    .line 82
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->k:Lcom/in2wow/sdk/d/c$d;

    .line 83
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->l:Lcom/in2wow/sdk/d/c$b;

    .line 85
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->m:Lcom/in2wow/sdk/d/c$c;

    .line 88
    iput-object p2, p0, Lcom/in2wow/sdk/d/c;->a:Ljava/lang/String;

    .line 89
    iput-object p1, p0, Lcom/in2wow/sdk/d/c;->b:Ljava/lang/String;

    .line 90
    iput-object p3, p0, Lcom/in2wow/sdk/d/c;->j:Lcom/in2wow/sdk/d/c$e;

    .line 92
    invoke-direct {p0}, Lcom/in2wow/sdk/d/c;->b()V

    return-void
.end method

.method private a(I)V
    .locals 3

    add-int/lit8 p1, p1, -0x1

    if-gtz p1, :cond_0

    return-void

    .line 200
    :cond_0
    :try_start_0
    invoke-virtual {p0}, Lcom/in2wow/sdk/d/c;->a()V

    .line 201
    new-instance v0, Ljava/net/Socket;

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

    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    .line 202
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Ljava/net/Socket;->setKeepAlive(Z)V

    .line 203
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    invoke-virtual {v0, v1}, Ljava/net/Socket;->setReuseAddress(Z)V

    .line 204
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    const/4 v2, 0x0

    invoke-virtual {v0, v2, v2}, Ljava/net/Socket;->setSoLinger(ZI)V

    .line 205
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

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

    .line 206
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    invoke-virtual {v0, v1}, Ljava/net/Socket;->setTcpNoDelay(Z)V

    .line 207
    new-instance v0, Ljava/net/InetSocketAddress;

    iget-object v1, p0, Lcom/in2wow/sdk/d/c;->c:Ljava/lang/String;

    iget v2, p0, Lcom/in2wow/sdk/d/c;->f:I

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

    .line 208
    iget-object v1, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    invoke-virtual {v1, v0}, Ljava/net/Socket;->connect(Ljava/net/SocketAddress;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 210
    invoke-static {v0}, Lcom/in2wow/sdk/m/j;->a(Ljava/lang/Throwable;)V

    const/4 v0, 0x0

    .line 211
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    const-wide/16 v0, 0x1388

    .line 214
    :try_start_1
    invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V

    .line 215
    invoke-direct {p0, p1}, Lcom/in2wow/sdk/d/c;->a(I)V
    :try_end_1
    .catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_0

    :catch_1
    move-exception p1

    .line 217
    invoke-static {p1}, Lcom/in2wow/sdk/m/j;->a(Ljava/lang/Throwable;)V

    :goto_0
    return-void
.end method

.method private a(I[B)V
    .locals 6

    .line 403
    array-length v5, p2

    const/4 v3, -0x1

    const/4 v4, 0x0

    move-object v0, p0

    move v1, p1

    move-object v2, p2

    invoke-direct/range {v0 .. v5}, Lcom/in2wow/sdk/d/c;->a(I[BIII)[B

    move-result-object p1

    .line 404
    invoke-direct {p0, p1}, Lcom/in2wow/sdk/d/c;->b([B)V

    .line 406
    invoke-direct {p0}, Lcom/in2wow/sdk/d/c;->d()V

    return-void
.end method

.method static synthetic a(Lcom/in2wow/sdk/d/c;I[B)V
    .locals 0

    .line 402
    invoke-direct {p0, p1, p2}, Lcom/in2wow/sdk/d/c;->a(I[B)V

    return-void
.end method

.method static synthetic a(Lcom/in2wow/sdk/d/c;Z)V
    .locals 0

    .line 72
    iput-boolean p1, p0, Lcom/in2wow/sdk/d/c;->d:Z

    return-void
.end method

.method static synthetic a(Lcom/in2wow/sdk/d/c;)Z
    .locals 0

    .line 72
    iget-boolean p0, p0, Lcom/in2wow/sdk/d/c;->d:Z

    return p0
.end method

.method private a(Ljava/net/Socket;Ljava/io/InputStream;I)Z
    .locals 7

    .line 138
    new-array p3, p3, [B

    .line 147
    invoke-direct {p0}, Lcom/in2wow/sdk/d/c;->c()V

    .line 148
    invoke-direct {p0}, Lcom/in2wow/sdk/d/c;->d()V

    .line 152
    invoke-virtual {p1}, Ljava/net/Socket;->isConnected()Z

    move-result p1

    const/4 v0, 0x0

    if-eqz p1, :cond_6

    .line 154
    invoke-virtual {p2, p3}, Ljava/io/InputStream;->read([B)I

    move-result p1

    const/4 p2, -0x1

    if-eq p1, p2, :cond_6

    .line 166
    :try_start_0
    new-instance p2, Ljava/lang/String;

    invoke-direct {p2, p3, v0, p1}, Ljava/lang/String;-><init>([BII)V

    const-string p1, "\n"

    .line 167
    invoke-virtual {p2, p1}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object p1

    .line 168
    array-length p2, p1

    const/4 p3, 0x0

    move-object v2, p3

    move-object v3, v2

    const/4 p3, 0x0

    const/4 v1, 0x0

    :goto_0
    const/4 v4, 0x1

    if-lt p3, p2, :cond_2

    const/16 p1, 0x65

    if-ne v1, p1, :cond_1

    if-eqz v2, :cond_1

    if-nez v3, :cond_0

    goto :goto_1

    :cond_0
    return v4

    :cond_1
    :goto_1
    return v0

    :cond_2
    aget-object v5, p1, p3

    .line 169
    invoke-virtual {v5}, Ljava/lang/String;->toUpperCase()Ljava/lang/String;

    move-result-object v5

    const-string v6, "HTTP/"

    .line 170
    invoke-virtual {v5, v6}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v6

    if-nez v6, :cond_3

    const-string v1, " "

    .line 171
    invoke-virtual {v5, v1}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v1

    aget-object v1, v1, v4

    invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v1

    goto :goto_2

    :cond_3
    const-string v6, "UPGRADE"

    .line 172
    invoke-virtual {v5, v6}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v6

    if-nez v6, :cond_4

    const-string v2, " "

    .line 173
    invoke-virtual {v5, v2}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    aget-object v2, v2, v4

    goto :goto_2

    :cond_4
    const-string v6, "SEC-WEBSOCKET-ACCEPT"

    .line 174
    invoke-virtual {v5, v6}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v6

    if-nez v6, :cond_5

    const-string v3, " "

    .line 175
    invoke-virtual {v5, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v3

    aget-object v3, v3, v4
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_5
    :goto_2
    add-int/lit8 p3, p3, 0x1

    goto :goto_0

    :catch_0
    move-exception p1

    .line 185
    invoke-static {p1}, Lcom/in2wow/sdk/m/j;->a(Ljava/lang/Throwable;)V

    :cond_6
    return v0
.end method

.method private a(I[BIII)[B
    .locals 23

    move-object/from16 v0, p0

    move/from16 v1, p3

    move/from16 v2, p4

    const/4 v4, 0x2

    const/4 v5, 0x0

    if-lez v1, :cond_0

    const/4 v6, 0x2

    goto :goto_0

    :cond_0
    const/4 v6, 0x0

    :goto_0
    add-int v7, p5, v6

    sub-int/2addr v7, v2

    const v8, 0xffff

    const/16 v9, 0x7d

    const/4 v10, 0x4

    if-gt v7, v9, :cond_1

    const/4 v11, 0x2

    goto :goto_1

    :cond_1
    if-gt v7, v8, :cond_2

    const/4 v11, 0x4

    goto :goto_1

    :cond_2
    const/16 v11, 0xa

    .line 419
    :goto_1
    iget-boolean v12, v0, Lcom/in2wow/sdk/d/c;->e:Z

    if-eqz v12, :cond_3

    const/4 v12, 0x4

    goto :goto_2

    :cond_3
    const/4 v12, 0x0

    :goto_2
    add-int/2addr v12, v11

    .line 420
    iget-boolean v13, v0, Lcom/in2wow/sdk/d/c;->e:Z

    if-eqz v13, :cond_4

    const/16 v13, 0x80

    goto :goto_3

    :cond_4
    const/4 v13, 0x0

    :goto_3
    add-int v14, v7, v12

    .line 421
    new-array v14, v14, [B

    move/from16 v15, p1

    int-to-byte v15, v15

    or-int/lit8 v15, v15, -0x80

    int-to-byte v15, v15

    .line 423
    aput-byte v15, v14, v5

    const/4 v15, 0x3

    const/16 v16, 0x1

    if-gt v7, v9, :cond_5

    or-int/2addr v7, v13

    int-to-byte v7, v7

    .line 426
    aput-byte v7, v14, v16

    :goto_4
    move/from16 v21, v6

    move/from16 v22, v11

    goto :goto_5

    :cond_5
    if-gt v7, v8, :cond_6

    or-int/lit8 v8, v13, 0x7e

    int-to-byte v8, v8

    .line 428
    aput-byte v8, v14, v16

    .line 429
    div-int/lit16 v8, v7, 0x100

    int-to-byte v8, v8

    aput-byte v8, v14, v4

    and-int/lit16 v7, v7, 0xff

    int-to-byte v7, v7

    .line 430
    aput-byte v7, v14, v15

    goto :goto_4

    :cond_6
    or-int/lit8 v8, v13, 0x7f

    int-to-byte v8, v8

    .line 433
    aput-byte v8, v14, v16

    int-to-long v8, v7

    const-wide/high16 v17, 0x100000000000000L

    .line 434
    div-long v17, v8, v17

    const-wide/16 v19, 0xff

    move/from16 v21, v6

    and-long v5, v17, v19

    long-to-int v5, v5

    int-to-byte v5, v5

    aput-byte v5, v14, v4

    const-wide/high16 v5, 0x1000000000000L

    .line 435
    div-long v5, v8, v5

    and-long v5, v5, v19

    long-to-int v5, v5

    int-to-byte v5, v5

    aput-byte v5, v14, v15

    const-wide v5, 0x10000000000L

    .line 436
    div-long v5, v8, v5

    and-long v5, v5, v19

    long-to-int v5, v5

    int-to-byte v5, v5

    aput-byte v5, v14, v10

    const/4 v5, 0x5

    const-wide v17, 0x100000000L

    .line 437
    div-long v17, v8, v17

    move/from16 v22, v11

    and-long v10, v17, v19

    long-to-int v6, v10

    int-to-byte v6, v6

    aput-byte v6, v14, v5

    const/4 v5, 0x6

    const-wide/32 v10, 0x1000000

    .line 438
    div-long v10, v8, v10

    and-long v10, v10, v19

    long-to-int v6, v10

    int-to-byte v6, v6

    aput-byte v6, v14, v5

    const/4 v5, 0x7

    const-wide/32 v10, 0x10000

    .line 439
    div-long v10, v8, v10

    and-long v10, v10, v19

    long-to-int v6, v10

    int-to-byte v6, v6

    aput-byte v6, v14, v5

    const/16 v5, 0x8

    const-wide/16 v10, 0x100

    .line 440
    div-long/2addr v8, v10

    and-long v8, v8, v19

    long-to-int v6, v8

    int-to-byte v6, v6

    aput-byte v6, v14, v5

    const/16 v5, 0x9

    and-int/lit16 v6, v7, 0xff

    int-to-byte v6, v6

    .line 441
    aput-byte v6, v14, v5

    :goto_5
    if-lez v1, :cond_7

    .line 445
    div-int/lit16 v5, v1, 0x100

    and-int/lit16 v5, v5, 0xff

    int-to-byte v5, v5

    aput-byte v5, v14, v12

    add-int/lit8 v5, v12, 0x1

    and-int/lit16 v1, v1, 0xff

    int-to-byte v1, v1

    .line 446
    aput-byte v1, v14, v5

    :cond_7
    add-int v6, v12, v21

    sub-int v1, p5, v2

    move-object/from16 v3, p2

    .line 449
    invoke-static {v3, v2, v14, v6, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 451
    iget-boolean v1, v0, Lcom/in2wow/sdk/d/c;->e:Z

    if-eqz v1, :cond_8

    const/4 v1, 0x4

    .line 452
    new-array v1, v1, [B

    .line 453
    invoke-static {}, Ljava/lang/Math;->random()D

    move-result-wide v2

    const-wide/high16 v5, 0x4070000000000000L    # 256.0

    mul-double v2, v2, v5

    invoke-static {v2, v3}, Ljava/lang/Math;->floor(D)D

    move-result-wide v2

    double-to-int v2, v2

    int-to-byte v2, v2

    const/4 v3, 0x0

    aput-byte v2, v1, v3

    invoke-static {}, Ljava/lang/Math;->random()D

    move-result-wide v2

    mul-double v2, v2, v5

    invoke-static {v2, v3}, Ljava/lang/Math;->floor(D)D

    move-result-wide v2

    double-to-int v2, v2

    int-to-byte v2, v2

    aput-byte v2, v1, v16

    .line 454
    invoke-static {}, Ljava/lang/Math;->random()D

    move-result-wide v2

    mul-double v2, v2, v5

    invoke-static {v2, v3}, Ljava/lang/Math;->floor(D)D

    move-result-wide v2

    double-to-int v2, v2

    int-to-byte v2, v2

    aput-byte v2, v1, v4

    invoke-static {}, Ljava/lang/Math;->random()D

    move-result-wide v2

    mul-double v2, v2, v5

    invoke-static {v2, v3}, Ljava/lang/Math;->floor(D)D

    move-result-wide v2

    double-to-int v2, v2

    int-to-byte v2, v2

    aput-byte v2, v1, v15

    .line 456
    array-length v2, v1

    move/from16 v10, v22

    const/4 v3, 0x0

    invoke-static {v1, v3, v14, v10, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 457
    invoke-direct {v0, v14, v1, v12}, Lcom/in2wow/sdk/d/c;->a([B[BI)[B

    :cond_8
    return-object v14
.end method

.method private a([B[BI)[B
    .locals 4

    .line 464
    array-length v0, p2

    if-nez v0, :cond_0

    return-object p1

    :cond_0
    const/4 v0, 0x0

    .line 468
    :goto_0
    array-length v1, p1

    sub-int/2addr v1, p3

    if-lt v0, v1, :cond_1

    return-object p1

    :cond_1
    add-int v1, p3, v0

    .line 469
    aget-byte v2, p1, v1

    rem-int/lit8 v3, v0, 0x4

    aget-byte v3, p2, v3

    xor-int/2addr v2, v3

    int-to-byte v2, v2

    aput-byte v2, p1, v1

    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method static synthetic b(Lcom/in2wow/sdk/d/c;)Lcom/in2wow/sdk/d/c$d;
    .locals 0

    .line 82
    iget-object p0, p0, Lcom/in2wow/sdk/d/c;->k:Lcom/in2wow/sdk/d/c$d;

    return-object p0
.end method

.method private b()V
    .locals 3

    .line 98
    :try_start_0
    new-instance v0, Ljava/net/URI;

    iget-object v1, p0, Lcom/in2wow/sdk/d/c;->b:Ljava/lang/String;

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

    .line 99
    invoke-virtual {v0}, Ljava/net/URI;->getHost()Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/in2wow/sdk/d/c;->c:Ljava/lang/String;

    .line 100
    invoke-virtual {v0}, Ljava/net/URI;->getPort()I

    move-result v0

    iput v0, p0, Lcom/in2wow/sdk/d/c;->f:I

    const/4 v0, 0x3

    .line 104
    invoke-direct {p0, v0}, Lcom/in2wow/sdk/d/c;->a(I)V

    .line 106
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    invoke-virtual {v0}, Ljava/net/Socket;->isConnected()Z

    move-result v0

    if-nez v0, :cond_0

    goto :goto_0

    .line 110
    :cond_0
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    invoke-virtual {v0}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;

    move-result-object v0

    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->h:Ljava/io/OutputStream;

    .line 111
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    invoke-virtual {v0}, Ljava/net/Socket;->getInputStream()Ljava/io/InputStream;

    move-result-object v0

    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->i:Ljava/io/InputStream;

    .line 115
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    iget-object v1, p0, Lcom/in2wow/sdk/d/c;->i:Ljava/io/InputStream;

    const/16 v2, 0x1000

    invoke-direct {p0, v0, v1, v2}, Lcom/in2wow/sdk/d/c;->a(Ljava/net/Socket;Ljava/io/InputStream;I)Z

    move-result v0

    if-nez v0, :cond_1

    return-void

    :cond_1
    const/4 v0, 0x1

    .line 121
    iput-boolean v0, p0, Lcom/in2wow/sdk/d/c;->d:Z

    .line 122
    new-instance v0, Lcom/in2wow/sdk/d/c$c;

    iget-object v1, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    invoke-direct {v0, p0, v1}, Lcom/in2wow/sdk/d/c$c;-><init>(Lcom/in2wow/sdk/d/c;Ljava/net/Socket;)V

    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->m:Lcom/in2wow/sdk/d/c$c;

    .line 123
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->m:Lcom/in2wow/sdk/d/c$c;

    invoke-virtual {v0}, Lcom/in2wow/sdk/d/c$c;->start()V

    .line 125
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->j:Lcom/in2wow/sdk/d/c$e;

    if-eqz v0, :cond_3

    .line 126
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->j:Lcom/in2wow/sdk/d/c$e;

    const/4 v1, 0x0

    invoke-interface {v0, v1, p0}, Lcom/in2wow/sdk/d/c$e;->a(Ljava/lang/Exception;Lcom/in2wow/sdk/d/c;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    :cond_2
    :goto_0
    return-void

    :catch_0
    move-exception v0

    .line 130
    invoke-static {v0}, Lcom/in2wow/sdk/m/j;->a(Ljava/lang/Throwable;)V

    :cond_3
    :goto_1
    return-void
.end method

.method private b(Ljava/lang/String;)V
    .locals 0

    .line 329
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object p1

    invoke-direct {p0, p1}, Lcom/in2wow/sdk/d/c;->b([B)V

    return-void
.end method

.method private b([B)V
    .locals 1

    .line 333
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->h:Ljava/io/OutputStream;

    if-eqz v0, :cond_0

    .line 334
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->h:Ljava/io/OutputStream;

    invoke-virtual {v0, p1}, Ljava/io/OutputStream;->write([B)V

    :cond_0
    return-void
.end method

.method static synthetic c(Lcom/in2wow/sdk/d/c;)Lcom/in2wow/sdk/d/c$b;
    .locals 0

    .line 83
    iget-object p0, p0, Lcom/in2wow/sdk/d/c;->l:Lcom/in2wow/sdk/d/c$b;

    return-object p0
.end method

.method private c()V
    .locals 4

    .line 300
    invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;

    move-result-object v0

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

    move-result-object v0

    const-string v1, "-"

    const-string v2, ""

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

    move-result-object v0

    const-string v1, "GET / HTTP/1.1\n"

    .line 302
    invoke-direct {p0, v1}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    .line 303
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Host: "

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

    iget-object v2, p0, Lcom/in2wow/sdk/d/c;->c:Ljava/lang/String;

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

    const-string v2, ":"

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

    iget v2, p0, Lcom/in2wow/sdk/d/c;->f:I

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

    const/16 v2, 0xa

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

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

    move-result-object v1

    invoke-direct {p0, v1}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    const-string v1, "User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.2.2; HTC One X Build/JDQ39)\n"

    .line 304
    invoke-direct {p0, v1}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    const-string v1, "Accept-Encoding: gzip, deflate\n"

    .line 305
    invoke-direct {p0, v1}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    const-string v1, "Accept: */*\n"

    .line 306
    invoke-direct {p0, v1}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    const-string v1, "Pragma: no-cache\n"

    .line 307
    invoke-direct {p0, v1}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    const-string v1, "Cache-Control: no-cache\n"

    .line 308
    invoke-direct {p0, v1}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    const-string v1, "Sec-WebSocket-Version: 13\n"

    .line 310
    invoke-direct {p0, v1}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    .line 311
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v3, "Sec-WebSocket-Key: "

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

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

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

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

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    const-string v0, "Sec-WebSocket-Extensions: x-webkit-deflate-frame\n"

    .line 312
    invoke-direct {p0, v0}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    const-string v0, "Connection: Upgrade\n"

    .line 313
    invoke-direct {p0, v0}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    const-string v0, "Upgrade: websocket\n"

    .line 314
    invoke-direct {p0, v0}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    .line 315
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->a:Ljava/lang/String;

    if-eqz v0, :cond_0

    .line 316
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Sec-WebSocket-Protocol: "

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

    iget-object v1, p0, Lcom/in2wow/sdk/d/c;->a:Ljava/lang/String;

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

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

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

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    :cond_0
    const-string v0, "\r\n"

    .line 319
    invoke-direct {p0, v0}, Lcom/in2wow/sdk/d/c;->b(Ljava/lang/String;)V

    return-void
.end method

.method private d()V
    .locals 1

    .line 323
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->h:Ljava/io/OutputStream;

    if-eqz v0, :cond_0

    .line 324
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->h:Ljava/io/OutputStream;

    invoke-virtual {v0}, Ljava/io/OutputStream;->flush()V

    :cond_0
    return-void
.end method


# virtual methods
.method public a([B)Lcom/in2wow/sdk/d/c$a;
    .locals 7

    .line 347
    invoke-static {p1}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;

    move-result-object p1

    .line 350
    new-instance v0, Lcom/in2wow/sdk/d/c$a;

    invoke-direct {v0, p0}, Lcom/in2wow/sdk/d/c$a;-><init>(Lcom/in2wow/sdk/d/c;)V

    .line 351
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->get()B

    move-result v1

    and-int/lit16 v2, v1, 0x80

    const/4 v3, 0x1

    const/4 v4, 0x0

    if-eqz v2, :cond_0

    const/4 v2, 0x1

    goto :goto_0

    :cond_0
    const/4 v2, 0x0

    .line 352
    :goto_0
    iput-boolean v2, v0, Lcom/in2wow/sdk/d/c$a;->b:Z

    and-int/lit8 v1, v1, 0xf

    int-to-byte v1, v1

    .line 356
    iput-byte v1, v0, Lcom/in2wow/sdk/d/c$a;->a:B

    .line 361
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->get()B

    move-result v1

    and-int/lit16 v2, v1, 0x80

    if-eqz v2, :cond_1

    goto :goto_1

    :cond_1
    const/4 v3, 0x0

    :goto_1
    const/16 v2, 0x7f

    and-int/2addr v1, v2

    int-to-byte v1, v1

    if-ne v1, v2, :cond_2

    const/16 v2, 0x8

    goto :goto_2

    :cond_2
    const/16 v2, 0x7e

    if-ne v1, v2, :cond_3

    const/4 v2, 0x2

    goto :goto_2

    :cond_3
    const/4 v2, 0x0

    :goto_2
    add-int/lit8 v2, v2, -0x1

    if-gtz v2, :cond_7

    const/4 v2, 0x0

    if-eqz v3, :cond_4

    const/4 v2, 0x4

    .line 383
    new-array v5, v2, [B

    .line 384
    invoke-virtual {p1, v5, v4, v2}, Ljava/nio/ByteBuffer;->get([BII)Ljava/nio/ByteBuffer;

    move-object v2, v5

    .line 389
    :cond_4
    new-array v5, v1, [B

    iput-object v5, v0, Lcom/in2wow/sdk/d/c$a;->c:[B

    .line 390
    iget-object v5, v0, Lcom/in2wow/sdk/d/c$a;->c:[B

    invoke-virtual {p1, v5, v4, v1}, Ljava/nio/ByteBuffer;->get([BII)Ljava/nio/ByteBuffer;

    if-eqz v3, :cond_6

    .line 394
    :goto_3
    iget-object p1, v0, Lcom/in2wow/sdk/d/c$a;->c:[B

    array-length p1, p1

    if-lt v4, p1, :cond_5

    goto :goto_4

    .line 395
    :cond_5
    iget-object p1, v0, Lcom/in2wow/sdk/d/c$a;->c:[B

    aget-byte v1, p1, v4

    rem-int/lit8 v3, v4, 0x4

    aget-byte v3, v2, v3

    xor-int/2addr v1, v3

    int-to-byte v1, v1

    aput-byte v1, p1, v4

    add-int/lit8 v4, v4, 0x1

    goto :goto_3

    :cond_6
    :goto_4
    return-object v0

    .line 375
    :cond_7
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->get()B

    move-result v5

    and-int/lit16 v5, v5, 0xff

    mul-int/lit8 v6, v2, 0x8

    shl-int/2addr v5, v6

    or-int/2addr v1, v5

    goto :goto_2
.end method

.method public a()V
    .locals 1

    const/4 v0, 0x0

    .line 285
    :try_start_0
    iput-boolean v0, p0, Lcom/in2wow/sdk/d/c;->d:Z

    .line 286
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

    if-eqz v0, :cond_0

    .line 287
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->g:Ljava/net/Socket;

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

    .line 290
    :cond_0
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->m:Lcom/in2wow/sdk/d/c$c;

    if-eqz v0, :cond_1

    .line 291
    iget-object v0, p0, Lcom/in2wow/sdk/d/c;->m:Lcom/in2wow/sdk/d/c$c;

    invoke-virtual {v0}, Lcom/in2wow/sdk/d/c$c;->join()V

    const/4 v0, 0x0

    .line 292
    iput-object v0, p0, Lcom/in2wow/sdk/d/c;->m:Lcom/in2wow/sdk/d/c$c;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 295
    invoke-static {v0}, Lcom/in2wow/sdk/m/j;->a(Ljava/lang/Throwable;)V

    :cond_1
    :goto_0
    return-void
.end method

.method public a(Lcom/in2wow/sdk/d/c$b;)V
    .locals 0

    .line 479
    iput-object p1, p0, Lcom/in2wow/sdk/d/c;->l:Lcom/in2wow/sdk/d/c$b;

    return-void
.end method

.method public a(Lcom/in2wow/sdk/d/c$d;)V
    .locals 0

    .line 475
    iput-object p1, p0, Lcom/in2wow/sdk/d/c;->k:Lcom/in2wow/sdk/d/c$d;

    return-void
.end method

.method public a(Ljava/lang/String;)V
    .locals 1

    .line 410
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object p1

    const/4 v0, 0x1

    invoke-direct {p0, v0, p1}, Lcom/in2wow/sdk/d/c;->a(I[B)V

    return-void
.end method
