123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525 |
- .class public Lokhttp3/internal/platform/Platform;
- .super Ljava/lang/Object;
- .source ""
- # static fields
- .field public static final INFO:I = 0x4
- .field private static final PLATFORM:Lokhttp3/internal/platform/Platform;
- .field public static final WARN:I = 0x5
- .field private static final logger:Ljava/util/logging/Logger;
- # direct methods
- .method static constructor <clinit>()V
- .locals 1
- invoke-static {}, Lokhttp3/internal/platform/Platform;->findPlatform()Lokhttp3/internal/platform/Platform;
- move-result-object v0
- sput-object v0, Lokhttp3/internal/platform/Platform;->PLATFORM:Lokhttp3/internal/platform/Platform;
- const-class v0, Lokhttp3/OkHttpClient;
- invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
- move-result-object v0
- invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
- move-result-object v0
- sput-object v0, Lokhttp3/internal/platform/Platform;->logger:Ljava/util/logging/Logger;
- return-void
- .end method
- .method public constructor <init>()V
- .locals 0
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- return-void
- .end method
- .method public static alpnProtocolNames(Ljava/util/List;)Ljava/util/List;
- .locals 5
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljava/util/List<",
- "Lokhttp3/Protocol;",
- ">;)",
- "Ljava/util/List<",
- "Ljava/lang/String;",
- ">;"
- }
- .end annotation
- new-instance v0, Ljava/util/ArrayList;
- invoke-interface {p0}, Ljava/util/List;->size()I
- move-result v1
- invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V
- invoke-interface {p0}, Ljava/util/List;->size()I
- move-result v1
- const/4 v2, 0x0
- :goto_0
- if-ge v2, v1, :cond_1
- invoke-interface {p0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v3
- check-cast v3, Lokhttp3/Protocol;
- sget-object v4, Lokhttp3/Protocol;->HTTP_1_0:Lokhttp3/Protocol;
- if-ne v3, v4, :cond_0
- goto :goto_1
- :cond_0
- invoke-virtual {v3}, Lokhttp3/Protocol;->toString()Ljava/lang/String;
- move-result-object v3
- invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
- :goto_1
- add-int/lit8 v2, v2, 0x1
- goto :goto_0
- :cond_1
- return-object v0
- .end method
- .method static concatLengthPrefixed(Ljava/util/List;)[B
- .locals 5
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljava/util/List<",
- "Lokhttp3/Protocol;",
- ">;)[B"
- }
- .end annotation
- new-instance v0, Lokio/Buffer;
- invoke-direct {v0}, Lokio/Buffer;-><init>()V
- invoke-interface {p0}, Ljava/util/List;->size()I
- move-result v1
- const/4 v2, 0x0
- :goto_0
- if-ge v2, v1, :cond_1
- invoke-interface {p0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v3
- check-cast v3, Lokhttp3/Protocol;
- sget-object v4, Lokhttp3/Protocol;->HTTP_1_0:Lokhttp3/Protocol;
- if-ne v3, v4, :cond_0
- goto :goto_1
- :cond_0
- invoke-virtual {v3}, Lokhttp3/Protocol;->toString()Ljava/lang/String;
- move-result-object v4
- invoke-virtual {v4}, Ljava/lang/String;->length()I
- move-result v4
- invoke-virtual {v0, v4}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
- invoke-virtual {v3}, Lokhttp3/Protocol;->toString()Ljava/lang/String;
- move-result-object v3
- invoke-virtual {v0, v3}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
- :goto_1
- add-int/lit8 v2, v2, 0x1
- goto :goto_0
- :cond_1
- invoke-virtual {v0}, Lokio/Buffer;->readByteArray()[B
- move-result-object p0
- return-object p0
- .end method
- .method private static findPlatform()Lokhttp3/internal/platform/Platform;
- .locals 1
- invoke-static {}, Lokhttp3/internal/platform/AndroidPlatform;->buildIfSupported()Lokhttp3/internal/platform/Platform;
- move-result-object v0
- if-eqz v0, :cond_0
- return-object v0
- :cond_0
- invoke-static {}, Lokhttp3/internal/platform/Jdk9Platform;->buildIfSupported()Lokhttp3/internal/platform/Jdk9Platform;
- move-result-object v0
- if-eqz v0, :cond_1
- return-object v0
- :cond_1
- invoke-static {}, Lokhttp3/internal/platform/JdkWithJettyBootPlatform;->buildIfSupported()Lokhttp3/internal/platform/Platform;
- move-result-object v0
- if-eqz v0, :cond_2
- return-object v0
- :cond_2
- new-instance v0, Lokhttp3/internal/platform/Platform;
- invoke-direct {v0}, Lokhttp3/internal/platform/Platform;-><init>()V
- return-object v0
- .end method
- .method public static get()Lokhttp3/internal/platform/Platform;
- .locals 1
- sget-object v0, Lokhttp3/internal/platform/Platform;->PLATFORM:Lokhttp3/internal/platform/Platform;
- return-object v0
- .end method
- .method static readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
- .locals 5
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">(",
- "Ljava/lang/Object;",
- "Ljava/lang/Class<",
- "TT;>;",
- "Ljava/lang/String;",
- ")TT;"
- }
- .end annotation
- const-class v0, Ljava/lang/Object;
- invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
- move-result-object v1
- :goto_0
- const/4 v2, 0x0
- if-eq v1, v0, :cond_2
- :try_start_0
- invoke-virtual {v1, p2}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
- move-result-object v3
- const/4 v4, 0x1
- invoke-virtual {v3, v4}, Ljava/lang/reflect/Field;->setAccessible(Z)V
- invoke-virtual {v3, p0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object v3
- if-eqz v3, :cond_1
- invoke-virtual {p1, v3}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z
- move-result v4
- if-nez v4, :cond_0
- goto :goto_1
- :cond_0
- invoke-virtual {p1, v3}, Ljava/lang/Class;->cast(Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object p0
- :try_end_0
- .catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_1
- .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
- return-object p0
- :cond_1
- :goto_1
- return-object v2
- :catch_0
- new-instance p0, Ljava/lang/AssertionError;
- invoke-direct {p0}, Ljava/lang/AssertionError;-><init>()V
- throw p0
- :catch_1
- invoke-virtual {v1}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;
- move-result-object v1
- goto :goto_0
- :cond_2
- const-string v1, "delegate"
- invoke-virtual {p2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v3
- if-nez v3, :cond_3
- invoke-static {p0, v0, v1}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
- move-result-object p0
- if-eqz p0, :cond_3
- invoke-static {p0, p1, p2}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
- move-result-object p0
- return-object p0
- :cond_3
- return-object v2
- .end method
- # virtual methods
- .method public afterHandshake(Ljavax/net/ssl/SSLSocket;)V
- .locals 0
- return-void
- .end method
- .method public buildCertificateChainCleaner(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/tls/CertificateChainCleaner;
- .locals 1
- new-instance v0, Lokhttp3/internal/tls/BasicCertificateChainCleaner;
- invoke-virtual {p0, p1}, Lokhttp3/internal/platform/Platform;->buildTrustRootIndex(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/tls/TrustRootIndex;
- move-result-object p1
- invoke-direct {v0, p1}, Lokhttp3/internal/tls/BasicCertificateChainCleaner;-><init>(Lokhttp3/internal/tls/TrustRootIndex;)V
- return-object v0
- .end method
- .method public buildTrustRootIndex(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/tls/TrustRootIndex;
- .locals 1
- new-instance v0, Lokhttp3/internal/tls/BasicTrustRootIndex;
- invoke-interface {p1}, Ljavax/net/ssl/X509TrustManager;->getAcceptedIssuers()[Ljava/security/cert/X509Certificate;
- move-result-object p1
- invoke-direct {v0, p1}, Lokhttp3/internal/tls/BasicTrustRootIndex;-><init>([Ljava/security/cert/X509Certificate;)V
- return-object v0
- .end method
- .method public configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
- .locals 0
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljavax/net/ssl/SSLSocket;",
- "Ljava/lang/String;",
- "Ljava/util/List<",
- "Lokhttp3/Protocol;",
- ">;)V"
- }
- .end annotation
- return-void
- .end method
- .method public connectSocket(Ljava/net/Socket;Ljava/net/InetSocketAddress;I)V
- .locals 0
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-virtual {p1, p2, p3}, Ljava/net/Socket;->connect(Ljava/net/SocketAddress;I)V
- return-void
- .end method
- .method public getPrefix()Ljava/lang/String;
- .locals 1
- const-string v0, "OkHttp"
- return-object v0
- .end method
- .method public getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
- .locals 0
- const/4 p1, 0x0
- return-object p1
- .end method
- .method public getStackTraceForCloseable(Ljava/lang/String;)Ljava/lang/Object;
- .locals 2
- sget-object v0, Lokhttp3/internal/platform/Platform;->logger:Ljava/util/logging/Logger;
- sget-object v1, Ljava/util/logging/Level;->FINE:Ljava/util/logging/Level;
- invoke-virtual {v0, v1}, Ljava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z
- move-result v0
- if-eqz v0, :cond_0
- new-instance v0, Ljava/lang/Throwable;
- invoke-direct {v0, p1}, Ljava/lang/Throwable;-><init>(Ljava/lang/String;)V
- return-object v0
- :cond_0
- const/4 p1, 0x0
- return-object p1
- .end method
- .method public isCleartextTrafficPermitted(Ljava/lang/String;)Z
- .locals 0
- const/4 p1, 0x1
- return p1
- .end method
- .method public log(ILjava/lang/String;Ljava/lang/Throwable;)V
- .locals 1
- const/4 v0, 0x5
- if-ne p1, v0, :cond_0
- sget-object p1, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;
- goto :goto_0
- :cond_0
- sget-object p1, Ljava/util/logging/Level;->INFO:Ljava/util/logging/Level;
- :goto_0
- sget-object v0, Lokhttp3/internal/platform/Platform;->logger:Ljava/util/logging/Logger;
- invoke-virtual {v0, p1, p2, p3}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
- return-void
- .end method
- .method public logCloseableLeak(Ljava/lang/String;Ljava/lang/Object;)V
- .locals 1
- if-nez p2, :cond_0
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string p1, " To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);"
- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- :cond_0
- const/4 v0, 0x5
- check-cast p2, Ljava/lang/Throwable;
- invoke-virtual {p0, v0, p1, p2}, Lokhttp3/internal/platform/Platform;->log(ILjava/lang/String;Ljava/lang/Throwable;)V
- return-void
- .end method
- .method public trustManager(Ljavax/net/ssl/SSLSocketFactory;)Ljavax/net/ssl/X509TrustManager;
- .locals 3
- const-string v0, "sun.security.ssl.SSLContextImpl"
- const/4 v1, 0x0
- :try_start_0
- invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
- move-result-object v0
- const-string v2, "context"
- invoke-static {p1, v0, v2}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
- move-result-object p1
- if-nez p1, :cond_0
- return-object v1
- :cond_0
- const-class v0, Ljavax/net/ssl/X509TrustManager;
- const-string v2, "trustManager"
- invoke-static {p1, v0, v2}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
- move-result-object p1
- check-cast p1, Ljavax/net/ssl/X509TrustManager;
- :try_end_0
- .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
- return-object p1
- :catch_0
- return-object v1
- .end method
|