RequestLine.smali 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. .class public final Lokhttp3/internal/http/RequestLine;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # direct methods
  5. .method private constructor <init>()V
  6. .locals 0
  7. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  8. return-void
  9. .end method
  10. .method public static get(Lokhttp3/Request;Ljava/net/Proxy$Type;)Ljava/lang/String;
  11. .locals 2
  12. new-instance v0, Ljava/lang/StringBuilder;
  13. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  14. invoke-virtual {p0}, Lokhttp3/Request;->method()Ljava/lang/String;
  15. move-result-object v1
  16. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  17. const/16 v1, 0x20
  18. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
  19. invoke-static {p0, p1}, Lokhttp3/internal/http/RequestLine;->includeAuthorityInRequestLine(Lokhttp3/Request;Ljava/net/Proxy$Type;)Z
  20. move-result p1
  21. invoke-virtual {p0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
  22. move-result-object p0
  23. if-eqz p1, :cond_0
  24. invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  25. goto :goto_0
  26. :cond_0
  27. invoke-static {p0}, Lokhttp3/internal/http/RequestLine;->requestPath(Lokhttp3/HttpUrl;)Ljava/lang/String;
  28. move-result-object p0
  29. invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  30. :goto_0
  31. const-string p0, " HTTP/1.1"
  32. invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  33. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  34. move-result-object p0
  35. return-object p0
  36. .end method
  37. .method private static includeAuthorityInRequestLine(Lokhttp3/Request;Ljava/net/Proxy$Type;)Z
  38. .locals 0
  39. invoke-virtual {p0}, Lokhttp3/Request;->isHttps()Z
  40. move-result p0
  41. if-nez p0, :cond_0
  42. sget-object p0, Ljava/net/Proxy$Type;->HTTP:Ljava/net/Proxy$Type;
  43. if-ne p1, p0, :cond_0
  44. const/4 p0, 0x1
  45. goto :goto_0
  46. :cond_0
  47. const/4 p0, 0x0
  48. :goto_0
  49. return p0
  50. .end method
  51. .method public static requestPath(Lokhttp3/HttpUrl;)Ljava/lang/String;
  52. .locals 2
  53. invoke-virtual {p0}, Lokhttp3/HttpUrl;->encodedPath()Ljava/lang/String;
  54. move-result-object v0
  55. invoke-virtual {p0}, Lokhttp3/HttpUrl;->encodedQuery()Ljava/lang/String;
  56. move-result-object p0
  57. if-eqz p0, :cond_0
  58. new-instance v1, Ljava/lang/StringBuilder;
  59. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  60. invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  61. const/16 v0, 0x3f
  62. invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
  63. invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  64. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  65. move-result-object v0
  66. :cond_0
  67. return-object v0
  68. .end method