TlsVersion.smali 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. .class public final enum Lokhttp3/TlsVersion;
  2. .super Ljava/lang/Enum;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/Signature;
  6. value = {
  7. "Ljava/lang/Enum<",
  8. "Lokhttp3/TlsVersion;",
  9. ">;"
  10. }
  11. .end annotation
  12. # static fields
  13. .field private static final synthetic $VALUES:[Lokhttp3/TlsVersion;
  14. .field public static final enum SSL_3_0:Lokhttp3/TlsVersion;
  15. .field public static final enum TLS_1_0:Lokhttp3/TlsVersion;
  16. .field public static final enum TLS_1_1:Lokhttp3/TlsVersion;
  17. .field public static final enum TLS_1_2:Lokhttp3/TlsVersion;
  18. .field public static final enum TLS_1_3:Lokhttp3/TlsVersion;
  19. # instance fields
  20. .field final javaName:Ljava/lang/String;
  21. # direct methods
  22. .method static constructor <clinit>()V
  23. .locals 8
  24. new-instance v0, Lokhttp3/TlsVersion;
  25. const/4 v1, 0x0
  26. const-string v2, "TLS_1_3"
  27. const-string v3, "TLSv1.3"
  28. invoke-direct {v0, v2, v1, v3}, Lokhttp3/TlsVersion;-><init>(Ljava/lang/String;ILjava/lang/String;)V
  29. sput-object v0, Lokhttp3/TlsVersion;->TLS_1_3:Lokhttp3/TlsVersion;
  30. new-instance v0, Lokhttp3/TlsVersion;
  31. const/4 v2, 0x1
  32. const-string v3, "TLS_1_2"
  33. const-string v4, "TLSv1.2"
  34. invoke-direct {v0, v3, v2, v4}, Lokhttp3/TlsVersion;-><init>(Ljava/lang/String;ILjava/lang/String;)V
  35. sput-object v0, Lokhttp3/TlsVersion;->TLS_1_2:Lokhttp3/TlsVersion;
  36. new-instance v0, Lokhttp3/TlsVersion;
  37. const/4 v3, 0x2
  38. const-string v4, "TLS_1_1"
  39. const-string v5, "TLSv1.1"
  40. invoke-direct {v0, v4, v3, v5}, Lokhttp3/TlsVersion;-><init>(Ljava/lang/String;ILjava/lang/String;)V
  41. sput-object v0, Lokhttp3/TlsVersion;->TLS_1_1:Lokhttp3/TlsVersion;
  42. new-instance v0, Lokhttp3/TlsVersion;
  43. const/4 v4, 0x3
  44. const-string v5, "TLS_1_0"
  45. const-string v6, "TLSv1"
  46. invoke-direct {v0, v5, v4, v6}, Lokhttp3/TlsVersion;-><init>(Ljava/lang/String;ILjava/lang/String;)V
  47. sput-object v0, Lokhttp3/TlsVersion;->TLS_1_0:Lokhttp3/TlsVersion;
  48. new-instance v0, Lokhttp3/TlsVersion;
  49. const/4 v5, 0x4
  50. const-string v6, "SSL_3_0"
  51. const-string v7, "SSLv3"
  52. invoke-direct {v0, v6, v5, v7}, Lokhttp3/TlsVersion;-><init>(Ljava/lang/String;ILjava/lang/String;)V
  53. sput-object v0, Lokhttp3/TlsVersion;->SSL_3_0:Lokhttp3/TlsVersion;
  54. const/4 v0, 0x5
  55. new-array v0, v0, [Lokhttp3/TlsVersion;
  56. sget-object v6, Lokhttp3/TlsVersion;->TLS_1_3:Lokhttp3/TlsVersion;
  57. aput-object v6, v0, v1
  58. sget-object v1, Lokhttp3/TlsVersion;->TLS_1_2:Lokhttp3/TlsVersion;
  59. aput-object v1, v0, v2
  60. sget-object v1, Lokhttp3/TlsVersion;->TLS_1_1:Lokhttp3/TlsVersion;
  61. aput-object v1, v0, v3
  62. sget-object v1, Lokhttp3/TlsVersion;->TLS_1_0:Lokhttp3/TlsVersion;
  63. aput-object v1, v0, v4
  64. sget-object v1, Lokhttp3/TlsVersion;->SSL_3_0:Lokhttp3/TlsVersion;
  65. aput-object v1, v0, v5
  66. sput-object v0, Lokhttp3/TlsVersion;->$VALUES:[Lokhttp3/TlsVersion;
  67. return-void
  68. .end method
  69. .method private constructor <init>(Ljava/lang/String;ILjava/lang/String;)V
  70. .locals 0
  71. .annotation system Ldalvik/annotation/Signature;
  72. value = {
  73. "(",
  74. "Ljava/lang/String;",
  75. ")V"
  76. }
  77. .end annotation
  78. invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
  79. iput-object p3, p0, Lokhttp3/TlsVersion;->javaName:Ljava/lang/String;
  80. return-void
  81. .end method
  82. .method public static forJavaName(Ljava/lang/String;)Lokhttp3/TlsVersion;
  83. .locals 6
  84. invoke-virtual {p0}, Ljava/lang/String;->hashCode()I
  85. move-result v0
  86. const v1, 0x4b88569
  87. const/4 v2, 0x4
  88. const/4 v3, 0x3
  89. const/4 v4, 0x2
  90. const/4 v5, 0x1
  91. if-eq v0, v1, :cond_1
  92. const v1, 0x4c38896
  93. if-eq v0, v1, :cond_0
  94. packed-switch v0, :pswitch_data_0
  95. goto :goto_0
  96. :pswitch_0
  97. const-string v0, "TLSv1.3"
  98. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  99. move-result v0
  100. if-eqz v0, :cond_2
  101. const/4 v0, 0x0
  102. goto :goto_1
  103. :pswitch_1
  104. const-string v0, "TLSv1.2"
  105. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  106. move-result v0
  107. if-eqz v0, :cond_2
  108. const/4 v0, 0x1
  109. goto :goto_1
  110. :pswitch_2
  111. const-string v0, "TLSv1.1"
  112. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  113. move-result v0
  114. if-eqz v0, :cond_2
  115. const/4 v0, 0x2
  116. goto :goto_1
  117. :cond_0
  118. const-string v0, "TLSv1"
  119. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  120. move-result v0
  121. if-eqz v0, :cond_2
  122. const/4 v0, 0x3
  123. goto :goto_1
  124. :cond_1
  125. const-string v0, "SSLv3"
  126. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  127. move-result v0
  128. if-eqz v0, :cond_2
  129. const/4 v0, 0x4
  130. goto :goto_1
  131. :cond_2
  132. :goto_0
  133. const/4 v0, -0x1
  134. :goto_1
  135. if-eqz v0, :cond_7
  136. if-eq v0, v5, :cond_6
  137. if-eq v0, v4, :cond_5
  138. if-eq v0, v3, :cond_4
  139. if-ne v0, v2, :cond_3
  140. sget-object p0, Lokhttp3/TlsVersion;->SSL_3_0:Lokhttp3/TlsVersion;
  141. return-object p0
  142. :cond_3
  143. new-instance v0, Ljava/lang/IllegalArgumentException;
  144. new-instance v1, Ljava/lang/StringBuilder;
  145. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  146. const-string v2, "Unexpected TLS version: "
  147. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  148. invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  149. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  150. move-result-object p0
  151. invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  152. throw v0
  153. :cond_4
  154. sget-object p0, Lokhttp3/TlsVersion;->TLS_1_0:Lokhttp3/TlsVersion;
  155. return-object p0
  156. :cond_5
  157. sget-object p0, Lokhttp3/TlsVersion;->TLS_1_1:Lokhttp3/TlsVersion;
  158. return-object p0
  159. :cond_6
  160. sget-object p0, Lokhttp3/TlsVersion;->TLS_1_2:Lokhttp3/TlsVersion;
  161. return-object p0
  162. :cond_7
  163. sget-object p0, Lokhttp3/TlsVersion;->TLS_1_3:Lokhttp3/TlsVersion;
  164. return-object p0
  165. nop
  166. :pswitch_data_0
  167. .packed-switch -0x1dfc3f27
  168. :pswitch_2
  169. :pswitch_1
  170. :pswitch_0
  171. .end packed-switch
  172. .end method
  173. .method static varargs forJavaNames([Ljava/lang/String;)Ljava/util/List;
  174. .locals 4
  175. .annotation system Ldalvik/annotation/Signature;
  176. value = {
  177. "([",
  178. "Ljava/lang/String;",
  179. ")",
  180. "Ljava/util/List<",
  181. "Lokhttp3/TlsVersion;",
  182. ">;"
  183. }
  184. .end annotation
  185. new-instance v0, Ljava/util/ArrayList;
  186. array-length v1, p0
  187. invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V
  188. array-length v1, p0
  189. const/4 v2, 0x0
  190. :goto_0
  191. if-ge v2, v1, :cond_0
  192. aget-object v3, p0, v2
  193. invoke-static {v3}, Lokhttp3/TlsVersion;->forJavaName(Ljava/lang/String;)Lokhttp3/TlsVersion;
  194. move-result-object v3
  195. invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  196. add-int/lit8 v2, v2, 0x1
  197. goto :goto_0
  198. :cond_0
  199. invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
  200. move-result-object p0
  201. return-object p0
  202. .end method
  203. .method public static valueOf(Ljava/lang/String;)Lokhttp3/TlsVersion;
  204. .locals 1
  205. const-class v0, Lokhttp3/TlsVersion;
  206. invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
  207. move-result-object p0
  208. check-cast p0, Lokhttp3/TlsVersion;
  209. return-object p0
  210. .end method
  211. .method public static values()[Lokhttp3/TlsVersion;
  212. .locals 1
  213. sget-object v0, Lokhttp3/TlsVersion;->$VALUES:[Lokhttp3/TlsVersion;
  214. invoke-virtual {v0}, [Lokhttp3/TlsVersion;->clone()Ljava/lang/Object;
  215. move-result-object v0
  216. check-cast v0, [Lokhttp3/TlsVersion;
  217. return-object v0
  218. .end method
  219. # virtual methods
  220. .method public javaName()Ljava/lang/String;
  221. .locals 1
  222. iget-object v0, p0, Lokhttp3/TlsVersion;->javaName:Ljava/lang/String;
  223. return-object v0
  224. .end method