RecordedRequest.smali 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. .class public final Lokhttp3/mockwebserver/RecordedRequest;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # instance fields
  5. .field private final body:Lokio/Buffer;
  6. .field private final bodySize:J
  7. .field private final chunkSizes:Ljava/util/List;
  8. .annotation system Ldalvik/annotation/Signature;
  9. value = {
  10. "Ljava/util/List<",
  11. "Ljava/lang/Integer;",
  12. ">;"
  13. }
  14. .end annotation
  15. .end field
  16. .field private final headers:Lokhttp3/Headers;
  17. .field private final method:Ljava/lang/String;
  18. .field private final path:Ljava/lang/String;
  19. .field private final requestLine:Ljava/lang/String;
  20. .field private final requestUrl:Lokhttp3/HttpUrl;
  21. .field private final sequenceNumber:I
  22. .field private final tlsVersion:Lokhttp3/TlsVersion;
  23. # direct methods
  24. .method public constructor <init>(Ljava/lang/String;Lokhttp3/Headers;Ljava/util/List;JLokio/Buffer;ILjava/net/Socket;)V
  25. .locals 0
  26. .annotation system Ldalvik/annotation/Signature;
  27. value = {
  28. "(",
  29. "Ljava/lang/String;",
  30. "Lokhttp3/Headers;",
  31. "Ljava/util/List<",
  32. "Ljava/lang/Integer;",
  33. ">;J",
  34. "Lokio/Buffer;",
  35. "I",
  36. "Ljava/net/Socket;",
  37. ")V"
  38. }
  39. .end annotation
  40. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  41. iput-object p1, p0, Lokhttp3/mockwebserver/RecordedRequest;->requestLine:Ljava/lang/String;
  42. iput-object p2, p0, Lokhttp3/mockwebserver/RecordedRequest;->headers:Lokhttp3/Headers;
  43. iput-object p3, p0, Lokhttp3/mockwebserver/RecordedRequest;->chunkSizes:Ljava/util/List;
  44. iput-wide p4, p0, Lokhttp3/mockwebserver/RecordedRequest;->bodySize:J
  45. iput-object p6, p0, Lokhttp3/mockwebserver/RecordedRequest;->body:Lokio/Buffer;
  46. iput p7, p0, Lokhttp3/mockwebserver/RecordedRequest;->sequenceNumber:I
  47. instance-of p2, p8, Ljavax/net/ssl/SSLSocket;
  48. const/4 p3, 0x0
  49. if-eqz p2, :cond_0
  50. move-object p4, p8
  51. check-cast p4, Ljavax/net/ssl/SSLSocket;
  52. invoke-virtual {p4}, Ljavax/net/ssl/SSLSocket;->getSession()Ljavax/net/ssl/SSLSession;
  53. move-result-object p4
  54. invoke-interface {p4}, Ljavax/net/ssl/SSLSession;->getProtocol()Ljava/lang/String;
  55. move-result-object p4
  56. invoke-static {p4}, Lokhttp3/TlsVersion;->forJavaName(Ljava/lang/String;)Lokhttp3/TlsVersion;
  57. move-result-object p4
  58. goto :goto_0
  59. :cond_0
  60. move-object p4, p3
  61. :goto_0
  62. iput-object p4, p0, Lokhttp3/mockwebserver/RecordedRequest;->tlsVersion:Lokhttp3/TlsVersion;
  63. if-eqz p1, :cond_2
  64. const/16 p3, 0x20
  65. invoke-virtual {p1, p3}, Ljava/lang/String;->indexOf(I)I
  66. move-result p4
  67. add-int/lit8 p5, p4, 0x1
  68. invoke-virtual {p1, p3, p5}, Ljava/lang/String;->indexOf(II)I
  69. move-result p3
  70. const/4 p6, 0x0
  71. invoke-virtual {p1, p6, p4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  72. move-result-object p4
  73. iput-object p4, p0, Lokhttp3/mockwebserver/RecordedRequest;->method:Ljava/lang/String;
  74. invoke-virtual {p1, p5, p3}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  75. move-result-object p1
  76. iput-object p1, p0, Lokhttp3/mockwebserver/RecordedRequest;->path:Ljava/lang/String;
  77. if-eqz p2, :cond_1
  78. const-string p1, "https"
  79. goto :goto_1
  80. :cond_1
  81. const-string p1, "http"
  82. :goto_1
  83. invoke-virtual {p8}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress;
  84. move-result-object p2
  85. invoke-virtual {p2}, Ljava/net/InetAddress;->getHostName()Ljava/lang/String;
  86. move-result-object p2
  87. invoke-virtual {p8}, Ljava/net/Socket;->getLocalPort()I
  88. move-result p3
  89. const/4 p4, 0x4
  90. new-array p4, p4, [Ljava/lang/Object;
  91. aput-object p1, p4, p6
  92. const/4 p1, 0x1
  93. aput-object p2, p4, p1
  94. const/4 p1, 0x2
  95. invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
  96. move-result-object p2
  97. aput-object p2, p4, p1
  98. const/4 p1, 0x3
  99. iget-object p2, p0, Lokhttp3/mockwebserver/RecordedRequest;->path:Ljava/lang/String;
  100. aput-object p2, p4, p1
  101. const-string p1, "%s://%s:%s%s"
  102. invoke-static {p1, p4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
  103. move-result-object p1
  104. invoke-static {p1}, Lokhttp3/HttpUrl;->parse(Ljava/lang/String;)Lokhttp3/HttpUrl;
  105. move-result-object p1
  106. iput-object p1, p0, Lokhttp3/mockwebserver/RecordedRequest;->requestUrl:Lokhttp3/HttpUrl;
  107. goto :goto_2
  108. :cond_2
  109. iput-object p3, p0, Lokhttp3/mockwebserver/RecordedRequest;->requestUrl:Lokhttp3/HttpUrl;
  110. iput-object p3, p0, Lokhttp3/mockwebserver/RecordedRequest;->method:Ljava/lang/String;
  111. iput-object p3, p0, Lokhttp3/mockwebserver/RecordedRequest;->path:Ljava/lang/String;
  112. :goto_2
  113. return-void
  114. .end method
  115. # virtual methods
  116. .method public getBody()Lokio/Buffer;
  117. .locals 1
  118. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->body:Lokio/Buffer;
  119. return-object v0
  120. .end method
  121. .method public getBodySize()J
  122. .locals 2
  123. iget-wide v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->bodySize:J
  124. return-wide v0
  125. .end method
  126. .method public getChunkSizes()Ljava/util/List;
  127. .locals 1
  128. .annotation system Ldalvik/annotation/Signature;
  129. value = {
  130. "()",
  131. "Ljava/util/List<",
  132. "Ljava/lang/Integer;",
  133. ">;"
  134. }
  135. .end annotation
  136. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->chunkSizes:Ljava/util/List;
  137. return-object v0
  138. .end method
  139. .method public getHeader(Ljava/lang/String;)Ljava/lang/String;
  140. .locals 1
  141. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->headers:Lokhttp3/Headers;
  142. invoke-virtual {v0, p1}, Lokhttp3/Headers;->values(Ljava/lang/String;)Ljava/util/List;
  143. move-result-object p1
  144. invoke-interface {p1}, Ljava/util/List;->isEmpty()Z
  145. move-result v0
  146. if-eqz v0, :cond_0
  147. const/4 p1, 0x0
  148. goto :goto_0
  149. :cond_0
  150. const/4 v0, 0x0
  151. invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
  152. move-result-object p1
  153. check-cast p1, Ljava/lang/String;
  154. :goto_0
  155. return-object p1
  156. .end method
  157. .method public getHeaders()Lokhttp3/Headers;
  158. .locals 1
  159. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->headers:Lokhttp3/Headers;
  160. return-object v0
  161. .end method
  162. .method public getMethod()Ljava/lang/String;
  163. .locals 1
  164. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->method:Ljava/lang/String;
  165. return-object v0
  166. .end method
  167. .method public getPath()Ljava/lang/String;
  168. .locals 1
  169. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->path:Ljava/lang/String;
  170. return-object v0
  171. .end method
  172. .method public getRequestLine()Ljava/lang/String;
  173. .locals 1
  174. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->requestLine:Ljava/lang/String;
  175. return-object v0
  176. .end method
  177. .method public getRequestUrl()Lokhttp3/HttpUrl;
  178. .locals 1
  179. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->requestUrl:Lokhttp3/HttpUrl;
  180. return-object v0
  181. .end method
  182. .method public getSequenceNumber()I
  183. .locals 1
  184. iget v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->sequenceNumber:I
  185. return v0
  186. .end method
  187. .method public getTlsVersion()Lokhttp3/TlsVersion;
  188. .locals 1
  189. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->tlsVersion:Lokhttp3/TlsVersion;
  190. return-object v0
  191. .end method
  192. .method public getUtf8Body()Ljava/lang/String;
  193. .locals 1
  194. invoke-virtual {p0}, Lokhttp3/mockwebserver/RecordedRequest;->getBody()Lokio/Buffer;
  195. move-result-object v0
  196. invoke-virtual {v0}, Lokio/Buffer;->readUtf8()Ljava/lang/String;
  197. move-result-object v0
  198. return-object v0
  199. .end method
  200. .method public toString()Ljava/lang/String;
  201. .locals 1
  202. iget-object v0, p0, Lokhttp3/mockwebserver/RecordedRequest;->requestLine:Ljava/lang/String;
  203. return-object v0
  204. .end method