Protocol.smali 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. .class public final enum Lokhttp3/Protocol;
  2. .super Ljava/lang/Enum;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/Signature;
  6. value = {
  7. "Ljava/lang/Enum<",
  8. "Lokhttp3/Protocol;",
  9. ">;"
  10. }
  11. .end annotation
  12. # static fields
  13. .field private static final synthetic $VALUES:[Lokhttp3/Protocol;
  14. .field public static final enum HTTP_1_0:Lokhttp3/Protocol;
  15. .field public static final enum HTTP_1_1:Lokhttp3/Protocol;
  16. .field public static final enum HTTP_2:Lokhttp3/Protocol;
  17. .field public static final enum SPDY_3:Lokhttp3/Protocol;
  18. # instance fields
  19. .field private final protocol:Ljava/lang/String;
  20. # direct methods
  21. .method static constructor <clinit>()V
  22. .locals 7
  23. new-instance v0, Lokhttp3/Protocol;
  24. const/4 v1, 0x0
  25. const-string v2, "HTTP_1_0"
  26. const-string v3, "http/1.0"
  27. invoke-direct {v0, v2, v1, v3}, Lokhttp3/Protocol;-><init>(Ljava/lang/String;ILjava/lang/String;)V
  28. sput-object v0, Lokhttp3/Protocol;->HTTP_1_0:Lokhttp3/Protocol;
  29. new-instance v0, Lokhttp3/Protocol;
  30. const/4 v2, 0x1
  31. const-string v3, "HTTP_1_1"
  32. const-string v4, "http/1.1"
  33. invoke-direct {v0, v3, v2, v4}, Lokhttp3/Protocol;-><init>(Ljava/lang/String;ILjava/lang/String;)V
  34. sput-object v0, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
  35. new-instance v0, Lokhttp3/Protocol;
  36. const/4 v3, 0x2
  37. const-string v4, "SPDY_3"
  38. const-string v5, "spdy/3.1"
  39. invoke-direct {v0, v4, v3, v5}, Lokhttp3/Protocol;-><init>(Ljava/lang/String;ILjava/lang/String;)V
  40. sput-object v0, Lokhttp3/Protocol;->SPDY_3:Lokhttp3/Protocol;
  41. new-instance v0, Lokhttp3/Protocol;
  42. const/4 v4, 0x3
  43. const-string v5, "HTTP_2"
  44. const-string v6, "h2"
  45. invoke-direct {v0, v5, v4, v6}, Lokhttp3/Protocol;-><init>(Ljava/lang/String;ILjava/lang/String;)V
  46. sput-object v0, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
  47. const/4 v0, 0x4
  48. new-array v0, v0, [Lokhttp3/Protocol;
  49. sget-object v5, Lokhttp3/Protocol;->HTTP_1_0:Lokhttp3/Protocol;
  50. aput-object v5, v0, v1
  51. sget-object v1, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
  52. aput-object v1, v0, v2
  53. sget-object v1, Lokhttp3/Protocol;->SPDY_3:Lokhttp3/Protocol;
  54. aput-object v1, v0, v3
  55. sget-object v1, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
  56. aput-object v1, v0, v4
  57. sput-object v0, Lokhttp3/Protocol;->$VALUES:[Lokhttp3/Protocol;
  58. return-void
  59. .end method
  60. .method private constructor <init>(Ljava/lang/String;ILjava/lang/String;)V
  61. .locals 0
  62. .annotation system Ldalvik/annotation/Signature;
  63. value = {
  64. "(",
  65. "Ljava/lang/String;",
  66. ")V"
  67. }
  68. .end annotation
  69. invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
  70. iput-object p3, p0, Lokhttp3/Protocol;->protocol:Ljava/lang/String;
  71. return-void
  72. .end method
  73. .method public static get(Ljava/lang/String;)Lokhttp3/Protocol;
  74. .locals 3
  75. .annotation system Ldalvik/annotation/Throws;
  76. value = {
  77. Ljava/io/IOException;
  78. }
  79. .end annotation
  80. sget-object v0, Lokhttp3/Protocol;->HTTP_1_0:Lokhttp3/Protocol;
  81. iget-object v0, v0, Lokhttp3/Protocol;->protocol:Ljava/lang/String;
  82. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  83. move-result v0
  84. if-eqz v0, :cond_0
  85. sget-object p0, Lokhttp3/Protocol;->HTTP_1_0:Lokhttp3/Protocol;
  86. return-object p0
  87. :cond_0
  88. sget-object v0, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
  89. iget-object v0, v0, Lokhttp3/Protocol;->protocol:Ljava/lang/String;
  90. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  91. move-result v0
  92. if-eqz v0, :cond_1
  93. sget-object p0, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
  94. return-object p0
  95. :cond_1
  96. sget-object v0, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
  97. iget-object v0, v0, Lokhttp3/Protocol;->protocol:Ljava/lang/String;
  98. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  99. move-result v0
  100. if-eqz v0, :cond_2
  101. sget-object p0, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
  102. return-object p0
  103. :cond_2
  104. sget-object v0, Lokhttp3/Protocol;->SPDY_3:Lokhttp3/Protocol;
  105. iget-object v0, v0, Lokhttp3/Protocol;->protocol:Ljava/lang/String;
  106. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  107. move-result v0
  108. if-eqz v0, :cond_3
  109. sget-object p0, Lokhttp3/Protocol;->SPDY_3:Lokhttp3/Protocol;
  110. return-object p0
  111. :cond_3
  112. new-instance v0, Ljava/io/IOException;
  113. new-instance v1, Ljava/lang/StringBuilder;
  114. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  115. const-string v2, "Unexpected protocol: "
  116. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  117. invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  118. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  119. move-result-object p0
  120. invoke-direct {v0, p0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  121. throw v0
  122. .end method
  123. .method public static valueOf(Ljava/lang/String;)Lokhttp3/Protocol;
  124. .locals 1
  125. const-class v0, Lokhttp3/Protocol;
  126. invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
  127. move-result-object p0
  128. check-cast p0, Lokhttp3/Protocol;
  129. return-object p0
  130. .end method
  131. .method public static values()[Lokhttp3/Protocol;
  132. .locals 1
  133. sget-object v0, Lokhttp3/Protocol;->$VALUES:[Lokhttp3/Protocol;
  134. invoke-virtual {v0}, [Lokhttp3/Protocol;->clone()Ljava/lang/Object;
  135. move-result-object v0
  136. check-cast v0, [Lokhttp3/Protocol;
  137. return-object v0
  138. .end method
  139. # virtual methods
  140. .method public toString()Ljava/lang/String;
  141. .locals 1
  142. iget-object v0, p0, Lokhttp3/Protocol;->protocol:Ljava/lang/String;
  143. return-object v0
  144. .end method