Util.smali 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. .class final Lokio/Util;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # static fields
  5. .field public static final UTF_8:Ljava/nio/charset/Charset;
  6. # direct methods
  7. .method static constructor <clinit>()V
  8. .locals 1
  9. const-string v0, "UTF-8"
  10. invoke-static {v0}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
  11. move-result-object v0
  12. sput-object v0, Lokio/Util;->UTF_8:Ljava/nio/charset/Charset;
  13. return-void
  14. .end method
  15. .method private constructor <init>()V
  16. .locals 0
  17. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  18. return-void
  19. .end method
  20. .method public static arrayRangeEquals([BI[BII)Z
  21. .locals 4
  22. const/4 v0, 0x0
  23. const/4 v1, 0x0
  24. :goto_0
  25. if-ge v1, p4, :cond_1
  26. add-int v2, v1, p1
  27. aget-byte v2, p0, v2
  28. add-int v3, v1, p3
  29. aget-byte v3, p2, v3
  30. if-eq v2, v3, :cond_0
  31. return v0
  32. :cond_0
  33. add-int/lit8 v1, v1, 0x1
  34. goto :goto_0
  35. :cond_1
  36. const/4 p0, 0x1
  37. return p0
  38. .end method
  39. .method public static checkOffsetAndCount(JJJ)V
  40. .locals 5
  41. or-long v0, p2, p4
  42. const-wide/16 v2, 0x0
  43. cmp-long v4, v0, v2
  44. if-ltz v4, :cond_0
  45. cmp-long v0, p2, p0
  46. if-gtz v0, :cond_0
  47. sub-long v0, p0, p2
  48. cmp-long v2, v0, p4
  49. if-ltz v2, :cond_0
  50. return-void
  51. :cond_0
  52. new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;
  53. const/4 v1, 0x3
  54. new-array v1, v1, [Ljava/lang/Object;
  55. const/4 v2, 0x0
  56. invoke-static {p0, p1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
  57. move-result-object p0
  58. aput-object p0, v1, v2
  59. const/4 p0, 0x1
  60. invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
  61. move-result-object p1
  62. aput-object p1, v1, p0
  63. const/4 p0, 0x2
  64. invoke-static {p4, p5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
  65. move-result-object p1
  66. aput-object p1, v1, p0
  67. const-string p0, "size=%s offset=%s byteCount=%s"
  68. invoke-static {p0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
  69. move-result-object p0
  70. invoke-direct {v0, p0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
  71. throw v0
  72. .end method
  73. .method public static reverseBytesInt(I)I
  74. .locals 2
  75. const/high16 v0, -0x1000000
  76. and-int/2addr v0, p0
  77. ushr-int/lit8 v0, v0, 0x18
  78. const/high16 v1, 0xff0000
  79. and-int/2addr v1, p0
  80. ushr-int/lit8 v1, v1, 0x8
  81. or-int/2addr v0, v1
  82. const v1, 0xff00
  83. and-int/2addr v1, p0
  84. shl-int/lit8 v1, v1, 0x8
  85. or-int/2addr v0, v1
  86. and-int/lit16 p0, p0, 0xff
  87. shl-int/lit8 p0, p0, 0x18
  88. or-int/2addr p0, v0
  89. return p0
  90. .end method
  91. .method public static reverseBytesLong(J)J
  92. .locals 8
  93. const-wide/high16 v0, -0x100000000000000L
  94. and-long/2addr v0, p0
  95. const/16 v2, 0x38
  96. ushr-long/2addr v0, v2
  97. const-wide/high16 v3, 0xff000000000000L
  98. and-long/2addr v3, p0
  99. const/16 v5, 0x28
  100. ushr-long/2addr v3, v5
  101. or-long/2addr v0, v3
  102. const-wide v3, 0xff0000000000L
  103. and-long/2addr v3, p0
  104. const/16 v6, 0x18
  105. ushr-long/2addr v3, v6
  106. or-long/2addr v0, v3
  107. const-wide v3, 0xff00000000L
  108. and-long/2addr v3, p0
  109. const/16 v7, 0x8
  110. ushr-long/2addr v3, v7
  111. or-long/2addr v0, v3
  112. const-wide v3, 0xff000000L
  113. and-long/2addr v3, p0
  114. shl-long/2addr v3, v7
  115. or-long/2addr v0, v3
  116. const-wide/32 v3, 0xff0000
  117. and-long/2addr v3, p0
  118. shl-long/2addr v3, v6
  119. or-long/2addr v0, v3
  120. const-wide/32 v3, 0xff00
  121. and-long/2addr v3, p0
  122. shl-long/2addr v3, v5
  123. or-long/2addr v0, v3
  124. const-wide/16 v3, 0xff
  125. and-long/2addr p0, v3
  126. shl-long/2addr p0, v2
  127. or-long/2addr p0, v0
  128. return-wide p0
  129. .end method
  130. .method public static reverseBytesShort(S)S
  131. .locals 1
  132. const v0, 0xffff
  133. and-int/2addr p0, v0
  134. const v0, 0xff00
  135. and-int/2addr v0, p0
  136. ushr-int/lit8 v0, v0, 0x8
  137. and-int/lit16 p0, p0, 0xff
  138. shl-int/lit8 p0, p0, 0x8
  139. or-int/2addr p0, v0
  140. int-to-short p0, p0
  141. return p0
  142. .end method
  143. .method public static sneakyRethrow(Ljava/lang/Throwable;)V
  144. .locals 0
  145. invoke-static {p0}, Lokio/Util;->sneakyThrow2(Ljava/lang/Throwable;)V
  146. return-void
  147. .end method
  148. .method private static sneakyThrow2(Ljava/lang/Throwable;)V
  149. .locals 0
  150. .annotation system Ldalvik/annotation/Signature;
  151. value = {
  152. "<T:",
  153. "Ljava/lang/Throwable;",
  154. ">(",
  155. "Ljava/lang/Throwable;",
  156. ")V^TT;"
  157. }
  158. .end annotation
  159. .annotation system Ldalvik/annotation/Throws;
  160. value = {
  161. Ljava/lang/Throwable;
  162. }
  163. .end annotation
  164. throw p0
  165. .end method