ConnectionSpec$Builder.smali 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. .class public final Lokhttp3/ConnectionSpec$Builder;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/ConnectionSpec;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x19
  10. name = "Builder"
  11. .end annotation
  12. # instance fields
  13. .field cipherSuites:[Ljava/lang/String;
  14. .field supportsTlsExtensions:Z
  15. .field tls:Z
  16. .field tlsVersions:[Ljava/lang/String;
  17. # direct methods
  18. .method public constructor <init>(Lokhttp3/ConnectionSpec;)V
  19. .locals 1
  20. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  21. iget-boolean v0, p1, Lokhttp3/ConnectionSpec;->tls:Z
  22. iput-boolean v0, p0, Lokhttp3/ConnectionSpec$Builder;->tls:Z
  23. iget-object v0, p1, Lokhttp3/ConnectionSpec;->cipherSuites:[Ljava/lang/String;
  24. iput-object v0, p0, Lokhttp3/ConnectionSpec$Builder;->cipherSuites:[Ljava/lang/String;
  25. iget-object v0, p1, Lokhttp3/ConnectionSpec;->tlsVersions:[Ljava/lang/String;
  26. iput-object v0, p0, Lokhttp3/ConnectionSpec$Builder;->tlsVersions:[Ljava/lang/String;
  27. iget-boolean p1, p1, Lokhttp3/ConnectionSpec;->supportsTlsExtensions:Z
  28. iput-boolean p1, p0, Lokhttp3/ConnectionSpec$Builder;->supportsTlsExtensions:Z
  29. return-void
  30. .end method
  31. .method constructor <init>(Z)V
  32. .locals 0
  33. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  34. iput-boolean p1, p0, Lokhttp3/ConnectionSpec$Builder;->tls:Z
  35. return-void
  36. .end method
  37. # virtual methods
  38. .method public allEnabledCipherSuites()Lokhttp3/ConnectionSpec$Builder;
  39. .locals 2
  40. iget-boolean v0, p0, Lokhttp3/ConnectionSpec$Builder;->tls:Z
  41. if-eqz v0, :cond_0
  42. const/4 v0, 0x0
  43. iput-object v0, p0, Lokhttp3/ConnectionSpec$Builder;->cipherSuites:[Ljava/lang/String;
  44. return-object p0
  45. :cond_0
  46. new-instance v0, Ljava/lang/IllegalStateException;
  47. const-string v1, "no cipher suites for cleartext connections"
  48. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  49. throw v0
  50. .end method
  51. .method public allEnabledTlsVersions()Lokhttp3/ConnectionSpec$Builder;
  52. .locals 2
  53. iget-boolean v0, p0, Lokhttp3/ConnectionSpec$Builder;->tls:Z
  54. if-eqz v0, :cond_0
  55. const/4 v0, 0x0
  56. iput-object v0, p0, Lokhttp3/ConnectionSpec$Builder;->tlsVersions:[Ljava/lang/String;
  57. return-object p0
  58. :cond_0
  59. new-instance v0, Ljava/lang/IllegalStateException;
  60. const-string v1, "no TLS versions for cleartext connections"
  61. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  62. throw v0
  63. .end method
  64. .method public build()Lokhttp3/ConnectionSpec;
  65. .locals 1
  66. new-instance v0, Lokhttp3/ConnectionSpec;
  67. invoke-direct {v0, p0}, Lokhttp3/ConnectionSpec;-><init>(Lokhttp3/ConnectionSpec$Builder;)V
  68. return-object v0
  69. .end method
  70. .method public varargs cipherSuites([Ljava/lang/String;)Lokhttp3/ConnectionSpec$Builder;
  71. .locals 1
  72. iget-boolean v0, p0, Lokhttp3/ConnectionSpec$Builder;->tls:Z
  73. if-eqz v0, :cond_1
  74. array-length v0, p1
  75. if-eqz v0, :cond_0
  76. invoke-virtual {p1}, [Ljava/lang/String;->clone()Ljava/lang/Object;
  77. move-result-object p1
  78. check-cast p1, [Ljava/lang/String;
  79. iput-object p1, p0, Lokhttp3/ConnectionSpec$Builder;->cipherSuites:[Ljava/lang/String;
  80. return-object p0
  81. :cond_0
  82. new-instance p1, Ljava/lang/IllegalArgumentException;
  83. const-string v0, "At least one cipher suite is required"
  84. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  85. throw p1
  86. :cond_1
  87. new-instance p1, Ljava/lang/IllegalStateException;
  88. const-string v0, "no cipher suites for cleartext connections"
  89. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  90. throw p1
  91. .end method
  92. .method public varargs cipherSuites([Lokhttp3/CipherSuite;)Lokhttp3/ConnectionSpec$Builder;
  93. .locals 3
  94. iget-boolean v0, p0, Lokhttp3/ConnectionSpec$Builder;->tls:Z
  95. if-eqz v0, :cond_1
  96. array-length v0, p1
  97. new-array v0, v0, [Ljava/lang/String;
  98. const/4 v1, 0x0
  99. :goto_0
  100. array-length v2, p1
  101. if-ge v1, v2, :cond_0
  102. aget-object v2, p1, v1
  103. iget-object v2, v2, Lokhttp3/CipherSuite;->javaName:Ljava/lang/String;
  104. aput-object v2, v0, v1
  105. add-int/lit8 v1, v1, 0x1
  106. goto :goto_0
  107. :cond_0
  108. invoke-virtual {p0, v0}, Lokhttp3/ConnectionSpec$Builder;->cipherSuites([Ljava/lang/String;)Lokhttp3/ConnectionSpec$Builder;
  109. move-result-object p1
  110. return-object p1
  111. :cond_1
  112. new-instance p1, Ljava/lang/IllegalStateException;
  113. const-string v0, "no cipher suites for cleartext connections"
  114. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  115. goto :goto_2
  116. :goto_1
  117. throw p1
  118. :goto_2
  119. goto :goto_1
  120. .end method
  121. .method public supportsTlsExtensions(Z)Lokhttp3/ConnectionSpec$Builder;
  122. .locals 1
  123. iget-boolean v0, p0, Lokhttp3/ConnectionSpec$Builder;->tls:Z
  124. if-eqz v0, :cond_0
  125. iput-boolean p1, p0, Lokhttp3/ConnectionSpec$Builder;->supportsTlsExtensions:Z
  126. return-object p0
  127. :cond_0
  128. new-instance p1, Ljava/lang/IllegalStateException;
  129. const-string v0, "no TLS extensions for cleartext connections"
  130. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  131. throw p1
  132. .end method
  133. .method public varargs tlsVersions([Ljava/lang/String;)Lokhttp3/ConnectionSpec$Builder;
  134. .locals 1
  135. iget-boolean v0, p0, Lokhttp3/ConnectionSpec$Builder;->tls:Z
  136. if-eqz v0, :cond_1
  137. array-length v0, p1
  138. if-eqz v0, :cond_0
  139. invoke-virtual {p1}, [Ljava/lang/String;->clone()Ljava/lang/Object;
  140. move-result-object p1
  141. check-cast p1, [Ljava/lang/String;
  142. iput-object p1, p0, Lokhttp3/ConnectionSpec$Builder;->tlsVersions:[Ljava/lang/String;
  143. return-object p0
  144. :cond_0
  145. new-instance p1, Ljava/lang/IllegalArgumentException;
  146. const-string v0, "At least one TLS version is required"
  147. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  148. throw p1
  149. :cond_1
  150. new-instance p1, Ljava/lang/IllegalStateException;
  151. const-string v0, "no TLS versions for cleartext connections"
  152. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  153. throw p1
  154. .end method
  155. .method public varargs tlsVersions([Lokhttp3/TlsVersion;)Lokhttp3/ConnectionSpec$Builder;
  156. .locals 3
  157. iget-boolean v0, p0, Lokhttp3/ConnectionSpec$Builder;->tls:Z
  158. if-eqz v0, :cond_1
  159. array-length v0, p1
  160. new-array v0, v0, [Ljava/lang/String;
  161. const/4 v1, 0x0
  162. :goto_0
  163. array-length v2, p1
  164. if-ge v1, v2, :cond_0
  165. aget-object v2, p1, v1
  166. iget-object v2, v2, Lokhttp3/TlsVersion;->javaName:Ljava/lang/String;
  167. aput-object v2, v0, v1
  168. add-int/lit8 v1, v1, 0x1
  169. goto :goto_0
  170. :cond_0
  171. invoke-virtual {p0, v0}, Lokhttp3/ConnectionSpec$Builder;->tlsVersions([Ljava/lang/String;)Lokhttp3/ConnectionSpec$Builder;
  172. move-result-object p1
  173. return-object p1
  174. :cond_1
  175. new-instance p1, Ljava/lang/IllegalStateException;
  176. const-string v0, "no TLS versions for cleartext connections"
  177. invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  178. goto :goto_2
  179. :goto_1
  180. throw p1
  181. :goto_2
  182. goto :goto_1
  183. .end method