.class public Lb/a/a/d;
.super Ljava/lang/Object;


# instance fields
.field final a:J

.field final b:Lb/af;

.field final c:Lb/ai;

.field private d:Ljava/util/Date;

.field private e:Ljava/lang/String;

.field private f:Ljava/util/Date;

.field private g:Ljava/lang/String;

.field private h:Ljava/util/Date;

.field private i:J

.field private j:J

.field private k:Ljava/lang/String;

.field private l:I


# direct methods
.method public constructor <init>(JLb/af;Lb/ai;)V
    .locals 7

    const/4 v6, -0x1

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

    iput v6, p0, Lb/a/a/d;->l:I

    iput-wide p1, p0, Lb/a/a/d;->a:J

    iput-object p3, p0, Lb/a/a/d;->b:Lb/af;

    iput-object p4, p0, Lb/a/a/d;->c:Lb/ai;

    if-eqz p4, :cond_5

    invoke-virtual {p4}, Lb/ai;->i()J

    move-result-wide v0

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

    invoke-virtual {p4}, Lb/ai;->g()J

    move-result-wide v0

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

    invoke-virtual {p4}, Lb/ai;->e()Lb/u;

    move-result-object v1

    const/4 v0, 0x0

    invoke-virtual {v1}, Lb/u;->b()I

    move-result v2

    :goto_0
    if-ge v0, v2, :cond_5

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

    move-result-object v3

    invoke-virtual {v1, v0}, Lb/u;->b(I)Ljava/lang/String;

    move-result-object v4

    const-string v5, "Date"

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

    move-result v5

    if-eqz v5, :cond_1

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

    move-result-object v3

    iput-object v3, p0, Lb/a/a/d;->d:Ljava/util/Date;

    iput-object v4, p0, Lb/a/a/d;->e:Ljava/lang/String;

    :cond_0
    :goto_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_1
    const-string v5, "Expires"

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

    move-result v5

    if-eqz v5, :cond_2

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

    move-result-object v3

    iput-object v3, p0, Lb/a/a/d;->h:Ljava/util/Date;

    goto :goto_1

    :cond_2
    const-string v5, "Last-Modified"

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

    move-result v5

    if-eqz v5, :cond_3

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

    move-result-object v3

    iput-object v3, p0, Lb/a/a/d;->f:Ljava/util/Date;

    iput-object v4, p0, Lb/a/a/d;->g:Ljava/lang/String;

    goto :goto_1

    :cond_3
    const-string v5, "ETag"

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

    move-result v5

    if-eqz v5, :cond_4

    iput-object v4, p0, Lb/a/a/d;->k:Ljava/lang/String;

    goto :goto_1

    :cond_4
    const-string v5, "Age"

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

    move-result v3

    if-eqz v3, :cond_0

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

    move-result v3

    iput v3, p0, Lb/a/a/d;->l:I

    goto :goto_1

    :cond_5
    return-void
.end method


# virtual methods
.method public a()Lb/a/a/c;
    .locals 12

    iget-object v0, p0, Lb/a/a/d;->c:Lb/ai;

    if-nez v0, :cond_1

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

    iget-object v1, p0, Lb/a/a/d;->b:Lb/af;

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-direct {v0, v1, v2, v3}, Lb/a/a/c;-><init>(Lb/af;Lb/ai;B)V

    :goto_0
    iget-object v1, v0, Lb/a/a/c;->b:Lb/af;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lb/a/a/d;->b:Lb/af;

    invoke-virtual {v1}, Lb/af;->b()Lb/d;

    move-result-object v1

    invoke-virtual {v1}, Lb/d;->i()Z

    move-result v1

    if-eqz v1, :cond_0

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

    const/4 v1, 0x0

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-direct {v0, v1, v2, v3}, Lb/a/a/c;-><init>(Lb/af;Lb/ai;B)V

    :cond_0
    return-object v0

    :cond_1
    iget-object v0, p0, Lb/a/a/d;->b:Lb/af;

    invoke-virtual {v0}, Lb/af;->d()Z

    move-result v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lb/a/a/d;->c:Lb/ai;

    invoke-virtual {v0}, Lb/ai;->d()Lb/t;

    move-result-object v0

    if-nez v0, :cond_2

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

    iget-object v1, p0, Lb/a/a/d;->b:Lb/af;

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-direct {v0, v1, v2, v3}, Lb/a/a/c;-><init>(Lb/af;Lb/ai;B)V

    goto :goto_0

    :cond_2
    iget-object v0, p0, Lb/a/a/d;->c:Lb/ai;

    iget-object v1, p0, Lb/a/a/d;->b:Lb/af;

    invoke-static {v0, v1}, Lb/a/a/c;->a(Lb/ai;Lb/af;)Z

    move-result v0

    if-nez v0, :cond_3

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

    iget-object v1, p0, Lb/a/a/d;->b:Lb/af;

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-direct {v0, v1, v2, v3}, Lb/a/a/c;-><init>(Lb/af;Lb/ai;B)V

    goto :goto_0

    :cond_3
    iget-object v0, p0, Lb/a/a/d;->b:Lb/af;

    invoke-virtual {v0}, Lb/af;->b()Lb/d;

    move-result-object v6

    invoke-virtual {v6}, Lb/d;->g()Z

    move-result v0

    if-nez v0, :cond_5

    iget-object v0, p0, Lb/a/a/d;->b:Lb/af;

    const-string v1, "If-Modified-Since"

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

    move-result-object v1

    if-nez v1, :cond_4

    const-string v1, "If-None-Match"

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

    move-result-object v0

    if-eqz v0, :cond_6

    :cond_4
    const/4 v0, 0x1

    :goto_1
    if-eqz v0, :cond_7

    :cond_5
    new-instance v0, Lb/a/a/c;

    iget-object v1, p0, Lb/a/a/d;->b:Lb/af;

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-direct {v0, v1, v2, v3}, Lb/a/a/c;-><init>(Lb/af;Lb/ai;B)V

    goto :goto_0

    :cond_6
    const/4 v0, 0x0

    goto :goto_1

    :cond_7
    iget-object v0, p0, Lb/a/a/d;->d:Ljava/util/Date;

    if-eqz v0, :cond_f

    const-wide/16 v0, 0x0

    iget-wide v2, p0, Lb/a/a/d;->j:J

    iget-object v4, p0, Lb/a/a/d;->d:Ljava/util/Date;

    invoke-virtual {v4}, Ljava/util/Date;->getTime()J

    move-result-wide v4

    sub-long/2addr v2, v4

    invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v0

    :goto_2
    iget v2, p0, Lb/a/a/d;->l:I

    const/4 v3, -0x1

    if-eq v2, v3, :cond_8

    sget-object v2, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    iget v3, p0, Lb/a/a/d;->l:I

    int-to-long v4, v3

    invoke-virtual {v2, v4, v5}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J

    move-result-wide v2

    invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v0

    :cond_8
    iget-wide v2, p0, Lb/a/a/d;->j:J

    iget-wide v4, p0, Lb/a/a/d;->i:J

    sub-long/2addr v2, v4

    add-long/2addr v0, v2

    iget-wide v2, p0, Lb/a/a/d;->a:J

    iget-wide v4, p0, Lb/a/a/d;->j:J

    sub-long/2addr v2, v4

    add-long v8, v0, v2

    iget-object v0, p0, Lb/a/a/d;->c:Lb/ai;

    invoke-virtual {v0}, Lb/ai;->b()Lb/d;

    move-result-object v0

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

    move-result v1

    const/4 v2, -0x1

    if-eq v1, v2, :cond_10

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

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

    move-result v0

    int-to-long v2, v0

    invoke-virtual {v1, v2, v3}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J

    move-result-wide v0

    :cond_9
    :goto_3
    invoke-virtual {v6}, Lb/d;->c()I

    move-result v2

    const/4 v3, -0x1

    if-eq v2, v3, :cond_a

    sget-object v2, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-virtual {v6}, Lb/d;->c()I

    move-result v3

    int-to-long v4, v3

    invoke-virtual {v2, v4, v5}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J

    move-result-wide v2

    invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v0

    :cond_a
    const-wide/16 v2, 0x0

    invoke-virtual {v6}, Lb/d;->e()I

    move-result v4

    const/4 v5, -0x1

    if-eq v4, v5, :cond_b

    sget-object v2, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-virtual {v6}, Lb/d;->e()I

    move-result v3

    int-to-long v4, v3

    invoke-virtual {v2, v4, v5}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J

    move-result-wide v2

    :cond_b
    const-wide/16 v4, 0x0

    iget-object v7, p0, Lb/a/a/d;->c:Lb/ai;

    invoke-virtual {v7}, Lb/ai;->b()Lb/d;

    move-result-object v7

    invoke-virtual {v7}, Lb/d;->f()Z

    move-result v10

    if-nez v10, :cond_c

    invoke-virtual {v6}, Lb/d;->d()I

    move-result v10

    const/4 v11, -0x1

    if-eq v10, v11, :cond_c

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

    invoke-virtual {v6}, Lb/d;->d()I

    move-result v5

    int-to-long v10, v5

    invoke-virtual {v4, v10, v11}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J

    move-result-wide v4

    :cond_c
    invoke-virtual {v7}, Lb/d;->g()Z

    move-result v6

    if-nez v6, :cond_17

    add-long v6, v8, v2

    add-long/2addr v4, v0

    cmp-long v4, v6, v4

    if-gez v4, :cond_17

    iget-object v4, p0, Lb/a/a/d;->c:Lb/ai;

    invoke-virtual {v4}, Lb/ai;->f()Lb/aj;

    move-result-object v4

    add-long/2addr v2, v8

    cmp-long v0, v2, v0

    if-ltz v0, :cond_d

    const-string v0, "Warning"

    const-string v1, "110 HttpURLConnection \"Response is stale\""

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

    :cond_d
    const-wide/32 v0, 0x5265c00

    cmp-long v0, v8, v0

    if-lez v0, :cond_e

    iget-object v0, p0, Lb/a/a/d;->c:Lb/ai;

    invoke-virtual {v0}, Lb/ai;->b()Lb/d;

    move-result-object v0

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

    move-result v0

    const/4 v1, -0x1

    if-ne v0, v1, :cond_16

    iget-object v0, p0, Lb/a/a/d;->h:Ljava/util/Date;

    if-nez v0, :cond_16

    const/4 v0, 0x1

    :goto_4
    if-eqz v0, :cond_e

    const-string v0, "Warning"

    const-string v1, "113 HttpURLConnection \"Heuristic expiration\""

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

    :cond_e
    new-instance v0, Lb/a/a/c;

    const/4 v1, 0x0

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

    move-result-object v2

    const/4 v3, 0x0

    invoke-direct {v0, v1, v2, v3}, Lb/a/a/c;-><init>(Lb/af;Lb/ai;B)V

    goto/16 :goto_0

    :cond_f
    const-wide/16 v0, 0x0

    goto/16 :goto_2

    :cond_10
    iget-object v0, p0, Lb/a/a/d;->h:Ljava/util/Date;

    if-eqz v0, :cond_12

    iget-object v0, p0, Lb/a/a/d;->d:Ljava/util/Date;

    if-eqz v0, :cond_11

    iget-object v0, p0, Lb/a/a/d;->d:Ljava/util/Date;

    invoke-virtual {v0}, Ljava/util/Date;->getTime()J

    move-result-wide v0

    :goto_5
    iget-object v2, p0, Lb/a/a/d;->h:Ljava/util/Date;

    invoke-virtual {v2}, Ljava/util/Date;->getTime()J

    move-result-wide v2

    sub-long v0, v2, v0

    const-wide/16 v2, 0x0

    cmp-long v2, v0, v2

    if-gtz v2, :cond_9

    const-wide/16 v0, 0x0

    goto/16 :goto_3

    :cond_11
    iget-wide v0, p0, Lb/a/a/d;->j:J

    goto :goto_5

    :cond_12
    iget-object v0, p0, Lb/a/a/d;->f:Ljava/util/Date;

    if-eqz v0, :cond_15

    iget-object v0, p0, Lb/a/a/d;->c:Lb/ai;

    invoke-virtual {v0}, Lb/ai;->h()Lb/af;

    move-result-object v0

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

    move-result-object v0

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

    move-result-object v0

    if-nez v0, :cond_15

    iget-object v0, p0, Lb/a/a/d;->d:Ljava/util/Date;

    if-eqz v0, :cond_13

    iget-object v0, p0, Lb/a/a/d;->d:Ljava/util/Date;

    invoke-virtual {v0}, Ljava/util/Date;->getTime()J

    move-result-wide v0

    :goto_6
    iget-object v2, p0, Lb/a/a/d;->f:Ljava/util/Date;

    invoke-virtual {v2}, Ljava/util/Date;->getTime()J

    move-result-wide v2

    sub-long/2addr v0, v2

    const-wide/16 v2, 0x0

    cmp-long v2, v0, v2

    if-lez v2, :cond_14

    const-wide/16 v2, 0xa

    div-long/2addr v0, v2

    goto/16 :goto_3

    :cond_13
    iget-wide v0, p0, Lb/a/a/d;->i:J

    goto :goto_6

    :cond_14
    const-wide/16 v0, 0x0

    goto/16 :goto_3

    :cond_15
    const-wide/16 v0, 0x0

    goto/16 :goto_3

    :cond_16
    const/4 v0, 0x0

    goto :goto_4

    :cond_17
    iget-object v0, p0, Lb/a/a/d;->k:Ljava/lang/String;

    if-eqz v0, :cond_18

    const-string v0, "If-None-Match"

    iget-object v1, p0, Lb/a/a/d;->k:Ljava/lang/String;

    :goto_7
    iget-object v2, p0, Lb/a/a/d;->b:Lb/af;

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

    move-result-object v2

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

    move-result-object v2

    sget-object v3, Lb/a/a;->a:Lb/a/a;

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

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

    iget-object v1, p0, Lb/a/a/d;->b:Lb/af;

    invoke-virtual {v1}, Lb/af;->f()Lb/ag;

    move-result-object v1

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

    move-result-object v2

    invoke-virtual {v1, v2}, Lb/ag;->a(Lb/u;)Lb/ag;

    move-result-object v1

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

    move-result-object v1

    iget-object v2, p0, Lb/a/a/d;->c:Lb/ai;

    const/4 v3, 0x0

    invoke-direct {v0, v1, v2, v3}, Lb/a/a/c;-><init>(Lb/af;Lb/ai;B)V

    goto/16 :goto_0

    :cond_18
    iget-object v0, p0, Lb/a/a/d;->f:Ljava/util/Date;

    if-eqz v0, :cond_19

    const-string v0, "If-Modified-Since"

    iget-object v1, p0, Lb/a/a/d;->g:Ljava/lang/String;

    goto :goto_7

    :cond_19
    iget-object v0, p0, Lb/a/a/d;->d:Ljava/util/Date;

    if-eqz v0, :cond_1a

    const-string v0, "If-Modified-Since"

    iget-object v1, p0, Lb/a/a/d;->e:Ljava/lang/String;

    goto :goto_7

    :cond_1a
    new-instance v0, Lb/a/a/c;

    iget-object v1, p0, Lb/a/a/d;->b:Lb/af;

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-direct {v0, v1, v2, v3}, Lb/a/a/c;-><init>(Lb/af;Lb/ai;B)V

    goto/16 :goto_0
.end method
