411 lines
8.4 KiB
Smali
411 lines
8.4 KiB
Smali
.class public Lvf/g;
|
|
.super Ljava/lang/Object;
|
|
.source "SSLContextBuilder.java"
|
|
|
|
|
|
# annotations
|
|
.annotation build Lcz/msebera/android/httpclient/annotation/NotThreadSafe;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lvf/g$a;,
|
|
Lvf/g$b;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final e:Ljava/lang/String; = "TLS"
|
|
|
|
.field public static final f:Ljava/lang/String; = "SSL"
|
|
|
|
|
|
# instance fields
|
|
.field public a:Ljava/lang/String;
|
|
|
|
.field public b:Ljava/util/Set;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Set<",
|
|
"Ljavax/net/ssl/KeyManager;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public c:Ljava/util/Set;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Set<",
|
|
"Ljavax/net/ssl/TrustManager;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public d:Ljava/security/SecureRandom;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 2
|
|
new-instance v0, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
|
|
|
|
iput-object v0, p0, Lvf/g;->b:Ljava/util/Set;
|
|
|
|
.line 3
|
|
new-instance v0, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
|
|
|
|
iput-object v0, p0, Lvf/g;->c:Ljava/util/Set;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a()Ljavax/net/ssl/SSLContext;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/security/NoSuchAlgorithmException;,
|
|
Ljava/security/KeyManagementException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lvf/g;->a:Ljava/lang/String;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string v0, "TLS"
|
|
|
|
:goto_0
|
|
invoke-static {v0}, Ljavax/net/ssl/SSLContext;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/SSLContext;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
iget-object v1, p0, Lvf/g;->b:Ljava/util/Set;
|
|
|
|
.line 3
|
|
invoke-interface {v1}, Ljava/util/Set;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
iget-object v1, p0, Lvf/g;->b:Ljava/util/Set;
|
|
|
|
invoke-interface {v1}, Ljava/util/Set;->size()I
|
|
|
|
move-result v3
|
|
|
|
new-array v3, v3, [Ljavax/net/ssl/KeyManager;
|
|
|
|
invoke-interface {v1, v3}, Ljava/util/Set;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, [Ljavax/net/ssl/KeyManager;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move-object v1, v2
|
|
|
|
:goto_1
|
|
iget-object v3, p0, Lvf/g;->c:Ljava/util/Set;
|
|
|
|
.line 4
|
|
invoke-interface {v3}, Ljava/util/Set;->isEmpty()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_2
|
|
|
|
iget-object v2, p0, Lvf/g;->c:Ljava/util/Set;
|
|
|
|
invoke-interface {v2}, Ljava/util/Set;->size()I
|
|
|
|
move-result v3
|
|
|
|
new-array v3, v3, [Ljavax/net/ssl/TrustManager;
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Set;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, [Ljavax/net/ssl/TrustManager;
|
|
|
|
:cond_2
|
|
iget-object v3, p0, Lvf/g;->d:Ljava/security/SecureRandom;
|
|
|
|
.line 5
|
|
invoke-virtual {v0, v1, v2, v3}, Ljavax/net/ssl/SSLContext;->init([Ljavax/net/ssl/KeyManager;[Ljavax/net/ssl/TrustManager;Ljava/security/SecureRandom;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public b(Ljava/security/KeyStore;[C)Lvf/g;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/security/NoSuchAlgorithmException;,
|
|
Ljava/security/KeyStoreException;,
|
|
Ljava/security/UnrecoverableKeyException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
invoke-virtual {p0, p1, p2, v0}, Lvf/g;->c(Ljava/security/KeyStore;[CLvf/e;)Lvf/g;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public c(Ljava/security/KeyStore;[CLvf/e;)Lvf/g;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/security/NoSuchAlgorithmException;,
|
|
Ljava/security/KeyStoreException;,
|
|
Ljava/security/UnrecoverableKeyException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {}, Ljavax/net/ssl/KeyManagerFactory;->getDefaultAlgorithm()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
invoke-static {v0}, Ljavax/net/ssl/KeyManagerFactory;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/KeyManagerFactory;
|
|
|
|
move-result-object v0
|
|
|
|
.line 3
|
|
invoke-virtual {v0, p1, p2}, Ljavax/net/ssl/KeyManagerFactory;->init(Ljava/security/KeyStore;[C)V
|
|
|
|
.line 4
|
|
invoke-virtual {v0}, Ljavax/net/ssl/KeyManagerFactory;->getKeyManagers()[Ljavax/net/ssl/KeyManager;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
const/4 p2, 0x0
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
move v0, p2
|
|
|
|
.line 5
|
|
:goto_0
|
|
array-length v1, p1
|
|
|
|
if-ge v0, v1, :cond_1
|
|
|
|
.line 6
|
|
aget-object v1, p1, v0
|
|
|
|
.line 7
|
|
instance-of v2, v1, Ljavax/net/ssl/X509KeyManager;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 8
|
|
new-instance v2, Lvf/g$a;
|
|
|
|
check-cast v1, Ljavax/net/ssl/X509KeyManager;
|
|
|
|
invoke-direct {v2, v1, p3}, Lvf/g$a;-><init>(Ljavax/net/ssl/X509KeyManager;Lvf/e;)V
|
|
|
|
aput-object v2, p1, v0
|
|
|
|
:cond_0
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 9
|
|
:cond_1
|
|
array-length p3, p1
|
|
|
|
:goto_1
|
|
if-ge p2, p3, :cond_2
|
|
|
|
aget-object v0, p1, p2
|
|
|
|
.line 10
|
|
iget-object v1, p0, Lvf/g;->b:Ljava/util/Set;
|
|
|
|
invoke-interface {v1, v0}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 p2, p2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public d(Ljava/security/KeyStore;)Lvf/g;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/security/NoSuchAlgorithmException;,
|
|
Ljava/security/KeyStoreException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
invoke-virtual {p0, p1, v0}, Lvf/g;->e(Ljava/security/KeyStore;Lvf/l;)Lvf/g;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public e(Ljava/security/KeyStore;Lvf/l;)Lvf/g;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/security/NoSuchAlgorithmException;,
|
|
Ljava/security/KeyStoreException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {}, Ljavax/net/ssl/TrustManagerFactory;->getDefaultAlgorithm()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
invoke-static {v0}, Ljavax/net/ssl/TrustManagerFactory;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/TrustManagerFactory;
|
|
|
|
move-result-object v0
|
|
|
|
.line 3
|
|
invoke-virtual {v0, p1}, Ljavax/net/ssl/TrustManagerFactory;->init(Ljava/security/KeyStore;)V
|
|
|
|
.line 4
|
|
invoke-virtual {v0}, Ljavax/net/ssl/TrustManagerFactory;->getTrustManagers()[Ljavax/net/ssl/TrustManager;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
move v1, v0
|
|
|
|
.line 5
|
|
:goto_0
|
|
array-length v2, p1
|
|
|
|
if-ge v1, v2, :cond_1
|
|
|
|
.line 6
|
|
aget-object v2, p1, v1
|
|
|
|
.line 7
|
|
instance-of v3, v2, Ljavax/net/ssl/X509TrustManager;
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
.line 8
|
|
new-instance v3, Lvf/g$b;
|
|
|
|
check-cast v2, Ljavax/net/ssl/X509TrustManager;
|
|
|
|
invoke-direct {v3, v2, p2}, Lvf/g$b;-><init>(Ljavax/net/ssl/X509TrustManager;Lvf/l;)V
|
|
|
|
aput-object v3, p1, v1
|
|
|
|
:cond_0
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 9
|
|
:cond_1
|
|
array-length p2, p1
|
|
|
|
:goto_1
|
|
if-ge v0, p2, :cond_2
|
|
|
|
aget-object v1, p1, v0
|
|
|
|
.line 10
|
|
iget-object v2, p0, Lvf/g;->c:Ljava/util/Set;
|
|
|
|
invoke-interface {v2, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public f(Ljava/security/SecureRandom;)Lvf/g;
|
|
.locals 0
|
|
|
|
.line 1
|
|
iput-object p1, p0, Lvf/g;->d:Ljava/security/SecureRandom;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public g(Ljava/lang/String;)Lvf/g;
|
|
.locals 0
|
|
|
|
.line 1
|
|
iput-object p1, p0, Lvf/g;->a:Ljava/lang/String;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public h()Lvf/g;
|
|
.locals 1
|
|
|
|
const-string v0, "SSL"
|
|
|
|
.line 1
|
|
iput-object v0, p0, Lvf/g;->a:Ljava/lang/String;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public i()Lvf/g;
|
|
.locals 1
|
|
|
|
const-string v0, "TLS"
|
|
|
|
.line 1
|
|
iput-object v0, p0, Lvf/g;->a:Ljava/lang/String;
|
|
|
|
return-object p0
|
|
.end method
|