200 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
			
		
		
	
	
			200 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
| .class public final Lcom/google/api/client/util/SslUtils;
 | |
| .super Ljava/lang/Object;
 | |
| .source "SslUtils.java"
 | |
| 
 | |
| 
 | |
| # direct methods
 | |
| .method private constructor <init>()V
 | |
|     .locals 0
 | |
| 
 | |
|     .line 1
 | |
|     invoke-direct {p0}, Ljava/lang/Object;-><init>()V
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public static getDefaultKeyManagerFactory()Ljavax/net/ssl/KeyManagerFactory;
 | |
|     .locals 1
 | |
|     .annotation system Ldalvik/annotation/Throws;
 | |
|         value = {
 | |
|             Ljava/security/NoSuchAlgorithmException;
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {}, Ljavax/net/ssl/KeyManagerFactory;->getDefaultAlgorithm()Ljava/lang/String;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-static {v0}, Ljavax/net/ssl/KeyManagerFactory;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/KeyManagerFactory;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| .method public static getDefaultTrustManagerFactory()Ljavax/net/ssl/TrustManagerFactory;
 | |
|     .locals 1
 | |
|     .annotation system Ldalvik/annotation/Throws;
 | |
|         value = {
 | |
|             Ljava/security/NoSuchAlgorithmException;
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {}, Ljavax/net/ssl/TrustManagerFactory;->getDefaultAlgorithm()Ljava/lang/String;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-static {v0}, Ljavax/net/ssl/TrustManagerFactory;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/TrustManagerFactory;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| .method public static getPkixKeyManagerFactory()Ljavax/net/ssl/KeyManagerFactory;
 | |
|     .locals 1
 | |
|     .annotation system Ldalvik/annotation/Throws;
 | |
|         value = {
 | |
|             Ljava/security/NoSuchAlgorithmException;
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     const-string v0, "PKIX"
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {v0}, Ljavax/net/ssl/KeyManagerFactory;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/KeyManagerFactory;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| .method public static getPkixTrustManagerFactory()Ljavax/net/ssl/TrustManagerFactory;
 | |
|     .locals 1
 | |
|     .annotation system Ldalvik/annotation/Throws;
 | |
|         value = {
 | |
|             Ljava/security/NoSuchAlgorithmException;
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     const-string v0, "PKIX"
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {v0}, Ljavax/net/ssl/TrustManagerFactory;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/TrustManagerFactory;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| .method public static getSslContext()Ljavax/net/ssl/SSLContext;
 | |
|     .locals 1
 | |
|     .annotation system Ldalvik/annotation/Throws;
 | |
|         value = {
 | |
|             Ljava/security/NoSuchAlgorithmException;
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     const-string v0, "SSL"
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {v0}, Ljavax/net/ssl/SSLContext;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/SSLContext;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| .method public static getTlsSslContext()Ljavax/net/ssl/SSLContext;
 | |
|     .locals 1
 | |
|     .annotation system Ldalvik/annotation/Throws;
 | |
|         value = {
 | |
|             Ljava/security/NoSuchAlgorithmException;
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     const-string v0, "TLS"
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {v0}, Ljavax/net/ssl/SSLContext;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/SSLContext;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| .method public static initSslContext(Ljavax/net/ssl/SSLContext;Ljava/security/KeyStore;Ljavax/net/ssl/TrustManagerFactory;)Ljavax/net/ssl/SSLContext;
 | |
|     .locals 0
 | |
|     .annotation system Ldalvik/annotation/Throws;
 | |
|         value = {
 | |
|             Ljava/security/GeneralSecurityException;
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     invoke-virtual {p2, p1}, Ljavax/net/ssl/TrustManagerFactory;->init(Ljava/security/KeyStore;)V
 | |
| 
 | |
|     .line 2
 | |
|     invoke-virtual {p2}, Ljavax/net/ssl/TrustManagerFactory;->getTrustManagers()[Ljavax/net/ssl/TrustManager;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     const/4 p2, 0x0
 | |
| 
 | |
|     invoke-virtual {p0, p2, p1, p2}, Ljavax/net/ssl/SSLContext;->init([Ljavax/net/ssl/KeyManager;[Ljavax/net/ssl/TrustManager;Ljava/security/SecureRandom;)V
 | |
| 
 | |
|     return-object p0
 | |
| .end method
 | |
| 
 | |
| .method public static trustAllHostnameVerifier()Ljavax/net/ssl/HostnameVerifier;
 | |
|     .locals 1
 | |
|     .annotation build Lcom/google/api/client/util/Beta;
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     new-instance v0, Lcom/google/api/client/util/SslUtils$2;
 | |
| 
 | |
|     invoke-direct {v0}, Lcom/google/api/client/util/SslUtils$2;-><init>()V
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| .method public static trustAllSSLContext()Ljavax/net/ssl/SSLContext;
 | |
|     .locals 3
 | |
|     .annotation build Lcom/google/api/client/util/Beta;
 | |
|     .end annotation
 | |
| 
 | |
|     .annotation system Ldalvik/annotation/Throws;
 | |
|         value = {
 | |
|             Ljava/security/GeneralSecurityException;
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     const/4 v0, 0x1
 | |
| 
 | |
|     new-array v0, v0, [Ljavax/net/ssl/TrustManager;
 | |
| 
 | |
|     .line 1
 | |
|     new-instance v1, Lcom/google/api/client/util/SslUtils$1;
 | |
| 
 | |
|     invoke-direct {v1}, Lcom/google/api/client/util/SslUtils$1;-><init>()V
 | |
| 
 | |
|     const/4 v2, 0x0
 | |
| 
 | |
|     aput-object v1, v0, v2
 | |
| 
 | |
|     .line 2
 | |
|     invoke-static {}, Lcom/google/api/client/util/SslUtils;->getTlsSslContext()Ljavax/net/ssl/SSLContext;
 | |
| 
 | |
|     move-result-object v1
 | |
| 
 | |
|     const/4 v2, 0x0
 | |
| 
 | |
|     .line 3
 | |
|     invoke-virtual {v1, v2, v0, v2}, Ljavax/net/ssl/SSLContext;->init([Ljavax/net/ssl/KeyManager;[Ljavax/net/ssl/TrustManager;Ljava/security/SecureRandom;)V
 | |
| 
 | |
|     return-object v1
 | |
| .end method
 |