CertificatePinner$Builder.smali 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. .class public final Lokhttp3/CertificatePinner$Builder;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/CertificatePinner;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x19
  10. name = "Builder"
  11. .end annotation
  12. # instance fields
  13. .field private final pins:Ljava/util/List;
  14. .annotation system Ldalvik/annotation/Signature;
  15. value = {
  16. "Ljava/util/List<",
  17. "Lokhttp3/CertificatePinner$Pin;",
  18. ">;"
  19. }
  20. .end annotation
  21. .end field
  22. # direct methods
  23. .method public constructor <init>()V
  24. .locals 1
  25. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  26. new-instance v0, Ljava/util/ArrayList;
  27. invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
  28. iput-object v0, p0, Lokhttp3/CertificatePinner$Builder;->pins:Ljava/util/List;
  29. return-void
  30. .end method
  31. # virtual methods
  32. .method public varargs add(Ljava/lang/String;[Ljava/lang/String;)Lokhttp3/CertificatePinner$Builder;
  33. .locals 5
  34. if-eqz p1, :cond_1
  35. array-length v0, p2
  36. const/4 v1, 0x0
  37. :goto_0
  38. if-ge v1, v0, :cond_0
  39. aget-object v2, p2, v1
  40. iget-object v3, p0, Lokhttp3/CertificatePinner$Builder;->pins:Ljava/util/List;
  41. new-instance v4, Lokhttp3/CertificatePinner$Pin;
  42. invoke-direct {v4, p1, v2}, Lokhttp3/CertificatePinner$Pin;-><init>(Ljava/lang/String;Ljava/lang/String;)V
  43. invoke-interface {v3, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  44. add-int/lit8 v1, v1, 0x1
  45. goto :goto_0
  46. :cond_0
  47. return-object p0
  48. :cond_1
  49. new-instance p1, Ljava/lang/NullPointerException;
  50. const-string p2, "pattern == null"
  51. invoke-direct {p1, p2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
  52. goto :goto_2
  53. :goto_1
  54. throw p1
  55. :goto_2
  56. goto :goto_1
  57. .end method
  58. .method public build()Lokhttp3/CertificatePinner;
  59. .locals 3
  60. new-instance v0, Lokhttp3/CertificatePinner;
  61. new-instance v1, Ljava/util/LinkedHashSet;
  62. iget-object v2, p0, Lokhttp3/CertificatePinner$Builder;->pins:Ljava/util/List;
  63. invoke-direct {v1, v2}, Ljava/util/LinkedHashSet;-><init>(Ljava/util/Collection;)V
  64. const/4 v2, 0x0
  65. invoke-direct {v0, v1, v2}, Lokhttp3/CertificatePinner;-><init>(Ljava/util/Set;Lokhttp3/internal/tls/CertificateChainCleaner;)V
  66. return-object v0
  67. .end method