RealCall.smali 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. .class final Lokhttp3/RealCall;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Lokhttp3/Call;
  6. # annotations
  7. .annotation system Ldalvik/annotation/MemberClasses;
  8. value = {
  9. Lokhttp3/RealCall$AsyncCall;
  10. }
  11. .end annotation
  12. # instance fields
  13. .field final client:Lokhttp3/OkHttpClient;
  14. .field private eventListener:Lokhttp3/EventListener;
  15. .field private executed:Z
  16. .field final forWebSocket:Z
  17. .field final originalRequest:Lokhttp3/Request;
  18. .field final retryAndFollowUpInterceptor:Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
  19. # direct methods
  20. .method private constructor <init>(Lokhttp3/OkHttpClient;Lokhttp3/Request;Z)V
  21. .locals 0
  22. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  23. iput-object p1, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  24. iput-object p2, p0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;
  25. iput-boolean p3, p0, Lokhttp3/RealCall;->forWebSocket:Z
  26. new-instance p2, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
  27. invoke-direct {p2, p1, p3}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;-><init>(Lokhttp3/OkHttpClient;Z)V
  28. iput-object p2, p0, Lokhttp3/RealCall;->retryAndFollowUpInterceptor:Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
  29. return-void
  30. .end method
  31. .method static synthetic access$000(Lokhttp3/RealCall;)Lokhttp3/EventListener;
  32. .locals 0
  33. iget-object p0, p0, Lokhttp3/RealCall;->eventListener:Lokhttp3/EventListener;
  34. return-object p0
  35. .end method
  36. .method private captureCallStackTrace()V
  37. .locals 2
  38. invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
  39. move-result-object v0
  40. const-string v1, "response.body().close()"
  41. invoke-virtual {v0, v1}, Lokhttp3/internal/platform/Platform;->getStackTraceForCloseable(Ljava/lang/String;)Ljava/lang/Object;
  42. move-result-object v0
  43. iget-object v1, p0, Lokhttp3/RealCall;->retryAndFollowUpInterceptor:Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
  44. invoke-virtual {v1, v0}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->setCallStackTrace(Ljava/lang/Object;)V
  45. return-void
  46. .end method
  47. .method static newRealCall(Lokhttp3/OkHttpClient;Lokhttp3/Request;Z)Lokhttp3/RealCall;
  48. .locals 1
  49. new-instance v0, Lokhttp3/RealCall;
  50. invoke-direct {v0, p0, p1, p2}, Lokhttp3/RealCall;-><init>(Lokhttp3/OkHttpClient;Lokhttp3/Request;Z)V
  51. invoke-virtual {p0}, Lokhttp3/OkHttpClient;->eventListenerFactory()Lokhttp3/EventListener$Factory;
  52. move-result-object p0
  53. invoke-interface {p0, v0}, Lokhttp3/EventListener$Factory;->create(Lokhttp3/Call;)Lokhttp3/EventListener;
  54. move-result-object p0
  55. iput-object p0, v0, Lokhttp3/RealCall;->eventListener:Lokhttp3/EventListener;
  56. return-object v0
  57. .end method
  58. # virtual methods
  59. .method public cancel()V
  60. .locals 1
  61. iget-object v0, p0, Lokhttp3/RealCall;->retryAndFollowUpInterceptor:Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
  62. invoke-virtual {v0}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->cancel()V
  63. return-void
  64. .end method
  65. .method public bridge synthetic clone()Ljava/lang/Object;
  66. .locals 1
  67. .annotation system Ldalvik/annotation/Throws;
  68. value = {
  69. Ljava/lang/CloneNotSupportedException;
  70. }
  71. .end annotation
  72. invoke-virtual {p0}, Lokhttp3/RealCall;->clone()Lokhttp3/RealCall;
  73. move-result-object v0
  74. return-object v0
  75. .end method
  76. .method public bridge synthetic clone()Lokhttp3/Call;
  77. .locals 1
  78. invoke-virtual {p0}, Lokhttp3/RealCall;->clone()Lokhttp3/RealCall;
  79. move-result-object v0
  80. return-object v0
  81. .end method
  82. .method public clone()Lokhttp3/RealCall;
  83. .locals 3
  84. iget-object v0, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  85. iget-object v1, p0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;
  86. iget-boolean v2, p0, Lokhttp3/RealCall;->forWebSocket:Z
  87. invoke-static {v0, v1, v2}, Lokhttp3/RealCall;->newRealCall(Lokhttp3/OkHttpClient;Lokhttp3/Request;Z)Lokhttp3/RealCall;
  88. move-result-object v0
  89. return-object v0
  90. .end method
  91. .method public enqueue(Lokhttp3/Callback;)V
  92. .locals 2
  93. monitor-enter p0
  94. :try_start_0
  95. iget-boolean v0, p0, Lokhttp3/RealCall;->executed:Z
  96. if-nez v0, :cond_0
  97. const/4 v0, 0x1
  98. iput-boolean v0, p0, Lokhttp3/RealCall;->executed:Z
  99. monitor-exit p0
  100. :try_end_0
  101. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  102. invoke-direct {p0}, Lokhttp3/RealCall;->captureCallStackTrace()V
  103. iget-object v0, p0, Lokhttp3/RealCall;->eventListener:Lokhttp3/EventListener;
  104. invoke-virtual {v0, p0}, Lokhttp3/EventListener;->callStart(Lokhttp3/Call;)V
  105. iget-object v0, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  106. invoke-virtual {v0}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;
  107. move-result-object v0
  108. new-instance v1, Lokhttp3/RealCall$AsyncCall;
  109. invoke-direct {v1, p0, p1}, Lokhttp3/RealCall$AsyncCall;-><init>(Lokhttp3/RealCall;Lokhttp3/Callback;)V
  110. invoke-virtual {v0, v1}, Lokhttp3/Dispatcher;->enqueue(Lokhttp3/RealCall$AsyncCall;)V
  111. return-void
  112. :cond_0
  113. :try_start_1
  114. new-instance p1, Ljava/lang/IllegalStateException;
  115. const-string v0, "Already Executed"
  116. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  117. throw p1
  118. :catchall_0
  119. move-exception p1
  120. monitor-exit p0
  121. :try_end_1
  122. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  123. throw p1
  124. .end method
  125. .method public execute()Lokhttp3/Response;
  126. .locals 2
  127. .annotation system Ldalvik/annotation/Throws;
  128. value = {
  129. Ljava/io/IOException;
  130. }
  131. .end annotation
  132. monitor-enter p0
  133. :try_start_0
  134. iget-boolean v0, p0, Lokhttp3/RealCall;->executed:Z
  135. if-nez v0, :cond_1
  136. const/4 v0, 0x1
  137. iput-boolean v0, p0, Lokhttp3/RealCall;->executed:Z
  138. monitor-exit p0
  139. :try_end_0
  140. .catchall {:try_start_0 .. :try_end_0} :catchall_1
  141. invoke-direct {p0}, Lokhttp3/RealCall;->captureCallStackTrace()V
  142. iget-object v0, p0, Lokhttp3/RealCall;->eventListener:Lokhttp3/EventListener;
  143. invoke-virtual {v0, p0}, Lokhttp3/EventListener;->callStart(Lokhttp3/Call;)V
  144. :try_start_1
  145. iget-object v0, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  146. invoke-virtual {v0}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;
  147. move-result-object v0
  148. invoke-virtual {v0, p0}, Lokhttp3/Dispatcher;->executed(Lokhttp3/RealCall;)V
  149. invoke-virtual {p0}, Lokhttp3/RealCall;->getResponseWithInterceptorChain()Lokhttp3/Response;
  150. move-result-object v0
  151. :try_end_1
  152. .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
  153. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  154. if-eqz v0, :cond_0
  155. iget-object v1, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  156. invoke-virtual {v1}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;
  157. move-result-object v1
  158. invoke-virtual {v1, p0}, Lokhttp3/Dispatcher;->finished(Lokhttp3/RealCall;)V
  159. return-object v0
  160. :cond_0
  161. :try_start_2
  162. new-instance v0, Ljava/io/IOException;
  163. const-string v1, "Canceled"
  164. invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  165. throw v0
  166. :try_end_2
  167. .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
  168. .catchall {:try_start_2 .. :try_end_2} :catchall_0
  169. :catchall_0
  170. move-exception v0
  171. goto :goto_0
  172. :catch_0
  173. move-exception v0
  174. :try_start_3
  175. iget-object v1, p0, Lokhttp3/RealCall;->eventListener:Lokhttp3/EventListener;
  176. invoke-virtual {v1, p0, v0}, Lokhttp3/EventListener;->callFailed(Lokhttp3/Call;Ljava/io/IOException;)V
  177. throw v0
  178. :try_end_3
  179. .catchall {:try_start_3 .. :try_end_3} :catchall_0
  180. :goto_0
  181. iget-object v1, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  182. invoke-virtual {v1}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;
  183. move-result-object v1
  184. invoke-virtual {v1, p0}, Lokhttp3/Dispatcher;->finished(Lokhttp3/RealCall;)V
  185. throw v0
  186. :cond_1
  187. :try_start_4
  188. new-instance v0, Ljava/lang/IllegalStateException;
  189. const-string v1, "Already Executed"
  190. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  191. throw v0
  192. :catchall_1
  193. move-exception v0
  194. monitor-exit p0
  195. :try_end_4
  196. .catchall {:try_start_4 .. :try_end_4} :catchall_1
  197. throw v0
  198. .end method
  199. .method getResponseWithInterceptorChain()Lokhttp3/Response;
  200. .locals 13
  201. .annotation system Ldalvik/annotation/Throws;
  202. value = {
  203. Ljava/io/IOException;
  204. }
  205. .end annotation
  206. new-instance v1, Ljava/util/ArrayList;
  207. invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
  208. iget-object v0, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  209. invoke-virtual {v0}, Lokhttp3/OkHttpClient;->interceptors()Ljava/util/List;
  210. move-result-object v0
  211. invoke-interface {v1, v0}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
  212. iget-object v0, p0, Lokhttp3/RealCall;->retryAndFollowUpInterceptor:Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
  213. invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  214. new-instance v0, Lokhttp3/internal/http/BridgeInterceptor;
  215. iget-object v2, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  216. invoke-virtual {v2}, Lokhttp3/OkHttpClient;->cookieJar()Lokhttp3/CookieJar;
  217. move-result-object v2
  218. invoke-direct {v0, v2}, Lokhttp3/internal/http/BridgeInterceptor;-><init>(Lokhttp3/CookieJar;)V
  219. invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  220. new-instance v0, Lokhttp3/internal/cache/CacheInterceptor;
  221. iget-object v2, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  222. invoke-virtual {v2}, Lokhttp3/OkHttpClient;->internalCache()Lokhttp3/internal/cache/InternalCache;
  223. move-result-object v2
  224. invoke-direct {v0, v2}, Lokhttp3/internal/cache/CacheInterceptor;-><init>(Lokhttp3/internal/cache/InternalCache;)V
  225. invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  226. new-instance v0, Lokhttp3/internal/connection/ConnectInterceptor;
  227. iget-object v2, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  228. invoke-direct {v0, v2}, Lokhttp3/internal/connection/ConnectInterceptor;-><init>(Lokhttp3/OkHttpClient;)V
  229. invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  230. iget-boolean v0, p0, Lokhttp3/RealCall;->forWebSocket:Z
  231. if-nez v0, :cond_0
  232. iget-object v0, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  233. invoke-virtual {v0}, Lokhttp3/OkHttpClient;->networkInterceptors()Ljava/util/List;
  234. move-result-object v0
  235. invoke-interface {v1, v0}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
  236. :cond_0
  237. new-instance v0, Lokhttp3/internal/http/CallServerInterceptor;
  238. iget-boolean v2, p0, Lokhttp3/RealCall;->forWebSocket:Z
  239. invoke-direct {v0, v2}, Lokhttp3/internal/http/CallServerInterceptor;-><init>(Z)V
  240. invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  241. new-instance v12, Lokhttp3/internal/http/RealInterceptorChain;
  242. const/4 v2, 0x0
  243. const/4 v3, 0x0
  244. const/4 v4, 0x0
  245. const/4 v5, 0x0
  246. iget-object v6, p0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;
  247. iget-object v8, p0, Lokhttp3/RealCall;->eventListener:Lokhttp3/EventListener;
  248. iget-object v0, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  249. invoke-virtual {v0}, Lokhttp3/OkHttpClient;->connectTimeoutMillis()I
  250. move-result v9
  251. iget-object v0, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  252. invoke-virtual {v0}, Lokhttp3/OkHttpClient;->readTimeoutMillis()I
  253. move-result v10
  254. iget-object v0, p0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  255. invoke-virtual {v0}, Lokhttp3/OkHttpClient;->writeTimeoutMillis()I
  256. move-result v11
  257. move-object v0, v12
  258. move-object v7, p0
  259. invoke-direct/range {v0 .. v11}, Lokhttp3/internal/http/RealInterceptorChain;-><init>(Ljava/util/List;Lokhttp3/internal/connection/StreamAllocation;Lokhttp3/internal/http/HttpCodec;Lokhttp3/internal/connection/RealConnection;ILokhttp3/Request;Lokhttp3/Call;Lokhttp3/EventListener;III)V
  260. iget-object v0, p0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;
  261. invoke-interface {v12, v0}, Lokhttp3/Interceptor$Chain;->proceed(Lokhttp3/Request;)Lokhttp3/Response;
  262. move-result-object v0
  263. return-object v0
  264. .end method
  265. .method public isCanceled()Z
  266. .locals 1
  267. iget-object v0, p0, Lokhttp3/RealCall;->retryAndFollowUpInterceptor:Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
  268. invoke-virtual {v0}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->isCanceled()Z
  269. move-result v0
  270. return v0
  271. .end method
  272. .method public declared-synchronized isExecuted()Z
  273. .locals 1
  274. monitor-enter p0
  275. :try_start_0
  276. iget-boolean v0, p0, Lokhttp3/RealCall;->executed:Z
  277. :try_end_0
  278. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  279. monitor-exit p0
  280. return v0
  281. :catchall_0
  282. move-exception v0
  283. monitor-exit p0
  284. throw v0
  285. .end method
  286. .method redactedUrl()Ljava/lang/String;
  287. .locals 1
  288. iget-object v0, p0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;
  289. invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
  290. move-result-object v0
  291. invoke-virtual {v0}, Lokhttp3/HttpUrl;->redact()Ljava/lang/String;
  292. move-result-object v0
  293. return-object v0
  294. .end method
  295. .method public request()Lokhttp3/Request;
  296. .locals 1
  297. iget-object v0, p0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;
  298. return-object v0
  299. .end method
  300. .method streamAllocation()Lokhttp3/internal/connection/StreamAllocation;
  301. .locals 1
  302. iget-object v0, p0, Lokhttp3/RealCall;->retryAndFollowUpInterceptor:Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
  303. invoke-virtual {v0}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation()Lokhttp3/internal/connection/StreamAllocation;
  304. move-result-object v0
  305. return-object v0
  306. .end method
  307. .method toLoggableString()Ljava/lang/String;
  308. .locals 2
  309. new-instance v0, Ljava/lang/StringBuilder;
  310. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  311. invoke-virtual {p0}, Lokhttp3/RealCall;->isCanceled()Z
  312. move-result v1
  313. if-eqz v1, :cond_0
  314. const-string v1, "canceled "
  315. goto :goto_0
  316. :cond_0
  317. const-string v1, ""
  318. :goto_0
  319. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  320. iget-boolean v1, p0, Lokhttp3/RealCall;->forWebSocket:Z
  321. if-eqz v1, :cond_1
  322. const-string v1, "web socket"
  323. goto :goto_1
  324. :cond_1
  325. const-string v1, "call"
  326. :goto_1
  327. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  328. const-string v1, " to "
  329. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  330. invoke-virtual {p0}, Lokhttp3/RealCall;->redactedUrl()Ljava/lang/String;
  331. move-result-object v1
  332. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  333. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  334. move-result-object v0
  335. return-object v0
  336. .end method