150 lines
3.4 KiB
Smali
150 lines
3.4 KiB
Smali
|
.class public final Lokhttp3/internal/http/CacheStrategy;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "CacheStrategy.java"
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation system Ldalvik/annotation/MemberClasses;
|
||
|
value = {
|
||
|
Lokhttp3/internal/http/CacheStrategy$Factory;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field public final cacheResponse:Lokhttp3/Response;
|
||
|
|
||
|
.field public final networkRequest:Lokhttp3/Request;
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method private constructor <init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
||
|
.locals 0
|
||
|
.param p1, "networkRequest" # Lokhttp3/Request;
|
||
|
.param p2, "cacheResponse" # Lokhttp3/Response;
|
||
|
|
||
|
.prologue
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
iput-object p1, p0, Lokhttp3/internal/http/CacheStrategy;->networkRequest:Lokhttp3/Request;
|
||
|
|
||
|
iput-object p2, p0, Lokhttp3/internal/http/CacheStrategy;->cacheResponse:Lokhttp3/Response;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method synthetic constructor <init>(Lokhttp3/Request;Lokhttp3/Response;Lokhttp3/internal/http/CacheStrategy$1;)V
|
||
|
.locals 0
|
||
|
.param p1, "x0" # Lokhttp3/Request;
|
||
|
.param p2, "x1" # Lokhttp3/Response;
|
||
|
.param p3, "x2" # Lokhttp3/internal/http/CacheStrategy$1;
|
||
|
|
||
|
.prologue
|
||
|
invoke-direct {p0, p1, p2}, Lokhttp3/internal/http/CacheStrategy;-><init>(Lokhttp3/Request;Lokhttp3/Response;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public static isCacheable(Lokhttp3/Response;Lokhttp3/Request;)Z
|
||
|
.locals 3
|
||
|
.param p0, "response" # Lokhttp3/Response;
|
||
|
.param p1, "request" # Lokhttp3/Request;
|
||
|
|
||
|
.prologue
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
invoke-virtual {p0}, Lokhttp3/Response;->code()I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
sparse-switch v1, :sswitch_data_0
|
||
|
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
return v0
|
||
|
|
||
|
:sswitch_0
|
||
|
const-string v1, "Expires"
|
||
|
|
||
|
invoke-virtual {p0, v1}, Lokhttp3/Response;->header(Ljava/lang/String;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
if-nez v1, :cond_1
|
||
|
|
||
|
invoke-virtual {p0}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Lokhttp3/CacheControl;->maxAgeSeconds()I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
const/4 v2, -0x1
|
||
|
|
||
|
if-ne v1, v2, :cond_1
|
||
|
|
||
|
invoke-virtual {p0}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Lokhttp3/CacheControl;->isPublic()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-nez v1, :cond_1
|
||
|
|
||
|
invoke-virtual {p0}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Lokhttp3/CacheControl;->isPrivate()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
:cond_1
|
||
|
:sswitch_1
|
||
|
invoke-virtual {p0}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Lokhttp3/CacheControl;->noStore()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-nez v1, :cond_0
|
||
|
|
||
|
invoke-virtual {p1}, Lokhttp3/Request;->cacheControl()Lokhttp3/CacheControl;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Lokhttp3/CacheControl;->noStore()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-nez v1, :cond_0
|
||
|
|
||
|
const/4 v0, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:sswitch_data_0
|
||
|
.sparse-switch
|
||
|
0xc8 -> :sswitch_1
|
||
|
0xcb -> :sswitch_1
|
||
|
0xcc -> :sswitch_1
|
||
|
0x12c -> :sswitch_1
|
||
|
0x12d -> :sswitch_1
|
||
|
0x12e -> :sswitch_0
|
||
|
0x133 -> :sswitch_0
|
||
|
0x134 -> :sswitch_1
|
||
|
0x194 -> :sswitch_1
|
||
|
0x195 -> :sswitch_1
|
||
|
0x19a -> :sswitch_1
|
||
|
0x19e -> :sswitch_1
|
||
|
0x1f5 -> :sswitch_1
|
||
|
.end sparse-switch
|
||
|
.end method
|