123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915 |
- .class Lokhttp3/internal/platform/AndroidPlatform;
- .super Lokhttp3/internal/platform/Platform;
- .source ""
- # annotations
- .annotation system Ldalvik/annotation/MemberClasses;
- value = {
- Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;,
- Lokhttp3/internal/platform/AndroidPlatform$CloseGuard;,
- Lokhttp3/internal/platform/AndroidPlatform$AndroidCertificateChainCleaner;
- }
- .end annotation
- # static fields
- .field private static final MAX_LOG_LENGTH:I = 0xfa0
- # instance fields
- .field private final closeGuard:Lokhttp3/internal/platform/AndroidPlatform$CloseGuard;
- .field private final getAlpnSelectedProtocol:Lokhttp3/internal/platform/OptionalMethod;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Lokhttp3/internal/platform/OptionalMethod<",
- "Ljava/net/Socket;",
- ">;"
- }
- .end annotation
- .end field
- .field private final setAlpnProtocols:Lokhttp3/internal/platform/OptionalMethod;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Lokhttp3/internal/platform/OptionalMethod<",
- "Ljava/net/Socket;",
- ">;"
- }
- .end annotation
- .end field
- .field private final setHostname:Lokhttp3/internal/platform/OptionalMethod;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Lokhttp3/internal/platform/OptionalMethod<",
- "Ljava/net/Socket;",
- ">;"
- }
- .end annotation
- .end field
- .field private final setUseSessionTickets:Lokhttp3/internal/platform/OptionalMethod;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Lokhttp3/internal/platform/OptionalMethod<",
- "Ljava/net/Socket;",
- ">;"
- }
- .end annotation
- .end field
- .field private final sslParametersClass:Ljava/lang/Class;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/lang/Class<",
- "*>;"
- }
- .end annotation
- .end field
- # direct methods
- .method constructor <init>(Ljava/lang/Class;Lokhttp3/internal/platform/OptionalMethod;Lokhttp3/internal/platform/OptionalMethod;Lokhttp3/internal/platform/OptionalMethod;Lokhttp3/internal/platform/OptionalMethod;)V
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljava/lang/Class<",
- "*>;",
- "Lokhttp3/internal/platform/OptionalMethod<",
- "Ljava/net/Socket;",
- ">;",
- "Lokhttp3/internal/platform/OptionalMethod<",
- "Ljava/net/Socket;",
- ">;",
- "Lokhttp3/internal/platform/OptionalMethod<",
- "Ljava/net/Socket;",
- ">;",
- "Lokhttp3/internal/platform/OptionalMethod<",
- "Ljava/net/Socket;",
- ">;)V"
- }
- .end annotation
- invoke-direct {p0}, Lokhttp3/internal/platform/Platform;-><init>()V
- invoke-static {}, Lokhttp3/internal/platform/AndroidPlatform$CloseGuard;->get()Lokhttp3/internal/platform/AndroidPlatform$CloseGuard;
- move-result-object v0
- iput-object v0, p0, Lokhttp3/internal/platform/AndroidPlatform;->closeGuard:Lokhttp3/internal/platform/AndroidPlatform$CloseGuard;
- iput-object p1, p0, Lokhttp3/internal/platform/AndroidPlatform;->sslParametersClass:Ljava/lang/Class;
- iput-object p2, p0, Lokhttp3/internal/platform/AndroidPlatform;->setUseSessionTickets:Lokhttp3/internal/platform/OptionalMethod;
- iput-object p3, p0, Lokhttp3/internal/platform/AndroidPlatform;->setHostname:Lokhttp3/internal/platform/OptionalMethod;
- iput-object p4, p0, Lokhttp3/internal/platform/AndroidPlatform;->getAlpnSelectedProtocol:Lokhttp3/internal/platform/OptionalMethod;
- iput-object p5, p0, Lokhttp3/internal/platform/AndroidPlatform;->setAlpnProtocols:Lokhttp3/internal/platform/OptionalMethod;
- return-void
- .end method
- .method private api23IsCleartextTrafficPermitted(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/Object;)Z
- .locals 3
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljava/lang/String;",
- "Ljava/lang/Class<",
- "*>;",
- "Ljava/lang/Object;",
- ")Z"
- }
- .end annotation
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/lang/reflect/InvocationTargetException;,
- Ljava/lang/IllegalAccessException;
- }
- .end annotation
- :try_start_0
- const-string v0, "isCleartextTrafficPermitted"
- const/4 v1, 0x0
- new-array v2, v1, [Ljava/lang/Class;
- invoke-virtual {p2, v0, v2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object p2
- new-array v0, v1, [Ljava/lang/Object;
- invoke-virtual {p2, p3, v0}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object p2
- check-cast p2, Ljava/lang/Boolean;
- invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
- move-result p1
- :try_end_0
- .catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
- return p1
- :catch_0
- invoke-super {p0, p1}, Lokhttp3/internal/platform/Platform;->isCleartextTrafficPermitted(Ljava/lang/String;)Z
- move-result p1
- return p1
- .end method
- .method private api24IsCleartextTrafficPermitted(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/Object;)Z
- .locals 5
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljava/lang/String;",
- "Ljava/lang/Class<",
- "*>;",
- "Ljava/lang/Object;",
- ")Z"
- }
- .end annotation
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/lang/reflect/InvocationTargetException;,
- Ljava/lang/IllegalAccessException;
- }
- .end annotation
- :try_start_0
- const-string v0, "isCleartextTrafficPermitted"
- const/4 v1, 0x1
- new-array v2, v1, [Ljava/lang/Class;
- const-class v3, Ljava/lang/String;
- const/4 v4, 0x0
- aput-object v3, v2, v4
- invoke-virtual {p2, v0, v2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object v0
- new-array v1, v1, [Ljava/lang/Object;
- aput-object p1, v1, v4
- invoke-virtual {v0, p3, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object v0
- check-cast v0, Ljava/lang/Boolean;
- invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z
- move-result p1
- :try_end_0
- .catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
- return p1
- :catch_0
- invoke-direct {p0, p1, p2, p3}, Lokhttp3/internal/platform/AndroidPlatform;->api23IsCleartextTrafficPermitted(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/Object;)Z
- move-result p1
- return p1
- .end method
- .method public static buildIfSupported()Lokhttp3/internal/platform/Platform;
- .locals 10
- const-class v0, [B
- const-string v1, "com.android.org.conscrypt.SSLParametersImpl"
- const/4 v2, 0x0
- :try_start_0
- invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
- move-result-object v1
- :try_end_0
- .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
- :goto_0
- move-object v4, v1
- goto :goto_1
- :catch_0
- const-string v1, "org.apache.harmony.xnet.provider.jsse.SSLParametersImpl"
- :try_start_1
- invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
- move-result-object v1
- goto :goto_0
- :goto_1
- new-instance v5, Lokhttp3/internal/platform/OptionalMethod;
- const-string v1, "setUseSessionTickets"
- const/4 v3, 0x1
- new-array v6, v3, [Ljava/lang/Class;
- sget-object v7, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;
- const/4 v8, 0x0
- aput-object v7, v6, v8
- invoke-direct {v5, v2, v1, v6}, Lokhttp3/internal/platform/OptionalMethod;-><init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V
- new-instance v6, Lokhttp3/internal/platform/OptionalMethod;
- const-string v1, "setHostname"
- new-array v7, v3, [Ljava/lang/Class;
- const-class v9, Ljava/lang/String;
- aput-object v9, v7, v8
- invoke-direct {v6, v2, v1, v7}, Lokhttp3/internal/platform/OptionalMethod;-><init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V
- invoke-static {}, Lokhttp3/internal/platform/AndroidPlatform;->supportsAlpn()Z
- move-result v1
- if-eqz v1, :cond_0
- new-instance v1, Lokhttp3/internal/platform/OptionalMethod;
- const-string v7, "getAlpnSelectedProtocol"
- new-array v9, v8, [Ljava/lang/Class;
- invoke-direct {v1, v0, v7, v9}, Lokhttp3/internal/platform/OptionalMethod;-><init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V
- new-instance v7, Lokhttp3/internal/platform/OptionalMethod;
- const-string v9, "setAlpnProtocols"
- new-array v3, v3, [Ljava/lang/Class;
- aput-object v0, v3, v8
- invoke-direct {v7, v2, v9, v3}, Lokhttp3/internal/platform/OptionalMethod;-><init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V
- move-object v8, v7
- move-object v7, v1
- goto :goto_2
- :cond_0
- move-object v7, v2
- move-object v8, v7
- :goto_2
- new-instance v0, Lokhttp3/internal/platform/AndroidPlatform;
- move-object v3, v0
- invoke-direct/range {v3 .. v8}, Lokhttp3/internal/platform/AndroidPlatform;-><init>(Ljava/lang/Class;Lokhttp3/internal/platform/OptionalMethod;Lokhttp3/internal/platform/OptionalMethod;Lokhttp3/internal/platform/OptionalMethod;Lokhttp3/internal/platform/OptionalMethod;)V
- :try_end_1
- .catch Ljava/lang/ClassNotFoundException; {:try_start_1 .. :try_end_1} :catch_1
- return-object v0
- :catch_1
- return-object v2
- .end method
- .method private static supportsAlpn()Z
- .locals 2
- const-string v0, "GMSCore_OpenSSL"
- invoke-static {v0}, Ljava/security/Security;->getProvider(Ljava/lang/String;)Ljava/security/Provider;
- move-result-object v0
- const/4 v1, 0x1
- if-eqz v0, :cond_0
- return v1
- :cond_0
- const-string v0, "android.net.Network"
- :try_start_0
- invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
- :try_end_0
- .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
- return v1
- :catch_0
- const/4 v0, 0x0
- return v0
- .end method
- # virtual methods
- .method public buildCertificateChainCleaner(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/tls/CertificateChainCleaner;
- .locals 7
- const-string v0, "android.net.http.X509TrustManagerExtensions"
- :try_start_0
- invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
- move-result-object v0
- const/4 v1, 0x1
- new-array v2, v1, [Ljava/lang/Class;
- const-class v3, Ljavax/net/ssl/X509TrustManager;
- const/4 v4, 0x0
- aput-object v3, v2, v4
- invoke-virtual {v0, v2}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
- move-result-object v2
- new-array v3, v1, [Ljava/lang/Object;
- aput-object p1, v3, v4
- invoke-virtual {v2, v3}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object v2
- const-string v3, "checkServerTrusted"
- const/4 v5, 0x3
- new-array v5, v5, [Ljava/lang/Class;
- const-class v6, [Ljava/security/cert/X509Certificate;
- aput-object v6, v5, v4
- const-class v4, Ljava/lang/String;
- aput-object v4, v5, v1
- const/4 v1, 0x2
- const-class v4, Ljava/lang/String;
- aput-object v4, v5, v1
- invoke-virtual {v0, v3, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object v0
- new-instance v1, Lokhttp3/internal/platform/AndroidPlatform$AndroidCertificateChainCleaner;
- invoke-direct {v1, v2, v0}, Lokhttp3/internal/platform/AndroidPlatform$AndroidCertificateChainCleaner;-><init>(Ljava/lang/Object;Ljava/lang/reflect/Method;)V
- :try_end_0
- .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
- return-object v1
- :catch_0
- invoke-super {p0, p1}, Lokhttp3/internal/platform/Platform;->buildCertificateChainCleaner(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/tls/CertificateChainCleaner;
- move-result-object p1
- return-object p1
- .end method
- .method public buildTrustRootIndex(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/tls/TrustRootIndex;
- .locals 6
- :try_start_0
- invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
- move-result-object v0
- const-string v1, "findTrustAnchorByIssuerAndSignature"
- const/4 v2, 0x1
- new-array v3, v2, [Ljava/lang/Class;
- const/4 v4, 0x0
- const-class v5, Ljava/security/cert/X509Certificate;
- aput-object v5, v3, v4
- invoke-virtual {v0, v1, v3}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object v0
- invoke-virtual {v0, v2}, Ljava/lang/reflect/Method;->setAccessible(Z)V
- new-instance v1, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;
- invoke-direct {v1, p1, v0}, Lokhttp3/internal/platform/AndroidPlatform$AndroidTrustRootIndex;-><init>(Ljavax/net/ssl/X509TrustManager;Ljava/lang/reflect/Method;)V
- :try_end_0
- .catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
- return-object v1
- :catch_0
- invoke-super {p0, p1}, Lokhttp3/internal/platform/Platform;->buildTrustRootIndex(Ljavax/net/ssl/X509TrustManager;)Lokhttp3/internal/tls/TrustRootIndex;
- move-result-object p1
- return-object p1
- .end method
- .method public configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
- .locals 5
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljavax/net/ssl/SSLSocket;",
- "Ljava/lang/String;",
- "Ljava/util/List<",
- "Lokhttp3/Protocol;",
- ">;)V"
- }
- .end annotation
- const/4 v0, 0x0
- const/4 v1, 0x1
- if-eqz p2, :cond_0
- iget-object v2, p0, Lokhttp3/internal/platform/AndroidPlatform;->setUseSessionTickets:Lokhttp3/internal/platform/OptionalMethod;
- new-array v3, v1, [Ljava/lang/Object;
- invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
- move-result-object v4
- aput-object v4, v3, v0
- invoke-virtual {v2, p1, v3}, Lokhttp3/internal/platform/OptionalMethod;->invokeOptionalWithoutCheckedException(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- iget-object v2, p0, Lokhttp3/internal/platform/AndroidPlatform;->setHostname:Lokhttp3/internal/platform/OptionalMethod;
- new-array v3, v1, [Ljava/lang/Object;
- aput-object p2, v3, v0
- invoke-virtual {v2, p1, v3}, Lokhttp3/internal/platform/OptionalMethod;->invokeOptionalWithoutCheckedException(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- :cond_0
- iget-object p2, p0, Lokhttp3/internal/platform/AndroidPlatform;->setAlpnProtocols:Lokhttp3/internal/platform/OptionalMethod;
- if-eqz p2, :cond_1
- invoke-virtual {p2, p1}, Lokhttp3/internal/platform/OptionalMethod;->isSupported(Ljava/lang/Object;)Z
- move-result p2
- if-eqz p2, :cond_1
- new-array p2, v1, [Ljava/lang/Object;
- invoke-static {p3}, Lokhttp3/internal/platform/Platform;->concatLengthPrefixed(Ljava/util/List;)[B
- move-result-object p3
- aput-object p3, p2, v0
- iget-object p3, p0, Lokhttp3/internal/platform/AndroidPlatform;->setAlpnProtocols:Lokhttp3/internal/platform/OptionalMethod;
- invoke-virtual {p3, p1, p2}, Lokhttp3/internal/platform/OptionalMethod;->invokeWithoutCheckedException(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- :cond_1
- 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
- :try_start_0
- invoke-virtual {p1, p2, p3}, Ljava/net/Socket;->connect(Ljava/net/SocketAddress;I)V
- :try_end_0
- .catch Ljava/lang/AssertionError; {:try_start_0 .. :try_end_0} :catch_1
- .catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_0
- return-void
- :catch_0
- move-exception p1
- new-instance p2, Ljava/io/IOException;
- const-string p3, "Exception in connect"
- invoke-direct {p2, p3}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
- invoke-virtual {p2, p1}, Ljava/io/IOException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
- throw p2
- :catch_1
- move-exception p1
- invoke-static {p1}, Lokhttp3/internal/Util;->isAndroidGetsocknameError(Ljava/lang/AssertionError;)Z
- move-result p2
- if-eqz p2, :cond_0
- new-instance p2, Ljava/io/IOException;
- invoke-direct {p2, p1}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V
- throw p2
- :cond_0
- throw p1
- .end method
- .method public getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
- .locals 3
- iget-object v0, p0, Lokhttp3/internal/platform/AndroidPlatform;->getAlpnSelectedProtocol:Lokhttp3/internal/platform/OptionalMethod;
- const/4 v1, 0x0
- if-nez v0, :cond_0
- return-object v1
- :cond_0
- invoke-virtual {v0, p1}, Lokhttp3/internal/platform/OptionalMethod;->isSupported(Ljava/lang/Object;)Z
- move-result v0
- if-nez v0, :cond_1
- return-object v1
- :cond_1
- iget-object v0, p0, Lokhttp3/internal/platform/AndroidPlatform;->getAlpnSelectedProtocol:Lokhttp3/internal/platform/OptionalMethod;
- const/4 v2, 0x0
- new-array v2, v2, [Ljava/lang/Object;
- invoke-virtual {v0, p1, v2}, Lokhttp3/internal/platform/OptionalMethod;->invokeWithoutCheckedException(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object p1
- check-cast p1, [B
- if-eqz p1, :cond_2
- new-instance v1, Ljava/lang/String;
- sget-object v0, Lokhttp3/internal/Util;->UTF_8:Ljava/nio/charset/Charset;
- invoke-direct {v1, p1, v0}, Ljava/lang/String;-><init>([BLjava/nio/charset/Charset;)V
- :cond_2
- return-object v1
- .end method
- .method public getStackTraceForCloseable(Ljava/lang/String;)Ljava/lang/Object;
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/platform/AndroidPlatform;->closeGuard:Lokhttp3/internal/platform/AndroidPlatform$CloseGuard;
- invoke-virtual {v0, p1}, Lokhttp3/internal/platform/AndroidPlatform$CloseGuard;->createAndOpen(Ljava/lang/String;)Ljava/lang/Object;
- move-result-object p1
- return-object p1
- .end method
- .method public isCleartextTrafficPermitted(Ljava/lang/String;)Z
- .locals 4
- const-string v0, "android.security.NetworkSecurityPolicy"
- :try_start_0
- invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
- move-result-object v0
- const-string v1, "getInstance"
- const/4 v2, 0x0
- new-array v3, v2, [Ljava/lang/Class;
- invoke-virtual {v0, v1, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object v1
- const/4 v3, 0x0
- new-array v2, v2, [Ljava/lang/Object;
- invoke-virtual {v1, v3, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object v1
- invoke-direct {p0, p1, v0, v1}, Lokhttp3/internal/platform/AndroidPlatform;->api24IsCleartextTrafficPermitted(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/Object;)Z
- move-result p1
- :try_end_0
- .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_3
- .catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_3
- .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_2
- .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_1
- .catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
- return p1
- :catch_0
- move-exception p1
- goto :goto_0
- :catch_1
- move-exception p1
- goto :goto_0
- :catch_2
- move-exception p1
- :goto_0
- const-string v0, "unable to determine cleartext support"
- invoke-static {v0, p1}, Lokhttp3/internal/Util;->assertionError(Ljava/lang/String;Ljava/lang/Exception;)Ljava/lang/AssertionError;
- move-result-object p1
- throw p1
- :catch_3
- invoke-super {p0, p1}, Lokhttp3/internal/platform/Platform;->isCleartextTrafficPermitted(Ljava/lang/String;)Z
- move-result p1
- return p1
- .end method
- .method public log(ILjava/lang/String;Ljava/lang/Throwable;)V
- .locals 5
- const/4 v0, 0x5
- if-ne p1, v0, :cond_0
- goto :goto_0
- :cond_0
- const/4 v0, 0x3
- :goto_0
- const/16 p1, 0xa
- if-eqz p3, :cond_1
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
- invoke-static {p3}, Landroid/util/Log;->getStackTraceString(Ljava/lang/Throwable;)Ljava/lang/String;
- move-result-object p2
- invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p2
- :cond_1
- const/4 p3, 0x0
- invoke-virtual {p2}, Ljava/lang/String;->length()I
- move-result v1
- :goto_1
- if-ge p3, v1, :cond_4
- invoke-virtual {p2, p1, p3}, Ljava/lang/String;->indexOf(II)I
- move-result v2
- const/4 v3, -0x1
- if-eq v2, v3, :cond_2
- goto :goto_2
- :cond_2
- move v2, v1
- :goto_2
- add-int/lit16 v3, p3, 0xfa0
- invoke-static {v2, v3}, Ljava/lang/Math;->min(II)I
- move-result v3
- invoke-virtual {p2, p3, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;
- move-result-object p3
- const-string v4, "OkHttp"
- invoke-static {v0, v4, p3}, Landroid/util/Log;->println(ILjava/lang/String;Ljava/lang/String;)I
- if-lt v3, v2, :cond_3
- add-int/lit8 p3, v3, 0x1
- goto :goto_1
- :cond_3
- move p3, v3
- goto :goto_2
- :cond_4
- return-void
- .end method
- .method public logCloseableLeak(Ljava/lang/String;Ljava/lang/Object;)V
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/platform/AndroidPlatform;->closeGuard:Lokhttp3/internal/platform/AndroidPlatform$CloseGuard;
- invoke-virtual {v0, p2}, Lokhttp3/internal/platform/AndroidPlatform$CloseGuard;->warnIfOpen(Ljava/lang/Object;)Z
- move-result p2
- if-nez p2, :cond_0
- const/4 p2, 0x5
- const/4 v0, 0x0
- invoke-virtual {p0, p2, p1, v0}, Lokhttp3/internal/platform/AndroidPlatform;->log(ILjava/lang/String;Ljava/lang/Throwable;)V
- :cond_0
- return-void
- .end method
- .method public trustManager(Ljavax/net/ssl/SSLSocketFactory;)Ljavax/net/ssl/X509TrustManager;
- .locals 4
- iget-object v0, p0, Lokhttp3/internal/platform/AndroidPlatform;->sslParametersClass:Ljava/lang/Class;
- const-string v1, "sslParameters"
- invoke-static {p1, v0, v1}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
- move-result-object v0
- if-nez v0, :cond_0
- :try_start_0
- const-string v0, "com.google.android.gms.org.conscrypt.SSLParametersImpl"
- const/4 v2, 0x0
- invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
- move-result-object v3
- invoke-virtual {v3}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
- move-result-object v3
- invoke-static {v0, v2, v3}, Ljava/lang/Class;->forName(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;
- move-result-object v0
- invoke-static {p1, v0, v1}, Lokhttp3/internal/platform/Platform;->readFieldOrNull(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
- move-result-object v0
- :try_end_0
- .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
- goto :goto_0
- :catch_0
- invoke-super {p0, p1}, Lokhttp3/internal/platform/Platform;->trustManager(Ljavax/net/ssl/SSLSocketFactory;)Ljavax/net/ssl/X509TrustManager;
- move-result-object p1
- return-object p1
- :cond_0
- :goto_0
- const-class p1, Ljavax/net/ssl/X509TrustManager;
- const-string v1, "x509TrustManager"
- invoke-static {v0, p1, v1}, 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;
- if-eqz p1, :cond_1
- return-object p1
- :cond_1
- const-class p1, Ljavax/net/ssl/X509TrustManager;
- const-string v1, "trustManager"
- invoke-static {v0, p1, v1}, 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;
- return-object p1
- .end method
|