JdkWithJettyBootPlatform$JettyNegoProvider.smali 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. .class Lokhttp3/internal/platform/JdkWithJettyBootPlatform$JettyNegoProvider;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Ljava/lang/reflect/InvocationHandler;
  6. # annotations
  7. .annotation system Ldalvik/annotation/EnclosingClass;
  8. value = Lokhttp3/internal/platform/JdkWithJettyBootPlatform;
  9. .end annotation
  10. .annotation system Ldalvik/annotation/InnerClass;
  11. accessFlags = 0xa
  12. name = "JettyNegoProvider"
  13. .end annotation
  14. # instance fields
  15. .field private final protocols:Ljava/util/List;
  16. .annotation system Ldalvik/annotation/Signature;
  17. value = {
  18. "Ljava/util/List<",
  19. "Ljava/lang/String;",
  20. ">;"
  21. }
  22. .end annotation
  23. .end field
  24. .field selected:Ljava/lang/String;
  25. .field unsupported:Z
  26. # direct methods
  27. .method constructor <init>(Ljava/util/List;)V
  28. .locals 0
  29. .annotation system Ldalvik/annotation/Signature;
  30. value = {
  31. "(",
  32. "Ljava/util/List<",
  33. "Ljava/lang/String;",
  34. ">;)V"
  35. }
  36. .end annotation
  37. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  38. iput-object p1, p0, Lokhttp3/internal/platform/JdkWithJettyBootPlatform$JettyNegoProvider;->protocols:Ljava/util/List;
  39. return-void
  40. .end method
  41. # virtual methods
  42. .method public invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;
  43. .locals 5
  44. .annotation system Ldalvik/annotation/Throws;
  45. value = {
  46. Ljava/lang/Throwable;
  47. }
  48. .end annotation
  49. invoke-virtual {p2}, Ljava/lang/reflect/Method;->getName()Ljava/lang/String;
  50. move-result-object p1
  51. invoke-virtual {p2}, Ljava/lang/reflect/Method;->getReturnType()Ljava/lang/Class;
  52. move-result-object v0
  53. if-nez p3, :cond_0
  54. sget-object p3, Lokhttp3/internal/Util;->EMPTY_STRING_ARRAY:[Ljava/lang/String;
  55. :cond_0
  56. const-string v1, "supports"
  57. invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  58. move-result v1
  59. const/4 v2, 0x1
  60. if-eqz v1, :cond_1
  61. sget-object v1, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;
  62. if-ne v1, v0, :cond_1
  63. invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
  64. move-result-object p1
  65. return-object p1
  66. :cond_1
  67. const-string v1, "unsupported"
  68. invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  69. move-result v1
  70. const/4 v3, 0x0
  71. if-eqz v1, :cond_2
  72. sget-object v1, Ljava/lang/Void;->TYPE:Ljava/lang/Class;
  73. if-ne v1, v0, :cond_2
  74. iput-boolean v2, p0, Lokhttp3/internal/platform/JdkWithJettyBootPlatform$JettyNegoProvider;->unsupported:Z
  75. return-object v3
  76. :cond_2
  77. const-string v1, "protocols"
  78. invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  79. move-result v1
  80. if-eqz v1, :cond_3
  81. array-length v1, p3
  82. if-nez v1, :cond_3
  83. iget-object p1, p0, Lokhttp3/internal/platform/JdkWithJettyBootPlatform$JettyNegoProvider;->protocols:Ljava/util/List;
  84. return-object p1
  85. :cond_3
  86. const-string v1, "selectProtocol"
  87. invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  88. move-result v1
  89. const/4 v4, 0x0
  90. if-nez v1, :cond_4
  91. const-string v1, "select"
  92. invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  93. move-result v1
  94. if-eqz v1, :cond_7
  95. :cond_4
  96. const-class v1, Ljava/lang/String;
  97. if-ne v1, v0, :cond_7
  98. array-length v0, p3
  99. if-ne v0, v2, :cond_7
  100. aget-object v0, p3, v4
  101. instance-of v0, v0, Ljava/util/List;
  102. if-eqz v0, :cond_7
  103. aget-object p1, p3, v4
  104. check-cast p1, Ljava/util/List;
  105. invoke-interface {p1}, Ljava/util/List;->size()I
  106. move-result p2
  107. const/4 p3, 0x0
  108. :goto_0
  109. if-ge p3, p2, :cond_6
  110. iget-object v0, p0, Lokhttp3/internal/platform/JdkWithJettyBootPlatform$JettyNegoProvider;->protocols:Ljava/util/List;
  111. invoke-interface {p1, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;
  112. move-result-object v1
  113. invoke-interface {v0, v1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
  114. move-result v0
  115. if-eqz v0, :cond_5
  116. invoke-interface {p1, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;
  117. move-result-object p1
  118. :goto_1
  119. check-cast p1, Ljava/lang/String;
  120. iput-object p1, p0, Lokhttp3/internal/platform/JdkWithJettyBootPlatform$JettyNegoProvider;->selected:Ljava/lang/String;
  121. return-object p1
  122. :cond_5
  123. add-int/lit8 p3, p3, 0x1
  124. goto :goto_0
  125. :cond_6
  126. iget-object p1, p0, Lokhttp3/internal/platform/JdkWithJettyBootPlatform$JettyNegoProvider;->protocols:Ljava/util/List;
  127. invoke-interface {p1, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
  128. move-result-object p1
  129. goto :goto_1
  130. :cond_7
  131. const-string v0, "protocolSelected"
  132. invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  133. move-result v0
  134. if-nez v0, :cond_8
  135. const-string v0, "selected"
  136. invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  137. move-result p1
  138. if-eqz p1, :cond_9
  139. :cond_8
  140. array-length p1, p3
  141. if-ne p1, v2, :cond_9
  142. aget-object p1, p3, v4
  143. check-cast p1, Ljava/lang/String;
  144. iput-object p1, p0, Lokhttp3/internal/platform/JdkWithJettyBootPlatform$JettyNegoProvider;->selected:Ljava/lang/String;
  145. return-object v3
  146. :cond_9
  147. invoke-virtual {p2, p0, p3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
  148. move-result-object p1
  149. return-object p1
  150. .end method