.class public Lcom/a/a/c/c/f;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/a/a/c/c/e;


# static fields
.field static final synthetic a:Z


# instance fields
.field b:Lcom/a/a/m;

.field c:Lcom/a/a/c/c/d;

.field d:Z

.field e:Lcom/a/a/s;

.field f:Lcom/a/a/a/g;

.field g:Z

.field h:Z

.field i:I

.field j:Lcom/a/a/a/a;

.field private k:Lcom/a/a/c/c;

.field private l:J


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const-class v0, Lcom/a/a/c/c/f;

    invoke-virtual {v0}, Ljava/lang/Class;->desiredAssertionStatus()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    sput-boolean v0, Lcom/a/a/c/c/f;->a:Z

    return-void

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method constructor <init>(Lcom/a/a/m;Lcom/a/a/c/c/d;)V
    .locals 3

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

    new-instance v0, Lcom/a/a/c/c;

    invoke-direct {v0}, Lcom/a/a/c/c;-><init>()V

    iput-object v0, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-wide/16 v0, -0x1

    iput-wide v0, p0, Lcom/a/a/c/c/f;->l:J

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/a/a/c/c/f;->d:Z

    const/16 v0, 0xc8

    iput v0, p0, Lcom/a/a/c/c/f;->i:I

    iput-object p1, p0, Lcom/a/a/c/c/f;->b:Lcom/a/a/m;

    iput-object p2, p0, Lcom/a/a/c/c/f;->c:Lcom/a/a/c/c/d;

    sget-object v0, Lcom/a/a/c/i;->b:Lcom/a/a/c/i;

    invoke-virtual {p2}, Lcom/a/a/c/c/d;->i()Lcom/a/a/c/c;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/a/a/c/d;->a(Lcom/a/a/c/i;Lcom/a/a/c/c;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v1, "Connection"

    const-string v2, "Keep-Alive"

    invoke-virtual {v0, v1, v2}, Lcom/a/a/c/c;->b(Ljava/lang/String;Ljava/lang/String;)Lcom/a/a/c/c;

    :cond_0
    return-void
.end method

.method private d()V
    .locals 8

    const-wide/16 v6, 0x0

    const/4 v2, 0x0

    const/4 v1, 0x1

    iget-boolean v0, p0, Lcom/a/a/c/c/f;->d:Z

    if-eqz v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iput-boolean v1, p0, Lcom/a/a/c/c/f;->d:Z

    iget-object v0, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v3, "Transfer-Encoding"

    invoke-virtual {v0, v3}, Lcom/a/a/c/c;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v3, ""

    invoke-virtual {v3, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    iget-object v3, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v4, "Transfer-Encoding"

    invoke-virtual {v3, v4}, Lcom/a/a/c/c;->d(Ljava/lang/String;)Ljava/util/List;

    :cond_1
    const-string v3, "Chunked"

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

    move-result v3

    if-nez v3, :cond_2

    if-nez v0, :cond_4

    :cond_2
    const-string v0, "close"

    iget-object v3, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v4, "Connection"

    invoke-virtual {v3, v4}, Lcom/a/a/c/c;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

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

    move-result v0

    if-nez v0, :cond_4

    move v0, v1

    :goto_1
    iget-wide v4, p0, Lcom/a/a/c/c/f;->l:J

    cmp-long v3, v4, v6

    if-gez v3, :cond_3

    iget-object v3, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v4, "Content-Length"

    invoke-virtual {v3, v4}, Lcom/a/a/c/c;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v4

    if-nez v4, :cond_3

    invoke-static {v3}, Ljava/lang/Long;->valueOf(Ljava/lang/String;)Ljava/lang/Long;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Long;->longValue()J

    move-result-wide v4

    iput-wide v4, p0, Lcom/a/a/c/c/f;->l:J

    :cond_3
    iget-wide v4, p0, Lcom/a/a/c/c/f;->l:J

    cmp-long v3, v4, v6

    if-gez v3, :cond_5

    if-eqz v0, :cond_5

    iget-object v0, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v3, "Transfer-Encoding"

    const-string v4, "Chunked"

    invoke-virtual {v0, v3, v4}, Lcom/a/a/c/c;->b(Ljava/lang/String;Ljava/lang/String;)Lcom/a/a/c/c;

    move v0, v1

    :goto_2
    sget-object v3, Ljava/util/Locale;->ENGLISH:Ljava/util/Locale;

    const-string v4, "HTTP/1.1 %s %s"

    const/4 v5, 0x2

    new-array v5, v5, [Ljava/lang/Object;

    iget v6, p0, Lcom/a/a/c/c/f;->i:I

    invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v6

    aput-object v6, v5, v2

    iget v2, p0, Lcom/a/a/c/c/f;->i:I

    invoke-static {v2}, Lcom/a/a/c/c/a;->a(I)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v5, v1

    invoke-static {v3, v4, v5}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    iget-object v2, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    invoke-virtual {v2, v1}, Lcom/a/a/c/c;->e(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iget-object v2, p0, Lcom/a/a/c/c/f;->b:Lcom/a/a/m;

    invoke-virtual {v1}, Ljava/lang/String;->getBytes()[B

    move-result-object v1

    new-instance v3, Lcom/a/a/c/c/r;

    invoke-direct {v3, p0, v0}, Lcom/a/a/c/c/r;-><init>(Lcom/a/a/c/c/f;Z)V

    invoke-static {v2, v1, v3}, Lcom/a/a/ah;->a(Lcom/a/a/s;[BLcom/a/a/a/a;)V

    goto/16 :goto_0

    :cond_4
    move v0, v2

    goto :goto_1

    :cond_5
    move v0, v2

    goto :goto_2
.end method


# virtual methods
.method public a(I)Lcom/a/a/c/c/e;
    .locals 0

    iput p1, p0, Lcom/a/a/c/c/f;->i:I

    return-object p0
.end method

.method protected a()V
    .locals 1

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/a/a/c/c/f;->h:Z

    return-void
.end method

.method public a(Lcom/a/a/a/a;)V
    .locals 1

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    invoke-interface {v0, p1}, Lcom/a/a/s;->a(Lcom/a/a/a/a;)V

    :goto_0
    return-void

    :cond_0
    iput-object p1, p0, Lcom/a/a/c/c/f;->j:Lcom/a/a/a/a;

    goto :goto_0
.end method

.method public a(Lcom/a/a/a/g;)V
    .locals 1

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    invoke-interface {v0, p1}, Lcom/a/a/s;->a(Lcom/a/a/a/g;)V

    :goto_0
    return-void

    :cond_0
    iput-object p1, p0, Lcom/a/a/c/c/f;->f:Lcom/a/a/a/g;

    goto :goto_0
.end method

.method public a(Lcom/a/a/o;)V
    .locals 1

    sget-boolean v0, Lcom/a/a/c/c/f;->a:Z

    if-nez v0, :cond_0

    iget-boolean v0, p0, Lcom/a/a/c/c/f;->h:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/AssertionError;

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

    throw v0

    :cond_0
    iget-boolean v0, p0, Lcom/a/a/c/c/f;->d:Z

    if-nez v0, :cond_1

    invoke-direct {p0}, Lcom/a/a/c/c/f;->d()V

    :cond_1
    invoke-virtual {p1}, Lcom/a/a/o;->l()I

    move-result v0

    if-nez v0, :cond_3

    :cond_2
    :goto_0
    return-void

    :cond_3
    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    invoke-interface {v0, p1}, Lcom/a/a/s;->a(Lcom/a/a/o;)V

    goto :goto_0
.end method

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

    iget-object v0, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v1, "Content-Type"

    invoke-virtual {v0, v1}, Lcom/a/a/c/c;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    if-nez v0, :cond_0

    const-string v0, "text/html; charset=utf-8"

    :cond_0
    invoke-virtual {p0, v0, p1}, Lcom/a/a/c/c/f;->a(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

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

    :try_start_0
    const-string v0, "UTF-8"

    invoke-virtual {p2, v0}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v0

    invoke-virtual {p0, p1, v0}, Lcom/a/a/c/c/f;->a(Ljava/lang/String;[B)V
    :try_end_0
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0

    return-void

    :catch_0
    move-exception v0

    new-instance v1, Ljava/lang/AssertionError;

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

    throw v1
.end method

.method public a(Ljava/lang/String;[B)V
    .locals 4

    sget-boolean v0, Lcom/a/a/c/c/f;->a:Z

    if-nez v0, :cond_0

    iget-wide v0, p0, Lcom/a/a/c/c/f;->l:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-ltz v0, :cond_0

    new-instance v0, Ljava/lang/AssertionError;

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

    throw v0

    :cond_0
    array-length v0, p2

    int-to-long v0, v0

    iput-wide v0, p0, Lcom/a/a/c/c/f;->l:J

    iget-object v0, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v1, "Content-Length"

    array-length v2, p2

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

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/a/a/c/c;->b(Ljava/lang/String;Ljava/lang/String;)Lcom/a/a/c/c;

    iget-object v0, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v1, "Content-Type"

    invoke-virtual {v0, v1, p1}, Lcom/a/a/c/c;->b(Ljava/lang/String;Ljava/lang/String;)Lcom/a/a/c/c;

    new-instance v0, Lcom/a/a/c/c/t;

    invoke-direct {v0, p0}, Lcom/a/a/c/c/t;-><init>(Lcom/a/a/c/c/f;)V

    invoke-static {p0, p2, v0}, Lcom/a/a/ah;->a(Lcom/a/a/s;[BLcom/a/a/a/a;)V

    return-void
.end method

.method public a(Lorg/json/JSONObject;)V
    .locals 2

    const-string v0, "application/json; charset=utf-8"

    invoke-virtual {p1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v0, v1}, Lcom/a/a/c/c/f;->a(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public a_(Ljava/lang/Exception;)V
    .locals 0

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

    return-void
.end method

.method public b()I
    .locals 1

    iget v0, p0, Lcom/a/a/c/c/f;->i:I

    return v0
.end method

.method protected b(Ljava/lang/Exception;)V
    .locals 0

    return-void
.end method

.method public c()V
    .locals 0

    invoke-direct {p0}, Lcom/a/a/c/c/f;->d()V

    return-void
.end method

.method public e()V
    .locals 2

    iget-boolean v0, p0, Lcom/a/a/c/c/f;->g:Z

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/a/a/c/c/f;->g:Z

    iget-boolean v0, p0, Lcom/a/a/c/c/f;->d:Z

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    if-eqz v0, :cond_0

    :cond_2
    iget-boolean v0, p0, Lcom/a/a/c/c/f;->d:Z

    if-nez v0, :cond_3

    iget-object v0, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    const-string v1, "Transfer-Encoding"

    invoke-virtual {v0, v1}, Lcom/a/a/c/c;->c(Ljava/lang/String;)Ljava/lang/String;

    :cond_3
    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    instance-of v0, v0, Lcom/a/a/c/b/d;

    if-eqz v0, :cond_5

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    check-cast v0, Lcom/a/a/c/b/d;

    const v1, 0x7fffffff

    invoke-virtual {v0, v1}, Lcom/a/a/c/b/d;->a(I)V

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    new-instance v1, Lcom/a/a/o;

    invoke-direct {v1}, Lcom/a/a/o;-><init>()V

    invoke-interface {v0, v1}, Lcom/a/a/s;->a(Lcom/a/a/o;)V

    :cond_4
    :goto_1
    invoke-virtual {p0}, Lcom/a/a/c/c/f;->a()V

    goto :goto_0

    :cond_5
    iget-boolean v0, p0, Lcom/a/a/c/c/f;->d:Z

    if-nez v0, :cond_4

    iget-object v0, p0, Lcom/a/a/c/c/f;->c:Lcom/a/a/c/c/d;

    invoke-virtual {v0}, Lcom/a/a/c/c/d;->k()Ljava/lang/String;

    move-result-object v0

    const-string v1, "HEAD"

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

    move-result v0

    if-nez v0, :cond_6

    const-string v0, "text/html"

    const-string v1, ""

    invoke-virtual {p0, v0, v1}, Lcom/a/a/c/c/f;->a(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    :cond_6
    invoke-virtual {p0}, Lcom/a/a/c/c/f;->c()V

    goto :goto_1
.end method

.method public g()Lcom/a/a/e;
    .locals 1

    iget-object v0, p0, Lcom/a/a/c/c/f;->b:Lcom/a/a/m;

    invoke-interface {v0}, Lcom/a/a/m;->g()Lcom/a/a/e;

    move-result-object v0

    return-object v0
.end method

.method public h()Lcom/a/a/a/g;
    .locals 1

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/a/a/c/c/f;->e:Lcom/a/a/s;

    invoke-interface {v0}, Lcom/a/a/s;->h()Lcom/a/a/a/g;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lcom/a/a/c/c/f;->f:Lcom/a/a/a/g;

    goto :goto_0
.end method

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

    iget-object v0, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    if-nez v0, :cond_0

    invoke-super {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_0
    sget-object v0, Ljava/util/Locale;->ENGLISH:Ljava/util/Locale;

    const-string v1, "HTTP/1.1 %s %s"

    const/4 v2, 0x2

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    iget v4, p0, Lcom/a/a/c/c/f;->i:I

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v2, v3

    const/4 v3, 0x1

    iget v4, p0, Lcom/a/a/c/c/f;->i:I

    invoke-static {v4}, Lcom/a/a/c/c/a;->a(I)Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-static {v0, v1, v2}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/a/a/c/c/f;->k:Lcom/a/a/c/c;

    invoke-virtual {v1, v0}, Lcom/a/a/c/c;->e(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method
