Cache$Entry.smali 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  1. .class final Lokhttp3/Cache$Entry;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/Cache;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x1a
  10. name = "Entry"
  11. .end annotation
  12. # static fields
  13. .field private static final RECEIVED_MILLIS:Ljava/lang/String;
  14. .field private static final SENT_MILLIS:Ljava/lang/String;
  15. # instance fields
  16. .field private final code:I
  17. .field private final handshake:Lokhttp3/Handshake;
  18. .field private final message:Ljava/lang/String;
  19. .field private final protocol:Lokhttp3/Protocol;
  20. .field private final receivedResponseMillis:J
  21. .field private final requestMethod:Ljava/lang/String;
  22. .field private final responseHeaders:Lokhttp3/Headers;
  23. .field private final sentRequestMillis:J
  24. .field private final url:Ljava/lang/String;
  25. .field private final varyHeaders:Lokhttp3/Headers;
  26. # direct methods
  27. .method static constructor <clinit>()V
  28. .locals 2
  29. new-instance v0, Ljava/lang/StringBuilder;
  30. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  31. invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
  32. move-result-object v1
  33. invoke-virtual {v1}, Lokhttp3/internal/platform/Platform;->getPrefix()Ljava/lang/String;
  34. move-result-object v1
  35. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  36. const-string v1, "-Sent-Millis"
  37. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  38. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  39. move-result-object v0
  40. sput-object v0, Lokhttp3/Cache$Entry;->SENT_MILLIS:Ljava/lang/String;
  41. new-instance v0, Ljava/lang/StringBuilder;
  42. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  43. invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
  44. move-result-object v1
  45. invoke-virtual {v1}, Lokhttp3/internal/platform/Platform;->getPrefix()Ljava/lang/String;
  46. move-result-object v1
  47. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  48. const-string v1, "-Received-Millis"
  49. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  50. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  51. move-result-object v0
  52. sput-object v0, Lokhttp3/Cache$Entry;->RECEIVED_MILLIS:Ljava/lang/String;
  53. return-void
  54. .end method
  55. .method constructor <init>(Lokhttp3/Response;)V
  56. .locals 2
  57. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  58. invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
  59. move-result-object v0
  60. invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
  61. move-result-object v0
  62. invoke-virtual {v0}, Lokhttp3/HttpUrl;->toString()Ljava/lang/String;
  63. move-result-object v0
  64. iput-object v0, p0, Lokhttp3/Cache$Entry;->url:Ljava/lang/String;
  65. invoke-static {p1}, Lokhttp3/internal/http/HttpHeaders;->varyHeaders(Lokhttp3/Response;)Lokhttp3/Headers;
  66. move-result-object v0
  67. iput-object v0, p0, Lokhttp3/Cache$Entry;->varyHeaders:Lokhttp3/Headers;
  68. invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
  69. move-result-object v0
  70. invoke-virtual {v0}, Lokhttp3/Request;->method()Ljava/lang/String;
  71. move-result-object v0
  72. iput-object v0, p0, Lokhttp3/Cache$Entry;->requestMethod:Ljava/lang/String;
  73. invoke-virtual {p1}, Lokhttp3/Response;->protocol()Lokhttp3/Protocol;
  74. move-result-object v0
  75. iput-object v0, p0, Lokhttp3/Cache$Entry;->protocol:Lokhttp3/Protocol;
  76. invoke-virtual {p1}, Lokhttp3/Response;->code()I
  77. move-result v0
  78. iput v0, p0, Lokhttp3/Cache$Entry;->code:I
  79. invoke-virtual {p1}, Lokhttp3/Response;->message()Ljava/lang/String;
  80. move-result-object v0
  81. iput-object v0, p0, Lokhttp3/Cache$Entry;->message:Ljava/lang/String;
  82. invoke-virtual {p1}, Lokhttp3/Response;->headers()Lokhttp3/Headers;
  83. move-result-object v0
  84. iput-object v0, p0, Lokhttp3/Cache$Entry;->responseHeaders:Lokhttp3/Headers;
  85. invoke-virtual {p1}, Lokhttp3/Response;->handshake()Lokhttp3/Handshake;
  86. move-result-object v0
  87. iput-object v0, p0, Lokhttp3/Cache$Entry;->handshake:Lokhttp3/Handshake;
  88. invoke-virtual {p1}, Lokhttp3/Response;->sentRequestAtMillis()J
  89. move-result-wide v0
  90. iput-wide v0, p0, Lokhttp3/Cache$Entry;->sentRequestMillis:J
  91. invoke-virtual {p1}, Lokhttp3/Response;->receivedResponseAtMillis()J
  92. move-result-wide v0
  93. iput-wide v0, p0, Lokhttp3/Cache$Entry;->receivedResponseMillis:J
  94. return-void
  95. .end method
  96. .method constructor <init>(Lokio/Source;)V
  97. .locals 8
  98. .annotation system Ldalvik/annotation/Throws;
  99. value = {
  100. Ljava/io/IOException;
  101. }
  102. .end annotation
  103. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  104. :try_start_0
  105. invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
  106. move-result-object v0
  107. invoke-interface {v0}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  108. move-result-object v1
  109. iput-object v1, p0, Lokhttp3/Cache$Entry;->url:Ljava/lang/String;
  110. invoke-interface {v0}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  111. move-result-object v1
  112. iput-object v1, p0, Lokhttp3/Cache$Entry;->requestMethod:Ljava/lang/String;
  113. new-instance v1, Lokhttp3/Headers$Builder;
  114. invoke-direct {v1}, Lokhttp3/Headers$Builder;-><init>()V
  115. invoke-static {v0}, Lokhttp3/Cache;->readInt(Lokio/BufferedSource;)I
  116. move-result v2
  117. const/4 v3, 0x0
  118. const/4 v4, 0x0
  119. :goto_0
  120. if-ge v4, v2, :cond_0
  121. invoke-interface {v0}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  122. move-result-object v5
  123. invoke-virtual {v1, v5}, Lokhttp3/Headers$Builder;->addLenient(Ljava/lang/String;)Lokhttp3/Headers$Builder;
  124. add-int/lit8 v4, v4, 0x1
  125. goto :goto_0
  126. :cond_0
  127. invoke-virtual {v1}, Lokhttp3/Headers$Builder;->build()Lokhttp3/Headers;
  128. move-result-object v1
  129. iput-object v1, p0, Lokhttp3/Cache$Entry;->varyHeaders:Lokhttp3/Headers;
  130. invoke-interface {v0}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  131. move-result-object v1
  132. invoke-static {v1}, Lokhttp3/internal/http/StatusLine;->parse(Ljava/lang/String;)Lokhttp3/internal/http/StatusLine;
  133. move-result-object v1
  134. iget-object v2, v1, Lokhttp3/internal/http/StatusLine;->protocol:Lokhttp3/Protocol;
  135. iput-object v2, p0, Lokhttp3/Cache$Entry;->protocol:Lokhttp3/Protocol;
  136. iget v2, v1, Lokhttp3/internal/http/StatusLine;->code:I
  137. iput v2, p0, Lokhttp3/Cache$Entry;->code:I
  138. iget-object v1, v1, Lokhttp3/internal/http/StatusLine;->message:Ljava/lang/String;
  139. iput-object v1, p0, Lokhttp3/Cache$Entry;->message:Ljava/lang/String;
  140. new-instance v1, Lokhttp3/Headers$Builder;
  141. invoke-direct {v1}, Lokhttp3/Headers$Builder;-><init>()V
  142. invoke-static {v0}, Lokhttp3/Cache;->readInt(Lokio/BufferedSource;)I
  143. move-result v2
  144. :goto_1
  145. if-ge v3, v2, :cond_1
  146. invoke-interface {v0}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  147. move-result-object v4
  148. invoke-virtual {v1, v4}, Lokhttp3/Headers$Builder;->addLenient(Ljava/lang/String;)Lokhttp3/Headers$Builder;
  149. add-int/lit8 v3, v3, 0x1
  150. goto :goto_1
  151. :cond_1
  152. sget-object v2, Lokhttp3/Cache$Entry;->SENT_MILLIS:Ljava/lang/String;
  153. invoke-virtual {v1, v2}, Lokhttp3/Headers$Builder;->get(Ljava/lang/String;)Ljava/lang/String;
  154. move-result-object v2
  155. sget-object v3, Lokhttp3/Cache$Entry;->RECEIVED_MILLIS:Ljava/lang/String;
  156. invoke-virtual {v1, v3}, Lokhttp3/Headers$Builder;->get(Ljava/lang/String;)Ljava/lang/String;
  157. move-result-object v3
  158. sget-object v4, Lokhttp3/Cache$Entry;->SENT_MILLIS:Ljava/lang/String;
  159. invoke-virtual {v1, v4}, Lokhttp3/Headers$Builder;->removeAll(Ljava/lang/String;)Lokhttp3/Headers$Builder;
  160. sget-object v4, Lokhttp3/Cache$Entry;->RECEIVED_MILLIS:Ljava/lang/String;
  161. invoke-virtual {v1, v4}, Lokhttp3/Headers$Builder;->removeAll(Ljava/lang/String;)Lokhttp3/Headers$Builder;
  162. const-wide/16 v4, 0x0
  163. if-eqz v2, :cond_2
  164. invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
  165. move-result-wide v6
  166. goto :goto_2
  167. :cond_2
  168. move-wide v6, v4
  169. :goto_2
  170. iput-wide v6, p0, Lokhttp3/Cache$Entry;->sentRequestMillis:J
  171. if-eqz v3, :cond_3
  172. invoke-static {v3}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
  173. move-result-wide v4
  174. :cond_3
  175. iput-wide v4, p0, Lokhttp3/Cache$Entry;->receivedResponseMillis:J
  176. invoke-virtual {v1}, Lokhttp3/Headers$Builder;->build()Lokhttp3/Headers;
  177. move-result-object v1
  178. iput-object v1, p0, Lokhttp3/Cache$Entry;->responseHeaders:Lokhttp3/Headers;
  179. invoke-direct {p0}, Lokhttp3/Cache$Entry;->isHttps()Z
  180. move-result v1
  181. if-eqz v1, :cond_6
  182. invoke-interface {v0}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  183. move-result-object v1
  184. invoke-virtual {v1}, Ljava/lang/String;->length()I
  185. move-result v2
  186. if-gtz v2, :cond_5
  187. invoke-interface {v0}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  188. move-result-object v1
  189. invoke-static {v1}, Lokhttp3/CipherSuite;->forJavaName(Ljava/lang/String;)Lokhttp3/CipherSuite;
  190. move-result-object v1
  191. invoke-direct {p0, v0}, Lokhttp3/Cache$Entry;->readCertificateList(Lokio/BufferedSource;)Ljava/util/List;
  192. move-result-object v2
  193. invoke-direct {p0, v0}, Lokhttp3/Cache$Entry;->readCertificateList(Lokio/BufferedSource;)Ljava/util/List;
  194. move-result-object v3
  195. invoke-interface {v0}, Lokio/BufferedSource;->exhausted()Z
  196. move-result v4
  197. if-nez v4, :cond_4
  198. invoke-interface {v0}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  199. move-result-object v0
  200. invoke-static {v0}, Lokhttp3/TlsVersion;->forJavaName(Ljava/lang/String;)Lokhttp3/TlsVersion;
  201. move-result-object v0
  202. goto :goto_3
  203. :cond_4
  204. sget-object v0, Lokhttp3/TlsVersion;->SSL_3_0:Lokhttp3/TlsVersion;
  205. :goto_3
  206. invoke-static {v0, v1, v2, v3}, Lokhttp3/Handshake;->get(Lokhttp3/TlsVersion;Lokhttp3/CipherSuite;Ljava/util/List;Ljava/util/List;)Lokhttp3/Handshake;
  207. move-result-object v0
  208. iput-object v0, p0, Lokhttp3/Cache$Entry;->handshake:Lokhttp3/Handshake;
  209. goto :goto_4
  210. :cond_5
  211. new-instance v0, Ljava/io/IOException;
  212. new-instance v2, Ljava/lang/StringBuilder;
  213. invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
  214. const-string v3, "expected \"\" but was \""
  215. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  216. invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  217. const-string v1, "\""
  218. invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  219. invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  220. move-result-object v1
  221. invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  222. throw v0
  223. :cond_6
  224. const/4 v0, 0x0
  225. iput-object v0, p0, Lokhttp3/Cache$Entry;->handshake:Lokhttp3/Handshake;
  226. :try_end_0
  227. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  228. :goto_4
  229. invoke-interface {p1}, Lokio/Source;->close()V
  230. return-void
  231. :catchall_0
  232. move-exception v0
  233. invoke-interface {p1}, Lokio/Source;->close()V
  234. goto :goto_6
  235. :goto_5
  236. throw v0
  237. :goto_6
  238. goto :goto_5
  239. .end method
  240. .method private isHttps()Z
  241. .locals 2
  242. iget-object v0, p0, Lokhttp3/Cache$Entry;->url:Ljava/lang/String;
  243. const-string v1, "https://"
  244. invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
  245. move-result v0
  246. return v0
  247. .end method
  248. .method private readCertificateList(Lokio/BufferedSource;)Ljava/util/List;
  249. .locals 6
  250. .annotation system Ldalvik/annotation/Signature;
  251. value = {
  252. "(",
  253. "Lokio/BufferedSource;",
  254. ")",
  255. "Ljava/util/List<",
  256. "Ljava/security/cert/Certificate;",
  257. ">;"
  258. }
  259. .end annotation
  260. .annotation system Ldalvik/annotation/Throws;
  261. value = {
  262. Ljava/io/IOException;
  263. }
  264. .end annotation
  265. invoke-static {p1}, Lokhttp3/Cache;->readInt(Lokio/BufferedSource;)I
  266. move-result v0
  267. const/4 v1, -0x1
  268. if-ne v0, v1, :cond_0
  269. invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
  270. move-result-object p1
  271. return-object p1
  272. :cond_0
  273. :try_start_0
  274. const-string v1, "X.509"
  275. invoke-static {v1}, Ljava/security/cert/CertificateFactory;->getInstance(Ljava/lang/String;)Ljava/security/cert/CertificateFactory;
  276. move-result-object v1
  277. new-instance v2, Ljava/util/ArrayList;
  278. invoke-direct {v2, v0}, Ljava/util/ArrayList;-><init>(I)V
  279. const/4 v3, 0x0
  280. :goto_0
  281. if-ge v3, v0, :cond_1
  282. invoke-interface {p1}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  283. move-result-object v4
  284. new-instance v5, Lokio/Buffer;
  285. invoke-direct {v5}, Lokio/Buffer;-><init>()V
  286. invoke-static {v4}, Lokio/ByteString;->decodeBase64(Ljava/lang/String;)Lokio/ByteString;
  287. move-result-object v4
  288. invoke-virtual {v5, v4}, Lokio/Buffer;->write(Lokio/ByteString;)Lokio/Buffer;
  289. invoke-virtual {v5}, Lokio/Buffer;->inputStream()Ljava/io/InputStream;
  290. move-result-object v4
  291. invoke-virtual {v1, v4}, Ljava/security/cert/CertificateFactory;->generateCertificate(Ljava/io/InputStream;)Ljava/security/cert/Certificate;
  292. move-result-object v4
  293. invoke-interface {v2, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  294. :try_end_0
  295. .catch Ljava/security/cert/CertificateException; {:try_start_0 .. :try_end_0} :catch_0
  296. add-int/lit8 v3, v3, 0x1
  297. goto :goto_0
  298. :cond_1
  299. return-object v2
  300. :catch_0
  301. move-exception p1
  302. new-instance v0, Ljava/io/IOException;
  303. invoke-virtual {p1}, Ljava/security/cert/CertificateException;->getMessage()Ljava/lang/String;
  304. move-result-object p1
  305. invoke-direct {v0, p1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  306. goto :goto_2
  307. :goto_1
  308. throw v0
  309. :goto_2
  310. goto :goto_1
  311. .end method
  312. .method private writeCertList(Lokio/BufferedSink;Ljava/util/List;)V
  313. .locals 4
  314. .annotation system Ldalvik/annotation/Signature;
  315. value = {
  316. "(",
  317. "Lokio/BufferedSink;",
  318. "Ljava/util/List<",
  319. "Ljava/security/cert/Certificate;",
  320. ">;)V"
  321. }
  322. .end annotation
  323. .annotation system Ldalvik/annotation/Throws;
  324. value = {
  325. Ljava/io/IOException;
  326. }
  327. .end annotation
  328. :try_start_0
  329. invoke-interface {p2}, Ljava/util/List;->size()I
  330. move-result v0
  331. int-to-long v0, v0
  332. invoke-interface {p1, v0, v1}, Lokio/BufferedSink;->writeDecimalLong(J)Lokio/BufferedSink;
  333. move-result-object v0
  334. const/16 v1, 0xa
  335. invoke-interface {v0, v1}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  336. const/4 v0, 0x0
  337. invoke-interface {p2}, Ljava/util/List;->size()I
  338. move-result v2
  339. :goto_0
  340. if-ge v0, v2, :cond_0
  341. invoke-interface {p2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
  342. move-result-object v3
  343. check-cast v3, Ljava/security/cert/Certificate;
  344. invoke-virtual {v3}, Ljava/security/cert/Certificate;->getEncoded()[B
  345. move-result-object v3
  346. invoke-static {v3}, Lokio/ByteString;->of([B)Lokio/ByteString;
  347. move-result-object v3
  348. invoke-virtual {v3}, Lokio/ByteString;->base64()Ljava/lang/String;
  349. move-result-object v3
  350. invoke-interface {p1, v3}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  351. move-result-object v3
  352. invoke-interface {v3, v1}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  353. :try_end_0
  354. .catch Ljava/security/cert/CertificateEncodingException; {:try_start_0 .. :try_end_0} :catch_0
  355. add-int/lit8 v0, v0, 0x1
  356. goto :goto_0
  357. :cond_0
  358. return-void
  359. :catch_0
  360. move-exception p1
  361. new-instance p2, Ljava/io/IOException;
  362. invoke-virtual {p1}, Ljava/security/cert/CertificateEncodingException;->getMessage()Ljava/lang/String;
  363. move-result-object p1
  364. invoke-direct {p2, p1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  365. goto :goto_2
  366. :goto_1
  367. throw p2
  368. :goto_2
  369. goto :goto_1
  370. .end method
  371. # virtual methods
  372. .method public matches(Lokhttp3/Request;Lokhttp3/Response;)Z
  373. .locals 2
  374. iget-object v0, p0, Lokhttp3/Cache$Entry;->url:Ljava/lang/String;
  375. invoke-virtual {p1}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
  376. move-result-object v1
  377. invoke-virtual {v1}, Lokhttp3/HttpUrl;->toString()Ljava/lang/String;
  378. move-result-object v1
  379. invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  380. move-result v0
  381. if-eqz v0, :cond_0
  382. iget-object v0, p0, Lokhttp3/Cache$Entry;->requestMethod:Ljava/lang/String;
  383. invoke-virtual {p1}, Lokhttp3/Request;->method()Ljava/lang/String;
  384. move-result-object v1
  385. invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  386. move-result v0
  387. if-eqz v0, :cond_0
  388. iget-object v0, p0, Lokhttp3/Cache$Entry;->varyHeaders:Lokhttp3/Headers;
  389. invoke-static {p2, v0, p1}, Lokhttp3/internal/http/HttpHeaders;->varyMatches(Lokhttp3/Response;Lokhttp3/Headers;Lokhttp3/Request;)Z
  390. move-result p1
  391. if-eqz p1, :cond_0
  392. const/4 p1, 0x1
  393. goto :goto_0
  394. :cond_0
  395. const/4 p1, 0x0
  396. :goto_0
  397. return p1
  398. .end method
  399. .method public response(Lokhttp3/internal/cache/DiskLruCache$Snapshot;)Lokhttp3/Response;
  400. .locals 5
  401. iget-object v0, p0, Lokhttp3/Cache$Entry;->responseHeaders:Lokhttp3/Headers;
  402. const-string v1, "Content-Type"
  403. invoke-virtual {v0, v1}, Lokhttp3/Headers;->get(Ljava/lang/String;)Ljava/lang/String;
  404. move-result-object v0
  405. iget-object v1, p0, Lokhttp3/Cache$Entry;->responseHeaders:Lokhttp3/Headers;
  406. const-string v2, "Content-Length"
  407. invoke-virtual {v1, v2}, Lokhttp3/Headers;->get(Ljava/lang/String;)Ljava/lang/String;
  408. move-result-object v1
  409. new-instance v2, Lokhttp3/Request$Builder;
  410. invoke-direct {v2}, Lokhttp3/Request$Builder;-><init>()V
  411. iget-object v3, p0, Lokhttp3/Cache$Entry;->url:Ljava/lang/String;
  412. invoke-virtual {v2, v3}, Lokhttp3/Request$Builder;->url(Ljava/lang/String;)Lokhttp3/Request$Builder;
  413. move-result-object v2
  414. iget-object v3, p0, Lokhttp3/Cache$Entry;->requestMethod:Ljava/lang/String;
  415. const/4 v4, 0x0
  416. invoke-virtual {v2, v3, v4}, Lokhttp3/Request$Builder;->method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
  417. move-result-object v2
  418. iget-object v3, p0, Lokhttp3/Cache$Entry;->varyHeaders:Lokhttp3/Headers;
  419. invoke-virtual {v2, v3}, Lokhttp3/Request$Builder;->headers(Lokhttp3/Headers;)Lokhttp3/Request$Builder;
  420. move-result-object v2
  421. invoke-virtual {v2}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request;
  422. move-result-object v2
  423. new-instance v3, Lokhttp3/Response$Builder;
  424. invoke-direct {v3}, Lokhttp3/Response$Builder;-><init>()V
  425. invoke-virtual {v3, v2}, Lokhttp3/Response$Builder;->request(Lokhttp3/Request;)Lokhttp3/Response$Builder;
  426. move-result-object v2
  427. iget-object v3, p0, Lokhttp3/Cache$Entry;->protocol:Lokhttp3/Protocol;
  428. invoke-virtual {v2, v3}, Lokhttp3/Response$Builder;->protocol(Lokhttp3/Protocol;)Lokhttp3/Response$Builder;
  429. move-result-object v2
  430. iget v3, p0, Lokhttp3/Cache$Entry;->code:I
  431. invoke-virtual {v2, v3}, Lokhttp3/Response$Builder;->code(I)Lokhttp3/Response$Builder;
  432. move-result-object v2
  433. iget-object v3, p0, Lokhttp3/Cache$Entry;->message:Ljava/lang/String;
  434. invoke-virtual {v2, v3}, Lokhttp3/Response$Builder;->message(Ljava/lang/String;)Lokhttp3/Response$Builder;
  435. move-result-object v2
  436. iget-object v3, p0, Lokhttp3/Cache$Entry;->responseHeaders:Lokhttp3/Headers;
  437. invoke-virtual {v2, v3}, Lokhttp3/Response$Builder;->headers(Lokhttp3/Headers;)Lokhttp3/Response$Builder;
  438. move-result-object v2
  439. new-instance v3, Lokhttp3/Cache$CacheResponseBody;
  440. invoke-direct {v3, p1, v0, v1}, Lokhttp3/Cache$CacheResponseBody;-><init>(Lokhttp3/internal/cache/DiskLruCache$Snapshot;Ljava/lang/String;Ljava/lang/String;)V
  441. invoke-virtual {v2, v3}, Lokhttp3/Response$Builder;->body(Lokhttp3/ResponseBody;)Lokhttp3/Response$Builder;
  442. move-result-object p1
  443. iget-object v0, p0, Lokhttp3/Cache$Entry;->handshake:Lokhttp3/Handshake;
  444. invoke-virtual {p1, v0}, Lokhttp3/Response$Builder;->handshake(Lokhttp3/Handshake;)Lokhttp3/Response$Builder;
  445. move-result-object p1
  446. iget-wide v0, p0, Lokhttp3/Cache$Entry;->sentRequestMillis:J
  447. invoke-virtual {p1, v0, v1}, Lokhttp3/Response$Builder;->sentRequestAtMillis(J)Lokhttp3/Response$Builder;
  448. move-result-object p1
  449. iget-wide v0, p0, Lokhttp3/Cache$Entry;->receivedResponseMillis:J
  450. invoke-virtual {p1, v0, v1}, Lokhttp3/Response$Builder;->receivedResponseAtMillis(J)Lokhttp3/Response$Builder;
  451. move-result-object p1
  452. invoke-virtual {p1}, Lokhttp3/Response$Builder;->build()Lokhttp3/Response;
  453. move-result-object p1
  454. return-object p1
  455. .end method
  456. .method public writeTo(Lokhttp3/internal/cache/DiskLruCache$Editor;)V
  457. .locals 7
  458. .annotation system Ldalvik/annotation/Throws;
  459. value = {
  460. Ljava/io/IOException;
  461. }
  462. .end annotation
  463. const/4 v0, 0x0
  464. invoke-virtual {p1, v0}, Lokhttp3/internal/cache/DiskLruCache$Editor;->newSink(I)Lokio/Sink;
  465. move-result-object p1
  466. invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink;
  467. move-result-object p1
  468. iget-object v1, p0, Lokhttp3/Cache$Entry;->url:Ljava/lang/String;
  469. invoke-interface {p1, v1}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  470. move-result-object v1
  471. const/16 v2, 0xa
  472. invoke-interface {v1, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  473. iget-object v1, p0, Lokhttp3/Cache$Entry;->requestMethod:Ljava/lang/String;
  474. invoke-interface {p1, v1}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  475. move-result-object v1
  476. invoke-interface {v1, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  477. iget-object v1, p0, Lokhttp3/Cache$Entry;->varyHeaders:Lokhttp3/Headers;
  478. invoke-virtual {v1}, Lokhttp3/Headers;->size()I
  479. move-result v1
  480. int-to-long v3, v1
  481. invoke-interface {p1, v3, v4}, Lokio/BufferedSink;->writeDecimalLong(J)Lokio/BufferedSink;
  482. move-result-object v1
  483. invoke-interface {v1, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  484. iget-object v1, p0, Lokhttp3/Cache$Entry;->varyHeaders:Lokhttp3/Headers;
  485. invoke-virtual {v1}, Lokhttp3/Headers;->size()I
  486. move-result v1
  487. const/4 v3, 0x0
  488. :goto_0
  489. const-string v4, ": "
  490. if-ge v3, v1, :cond_0
  491. iget-object v5, p0, Lokhttp3/Cache$Entry;->varyHeaders:Lokhttp3/Headers;
  492. invoke-virtual {v5, v3}, Lokhttp3/Headers;->name(I)Ljava/lang/String;
  493. move-result-object v5
  494. invoke-interface {p1, v5}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  495. move-result-object v5
  496. invoke-interface {v5, v4}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  497. move-result-object v4
  498. iget-object v5, p0, Lokhttp3/Cache$Entry;->varyHeaders:Lokhttp3/Headers;
  499. invoke-virtual {v5, v3}, Lokhttp3/Headers;->value(I)Ljava/lang/String;
  500. move-result-object v5
  501. invoke-interface {v4, v5}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  502. move-result-object v4
  503. invoke-interface {v4, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  504. add-int/lit8 v3, v3, 0x1
  505. goto :goto_0
  506. :cond_0
  507. new-instance v1, Lokhttp3/internal/http/StatusLine;
  508. iget-object v3, p0, Lokhttp3/Cache$Entry;->protocol:Lokhttp3/Protocol;
  509. iget v5, p0, Lokhttp3/Cache$Entry;->code:I
  510. iget-object v6, p0, Lokhttp3/Cache$Entry;->message:Ljava/lang/String;
  511. invoke-direct {v1, v3, v5, v6}, Lokhttp3/internal/http/StatusLine;-><init>(Lokhttp3/Protocol;ILjava/lang/String;)V
  512. invoke-virtual {v1}, Lokhttp3/internal/http/StatusLine;->toString()Ljava/lang/String;
  513. move-result-object v1
  514. invoke-interface {p1, v1}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  515. move-result-object v1
  516. invoke-interface {v1, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  517. iget-object v1, p0, Lokhttp3/Cache$Entry;->responseHeaders:Lokhttp3/Headers;
  518. invoke-virtual {v1}, Lokhttp3/Headers;->size()I
  519. move-result v1
  520. add-int/lit8 v1, v1, 0x2
  521. int-to-long v5, v1
  522. invoke-interface {p1, v5, v6}, Lokio/BufferedSink;->writeDecimalLong(J)Lokio/BufferedSink;
  523. move-result-object v1
  524. invoke-interface {v1, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  525. iget-object v1, p0, Lokhttp3/Cache$Entry;->responseHeaders:Lokhttp3/Headers;
  526. invoke-virtual {v1}, Lokhttp3/Headers;->size()I
  527. move-result v1
  528. :goto_1
  529. if-ge v0, v1, :cond_1
  530. iget-object v3, p0, Lokhttp3/Cache$Entry;->responseHeaders:Lokhttp3/Headers;
  531. invoke-virtual {v3, v0}, Lokhttp3/Headers;->name(I)Ljava/lang/String;
  532. move-result-object v3
  533. invoke-interface {p1, v3}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  534. move-result-object v3
  535. invoke-interface {v3, v4}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  536. move-result-object v3
  537. iget-object v5, p0, Lokhttp3/Cache$Entry;->responseHeaders:Lokhttp3/Headers;
  538. invoke-virtual {v5, v0}, Lokhttp3/Headers;->value(I)Ljava/lang/String;
  539. move-result-object v5
  540. invoke-interface {v3, v5}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  541. move-result-object v3
  542. invoke-interface {v3, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  543. add-int/lit8 v0, v0, 0x1
  544. goto :goto_1
  545. :cond_1
  546. sget-object v0, Lokhttp3/Cache$Entry;->SENT_MILLIS:Ljava/lang/String;
  547. invoke-interface {p1, v0}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  548. move-result-object v0
  549. invoke-interface {v0, v4}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  550. move-result-object v0
  551. iget-wide v5, p0, Lokhttp3/Cache$Entry;->sentRequestMillis:J
  552. invoke-interface {v0, v5, v6}, Lokio/BufferedSink;->writeDecimalLong(J)Lokio/BufferedSink;
  553. move-result-object v0
  554. invoke-interface {v0, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  555. sget-object v0, Lokhttp3/Cache$Entry;->RECEIVED_MILLIS:Ljava/lang/String;
  556. invoke-interface {p1, v0}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  557. move-result-object v0
  558. invoke-interface {v0, v4}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  559. move-result-object v0
  560. iget-wide v3, p0, Lokhttp3/Cache$Entry;->receivedResponseMillis:J
  561. invoke-interface {v0, v3, v4}, Lokio/BufferedSink;->writeDecimalLong(J)Lokio/BufferedSink;
  562. move-result-object v0
  563. invoke-interface {v0, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  564. invoke-direct {p0}, Lokhttp3/Cache$Entry;->isHttps()Z
  565. move-result v0
  566. if-eqz v0, :cond_2
  567. invoke-interface {p1, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  568. iget-object v0, p0, Lokhttp3/Cache$Entry;->handshake:Lokhttp3/Handshake;
  569. invoke-virtual {v0}, Lokhttp3/Handshake;->cipherSuite()Lokhttp3/CipherSuite;
  570. move-result-object v0
  571. invoke-virtual {v0}, Lokhttp3/CipherSuite;->javaName()Ljava/lang/String;
  572. move-result-object v0
  573. invoke-interface {p1, v0}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  574. move-result-object v0
  575. invoke-interface {v0, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  576. iget-object v0, p0, Lokhttp3/Cache$Entry;->handshake:Lokhttp3/Handshake;
  577. invoke-virtual {v0}, Lokhttp3/Handshake;->peerCertificates()Ljava/util/List;
  578. move-result-object v0
  579. invoke-direct {p0, p1, v0}, Lokhttp3/Cache$Entry;->writeCertList(Lokio/BufferedSink;Ljava/util/List;)V
  580. iget-object v0, p0, Lokhttp3/Cache$Entry;->handshake:Lokhttp3/Handshake;
  581. invoke-virtual {v0}, Lokhttp3/Handshake;->localCertificates()Ljava/util/List;
  582. move-result-object v0
  583. invoke-direct {p0, p1, v0}, Lokhttp3/Cache$Entry;->writeCertList(Lokio/BufferedSink;Ljava/util/List;)V
  584. iget-object v0, p0, Lokhttp3/Cache$Entry;->handshake:Lokhttp3/Handshake;
  585. invoke-virtual {v0}, Lokhttp3/Handshake;->tlsVersion()Lokhttp3/TlsVersion;
  586. move-result-object v0
  587. invoke-virtual {v0}, Lokhttp3/TlsVersion;->javaName()Ljava/lang/String;
  588. move-result-object v0
  589. invoke-interface {p1, v0}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  590. move-result-object v0
  591. invoke-interface {v0, v2}, Lokio/BufferedSink;->writeByte(I)Lokio/BufferedSink;
  592. :cond_2
  593. invoke-interface {p1}, Lokio/Sink;->close()V
  594. return-void
  595. .end method