Settings.smali 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. .class public final Lokhttp3/internal/http2/Settings;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # static fields
  5. .field static final COUNT:I = 0xa
  6. .field static final DEFAULT_INITIAL_WINDOW_SIZE:I = 0xffff
  7. .field static final ENABLE_PUSH:I = 0x2
  8. .field static final HEADER_TABLE_SIZE:I = 0x1
  9. .field static final INITIAL_WINDOW_SIZE:I = 0x7
  10. .field static final MAX_CONCURRENT_STREAMS:I = 0x4
  11. .field static final MAX_FRAME_SIZE:I = 0x5
  12. .field static final MAX_HEADER_LIST_SIZE:I = 0x6
  13. # instance fields
  14. .field private set:I
  15. .field private final values:[I
  16. # direct methods
  17. .method public constructor <init>()V
  18. .locals 1
  19. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  20. const/16 v0, 0xa
  21. new-array v0, v0, [I
  22. iput-object v0, p0, Lokhttp3/internal/http2/Settings;->values:[I
  23. return-void
  24. .end method
  25. # virtual methods
  26. .method clear()V
  27. .locals 2
  28. const/4 v0, 0x0
  29. iput v0, p0, Lokhttp3/internal/http2/Settings;->set:I
  30. iget-object v1, p0, Lokhttp3/internal/http2/Settings;->values:[I
  31. invoke-static {v1, v0}, Ljava/util/Arrays;->fill([II)V
  32. return-void
  33. .end method
  34. .method get(I)I
  35. .locals 1
  36. iget-object v0, p0, Lokhttp3/internal/http2/Settings;->values:[I
  37. aget p1, v0, p1
  38. return p1
  39. .end method
  40. .method getEnablePush(Z)Z
  41. .locals 3
  42. iget v0, p0, Lokhttp3/internal/http2/Settings;->set:I
  43. and-int/lit8 v0, v0, 0x4
  44. const/4 v1, 0x0
  45. const/4 v2, 0x1
  46. if-eqz v0, :cond_0
  47. iget-object p1, p0, Lokhttp3/internal/http2/Settings;->values:[I
  48. const/4 v0, 0x2
  49. aget p1, p1, v0
  50. goto :goto_0
  51. :cond_0
  52. if-eqz p1, :cond_1
  53. const/4 p1, 0x1
  54. goto :goto_0
  55. :cond_1
  56. const/4 p1, 0x0
  57. :goto_0
  58. if-ne p1, v2, :cond_2
  59. const/4 v1, 0x1
  60. :cond_2
  61. return v1
  62. .end method
  63. .method getHeaderTableSize()I
  64. .locals 2
  65. iget v0, p0, Lokhttp3/internal/http2/Settings;->set:I
  66. and-int/lit8 v0, v0, 0x2
  67. if-eqz v0, :cond_0
  68. iget-object v0, p0, Lokhttp3/internal/http2/Settings;->values:[I
  69. const/4 v1, 0x1
  70. aget v0, v0, v1
  71. goto :goto_0
  72. :cond_0
  73. const/4 v0, -0x1
  74. :goto_0
  75. return v0
  76. .end method
  77. .method getInitialWindowSize()I
  78. .locals 2
  79. iget v0, p0, Lokhttp3/internal/http2/Settings;->set:I
  80. and-int/lit16 v0, v0, 0x80
  81. if-eqz v0, :cond_0
  82. iget-object v0, p0, Lokhttp3/internal/http2/Settings;->values:[I
  83. const/4 v1, 0x7
  84. aget v0, v0, v1
  85. goto :goto_0
  86. :cond_0
  87. const v0, 0xffff
  88. :goto_0
  89. return v0
  90. .end method
  91. .method getMaxConcurrentStreams(I)I
  92. .locals 1
  93. iget v0, p0, Lokhttp3/internal/http2/Settings;->set:I
  94. and-int/lit8 v0, v0, 0x10
  95. if-eqz v0, :cond_0
  96. iget-object p1, p0, Lokhttp3/internal/http2/Settings;->values:[I
  97. const/4 v0, 0x4
  98. aget p1, p1, v0
  99. :cond_0
  100. return p1
  101. .end method
  102. .method getMaxFrameSize(I)I
  103. .locals 1
  104. iget v0, p0, Lokhttp3/internal/http2/Settings;->set:I
  105. and-int/lit8 v0, v0, 0x20
  106. if-eqz v0, :cond_0
  107. iget-object p1, p0, Lokhttp3/internal/http2/Settings;->values:[I
  108. const/4 v0, 0x5
  109. aget p1, p1, v0
  110. :cond_0
  111. return p1
  112. .end method
  113. .method getMaxHeaderListSize(I)I
  114. .locals 1
  115. iget v0, p0, Lokhttp3/internal/http2/Settings;->set:I
  116. and-int/lit8 v0, v0, 0x40
  117. if-eqz v0, :cond_0
  118. iget-object p1, p0, Lokhttp3/internal/http2/Settings;->values:[I
  119. const/4 v0, 0x6
  120. aget p1, p1, v0
  121. :cond_0
  122. return p1
  123. .end method
  124. .method isSet(I)Z
  125. .locals 2
  126. const/4 v0, 0x1
  127. shl-int p1, v0, p1
  128. iget v1, p0, Lokhttp3/internal/http2/Settings;->set:I
  129. and-int/2addr p1, v1
  130. if-eqz p1, :cond_0
  131. goto :goto_0
  132. :cond_0
  133. const/4 v0, 0x0
  134. :goto_0
  135. return v0
  136. .end method
  137. .method merge(Lokhttp3/internal/http2/Settings;)V
  138. .locals 2
  139. const/4 v0, 0x0
  140. :goto_0
  141. const/16 v1, 0xa
  142. if-ge v0, v1, :cond_1
  143. invoke-virtual {p1, v0}, Lokhttp3/internal/http2/Settings;->isSet(I)Z
  144. move-result v1
  145. if-nez v1, :cond_0
  146. goto :goto_1
  147. :cond_0
  148. invoke-virtual {p1, v0}, Lokhttp3/internal/http2/Settings;->get(I)I
  149. move-result v1
  150. invoke-virtual {p0, v0, v1}, Lokhttp3/internal/http2/Settings;->set(II)Lokhttp3/internal/http2/Settings;
  151. :goto_1
  152. add-int/lit8 v0, v0, 0x1
  153. goto :goto_0
  154. :cond_1
  155. return-void
  156. .end method
  157. .method set(II)Lokhttp3/internal/http2/Settings;
  158. .locals 3
  159. if-ltz p1, :cond_1
  160. iget-object v0, p0, Lokhttp3/internal/http2/Settings;->values:[I
  161. array-length v1, v0
  162. if-lt p1, v1, :cond_0
  163. goto :goto_0
  164. :cond_0
  165. const/4 v1, 0x1
  166. shl-int/2addr v1, p1
  167. iget v2, p0, Lokhttp3/internal/http2/Settings;->set:I
  168. or-int/2addr v1, v2
  169. iput v1, p0, Lokhttp3/internal/http2/Settings;->set:I
  170. aput p2, v0, p1
  171. :cond_1
  172. :goto_0
  173. return-object p0
  174. .end method
  175. .method size()I
  176. .locals 1
  177. iget v0, p0, Lokhttp3/internal/http2/Settings;->set:I
  178. invoke-static {v0}, Ljava/lang/Integer;->bitCount(I)I
  179. move-result v0
  180. return v0
  181. .end method