mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
934 lines
24 KiB
Smali
934 lines
24 KiB
Smali
.class public final Lokhttp3/internal/cache/CacheStrategy$Factory;
|
|
.super Ljava/lang/Object;
|
|
.source "CacheStrategy.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lokhttp3/internal/cache/CacheStrategy;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Factory"
|
|
.end annotation
|
|
|
|
.annotation runtime Lkotlin/Metadata;
|
|
bv = {
|
|
0x1,
|
|
0x0,
|
|
0x3
|
|
}
|
|
d1 = {
|
|
"\u0000B\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u0008\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\n\n\u0002\u0018\u0002\n\u0002\u0008\u0003\n\u0002\u0010\u000b\n\u0002\u0008\u0002\u0018\u00002\u00020\u0001B\u001f\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0008\u0010\u0006\u001a\u0004\u0018\u00010\u0007\u00a2\u0006\u0002\u0010\u0008J\u0008\u0010\u0017\u001a\u00020\u0003H\u0002J\u0006\u0010\u0018\u001a\u00020\u0019J\u0008\u0010\u001a\u001a\u00020\u0019H\u0002J\u0008\u0010\u001b\u001a\u00020\u0003H\u0002J\u0010\u0010\u001c\u001a\u00020\u001d2\u0006\u0010\u0004\u001a\u00020\u0005H\u0002J\u0008\u0010\u001e\u001a\u00020\u001dH\u0002R\u000e\u0010\t\u001a\u00020\nX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0006\u001a\u0004\u0018\u00010\u0007X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u000b\u001a\u0004\u0018\u00010\u000cX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\r\u001a\u0004\u0018\u00010\u000eX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u000f\u001a\u0004\u0018\u00010\u000eX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0010\u001a\u0004\u0018\u00010\u000cX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0003X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0004\u001a\u00020\u0005X\u0080\u0004\u00a2\u0006\u0008\n\u0000\u001a\u0004\u0008\u0012\u0010\u0013R\u000e\u0010\u0014\u001a\u00020\u0003X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0015\u001a\u0004\u0018\u00010\u000eX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0016\u001a\u0004\u0018\u00010\u000cX\u0082\u000e\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u001f"
|
|
}
|
|
d2 = {
|
|
"Lokhttp3/internal/cache/CacheStrategy$Factory;",
|
|
"",
|
|
"nowMillis",
|
|
"",
|
|
"request",
|
|
"Lokhttp3/Request;",
|
|
"cacheResponse",
|
|
"Lokhttp3/Response;",
|
|
"(JLokhttp3/Request;Lokhttp3/Response;)V",
|
|
"ageSeconds",
|
|
"",
|
|
"etag",
|
|
"",
|
|
"expires",
|
|
"Ljava/util/Date;",
|
|
"lastModified",
|
|
"lastModifiedString",
|
|
"receivedResponseMillis",
|
|
"getRequest$okhttp",
|
|
"()Lokhttp3/Request;",
|
|
"sentRequestMillis",
|
|
"servedDate",
|
|
"servedDateString",
|
|
"cacheResponseAge",
|
|
"compute",
|
|
"Lokhttp3/internal/cache/CacheStrategy;",
|
|
"computeCandidate",
|
|
"computeFreshnessLifetime",
|
|
"hasConditions",
|
|
"",
|
|
"isFreshnessLifetimeHeuristic",
|
|
"okhttp"
|
|
}
|
|
k = 0x1
|
|
mv = {
|
|
0x1,
|
|
0x4,
|
|
0x0
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private ageSeconds:I
|
|
|
|
.field private final cacheResponse:Lokhttp3/Response;
|
|
|
|
.field private etag:Ljava/lang/String;
|
|
|
|
.field private expires:Ljava/util/Date;
|
|
|
|
.field private lastModified:Ljava/util/Date;
|
|
|
|
.field private lastModifiedString:Ljava/lang/String;
|
|
|
|
.field private final nowMillis:J
|
|
|
|
.field private receivedResponseMillis:J
|
|
|
|
.field private final request:Lokhttp3/Request;
|
|
|
|
.field private sentRequestMillis:J
|
|
|
|
.field private servedDate:Ljava/util/Date;
|
|
|
|
.field private servedDateString:Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(JLokhttp3/Request;Lokhttp3/Response;)V
|
|
.locals 4
|
|
|
|
const-string v0, "request"
|
|
|
|
invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 52
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-wide p1, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->nowMillis:J
|
|
|
|
iput-object p3, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
iput-object p4, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
const/4 p1, -0x1
|
|
|
|
iput p1, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->ageSeconds:I
|
|
|
|
if-eqz p4, :cond_5
|
|
|
|
.line 99
|
|
invoke-virtual {p4}, Lokhttp3/Response;->sentRequestAtMillis()J
|
|
|
|
move-result-wide p2
|
|
|
|
iput-wide p2, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->sentRequestMillis:J
|
|
|
|
.line 100
|
|
invoke-virtual {p4}, Lokhttp3/Response;->receivedResponseAtMillis()J
|
|
|
|
move-result-wide p2
|
|
|
|
iput-wide p2, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->receivedResponseMillis:J
|
|
|
|
.line 101
|
|
invoke-virtual {p4}, Lokhttp3/Response;->headers()Lokhttp3/Headers;
|
|
|
|
move-result-object p2
|
|
|
|
.line 102
|
|
invoke-virtual {p2}, Lokhttp3/Headers;->size()I
|
|
|
|
move-result p3
|
|
|
|
const/4 p4, 0x0
|
|
|
|
:goto_0
|
|
if-ge p4, p3, :cond_5
|
|
|
|
.line 103
|
|
invoke-virtual {p2, p4}, Lokhttp3/Headers;->name(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 104
|
|
invoke-virtual {p2, p4}, Lokhttp3/Headers;->value(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "Date"
|
|
|
|
const/4 v3, 0x1
|
|
|
|
.line 106
|
|
invoke-static {v0, v2, v3}, Lkotlin/text/StringsKt;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 107
|
|
invoke-static {v1}, Lokhttp3/internal/http/DatesKt;->toHttpDateOrNull(Ljava/lang/String;)Ljava/util/Date;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->servedDate:Ljava/util/Date;
|
|
|
|
iput-object v1, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->servedDateString:Ljava/lang/String;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
const-string v2, "Expires"
|
|
|
|
.line 110
|
|
invoke-static {v0, v2, v3}, Lkotlin/text/StringsKt;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 111
|
|
invoke-static {v1}, Lokhttp3/internal/http/DatesKt;->toHttpDateOrNull(Ljava/lang/String;)Ljava/util/Date;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->expires:Ljava/util/Date;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const-string v2, "Last-Modified"
|
|
|
|
.line 113
|
|
invoke-static {v0, v2, v3}, Lkotlin/text/StringsKt;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
.line 114
|
|
invoke-static {v1}, Lokhttp3/internal/http/DatesKt;->toHttpDateOrNull(Ljava/lang/String;)Ljava/util/Date;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->lastModified:Ljava/util/Date;
|
|
|
|
iput-object v1, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->lastModifiedString:Ljava/lang/String;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const-string v2, "ETag"
|
|
|
|
.line 117
|
|
invoke-static {v0, v2, v3}, Lkotlin/text/StringsKt;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
iput-object v1, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->etag:Ljava/lang/String;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
const-string v2, "Age"
|
|
|
|
.line 120
|
|
invoke-static {v0, v2, v3}, Lkotlin/text/StringsKt;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
.line 121
|
|
invoke-static {v1, p1}, Lokhttp3/internal/Util;->toNonNegativeInt(Ljava/lang/String;I)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->ageSeconds:I
|
|
|
|
:cond_4
|
|
:goto_1
|
|
add-int/lit8 p4, p4, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_5
|
|
return-void
|
|
.end method
|
|
|
|
.method private final cacheResponseAge()J
|
|
.locals 9
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->servedDate:Ljava/util/Date;
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-wide v3, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->receivedResponseMillis:J
|
|
|
|
.line 263
|
|
invoke-virtual {v0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v5
|
|
|
|
sub-long/2addr v3, v5
|
|
|
|
invoke-static {v1, v2, v3, v4}, Ljava/lang/Math;->max(JJ)J
|
|
|
|
move-result-wide v1
|
|
|
|
:cond_0
|
|
iget v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->ageSeconds:I
|
|
|
|
const/4 v3, -0x1
|
|
|
|
if-eq v0, v3, :cond_1
|
|
|
|
.line 269
|
|
sget-object v0, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
iget v3, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->ageSeconds:I
|
|
|
|
int-to-long v3, v3
|
|
|
|
invoke-virtual {v0, v3, v4}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v1, v2, v3, v4}, Ljava/lang/Math;->max(JJ)J
|
|
|
|
move-result-wide v1
|
|
|
|
:cond_1
|
|
iget-wide v3, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->receivedResponseMillis:J
|
|
|
|
iget-wide v5, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->sentRequestMillis:J
|
|
|
|
sub-long v5, v3, v5
|
|
|
|
iget-wide v7, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->nowMillis:J
|
|
|
|
sub-long/2addr v7, v3
|
|
|
|
add-long/2addr v1, v5
|
|
|
|
add-long/2addr v1, v7
|
|
|
|
return-wide v1
|
|
.end method
|
|
|
|
.method private final computeCandidate()Lokhttp3/internal/cache/CacheStrategy;
|
|
.locals 13
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 144
|
|
new-instance v0, Lokhttp3/internal/cache/CacheStrategy;
|
|
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
invoke-direct {v0, p0, v1}, Lokhttp3/internal/cache/CacheStrategy;-><init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
.line 148
|
|
invoke-virtual {v0}, Lokhttp3/Request;->isHttps()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
invoke-virtual {v0}, Lokhttp3/Response;->handshake()Lokhttp3/Handshake;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 149
|
|
new-instance v0, Lokhttp3/internal/cache/CacheStrategy;
|
|
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
invoke-direct {v0, p0, v1}, Lokhttp3/internal/cache/CacheStrategy;-><init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
|
|
|
return-object v0
|
|
|
|
.line 155
|
|
:cond_1
|
|
sget-object v0, Lokhttp3/internal/cache/CacheStrategy;->Companion:Lokhttp3/internal/cache/CacheStrategy$Companion;
|
|
|
|
iget-object v2, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
iget-object v3, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
invoke-virtual {v0, v2, v3}, Lokhttp3/internal/cache/CacheStrategy$Companion;->isCacheable(Lokhttp3/Response;Lokhttp3/Request;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
.line 156
|
|
new-instance v0, Lokhttp3/internal/cache/CacheStrategy;
|
|
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
invoke-direct {v0, p0, v1}, Lokhttp3/internal/cache/CacheStrategy;-><init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
|
|
|
return-object v0
|
|
|
|
:cond_2
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
.line 159
|
|
invoke-virtual {v0}, Lokhttp3/Request;->cacheControl()Lokhttp3/CacheControl;
|
|
|
|
move-result-object v0
|
|
|
|
.line 160
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->noCache()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_d
|
|
|
|
iget-object v2, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
invoke-direct {p0, v2}, Lokhttp3/internal/cache/CacheStrategy$Factory;->hasConditions(Lokhttp3/Request;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
goto/16 :goto_3
|
|
|
|
:cond_3
|
|
iget-object v2, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
.line 164
|
|
invoke-virtual {v2}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
|
|
|
|
move-result-object v2
|
|
|
|
.line 166
|
|
invoke-direct {p0}, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponseAge()J
|
|
|
|
move-result-wide v3
|
|
|
|
.line 167
|
|
invoke-direct {p0}, Lokhttp3/internal/cache/CacheStrategy$Factory;->computeFreshnessLifetime()J
|
|
|
|
move-result-wide v5
|
|
|
|
.line 169
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->maxAgeSeconds()I
|
|
|
|
move-result v7
|
|
|
|
const/4 v8, -0x1
|
|
|
|
if-eq v7, v8, :cond_4
|
|
|
|
.line 170
|
|
sget-object v7, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->maxAgeSeconds()I
|
|
|
|
move-result v9
|
|
|
|
int-to-long v9, v9
|
|
|
|
invoke-virtual {v7, v9, v10}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
move-result-wide v9
|
|
|
|
invoke-static {v5, v6, v9, v10}, Ljava/lang/Math;->min(JJ)J
|
|
|
|
move-result-wide v5
|
|
|
|
.line 174
|
|
:cond_4
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->minFreshSeconds()I
|
|
|
|
move-result v7
|
|
|
|
const-wide/16 v9, 0x0
|
|
|
|
if-eq v7, v8, :cond_5
|
|
|
|
.line 175
|
|
sget-object v7, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->minFreshSeconds()I
|
|
|
|
move-result v11
|
|
|
|
int-to-long v11, v11
|
|
|
|
invoke-virtual {v7, v11, v12}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
move-result-wide v11
|
|
|
|
goto :goto_0
|
|
|
|
:cond_5
|
|
move-wide v11, v9
|
|
|
|
.line 179
|
|
:goto_0
|
|
invoke-virtual {v2}, Lokhttp3/CacheControl;->mustRevalidate()Z
|
|
|
|
move-result v7
|
|
|
|
if-nez v7, :cond_6
|
|
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->maxStaleSeconds()I
|
|
|
|
move-result v7
|
|
|
|
if-eq v7, v8, :cond_6
|
|
|
|
.line 180
|
|
sget-object v7, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->maxStaleSeconds()I
|
|
|
|
move-result v0
|
|
|
|
int-to-long v8, v0
|
|
|
|
invoke-virtual {v7, v8, v9}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
move-result-wide v9
|
|
|
|
.line 183
|
|
:cond_6
|
|
invoke-virtual {v2}, Lokhttp3/CacheControl;->noCache()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_9
|
|
|
|
add-long/2addr v11, v3
|
|
|
|
add-long/2addr v9, v5
|
|
|
|
cmp-long v0, v11, v9
|
|
|
|
if-gez v0, :cond_9
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
.line 184
|
|
invoke-virtual {v0}, Lokhttp3/Response;->newBuilder()Lokhttp3/Response$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
cmp-long v2, v11, v5
|
|
|
|
const-string v5, "Warning"
|
|
|
|
if-ltz v2, :cond_7
|
|
|
|
const-string v2, "110 HttpURLConnection \"Response is stale\""
|
|
|
|
.line 186
|
|
invoke-virtual {v0, v5, v2}, Lokhttp3/Response$Builder;->addHeader(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Response$Builder;
|
|
|
|
:cond_7
|
|
const-wide/32 v6, 0x5265c00
|
|
|
|
cmp-long v2, v3, v6
|
|
|
|
if-lez v2, :cond_8
|
|
|
|
.line 189
|
|
invoke-direct {p0}, Lokhttp3/internal/cache/CacheStrategy$Factory;->isFreshnessLifetimeHeuristic()Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_8
|
|
|
|
const-string p0, "113 HttpURLConnection \"Heuristic expiration\""
|
|
|
|
.line 190
|
|
invoke-virtual {v0, v5, p0}, Lokhttp3/Response$Builder;->addHeader(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Response$Builder;
|
|
|
|
.line 192
|
|
:cond_8
|
|
new-instance p0, Lokhttp3/internal/cache/CacheStrategy;
|
|
|
|
invoke-virtual {v0}, Lokhttp3/Response$Builder;->build()Lokhttp3/Response;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v1, v0}, Lokhttp3/internal/cache/CacheStrategy;-><init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_9
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->etag:Ljava/lang/String;
|
|
|
|
if-eqz v0, :cond_a
|
|
|
|
const-string v1, "If-None-Match"
|
|
|
|
goto :goto_2
|
|
|
|
:cond_a
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->lastModified:Ljava/util/Date;
|
|
|
|
const-string v2, "If-Modified-Since"
|
|
|
|
if-eqz v0, :cond_b
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->lastModifiedString:Ljava/lang/String;
|
|
|
|
:goto_1
|
|
move-object v1, v2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_b
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->servedDate:Ljava/util/Date;
|
|
|
|
if-eqz v0, :cond_c
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->servedDateString:Ljava/lang/String;
|
|
|
|
goto :goto_1
|
|
|
|
:goto_2
|
|
iget-object v2, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
.line 218
|
|
invoke-virtual {v2}, Lokhttp3/Request;->headers()Lokhttp3/Headers;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Lokhttp3/Headers;->newBuilder()Lokhttp3/Headers$Builder;
|
|
|
|
move-result-object v2
|
|
|
|
.line 219
|
|
invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {v2, v1, v0}, Lokhttp3/Headers$Builder;->addLenient$okhttp(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
.line 221
|
|
invoke-virtual {v0}, Lokhttp3/Request;->newBuilder()Lokhttp3/Request$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
.line 222
|
|
invoke-virtual {v2}, Lokhttp3/Headers$Builder;->build()Lokhttp3/Headers;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lokhttp3/Request$Builder;->headers(Lokhttp3/Headers;)Lokhttp3/Request$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
.line 223
|
|
invoke-virtual {v0}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request;
|
|
|
|
move-result-object v0
|
|
|
|
.line 224
|
|
new-instance v1, Lokhttp3/internal/cache/CacheStrategy;
|
|
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
invoke-direct {v1, v0, p0}, Lokhttp3/internal/cache/CacheStrategy;-><init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
|
|
|
return-object v1
|
|
|
|
.line 215
|
|
:cond_c
|
|
new-instance v0, Lokhttp3/internal/cache/CacheStrategy;
|
|
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
invoke-direct {v0, p0, v1}, Lokhttp3/internal/cache/CacheStrategy;-><init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
|
|
|
return-object v0
|
|
|
|
.line 161
|
|
:cond_d
|
|
:goto_3
|
|
new-instance v0, Lokhttp3/internal/cache/CacheStrategy;
|
|
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
invoke-direct {v0, p0, v1}, Lokhttp3/internal/cache/CacheStrategy;-><init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final computeFreshnessLifetime()J
|
|
.locals 7
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
.line 232
|
|
invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {v0}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
|
|
|
|
move-result-object v0
|
|
|
|
.line 233
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->maxAgeSeconds()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, -0x1
|
|
|
|
if-eq v1, v2, :cond_0
|
|
|
|
.line 234
|
|
sget-object p0, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->maxAgeSeconds()I
|
|
|
|
move-result v0
|
|
|
|
int-to-long v0, v0
|
|
|
|
invoke-virtual {p0, v0, v1}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
move-result-wide v0
|
|
|
|
return-wide v0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->expires:Ljava/util/Date;
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
iget-object v3, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->servedDate:Ljava/util/Date;
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
.line 239
|
|
invoke-virtual {v3}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-wide v3, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->receivedResponseMillis:J
|
|
|
|
.line 240
|
|
:goto_0
|
|
invoke-virtual {v0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v5
|
|
|
|
sub-long/2addr v5, v3
|
|
|
|
cmp-long p0, v5, v1
|
|
|
|
if-lez p0, :cond_2
|
|
|
|
move-wide v1, v5
|
|
|
|
:cond_2
|
|
return-wide v1
|
|
|
|
:cond_3
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->lastModified:Ljava/util/Date;
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
.line 244
|
|
invoke-virtual {v0}, Lokhttp3/Response;->request()Lokhttp3/Request;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lokhttp3/HttpUrl;->query()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_5
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->servedDate:Ljava/util/Date;
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
.line 248
|
|
invoke-virtual {v0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
iget-wide v3, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->sentRequestMillis:J
|
|
|
|
:goto_1
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->lastModified:Ljava/util/Date;
|
|
|
|
.line 249
|
|
invoke-static {p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {p0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v5
|
|
|
|
sub-long/2addr v3, v5
|
|
|
|
cmp-long p0, v3, v1
|
|
|
|
if-lez p0, :cond_5
|
|
|
|
const/16 p0, 0xa
|
|
|
|
int-to-long v0, p0
|
|
|
|
.line 250
|
|
div-long v1, v3, v0
|
|
|
|
:cond_5
|
|
return-wide v1
|
|
.end method
|
|
|
|
.method private final hasConditions(Lokhttp3/Request;)Z
|
|
.locals 0
|
|
|
|
const-string p0, "If-Modified-Since"
|
|
|
|
.line 285
|
|
invoke-virtual {p1, p0}, Lokhttp3/Request;->header(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
const-string p0, "If-None-Match"
|
|
|
|
invoke-virtual {p1, p0}, Lokhttp3/Request;->header(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p0, 0x1
|
|
|
|
:goto_1
|
|
return p0
|
|
.end method
|
|
|
|
.method private final isFreshnessLifetimeHeuristic()Z
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->cacheResponse:Lokhttp3/Response;
|
|
|
|
.line 94
|
|
invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {v0}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lokhttp3/CacheControl;->maxAgeSeconds()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, -0x1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->expires:Ljava/util/Date;
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final compute()Lokhttp3/internal/cache/CacheStrategy;
|
|
.locals 2
|
|
|
|
.line 130
|
|
invoke-direct {p0}, Lokhttp3/internal/cache/CacheStrategy$Factory;->computeCandidate()Lokhttp3/internal/cache/CacheStrategy;
|
|
|
|
move-result-object v0
|
|
|
|
.line 133
|
|
invoke-virtual {v0}, Lokhttp3/internal/cache/CacheStrategy;->getNetworkRequest()Lokhttp3/Request;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
invoke-virtual {p0}, Lokhttp3/Request;->cacheControl()Lokhttp3/CacheControl;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Lokhttp3/CacheControl;->onlyIfCached()Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 134
|
|
new-instance p0, Lokhttp3/internal/cache/CacheStrategy;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, v0, v0}, Lokhttp3/internal/cache/CacheStrategy;-><init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getRequest$okhttp()Lokhttp3/Request;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lokhttp3/internal/cache/CacheStrategy$Factory;->request:Lokhttp3/Request;
|
|
|
|
return-object p0
|
|
.end method
|