Cookie$Builder.smali 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. .class public final Lokhttp3/Cookie$Builder;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/Cookie;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x19
  10. name = "Builder"
  11. .end annotation
  12. # instance fields
  13. .field domain:Ljava/lang/String;
  14. .field expiresAt:J
  15. .field hostOnly:Z
  16. .field httpOnly:Z
  17. .field name:Ljava/lang/String;
  18. .field path:Ljava/lang/String;
  19. .field persistent:Z
  20. .field secure:Z
  21. .field value:Ljava/lang/String;
  22. # direct methods
  23. .method public constructor <init>()V
  24. .locals 2
  25. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  26. const-wide v0, 0xe677d21fdbffL
  27. iput-wide v0, p0, Lokhttp3/Cookie$Builder;->expiresAt:J
  28. const-string v0, "/"
  29. iput-object v0, p0, Lokhttp3/Cookie$Builder;->path:Ljava/lang/String;
  30. return-void
  31. .end method
  32. .method private domain(Ljava/lang/String;Z)Lokhttp3/Cookie$Builder;
  33. .locals 2
  34. if-eqz p1, :cond_1
  35. invoke-static {p1}, Lokhttp3/internal/Util;->canonicalizeHost(Ljava/lang/String;)Ljava/lang/String;
  36. move-result-object v0
  37. if-eqz v0, :cond_0
  38. iput-object v0, p0, Lokhttp3/Cookie$Builder;->domain:Ljava/lang/String;
  39. iput-boolean p2, p0, Lokhttp3/Cookie$Builder;->hostOnly:Z
  40. return-object p0
  41. :cond_0
  42. new-instance p2, Ljava/lang/IllegalArgumentException;
  43. new-instance v0, Ljava/lang/StringBuilder;
  44. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  45. const-string v1, "unexpected domain: "
  46. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  47. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  48. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  49. move-result-object p1
  50. invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  51. throw p2
  52. :cond_1
  53. new-instance p1, Ljava/lang/NullPointerException;
  54. const-string p2, "domain == null"
  55. invoke-direct {p1, p2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
  56. throw p1
  57. .end method
  58. # virtual methods
  59. .method public build()Lokhttp3/Cookie;
  60. .locals 1
  61. new-instance v0, Lokhttp3/Cookie;
  62. invoke-direct {v0, p0}, Lokhttp3/Cookie;-><init>(Lokhttp3/Cookie$Builder;)V
  63. return-object v0
  64. .end method
  65. .method public domain(Ljava/lang/String;)Lokhttp3/Cookie$Builder;
  66. .locals 1
  67. const/4 v0, 0x0
  68. invoke-direct {p0, p1, v0}, Lokhttp3/Cookie$Builder;->domain(Ljava/lang/String;Z)Lokhttp3/Cookie$Builder;
  69. move-result-object p1
  70. return-object p1
  71. .end method
  72. .method public expiresAt(J)Lokhttp3/Cookie$Builder;
  73. .locals 3
  74. const-wide/16 v0, 0x0
  75. cmp-long v2, p1, v0
  76. if-gtz v2, :cond_0
  77. const-wide/high16 p1, -0x8000000000000000L
  78. :cond_0
  79. const-wide v0, 0xe677d21fdbffL
  80. cmp-long v2, p1, v0
  81. if-lez v2, :cond_1
  82. move-wide p1, v0
  83. :cond_1
  84. iput-wide p1, p0, Lokhttp3/Cookie$Builder;->expiresAt:J
  85. const/4 p1, 0x1
  86. iput-boolean p1, p0, Lokhttp3/Cookie$Builder;->persistent:Z
  87. return-object p0
  88. .end method
  89. .method public hostOnlyDomain(Ljava/lang/String;)Lokhttp3/Cookie$Builder;
  90. .locals 1
  91. const/4 v0, 0x1
  92. invoke-direct {p0, p1, v0}, Lokhttp3/Cookie$Builder;->domain(Ljava/lang/String;Z)Lokhttp3/Cookie$Builder;
  93. move-result-object p1
  94. return-object p1
  95. .end method
  96. .method public httpOnly()Lokhttp3/Cookie$Builder;
  97. .locals 1
  98. const/4 v0, 0x1
  99. iput-boolean v0, p0, Lokhttp3/Cookie$Builder;->httpOnly:Z
  100. return-object p0
  101. .end method
  102. .method public name(Ljava/lang/String;)Lokhttp3/Cookie$Builder;
  103. .locals 1
  104. if-eqz p1, :cond_1
  105. invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;
  106. move-result-object v0
  107. invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  108. move-result v0
  109. if-eqz v0, :cond_0
  110. iput-object p1, p0, Lokhttp3/Cookie$Builder;->name:Ljava/lang/String;
  111. return-object p0
  112. :cond_0
  113. new-instance p1, Ljava/lang/IllegalArgumentException;
  114. const-string v0, "name is not trimmed"
  115. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  116. throw p1
  117. :cond_1
  118. new-instance p1, Ljava/lang/NullPointerException;
  119. const-string v0, "name == null"
  120. invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
  121. throw p1
  122. .end method
  123. .method public path(Ljava/lang/String;)Lokhttp3/Cookie$Builder;
  124. .locals 1
  125. const-string v0, "/"
  126. invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
  127. move-result v0
  128. if-eqz v0, :cond_0
  129. iput-object p1, p0, Lokhttp3/Cookie$Builder;->path:Ljava/lang/String;
  130. return-object p0
  131. :cond_0
  132. new-instance p1, Ljava/lang/IllegalArgumentException;
  133. const-string v0, "path must start with \'/\'"
  134. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  135. throw p1
  136. .end method
  137. .method public secure()Lokhttp3/Cookie$Builder;
  138. .locals 1
  139. const/4 v0, 0x1
  140. iput-boolean v0, p0, Lokhttp3/Cookie$Builder;->secure:Z
  141. return-object p0
  142. .end method
  143. .method public value(Ljava/lang/String;)Lokhttp3/Cookie$Builder;
  144. .locals 1
  145. if-eqz p1, :cond_1
  146. invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;
  147. move-result-object v0
  148. invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  149. move-result v0
  150. if-eqz v0, :cond_0
  151. iput-object p1, p0, Lokhttp3/Cookie$Builder;->value:Ljava/lang/String;
  152. return-object p0
  153. :cond_0
  154. new-instance p1, Ljava/lang/IllegalArgumentException;
  155. const-string v0, "value is not trimmed"
  156. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  157. throw p1
  158. :cond_1
  159. new-instance p1, Ljava/lang/NullPointerException;
  160. const-string v0, "value == null"
  161. invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
  162. throw p1
  163. .end method