AndroidPlatform$AndroidTrustRootIndex.smali 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. .class final Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Lokhttp3/internal/tls/TrustRootIndex;
  6. # annotations
  7. .annotation system Ldalvik/annotation/EnclosingClass;
  8. value = Lokhttp3/internal/platform/AndroidPlatform;
  9. .end annotation
  10. .annotation system Ldalvik/annotation/InnerClass;
  11. accessFlags = 0x18
  12. name = "AndroidTrustRootIndex"
  13. .end annotation
  14. # instance fields
  15. .field private final findByIssuerAndSignatureMethod:Ljava/lang/reflect/Method;
  16. .field private final trustManager:Ljavax/net/ssl/X509TrustManager;
  17. # direct methods
  18. .method constructor <init>(Ljavax/net/ssl/X509TrustManager;Ljava/lang/reflect/Method;)V
  19. .locals 0
  20. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  21. iput-object p2, p0, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->findByIssuerAndSignatureMethod:Ljava/lang/reflect/Method;
  22. iput-object p1, p0, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->trustManager:Ljavax/net/ssl/X509TrustManager;
  23. return-void
  24. .end method
  25. # virtual methods
  26. .method public equals(Ljava/lang/Object;)Z
  27. .locals 4
  28. const/4 v0, 0x1
  29. if-ne p1, p0, :cond_0
  30. return v0
  31. :cond_0
  32. instance-of v1, p1, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;
  33. const/4 v2, 0x0
  34. if-nez v1, :cond_1
  35. return v2
  36. :cond_1
  37. check-cast p1, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;
  38. iget-object v1, p0, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->trustManager:Ljavax/net/ssl/X509TrustManager;
  39. iget-object v3, p1, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->trustManager:Ljavax/net/ssl/X509TrustManager;
  40. invoke-virtual {v1, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
  41. move-result v1
  42. if-eqz v1, :cond_2
  43. iget-object v1, p0, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->findByIssuerAndSignatureMethod:Ljava/lang/reflect/Method;
  44. iget-object p1, p1, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->findByIssuerAndSignatureMethod:Ljava/lang/reflect/Method;
  45. invoke-virtual {v1, p1}, Ljava/lang/reflect/Method;->equals(Ljava/lang/Object;)Z
  46. move-result p1
  47. if-eqz p1, :cond_2
  48. goto :goto_0
  49. :cond_2
  50. const/4 v0, 0x0
  51. :goto_0
  52. return v0
  53. .end method
  54. .method public findByIssuerAndSignature(Ljava/security/cert/X509Certificate;)Ljava/security/cert/X509Certificate;
  55. .locals 5
  56. const/4 v0, 0x0
  57. :try_start_0
  58. iget-object v1, p0, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->findByIssuerAndSignatureMethod:Ljava/lang/reflect/Method;
  59. iget-object v2, p0, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->trustManager:Ljavax/net/ssl/X509TrustManager;
  60. const/4 v3, 0x1
  61. new-array v3, v3, [Ljava/lang/Object;
  62. const/4 v4, 0x0
  63. aput-object p1, v3, v4
  64. invoke-virtual {v1, v2, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
  65. move-result-object p1
  66. check-cast p1, Ljava/security/cert/TrustAnchor;
  67. if-eqz p1, :cond_0
  68. invoke-virtual {p1}, Ljava/security/cert/TrustAnchor;->getTrustedCert()Ljava/security/cert/X509Certificate;
  69. move-result-object v0
  70. :try_end_0
  71. .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1
  72. .catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
  73. :catch_0
  74. :cond_0
  75. return-object v0
  76. :catch_1
  77. move-exception p1
  78. const-string v0, "unable to get issues and signature"
  79. invoke-static {v0, p1}, Lokhttp3/internal/Util;->assertionError(Ljava/lang/String;Ljava/lang/Exception;)Ljava/lang/AssertionError;
  80. move-result-object p1
  81. throw p1
  82. .end method
  83. .method public hashCode()I
  84. .locals 2
  85. iget-object v0, p0, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->trustManager:Ljavax/net/ssl/X509TrustManager;
  86. invoke-virtual {v0}, Ljava/lang/Object;->hashCode()I
  87. move-result v0
  88. iget-object v1, p0, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;->findByIssuerAndSignatureMethod:Ljava/lang/reflect/Method;
  89. invoke-virtual {v1}, Ljava/lang/reflect/Method;->hashCode()I
  90. move-result v1
  91. mul-int/lit8 v1, v1, 0x1f
  92. add-int/2addr v0, v1
  93. return v0
  94. .end method