CacheStrategy.smali
3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
.class public final Lokhttp3/internal/cache/CacheStrategy;
.super Ljava/lang/Object;
.source "CacheStrategy.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokhttp3/internal/cache/CacheStrategy$Factory;
}
.end annotation
# instance fields
.field public final cacheResponse:Lokhttp3/Response;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
.field public final networkRequest:Lokhttp3/Request;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
# direct methods
.method constructor <init>(Lokhttp3/Request;Lokhttp3/Response;)V
.locals 0
.line 57
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 58
iput-object p1, p0, Lokhttp3/internal/cache/CacheStrategy;->networkRequest:Lokhttp3/Request;
.line 59
iput-object p2, p0, Lokhttp3/internal/cache/CacheStrategy;->cacheResponse:Lokhttp3/Response;
return-void
.end method
.method public static isCacheable(Lokhttp3/Response;Lokhttp3/Request;)Z
.locals 3
.line 66
invoke-virtual {p0}, Lokhttp3/Response;->code()I
move-result v0
const/16 v1, 0xc8
const/4 v2, 0x0
if-eq v0, v1, :cond_2
const/16 v1, 0x19a
if-eq v0, v1, :cond_2
const/16 v1, 0x19e
if-eq v0, v1, :cond_2
const/16 v1, 0x1f5
if-eq v0, v1, :cond_2
const/16 v1, 0xcb
if-eq v0, v1, :cond_2
const/16 v1, 0xcc
if-eq v0, v1, :cond_2
const/16 v1, 0x133
if-eq v0, v1, :cond_0
const/16 v1, 0x134
if-eq v0, v1, :cond_2
const/16 v1, 0x194
if-eq v0, v1, :cond_2
const/16 v1, 0x195
if-eq v0, v1, :cond_2
packed-switch v0, :pswitch_data_0
goto :goto_0
:cond_0
:pswitch_0
const-string v0, "Expires"
.line 86
invoke-virtual {p0, v0}, Lokhttp3/Response;->header(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
if-nez v0, :cond_2
.line 87
invoke-virtual {p0}, 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_2
.line 88
invoke-virtual {p0}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
move-result-object v0
invoke-virtual {v0}, Lokhttp3/CacheControl;->isPublic()Z
move-result v0
if-nez v0, :cond_2
.line 89
invoke-virtual {p0}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
move-result-object v0
invoke-virtual {v0}, Lokhttp3/CacheControl;->isPrivate()Z
move-result v0
if-eqz v0, :cond_1
goto :goto_1
:cond_1
:goto_0
return v2
.line 100
:cond_2
:goto_1
:pswitch_1
invoke-virtual {p0}, Lokhttp3/Response;->cacheControl()Lokhttp3/CacheControl;
move-result-object p0
invoke-virtual {p0}, Lokhttp3/CacheControl;->noStore()Z
move-result p0
if-nez p0, :cond_3
invoke-virtual {p1}, Lokhttp3/Request;->cacheControl()Lokhttp3/CacheControl;
move-result-object p0
invoke-virtual {p0}, Lokhttp3/CacheControl;->noStore()Z
move-result p0
if-nez p0, :cond_3
const/4 v2, 0x1
:cond_3
return v2
:pswitch_data_0
.packed-switch 0x12c
:pswitch_1
:pswitch_1
:pswitch_0
.end packed-switch
.end method