HttpUrl.smali 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149
  1. .class public final Lokhttp3/HttpUrl;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/MemberClasses;
  6. value = {
  7. Lokhttp3/HttpUrl$Builder;
  8. }
  9. .end annotation
  10. # static fields
  11. .field static final FORM_ENCODE_SET:Ljava/lang/String; = " \"\':;<=>@[]^`{}|/\\?#&!$(),~"
  12. .field static final FRAGMENT_ENCODE_SET:Ljava/lang/String; = ""
  13. .field static final FRAGMENT_ENCODE_SET_URI:Ljava/lang/String; = " \"#<>\\^`{|}"
  14. .field private static final HEX_DIGITS:[C
  15. .field static final PASSWORD_ENCODE_SET:Ljava/lang/String; = " \"\':;<=>@[]^`{}|/\\?#"
  16. .field static final PATH_SEGMENT_ENCODE_SET:Ljava/lang/String; = " \"<>^`{}|/\\?#"
  17. .field static final PATH_SEGMENT_ENCODE_SET_URI:Ljava/lang/String; = "[]"
  18. .field static final QUERY_COMPONENT_ENCODE_SET:Ljava/lang/String; = " \"\'<>#&="
  19. .field static final QUERY_COMPONENT_ENCODE_SET_URI:Ljava/lang/String; = "\\^`{|}"
  20. .field static final QUERY_ENCODE_SET:Ljava/lang/String; = " \"\'<>#"
  21. .field static final USERNAME_ENCODE_SET:Ljava/lang/String; = " \"\':;<=>@[]^`{}|/\\?#"
  22. # instance fields
  23. .field private final fragment:Ljava/lang/String;
  24. .field final host:Ljava/lang/String;
  25. .field private final password:Ljava/lang/String;
  26. .field private final pathSegments:Ljava/util/List;
  27. .annotation system Ldalvik/annotation/Signature;
  28. value = {
  29. "Ljava/util/List<",
  30. "Ljava/lang/String;",
  31. ">;"
  32. }
  33. .end annotation
  34. .end field
  35. .field final port:I
  36. .field private final queryNamesAndValues:Ljava/util/List;
  37. .annotation system Ldalvik/annotation/Signature;
  38. value = {
  39. "Ljava/util/List<",
  40. "Ljava/lang/String;",
  41. ">;"
  42. }
  43. .end annotation
  44. .end field
  45. .field final scheme:Ljava/lang/String;
  46. .field private final url:Ljava/lang/String;
  47. .field private final username:Ljava/lang/String;
  48. # direct methods
  49. .method static constructor <clinit>()V
  50. .locals 1
  51. const/16 v0, 0x10
  52. new-array v0, v0, [C
  53. fill-array-data v0, :array_0
  54. sput-object v0, Lokhttp3/HttpUrl;->HEX_DIGITS:[C
  55. return-void
  56. :array_0
  57. .array-data 2
  58. 0x30s
  59. 0x31s
  60. 0x32s
  61. 0x33s
  62. 0x34s
  63. 0x35s
  64. 0x36s
  65. 0x37s
  66. 0x38s
  67. 0x39s
  68. 0x41s
  69. 0x42s
  70. 0x43s
  71. 0x44s
  72. 0x45s
  73. 0x46s
  74. .end array-data
  75. .end method
  76. .method constructor <init>(Lokhttp3/HttpUrl$Builder;)V
  77. .locals 4
  78. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  79. iget-object v0, p1, Lokhttp3/HttpUrl$Builder;->scheme:Ljava/lang/String;
  80. iput-object v0, p0, Lokhttp3/HttpUrl;->scheme:Ljava/lang/String;
  81. iget-object v0, p1, Lokhttp3/HttpUrl$Builder;->encodedUsername:Ljava/lang/String;
  82. const/4 v1, 0x0
  83. invoke-static {v0, v1}, Lokhttp3/HttpUrl;->percentDecode(Ljava/lang/String;Z)Ljava/lang/String;
  84. move-result-object v0
  85. iput-object v0, p0, Lokhttp3/HttpUrl;->username:Ljava/lang/String;
  86. iget-object v0, p1, Lokhttp3/HttpUrl$Builder;->encodedPassword:Ljava/lang/String;
  87. invoke-static {v0, v1}, Lokhttp3/HttpUrl;->percentDecode(Ljava/lang/String;Z)Ljava/lang/String;
  88. move-result-object v0
  89. iput-object v0, p0, Lokhttp3/HttpUrl;->password:Ljava/lang/String;
  90. iget-object v0, p1, Lokhttp3/HttpUrl$Builder;->host:Ljava/lang/String;
  91. iput-object v0, p0, Lokhttp3/HttpUrl;->host:Ljava/lang/String;
  92. invoke-virtual {p1}, Lokhttp3/HttpUrl$Builder;->effectivePort()I
  93. move-result v0
  94. iput v0, p0, Lokhttp3/HttpUrl;->port:I
  95. iget-object v0, p1, Lokhttp3/HttpUrl$Builder;->encodedPathSegments:Ljava/util/List;
  96. invoke-direct {p0, v0, v1}, Lokhttp3/HttpUrl;->percentDecode(Ljava/util/List;Z)Ljava/util/List;
  97. move-result-object v0
  98. iput-object v0, p0, Lokhttp3/HttpUrl;->pathSegments:Ljava/util/List;
  99. iget-object v0, p1, Lokhttp3/HttpUrl$Builder;->encodedQueryNamesAndValues:Ljava/util/List;
  100. const/4 v2, 0x0
  101. if-eqz v0, :cond_0
  102. const/4 v3, 0x1
  103. invoke-direct {p0, v0, v3}, Lokhttp3/HttpUrl;->percentDecode(Ljava/util/List;Z)Ljava/util/List;
  104. move-result-object v0
  105. goto :goto_0
  106. :cond_0
  107. move-object v0, v2
  108. :goto_0
  109. iput-object v0, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  110. iget-object v0, p1, Lokhttp3/HttpUrl$Builder;->encodedFragment:Ljava/lang/String;
  111. if-eqz v0, :cond_1
  112. invoke-static {v0, v1}, Lokhttp3/HttpUrl;->percentDecode(Ljava/lang/String;Z)Ljava/lang/String;
  113. move-result-object v2
  114. :cond_1
  115. iput-object v2, p0, Lokhttp3/HttpUrl;->fragment:Ljava/lang/String;
  116. invoke-virtual {p1}, Lokhttp3/HttpUrl$Builder;->toString()Ljava/lang/String;
  117. move-result-object p1
  118. iput-object p1, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  119. return-void
  120. .end method
  121. .method static canonicalize(Ljava/lang/String;IILjava/lang/String;ZZZZLjava/nio/charset/Charset;)Ljava/lang/String;
  122. .locals 11
  123. move-object v1, p0
  124. move v3, p2
  125. move v2, p1
  126. :goto_0
  127. if-ge v2, v3, :cond_5
  128. invoke-virtual {p0, v2}, Ljava/lang/String;->codePointAt(I)I
  129. move-result v0
  130. const/16 v4, 0x20
  131. if-lt v0, v4, :cond_3
  132. const/16 v4, 0x7f
  133. if-eq v0, v4, :cond_3
  134. const/16 v4, 0x80
  135. if-lt v0, v4, :cond_0
  136. if-nez p7, :cond_3
  137. :cond_0
  138. move-object v4, p3
  139. invoke-virtual {p3, v0}, Ljava/lang/String;->indexOf(I)I
  140. move-result v5
  141. const/4 v6, -0x1
  142. if-ne v5, v6, :cond_4
  143. const/16 v5, 0x25
  144. if-ne v0, v5, :cond_1
  145. if-eqz p4, :cond_4
  146. if-eqz p5, :cond_1
  147. invoke-static {p0, v2, p2}, Lokhttp3/HttpUrl;->percentEncoded(Ljava/lang/String;II)Z
  148. move-result v5
  149. if-eqz v5, :cond_4
  150. :cond_1
  151. const/16 v5, 0x2b
  152. if-ne v0, v5, :cond_2
  153. if-eqz p6, :cond_2
  154. goto :goto_1
  155. :cond_2
  156. invoke-static {v0}, Ljava/lang/Character;->charCount(I)I
  157. move-result v0
  158. add-int/2addr v2, v0
  159. goto :goto_0
  160. :cond_3
  161. move-object v4, p3
  162. :cond_4
  163. :goto_1
  164. new-instance v10, Lokio/Buffer;
  165. invoke-direct {v10}, Lokio/Buffer;-><init>()V
  166. move v0, p1
  167. invoke-virtual {v10, p0, p1, v2}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;II)Lokio/Buffer;
  168. move-object v0, v10
  169. move-object v1, p0
  170. move v3, p2
  171. move-object v4, p3
  172. move v5, p4
  173. move/from16 v6, p5
  174. move/from16 v7, p6
  175. move/from16 v8, p7
  176. move-object/from16 v9, p8
  177. invoke-static/range {v0 .. v9}, Lokhttp3/HttpUrl;->canonicalize(Lokio/Buffer;Ljava/lang/String;IILjava/lang/String;ZZZZLjava/nio/charset/Charset;)V
  178. invoke-virtual {v10}, Lokio/Buffer;->readUtf8()Ljava/lang/String;
  179. move-result-object v0
  180. return-object v0
  181. :cond_5
  182. move v0, p1
  183. invoke-virtual {p0, p1, p2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  184. move-result-object v0
  185. return-object v0
  186. .end method
  187. .method static canonicalize(Ljava/lang/String;Ljava/lang/String;ZZZZ)Ljava/lang/String;
  188. .locals 9
  189. invoke-virtual {p0}, Ljava/lang/String;->length()I
  190. move-result v2
  191. const/4 v1, 0x0
  192. const/4 v8, 0x0
  193. move-object v0, p0
  194. move-object v3, p1
  195. move v4, p2
  196. move v5, p3
  197. move v6, p4
  198. move v7, p5
  199. invoke-static/range {v0 .. v8}, Lokhttp3/HttpUrl;->canonicalize(Ljava/lang/String;IILjava/lang/String;ZZZZLjava/nio/charset/Charset;)Ljava/lang/String;
  200. move-result-object p0
  201. return-object p0
  202. .end method
  203. .method static canonicalize(Ljava/lang/String;Ljava/lang/String;ZZZZLjava/nio/charset/Charset;)Ljava/lang/String;
  204. .locals 9
  205. invoke-virtual {p0}, Ljava/lang/String;->length()I
  206. move-result v2
  207. const/4 v1, 0x0
  208. move-object v0, p0
  209. move-object v3, p1
  210. move v4, p2
  211. move v5, p3
  212. move v6, p4
  213. move v7, p5
  214. move-object v8, p6
  215. invoke-static/range {v0 .. v8}, Lokhttp3/HttpUrl;->canonicalize(Ljava/lang/String;IILjava/lang/String;ZZZZLjava/nio/charset/Charset;)Ljava/lang/String;
  216. move-result-object p0
  217. return-object p0
  218. .end method
  219. .method static canonicalize(Lokio/Buffer;Ljava/lang/String;IILjava/lang/String;ZZZZLjava/nio/charset/Charset;)V
  220. .locals 6
  221. const/4 v0, 0x0
  222. :goto_0
  223. if-ge p2, p3, :cond_a
  224. invoke-virtual {p1, p2}, Ljava/lang/String;->codePointAt(I)I
  225. move-result v1
  226. if-eqz p5, :cond_0
  227. const/16 v2, 0x9
  228. if-eq v1, v2, :cond_9
  229. const/16 v2, 0xa
  230. if-eq v1, v2, :cond_9
  231. const/16 v2, 0xc
  232. if-eq v1, v2, :cond_9
  233. const/16 v2, 0xd
  234. if-ne v1, v2, :cond_0
  235. goto/16 :goto_5
  236. :cond_0
  237. const/16 v2, 0x2b
  238. if-ne v1, v2, :cond_2
  239. if-eqz p7, :cond_2
  240. if-eqz p5, :cond_1
  241. const-string v2, "+"
  242. goto :goto_1
  243. :cond_1
  244. const-string v2, "%2B"
  245. :goto_1
  246. invoke-virtual {p0, v2}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  247. goto/16 :goto_5
  248. :cond_2
  249. const/16 v2, 0x20
  250. const/16 v3, 0x25
  251. if-lt v1, v2, :cond_5
  252. const/16 v2, 0x7f
  253. if-eq v1, v2, :cond_5
  254. const/16 v2, 0x80
  255. if-lt v1, v2, :cond_3
  256. if-nez p8, :cond_5
  257. :cond_3
  258. invoke-virtual {p4, v1}, Ljava/lang/String;->indexOf(I)I
  259. move-result v2
  260. const/4 v4, -0x1
  261. if-ne v2, v4, :cond_5
  262. if-ne v1, v3, :cond_4
  263. if-eqz p5, :cond_5
  264. if-eqz p6, :cond_4
  265. invoke-static {p1, p2, p3}, Lokhttp3/HttpUrl;->percentEncoded(Ljava/lang/String;II)Z
  266. move-result v2
  267. if-nez v2, :cond_4
  268. goto :goto_2
  269. :cond_4
  270. invoke-virtual {p0, v1}, Lokio/Buffer;->writeUtf8CodePoint(I)Lokio/Buffer;
  271. goto :goto_5
  272. :cond_5
  273. :goto_2
  274. if-nez v0, :cond_6
  275. new-instance v0, Lokio/Buffer;
  276. invoke-direct {v0}, Lokio/Buffer;-><init>()V
  277. :cond_6
  278. if-eqz p9, :cond_8
  279. sget-object v2, Lokhttp3/internal/Util;->UTF_8:Ljava/nio/charset/Charset;
  280. invoke-virtual {p9, v2}, Ljava/nio/charset/Charset;->equals(Ljava/lang/Object;)Z
  281. move-result v2
  282. if-eqz v2, :cond_7
  283. goto :goto_3
  284. :cond_7
  285. invoke-static {v1}, Ljava/lang/Character;->charCount(I)I
  286. move-result v2
  287. add-int/2addr v2, p2
  288. invoke-virtual {v0, p1, p2, v2, p9}, Lokio/Buffer;->writeString(Ljava/lang/String;IILjava/nio/charset/Charset;)Lokio/Buffer;
  289. goto :goto_4
  290. :cond_8
  291. :goto_3
  292. invoke-virtual {v0, v1}, Lokio/Buffer;->writeUtf8CodePoint(I)Lokio/Buffer;
  293. :goto_4
  294. invoke-virtual {v0}, Lokio/Buffer;->exhausted()Z
  295. move-result v2
  296. if-nez v2, :cond_9
  297. invoke-virtual {v0}, Lokio/Buffer;->readByte()B
  298. move-result v2
  299. and-int/lit16 v2, v2, 0xff
  300. invoke-virtual {p0, v3}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  301. sget-object v4, Lokhttp3/HttpUrl;->HEX_DIGITS:[C
  302. shr-int/lit8 v5, v2, 0x4
  303. and-int/lit8 v5, v5, 0xf
  304. aget-char v4, v4, v5
  305. invoke-virtual {p0, v4}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  306. sget-object v4, Lokhttp3/HttpUrl;->HEX_DIGITS:[C
  307. and-int/lit8 v2, v2, 0xf
  308. aget-char v2, v4, v2
  309. invoke-virtual {p0, v2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  310. goto :goto_4
  311. :cond_9
  312. :goto_5
  313. invoke-static {v1}, Ljava/lang/Character;->charCount(I)I
  314. move-result v1
  315. add-int/2addr p2, v1
  316. goto/16 :goto_0
  317. :cond_a
  318. return-void
  319. .end method
  320. .method public static defaultPort(Ljava/lang/String;)I
  321. .locals 1
  322. const-string v0, "http"
  323. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  324. move-result v0
  325. if-eqz v0, :cond_0
  326. const/16 p0, 0x50
  327. return p0
  328. :cond_0
  329. const-string v0, "https"
  330. invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  331. move-result p0
  332. if-eqz p0, :cond_1
  333. const/16 p0, 0x1bb
  334. return p0
  335. :cond_1
  336. const/4 p0, -0x1
  337. return p0
  338. .end method
  339. .method public static get(Ljava/net/URI;)Lokhttp3/HttpUrl;
  340. .locals 0
  341. invoke-virtual {p0}, Ljava/net/URI;->toString()Ljava/lang/String;
  342. move-result-object p0
  343. invoke-static {p0}, Lokhttp3/HttpUrl;->parse(Ljava/lang/String;)Lokhttp3/HttpUrl;
  344. move-result-object p0
  345. return-object p0
  346. .end method
  347. .method public static get(Ljava/net/URL;)Lokhttp3/HttpUrl;
  348. .locals 0
  349. invoke-virtual {p0}, Ljava/net/URL;->toString()Ljava/lang/String;
  350. move-result-object p0
  351. invoke-static {p0}, Lokhttp3/HttpUrl;->parse(Ljava/lang/String;)Lokhttp3/HttpUrl;
  352. move-result-object p0
  353. return-object p0
  354. .end method
  355. .method static getChecked(Ljava/lang/String;)Lokhttp3/HttpUrl;
  356. .locals 4
  357. .annotation system Ldalvik/annotation/Throws;
  358. value = {
  359. Ljava/net/MalformedURLException;,
  360. Ljava/net/UnknownHostException;
  361. }
  362. .end annotation
  363. new-instance v0, Lokhttp3/HttpUrl$Builder;
  364. invoke-direct {v0}, Lokhttp3/HttpUrl$Builder;-><init>()V
  365. const/4 v1, 0x0
  366. invoke-virtual {v0, v1, p0}, Lokhttp3/HttpUrl$Builder;->parse(Lokhttp3/HttpUrl;Ljava/lang/String;)Lokhttp3/HttpUrl$Builder$ParseResult;
  367. move-result-object v1
  368. sget-object v2, Lokhttp3/HttpUrl$1;->$SwitchMap$okhttp3$HttpUrl$Builder$ParseResult:[I
  369. invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
  370. move-result v3
  371. aget v2, v2, v3
  372. const/4 v3, 0x1
  373. if-eq v2, v3, :cond_1
  374. const/4 v0, 0x2
  375. if-eq v2, v0, :cond_0
  376. new-instance v0, Ljava/net/MalformedURLException;
  377. new-instance v2, Ljava/lang/StringBuilder;
  378. invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
  379. const-string v3, "Invalid URL: "
  380. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  381. invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  382. const-string v1, " for "
  383. invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  384. invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  385. invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  386. move-result-object p0
  387. invoke-direct {v0, p0}, Ljava/net/MalformedURLException;-><init>(Ljava/lang/String;)V
  388. throw v0
  389. :cond_0
  390. new-instance v0, Ljava/net/UnknownHostException;
  391. new-instance v1, Ljava/lang/StringBuilder;
  392. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  393. const-string v2, "Invalid host: "
  394. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  395. invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  396. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  397. move-result-object p0
  398. invoke-direct {v0, p0}, Ljava/net/UnknownHostException;-><init>(Ljava/lang/String;)V
  399. throw v0
  400. :cond_1
  401. invoke-virtual {v0}, Lokhttp3/HttpUrl$Builder;->build()Lokhttp3/HttpUrl;
  402. move-result-object p0
  403. return-object p0
  404. .end method
  405. .method static namesAndValuesToQueryString(Ljava/lang/StringBuilder;Ljava/util/List;)V
  406. .locals 5
  407. .annotation system Ldalvik/annotation/Signature;
  408. value = {
  409. "(",
  410. "Ljava/lang/StringBuilder;",
  411. "Ljava/util/List<",
  412. "Ljava/lang/String;",
  413. ">;)V"
  414. }
  415. .end annotation
  416. invoke-interface {p1}, Ljava/util/List;->size()I
  417. move-result v0
  418. const/4 v1, 0x0
  419. :goto_0
  420. if-ge v1, v0, :cond_2
  421. invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
  422. move-result-object v2
  423. check-cast v2, Ljava/lang/String;
  424. add-int/lit8 v3, v1, 0x1
  425. invoke-interface {p1, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
  426. move-result-object v3
  427. check-cast v3, Ljava/lang/String;
  428. if-lez v1, :cond_0
  429. const/16 v4, 0x26
  430. invoke-virtual {p0, v4}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
  431. :cond_0
  432. invoke-virtual {p0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  433. if-eqz v3, :cond_1
  434. const/16 v2, 0x3d
  435. invoke-virtual {p0, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
  436. invoke-virtual {p0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  437. :cond_1
  438. add-int/lit8 v1, v1, 0x2
  439. goto :goto_0
  440. :cond_2
  441. return-void
  442. .end method
  443. .method public static parse(Ljava/lang/String;)Lokhttp3/HttpUrl;
  444. .locals 3
  445. new-instance v0, Lokhttp3/HttpUrl$Builder;
  446. invoke-direct {v0}, Lokhttp3/HttpUrl$Builder;-><init>()V
  447. const/4 v1, 0x0
  448. invoke-virtual {v0, v1, p0}, Lokhttp3/HttpUrl$Builder;->parse(Lokhttp3/HttpUrl;Ljava/lang/String;)Lokhttp3/HttpUrl$Builder$ParseResult;
  449. move-result-object p0
  450. sget-object v2, Lokhttp3/HttpUrl$Builder$ParseResult;->SUCCESS:Lokhttp3/HttpUrl$Builder$ParseResult;
  451. if-ne p0, v2, :cond_0
  452. invoke-virtual {v0}, Lokhttp3/HttpUrl$Builder;->build()Lokhttp3/HttpUrl;
  453. move-result-object v1
  454. :cond_0
  455. return-object v1
  456. .end method
  457. .method static pathSegmentsToString(Ljava/lang/StringBuilder;Ljava/util/List;)V
  458. .locals 3
  459. .annotation system Ldalvik/annotation/Signature;
  460. value = {
  461. "(",
  462. "Ljava/lang/StringBuilder;",
  463. "Ljava/util/List<",
  464. "Ljava/lang/String;",
  465. ">;)V"
  466. }
  467. .end annotation
  468. invoke-interface {p1}, Ljava/util/List;->size()I
  469. move-result v0
  470. const/4 v1, 0x0
  471. :goto_0
  472. if-ge v1, v0, :cond_0
  473. const/16 v2, 0x2f
  474. invoke-virtual {p0, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
  475. invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
  476. move-result-object v2
  477. check-cast v2, Ljava/lang/String;
  478. invoke-virtual {p0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  479. add-int/lit8 v1, v1, 0x1
  480. goto :goto_0
  481. :cond_0
  482. return-void
  483. .end method
  484. .method static percentDecode(Ljava/lang/String;IIZ)Ljava/lang/String;
  485. .locals 3
  486. move v0, p1
  487. :goto_0
  488. if-ge v0, p2, :cond_2
  489. invoke-virtual {p0, v0}, Ljava/lang/String;->charAt(I)C
  490. move-result v1
  491. const/16 v2, 0x25
  492. if-eq v1, v2, :cond_1
  493. const/16 v2, 0x2b
  494. if-ne v1, v2, :cond_0
  495. if-eqz p3, :cond_0
  496. goto :goto_1
  497. :cond_0
  498. add-int/lit8 v0, v0, 0x1
  499. goto :goto_0
  500. :cond_1
  501. :goto_1
  502. new-instance v1, Lokio/Buffer;
  503. invoke-direct {v1}, Lokio/Buffer;-><init>()V
  504. invoke-virtual {v1, p0, p1, v0}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;II)Lokio/Buffer;
  505. invoke-static {v1, p0, v0, p2, p3}, Lokhttp3/HttpUrl;->percentDecode(Lokio/Buffer;Ljava/lang/String;IIZ)V
  506. invoke-virtual {v1}, Lokio/Buffer;->readUtf8()Ljava/lang/String;
  507. move-result-object p0
  508. return-object p0
  509. :cond_2
  510. invoke-virtual {p0, p1, p2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  511. move-result-object p0
  512. return-object p0
  513. .end method
  514. .method static percentDecode(Ljava/lang/String;Z)Ljava/lang/String;
  515. .locals 2
  516. invoke-virtual {p0}, Ljava/lang/String;->length()I
  517. move-result v0
  518. const/4 v1, 0x0
  519. invoke-static {p0, v1, v0, p1}, Lokhttp3/HttpUrl;->percentDecode(Ljava/lang/String;IIZ)Ljava/lang/String;
  520. move-result-object p0
  521. return-object p0
  522. .end method
  523. .method private percentDecode(Ljava/util/List;Z)Ljava/util/List;
  524. .locals 4
  525. .annotation system Ldalvik/annotation/Signature;
  526. value = {
  527. "(",
  528. "Ljava/util/List<",
  529. "Ljava/lang/String;",
  530. ">;Z)",
  531. "Ljava/util/List<",
  532. "Ljava/lang/String;",
  533. ">;"
  534. }
  535. .end annotation
  536. invoke-interface {p1}, Ljava/util/List;->size()I
  537. move-result v0
  538. new-instance v1, Ljava/util/ArrayList;
  539. invoke-direct {v1, v0}, Ljava/util/ArrayList;-><init>(I)V
  540. const/4 v2, 0x0
  541. :goto_0
  542. if-ge v2, v0, :cond_1
  543. invoke-interface {p1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
  544. move-result-object v3
  545. check-cast v3, Ljava/lang/String;
  546. if-eqz v3, :cond_0
  547. invoke-static {v3, p2}, Lokhttp3/HttpUrl;->percentDecode(Ljava/lang/String;Z)Ljava/lang/String;
  548. move-result-object v3
  549. goto :goto_1
  550. :cond_0
  551. const/4 v3, 0x0
  552. :goto_1
  553. invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  554. add-int/lit8 v2, v2, 0x1
  555. goto :goto_0
  556. :cond_1
  557. invoke-static {v1}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
  558. move-result-object p1
  559. return-object p1
  560. .end method
  561. .method static percentDecode(Lokio/Buffer;Ljava/lang/String;IIZ)V
  562. .locals 5
  563. :goto_0
  564. if-ge p2, p3, :cond_2
  565. invoke-virtual {p1, p2}, Ljava/lang/String;->codePointAt(I)I
  566. move-result v0
  567. const/16 v1, 0x25
  568. if-ne v0, v1, :cond_0
  569. add-int/lit8 v1, p2, 0x2
  570. if-ge v1, p3, :cond_0
  571. add-int/lit8 v2, p2, 0x1
  572. invoke-virtual {p1, v2}, Ljava/lang/String;->charAt(I)C
  573. move-result v2
  574. invoke-static {v2}, Lokhttp3/internal/Util;->decodeHexDigit(C)I
  575. move-result v2
  576. invoke-virtual {p1, v1}, Ljava/lang/String;->charAt(I)C
  577. move-result v3
  578. invoke-static {v3}, Lokhttp3/internal/Util;->decodeHexDigit(C)I
  579. move-result v3
  580. const/4 v4, -0x1
  581. if-eq v2, v4, :cond_1
  582. if-eq v3, v4, :cond_1
  583. shl-int/lit8 p2, v2, 0x4
  584. add-int/2addr p2, v3
  585. invoke-virtual {p0, p2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  586. move p2, v1
  587. goto :goto_1
  588. :cond_0
  589. const/16 v1, 0x2b
  590. if-ne v0, v1, :cond_1
  591. if-eqz p4, :cond_1
  592. const/16 v1, 0x20
  593. invoke-virtual {p0, v1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  594. goto :goto_1
  595. :cond_1
  596. invoke-virtual {p0, v0}, Lokio/Buffer;->writeUtf8CodePoint(I)Lokio/Buffer;
  597. :goto_1
  598. invoke-static {v0}, Ljava/lang/Character;->charCount(I)I
  599. move-result v0
  600. add-int/2addr p2, v0
  601. goto :goto_0
  602. :cond_2
  603. return-void
  604. .end method
  605. .method static percentEncoded(Ljava/lang/String;II)Z
  606. .locals 3
  607. add-int/lit8 v0, p1, 0x2
  608. const/4 v1, 0x1
  609. if-ge v0, p2, :cond_0
  610. invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C
  611. move-result p2
  612. const/16 v2, 0x25
  613. if-ne p2, v2, :cond_0
  614. add-int/2addr p1, v1
  615. invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C
  616. move-result p1
  617. invoke-static {p1}, Lokhttp3/internal/Util;->decodeHexDigit(C)I
  618. move-result p1
  619. const/4 p2, -0x1
  620. if-eq p1, p2, :cond_0
  621. invoke-virtual {p0, v0}, Ljava/lang/String;->charAt(I)C
  622. move-result p0
  623. invoke-static {p0}, Lokhttp3/internal/Util;->decodeHexDigit(C)I
  624. move-result p0
  625. if-eq p0, p2, :cond_0
  626. goto :goto_0
  627. :cond_0
  628. const/4 v1, 0x0
  629. :goto_0
  630. return v1
  631. .end method
  632. .method static queryStringToNamesAndValues(Ljava/lang/String;)Ljava/util/List;
  633. .locals 5
  634. .annotation system Ldalvik/annotation/Signature;
  635. value = {
  636. "(",
  637. "Ljava/lang/String;",
  638. ")",
  639. "Ljava/util/List<",
  640. "Ljava/lang/String;",
  641. ">;"
  642. }
  643. .end annotation
  644. new-instance v0, Ljava/util/ArrayList;
  645. invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
  646. const/4 v1, 0x0
  647. :goto_0
  648. invoke-virtual {p0}, Ljava/lang/String;->length()I
  649. move-result v2
  650. if-gt v1, v2, :cond_3
  651. const/16 v2, 0x26
  652. invoke-virtual {p0, v2, v1}, Ljava/lang/String;->indexOf(II)I
  653. move-result v2
  654. const/4 v3, -0x1
  655. if-ne v2, v3, :cond_0
  656. invoke-virtual {p0}, Ljava/lang/String;->length()I
  657. move-result v2
  658. :cond_0
  659. const/16 v4, 0x3d
  660. invoke-virtual {p0, v4, v1}, Ljava/lang/String;->indexOf(II)I
  661. move-result v4
  662. if-eq v4, v3, :cond_2
  663. if-le v4, v2, :cond_1
  664. goto :goto_1
  665. :cond_1
  666. invoke-virtual {p0, v1, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  667. move-result-object v1
  668. invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  669. add-int/lit8 v4, v4, 0x1
  670. invoke-virtual {p0, v4, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  671. move-result-object v1
  672. goto :goto_2
  673. :cond_2
  674. :goto_1
  675. invoke-virtual {p0, v1, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  676. move-result-object v1
  677. invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  678. const/4 v1, 0x0
  679. :goto_2
  680. invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  681. add-int/lit8 v1, v2, 0x1
  682. goto :goto_0
  683. :cond_3
  684. return-object v0
  685. .end method
  686. # virtual methods
  687. .method public encodedFragment()Ljava/lang/String;
  688. .locals 2
  689. iget-object v0, p0, Lokhttp3/HttpUrl;->fragment:Ljava/lang/String;
  690. if-nez v0, :cond_0
  691. const/4 v0, 0x0
  692. return-object v0
  693. :cond_0
  694. iget-object v0, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  695. const/16 v1, 0x23
  696. invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
  697. move-result v0
  698. add-int/lit8 v0, v0, 0x1
  699. iget-object v1, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  700. invoke-virtual {v1, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
  701. move-result-object v0
  702. return-object v0
  703. .end method
  704. .method public encodedPassword()Ljava/lang/String;
  705. .locals 3
  706. iget-object v0, p0, Lokhttp3/HttpUrl;->password:Ljava/lang/String;
  707. invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
  708. move-result v0
  709. if-eqz v0, :cond_0
  710. const-string v0, ""
  711. return-object v0
  712. :cond_0
  713. iget-object v0, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  714. const/16 v1, 0x3a
  715. iget-object v2, p0, Lokhttp3/HttpUrl;->scheme:Ljava/lang/String;
  716. invoke-virtual {v2}, Ljava/lang/String;->length()I
  717. move-result v2
  718. add-int/lit8 v2, v2, 0x3
  719. invoke-virtual {v0, v1, v2}, Ljava/lang/String;->indexOf(II)I
  720. move-result v0
  721. add-int/lit8 v0, v0, 0x1
  722. iget-object v1, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  723. const/16 v2, 0x40
  724. invoke-virtual {v1, v2}, Ljava/lang/String;->indexOf(I)I
  725. move-result v1
  726. iget-object v2, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  727. invoke-virtual {v2, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  728. move-result-object v0
  729. return-object v0
  730. .end method
  731. .method public encodedPath()Ljava/lang/String;
  732. .locals 4
  733. iget-object v0, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  734. iget-object v1, p0, Lokhttp3/HttpUrl;->scheme:Ljava/lang/String;
  735. invoke-virtual {v1}, Ljava/lang/String;->length()I
  736. move-result v1
  737. add-int/lit8 v1, v1, 0x3
  738. const/16 v2, 0x2f
  739. invoke-virtual {v0, v2, v1}, Ljava/lang/String;->indexOf(II)I
  740. move-result v0
  741. iget-object v1, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  742. invoke-virtual {v1}, Ljava/lang/String;->length()I
  743. move-result v2
  744. const-string v3, "?#"
  745. invoke-static {v1, v0, v2, v3}, Lokhttp3/internal/Util;->delimiterOffset(Ljava/lang/String;IILjava/lang/String;)I
  746. move-result v1
  747. iget-object v2, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  748. invoke-virtual {v2, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  749. move-result-object v0
  750. return-object v0
  751. .end method
  752. .method public encodedPathSegments()Ljava/util/List;
  753. .locals 6
  754. .annotation system Ldalvik/annotation/Signature;
  755. value = {
  756. "()",
  757. "Ljava/util/List<",
  758. "Ljava/lang/String;",
  759. ">;"
  760. }
  761. .end annotation
  762. iget-object v0, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  763. iget-object v1, p0, Lokhttp3/HttpUrl;->scheme:Ljava/lang/String;
  764. invoke-virtual {v1}, Ljava/lang/String;->length()I
  765. move-result v1
  766. add-int/lit8 v1, v1, 0x3
  767. const/16 v2, 0x2f
  768. invoke-virtual {v0, v2, v1}, Ljava/lang/String;->indexOf(II)I
  769. move-result v0
  770. iget-object v1, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  771. invoke-virtual {v1}, Ljava/lang/String;->length()I
  772. move-result v3
  773. const-string v4, "?#"
  774. invoke-static {v1, v0, v3, v4}, Lokhttp3/internal/Util;->delimiterOffset(Ljava/lang/String;IILjava/lang/String;)I
  775. move-result v1
  776. new-instance v3, Ljava/util/ArrayList;
  777. invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V
  778. :goto_0
  779. if-ge v0, v1, :cond_0
  780. add-int/lit8 v0, v0, 0x1
  781. iget-object v4, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  782. invoke-static {v4, v0, v1, v2}, Lokhttp3/internal/Util;->delimiterOffset(Ljava/lang/String;IIC)I
  783. move-result v4
  784. iget-object v5, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  785. invoke-virtual {v5, v0, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  786. move-result-object v0
  787. invoke-interface {v3, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  788. move v0, v4
  789. goto :goto_0
  790. :cond_0
  791. return-object v3
  792. .end method
  793. .method public encodedQuery()Ljava/lang/String;
  794. .locals 5
  795. iget-object v0, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  796. if-nez v0, :cond_0
  797. const/4 v0, 0x0
  798. return-object v0
  799. :cond_0
  800. iget-object v0, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  801. const/16 v1, 0x3f
  802. invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
  803. move-result v0
  804. add-int/lit8 v0, v0, 0x1
  805. iget-object v1, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  806. add-int/lit8 v2, v0, 0x1
  807. invoke-virtual {v1}, Ljava/lang/String;->length()I
  808. move-result v3
  809. const/16 v4, 0x23
  810. invoke-static {v1, v2, v3, v4}, Lokhttp3/internal/Util;->delimiterOffset(Ljava/lang/String;IIC)I
  811. move-result v1
  812. iget-object v2, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  813. invoke-virtual {v2, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  814. move-result-object v0
  815. return-object v0
  816. .end method
  817. .method public encodedUsername()Ljava/lang/String;
  818. .locals 4
  819. iget-object v0, p0, Lokhttp3/HttpUrl;->username:Ljava/lang/String;
  820. invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
  821. move-result v0
  822. if-eqz v0, :cond_0
  823. const-string v0, ""
  824. return-object v0
  825. :cond_0
  826. iget-object v0, p0, Lokhttp3/HttpUrl;->scheme:Ljava/lang/String;
  827. invoke-virtual {v0}, Ljava/lang/String;->length()I
  828. move-result v0
  829. add-int/lit8 v0, v0, 0x3
  830. iget-object v1, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  831. invoke-virtual {v1}, Ljava/lang/String;->length()I
  832. move-result v2
  833. const-string v3, ":@"
  834. invoke-static {v1, v0, v2, v3}, Lokhttp3/internal/Util;->delimiterOffset(Ljava/lang/String;IILjava/lang/String;)I
  835. move-result v1
  836. iget-object v2, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  837. invoke-virtual {v2, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  838. move-result-object v0
  839. return-object v0
  840. .end method
  841. .method public equals(Ljava/lang/Object;)Z
  842. .locals 1
  843. instance-of v0, p1, Lokhttp3/HttpUrl;
  844. if-eqz v0, :cond_0
  845. check-cast p1, Lokhttp3/HttpUrl;
  846. iget-object p1, p1, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  847. iget-object v0, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  848. invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  849. move-result p1
  850. if-eqz p1, :cond_0
  851. const/4 p1, 0x1
  852. goto :goto_0
  853. :cond_0
  854. const/4 p1, 0x0
  855. :goto_0
  856. return p1
  857. .end method
  858. .method public fragment()Ljava/lang/String;
  859. .locals 1
  860. iget-object v0, p0, Lokhttp3/HttpUrl;->fragment:Ljava/lang/String;
  861. return-object v0
  862. .end method
  863. .method public hashCode()I
  864. .locals 1
  865. iget-object v0, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  866. invoke-virtual {v0}, Ljava/lang/String;->hashCode()I
  867. move-result v0
  868. return v0
  869. .end method
  870. .method public host()Ljava/lang/String;
  871. .locals 1
  872. iget-object v0, p0, Lokhttp3/HttpUrl;->host:Ljava/lang/String;
  873. return-object v0
  874. .end method
  875. .method public isHttps()Z
  876. .locals 2
  877. iget-object v0, p0, Lokhttp3/HttpUrl;->scheme:Ljava/lang/String;
  878. const-string v1, "https"
  879. invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  880. move-result v0
  881. return v0
  882. .end method
  883. .method public newBuilder()Lokhttp3/HttpUrl$Builder;
  884. .locals 3
  885. new-instance v0, Lokhttp3/HttpUrl$Builder;
  886. invoke-direct {v0}, Lokhttp3/HttpUrl$Builder;-><init>()V
  887. iget-object v1, p0, Lokhttp3/HttpUrl;->scheme:Ljava/lang/String;
  888. iput-object v1, v0, Lokhttp3/HttpUrl$Builder;->scheme:Ljava/lang/String;
  889. invoke-virtual {p0}, Lokhttp3/HttpUrl;->encodedUsername()Ljava/lang/String;
  890. move-result-object v1
  891. iput-object v1, v0, Lokhttp3/HttpUrl$Builder;->encodedUsername:Ljava/lang/String;
  892. invoke-virtual {p0}, Lokhttp3/HttpUrl;->encodedPassword()Ljava/lang/String;
  893. move-result-object v1
  894. iput-object v1, v0, Lokhttp3/HttpUrl$Builder;->encodedPassword:Ljava/lang/String;
  895. iget-object v1, p0, Lokhttp3/HttpUrl;->host:Ljava/lang/String;
  896. iput-object v1, v0, Lokhttp3/HttpUrl$Builder;->host:Ljava/lang/String;
  897. iget v1, p0, Lokhttp3/HttpUrl;->port:I
  898. iget-object v2, p0, Lokhttp3/HttpUrl;->scheme:Ljava/lang/String;
  899. invoke-static {v2}, Lokhttp3/HttpUrl;->defaultPort(Ljava/lang/String;)I
  900. move-result v2
  901. if-eq v1, v2, :cond_0
  902. iget v1, p0, Lokhttp3/HttpUrl;->port:I
  903. goto :goto_0
  904. :cond_0
  905. const/4 v1, -0x1
  906. :goto_0
  907. iput v1, v0, Lokhttp3/HttpUrl$Builder;->port:I
  908. iget-object v1, v0, Lokhttp3/HttpUrl$Builder;->encodedPathSegments:Ljava/util/List;
  909. invoke-interface {v1}, Ljava/util/List;->clear()V
  910. iget-object v1, v0, Lokhttp3/HttpUrl$Builder;->encodedPathSegments:Ljava/util/List;
  911. invoke-virtual {p0}, Lokhttp3/HttpUrl;->encodedPathSegments()Ljava/util/List;
  912. move-result-object v2
  913. invoke-interface {v1, v2}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
  914. invoke-virtual {p0}, Lokhttp3/HttpUrl;->encodedQuery()Ljava/lang/String;
  915. move-result-object v1
  916. invoke-virtual {v0, v1}, Lokhttp3/HttpUrl$Builder;->encodedQuery(Ljava/lang/String;)Lokhttp3/HttpUrl$Builder;
  917. invoke-virtual {p0}, Lokhttp3/HttpUrl;->encodedFragment()Ljava/lang/String;
  918. move-result-object v1
  919. iput-object v1, v0, Lokhttp3/HttpUrl$Builder;->encodedFragment:Ljava/lang/String;
  920. return-object v0
  921. .end method
  922. .method public newBuilder(Ljava/lang/String;)Lokhttp3/HttpUrl$Builder;
  923. .locals 2
  924. new-instance v0, Lokhttp3/HttpUrl$Builder;
  925. invoke-direct {v0}, Lokhttp3/HttpUrl$Builder;-><init>()V
  926. invoke-virtual {v0, p0, p1}, Lokhttp3/HttpUrl$Builder;->parse(Lokhttp3/HttpUrl;Ljava/lang/String;)Lokhttp3/HttpUrl$Builder$ParseResult;
  927. move-result-object p1
  928. sget-object v1, Lokhttp3/HttpUrl$Builder$ParseResult;->SUCCESS:Lokhttp3/HttpUrl$Builder$ParseResult;
  929. if-ne p1, v1, :cond_0
  930. goto :goto_0
  931. :cond_0
  932. const/4 v0, 0x0
  933. :goto_0
  934. return-object v0
  935. .end method
  936. .method public password()Ljava/lang/String;
  937. .locals 1
  938. iget-object v0, p0, Lokhttp3/HttpUrl;->password:Ljava/lang/String;
  939. return-object v0
  940. .end method
  941. .method public pathSegments()Ljava/util/List;
  942. .locals 1
  943. .annotation system Ldalvik/annotation/Signature;
  944. value = {
  945. "()",
  946. "Ljava/util/List<",
  947. "Ljava/lang/String;",
  948. ">;"
  949. }
  950. .end annotation
  951. iget-object v0, p0, Lokhttp3/HttpUrl;->pathSegments:Ljava/util/List;
  952. return-object v0
  953. .end method
  954. .method public pathSize()I
  955. .locals 1
  956. iget-object v0, p0, Lokhttp3/HttpUrl;->pathSegments:Ljava/util/List;
  957. invoke-interface {v0}, Ljava/util/List;->size()I
  958. move-result v0
  959. return v0
  960. .end method
  961. .method public port()I
  962. .locals 1
  963. iget v0, p0, Lokhttp3/HttpUrl;->port:I
  964. return v0
  965. .end method
  966. .method public query()Ljava/lang/String;
  967. .locals 2
  968. iget-object v0, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  969. if-nez v0, :cond_0
  970. const/4 v0, 0x0
  971. return-object v0
  972. :cond_0
  973. new-instance v0, Ljava/lang/StringBuilder;
  974. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  975. iget-object v1, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  976. invoke-static {v0, v1}, Lokhttp3/HttpUrl;->namesAndValuesToQueryString(Ljava/lang/StringBuilder;Ljava/util/List;)V
  977. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  978. move-result-object v0
  979. return-object v0
  980. .end method
  981. .method public queryParameter(Ljava/lang/String;)Ljava/lang/String;
  982. .locals 4
  983. iget-object v0, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  984. const/4 v1, 0x0
  985. if-nez v0, :cond_0
  986. return-object v1
  987. :cond_0
  988. const/4 v2, 0x0
  989. invoke-interface {v0}, Ljava/util/List;->size()I
  990. move-result v0
  991. :goto_0
  992. if-ge v2, v0, :cond_2
  993. iget-object v3, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  994. invoke-interface {v3, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
  995. move-result-object v3
  996. invoke-virtual {p1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  997. move-result v3
  998. if-eqz v3, :cond_1
  999. iget-object p1, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1000. add-int/lit8 v2, v2, 0x1
  1001. invoke-interface {p1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
  1002. move-result-object p1
  1003. check-cast p1, Ljava/lang/String;
  1004. return-object p1
  1005. :cond_1
  1006. add-int/lit8 v2, v2, 0x2
  1007. goto :goto_0
  1008. :cond_2
  1009. return-object v1
  1010. .end method
  1011. .method public queryParameterName(I)Ljava/lang/String;
  1012. .locals 1
  1013. iget-object v0, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1014. if-eqz v0, :cond_0
  1015. mul-int/lit8 p1, p1, 0x2
  1016. invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
  1017. move-result-object p1
  1018. check-cast p1, Ljava/lang/String;
  1019. return-object p1
  1020. :cond_0
  1021. new-instance p1, Ljava/lang/IndexOutOfBoundsException;
  1022. invoke-direct {p1}, Ljava/lang/IndexOutOfBoundsException;-><init>()V
  1023. throw p1
  1024. .end method
  1025. .method public queryParameterNames()Ljava/util/Set;
  1026. .locals 4
  1027. .annotation system Ldalvik/annotation/Signature;
  1028. value = {
  1029. "()",
  1030. "Ljava/util/Set<",
  1031. "Ljava/lang/String;",
  1032. ">;"
  1033. }
  1034. .end annotation
  1035. iget-object v0, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1036. if-nez v0, :cond_0
  1037. invoke-static {}, Ljava/util/Collections;->emptySet()Ljava/util/Set;
  1038. move-result-object v0
  1039. return-object v0
  1040. :cond_0
  1041. new-instance v0, Ljava/util/LinkedHashSet;
  1042. invoke-direct {v0}, Ljava/util/LinkedHashSet;-><init>()V
  1043. const/4 v1, 0x0
  1044. iget-object v2, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1045. invoke-interface {v2}, Ljava/util/List;->size()I
  1046. move-result v2
  1047. :goto_0
  1048. if-ge v1, v2, :cond_1
  1049. iget-object v3, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1050. invoke-interface {v3, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
  1051. move-result-object v3
  1052. invoke-interface {v0, v3}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
  1053. add-int/lit8 v1, v1, 0x2
  1054. goto :goto_0
  1055. :cond_1
  1056. invoke-static {v0}, Ljava/util/Collections;->unmodifiableSet(Ljava/util/Set;)Ljava/util/Set;
  1057. move-result-object v0
  1058. return-object v0
  1059. .end method
  1060. .method public queryParameterValue(I)Ljava/lang/String;
  1061. .locals 1
  1062. iget-object v0, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1063. if-eqz v0, :cond_0
  1064. mul-int/lit8 p1, p1, 0x2
  1065. add-int/lit8 p1, p1, 0x1
  1066. invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
  1067. move-result-object p1
  1068. check-cast p1, Ljava/lang/String;
  1069. return-object p1
  1070. :cond_0
  1071. new-instance p1, Ljava/lang/IndexOutOfBoundsException;
  1072. invoke-direct {p1}, Ljava/lang/IndexOutOfBoundsException;-><init>()V
  1073. throw p1
  1074. .end method
  1075. .method public queryParameterValues(Ljava/lang/String;)Ljava/util/List;
  1076. .locals 5
  1077. .annotation system Ldalvik/annotation/Signature;
  1078. value = {
  1079. "(",
  1080. "Ljava/lang/String;",
  1081. ")",
  1082. "Ljava/util/List<",
  1083. "Ljava/lang/String;",
  1084. ">;"
  1085. }
  1086. .end annotation
  1087. iget-object v0, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1088. if-nez v0, :cond_0
  1089. invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
  1090. move-result-object p1
  1091. return-object p1
  1092. :cond_0
  1093. new-instance v0, Ljava/util/ArrayList;
  1094. invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
  1095. const/4 v1, 0x0
  1096. iget-object v2, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1097. invoke-interface {v2}, Ljava/util/List;->size()I
  1098. move-result v2
  1099. :goto_0
  1100. if-ge v1, v2, :cond_2
  1101. iget-object v3, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1102. invoke-interface {v3, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
  1103. move-result-object v3
  1104. invoke-virtual {p1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  1105. move-result v3
  1106. if-eqz v3, :cond_1
  1107. iget-object v3, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1108. add-int/lit8 v4, v1, 0x1
  1109. invoke-interface {v3, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
  1110. move-result-object v3
  1111. invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  1112. :cond_1
  1113. add-int/lit8 v1, v1, 0x2
  1114. goto :goto_0
  1115. :cond_2
  1116. invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
  1117. move-result-object p1
  1118. return-object p1
  1119. .end method
  1120. .method public querySize()I
  1121. .locals 1
  1122. iget-object v0, p0, Lokhttp3/HttpUrl;->queryNamesAndValues:Ljava/util/List;
  1123. if-eqz v0, :cond_0
  1124. invoke-interface {v0}, Ljava/util/List;->size()I
  1125. move-result v0
  1126. div-int/lit8 v0, v0, 0x2
  1127. goto :goto_0
  1128. :cond_0
  1129. const/4 v0, 0x0
  1130. :goto_0
  1131. return v0
  1132. .end method
  1133. .method public redact()Ljava/lang/String;
  1134. .locals 2
  1135. const-string v0, "/..."
  1136. invoke-virtual {p0, v0}, Lokhttp3/HttpUrl;->newBuilder(Ljava/lang/String;)Lokhttp3/HttpUrl$Builder;
  1137. move-result-object v0
  1138. const-string v1, ""
  1139. invoke-virtual {v0, v1}, Lokhttp3/HttpUrl$Builder;->username(Ljava/lang/String;)Lokhttp3/HttpUrl$Builder;
  1140. move-result-object v0
  1141. invoke-virtual {v0, v1}, Lokhttp3/HttpUrl$Builder;->password(Ljava/lang/String;)Lokhttp3/HttpUrl$Builder;
  1142. move-result-object v0
  1143. invoke-virtual {v0}, Lokhttp3/HttpUrl$Builder;->build()Lokhttp3/HttpUrl;
  1144. move-result-object v0
  1145. invoke-virtual {v0}, Lokhttp3/HttpUrl;->toString()Ljava/lang/String;
  1146. move-result-object v0
  1147. return-object v0
  1148. .end method
  1149. .method public resolve(Ljava/lang/String;)Lokhttp3/HttpUrl;
  1150. .locals 0
  1151. invoke-virtual {p0, p1}, Lokhttp3/HttpUrl;->newBuilder(Ljava/lang/String;)Lokhttp3/HttpUrl$Builder;
  1152. move-result-object p1
  1153. if-eqz p1, :cond_0
  1154. invoke-virtual {p1}, Lokhttp3/HttpUrl$Builder;->build()Lokhttp3/HttpUrl;
  1155. move-result-object p1
  1156. goto :goto_0
  1157. :cond_0
  1158. const/4 p1, 0x0
  1159. :goto_0
  1160. return-object p1
  1161. .end method
  1162. .method public scheme()Ljava/lang/String;
  1163. .locals 1
  1164. iget-object v0, p0, Lokhttp3/HttpUrl;->scheme:Ljava/lang/String;
  1165. return-object v0
  1166. .end method
  1167. .method public toString()Ljava/lang/String;
  1168. .locals 1
  1169. iget-object v0, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  1170. return-object v0
  1171. .end method
  1172. .method public topPrivateDomain()Ljava/lang/String;
  1173. .locals 2
  1174. iget-object v0, p0, Lokhttp3/HttpUrl;->host:Ljava/lang/String;
  1175. invoke-static {v0}, Lokhttp3/internal/Util;->verifyAsIpAddress(Ljava/lang/String;)Z
  1176. move-result v0
  1177. if-eqz v0, :cond_0
  1178. const/4 v0, 0x0
  1179. return-object v0
  1180. :cond_0
  1181. invoke-static {}, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->get()Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;
  1182. move-result-object v0
  1183. iget-object v1, p0, Lokhttp3/HttpUrl;->host:Ljava/lang/String;
  1184. invoke-virtual {v0, v1}, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->getEffectiveTldPlusOne(Ljava/lang/String;)Ljava/lang/String;
  1185. move-result-object v0
  1186. return-object v0
  1187. .end method
  1188. .method public uri()Ljava/net/URI;
  1189. .locals 4
  1190. invoke-virtual {p0}, Lokhttp3/HttpUrl;->newBuilder()Lokhttp3/HttpUrl$Builder;
  1191. move-result-object v0
  1192. invoke-virtual {v0}, Lokhttp3/HttpUrl$Builder;->reencodeForUri()Lokhttp3/HttpUrl$Builder;
  1193. move-result-object v0
  1194. invoke-virtual {v0}, Lokhttp3/HttpUrl$Builder;->toString()Ljava/lang/String;
  1195. move-result-object v0
  1196. :try_start_0
  1197. new-instance v1, Ljava/net/URI;
  1198. invoke-direct {v1, v0}, Ljava/net/URI;-><init>(Ljava/lang/String;)V
  1199. :try_end_0
  1200. .catch Ljava/net/URISyntaxException; {:try_start_0 .. :try_end_0} :catch_0
  1201. return-object v1
  1202. :catch_0
  1203. move-exception v1
  1204. :try_start_1
  1205. const-string v2, "[\\u0000-\\u001F\\u007F-\\u009F\\p{javaWhitespace}]"
  1206. const-string v3, ""
  1207. invoke-virtual {v0, v2, v3}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
  1208. move-result-object v0
  1209. invoke-static {v0}, Ljava/net/URI;->create(Ljava/lang/String;)Ljava/net/URI;
  1210. move-result-object v0
  1211. :try_end_1
  1212. .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
  1213. return-object v0
  1214. :catch_1
  1215. new-instance v0, Ljava/lang/RuntimeException;
  1216. invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
  1217. throw v0
  1218. .end method
  1219. .method public url()Ljava/net/URL;
  1220. .locals 2
  1221. :try_start_0
  1222. new-instance v0, Ljava/net/URL;
  1223. iget-object v1, p0, Lokhttp3/HttpUrl;->url:Ljava/lang/String;
  1224. invoke-direct {v0, v1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
  1225. :try_end_0
  1226. .catch Ljava/net/MalformedURLException; {:try_start_0 .. :try_end_0} :catch_0
  1227. return-object v0
  1228. :catch_0
  1229. move-exception v0
  1230. new-instance v1, Ljava/lang/RuntimeException;
  1231. invoke-direct {v1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
  1232. throw v1
  1233. .end method
  1234. .method public username()Ljava/lang/String;
  1235. .locals 1
  1236. iget-object v0, p0, Lokhttp3/HttpUrl;->username:Ljava/lang/String;
  1237. return-object v0
  1238. .end method