.class public final Lokhttp3/internal/http/BridgeInterceptor; .super Ljava/lang/Object; .source "BridgeInterceptor.kt" # interfaces .implements Lokhttp3/Interceptor; # annotations .annotation system Ldalvik/annotation/SourceDebugExtension; value = "SMAP\nBridgeInterceptor.kt\nKotlin\n*S Kotlin\n*F\n+ 1 BridgeInterceptor.kt\nokhttp3/internal/http/BridgeInterceptor\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,117:1\n1808#2,3:118\n*E\n*S KotlinDebug\n*F\n+ 1 BridgeInterceptor.kt\nokhttp3/internal/http/BridgeInterceptor\n*L\n111#1,3:118\n*E\n" .end annotation .annotation runtime Lkotlin/Metadata; bv = { 0x1, 0x0, 0x3 } d1 = { "\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\u0002\u0010\u0004J\u0016\u0010\u0005\u001a\u00020\u00062\u000c\u0010\u0007\u001a\u0008\u0012\u0004\u0012\u00020\t0\u0008H\u0002J\u0010\u0010\n\u001a\u00020\u000b2\u0006\u0010\u000c\u001a\u00020\rH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u000e" } d2 = { "Lokhttp3/internal/http/BridgeInterceptor;", "Lokhttp3/Interceptor;", "cookieJar", "Lokhttp3/CookieJar;", "(Lokhttp3/CookieJar;)V", "cookieHeader", "", "cookies", "", "Lokhttp3/Cookie;", "intercept", "Lokhttp3/Response;", "chain", "Lokhttp3/Interceptor$Chain;", "okhttp" } k = 0x1 mv = { 0x1, 0x4, 0x0 } .end annotation # instance fields .field private final cookieJar:Lokhttp3/CookieJar; # direct methods .method public constructor (Lokhttp3/CookieJar;)V .locals 1 const-string v0, "cookieJar" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 34 invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lokhttp3/internal/http/BridgeInterceptor;->cookieJar:Lokhttp3/CookieJar; return-void .end method .method private final cookieHeader(Ljava/util/List;)Ljava/lang/String; .locals 4 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/List<", "Lokhttp3/Cookie;", ">;)", "Ljava/lang/String;" } .end annotation .line 110 new-instance p0, Ljava/lang/StringBuilder; invoke-direct {p0}, Ljava/lang/StringBuilder;->()V .line 111 check-cast p1, Ljava/lang/Iterable; .line 119 invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object p1 const/4 v0, 0x0 :goto_0 invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_2 invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 add-int/lit8 v2, v0, 0x1 if-gez v0, :cond_0 invoke-static {}, Lkotlin/collections/CollectionsKt;->throwIndexOverflow()V :cond_0 check-cast v1, Lokhttp3/Cookie; if-lez v0, :cond_1 const-string v0, "; " .line 112 invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; .line 113 :cond_1 invoke-virtual {v1}, Lokhttp3/Cookie;->name()Ljava/lang/String; move-result-object v0 invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const/16 v3, 0x3d invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v1}, Lokhttp3/Cookie;->value()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move v0, v2 goto :goto_0 .line 110 :cond_2 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 const-string p1, "StringBuilder().apply(builderAction).toString()" invoke-static {p0, p1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V return-object p0 .end method # virtual methods .method public intercept(Lokhttp3/Interceptor$Chain;)Lokhttp3/Response; .locals 12 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const-string v0, "chain" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 38 invoke-interface {p1}, Lokhttp3/Interceptor$Chain;->request()Lokhttp3/Request; move-result-object v0 .line 39 invoke-virtual {v0}, Lokhttp3/Request;->newBuilder()Lokhttp3/Request$Builder; move-result-object v1 .line 41 invoke-virtual {v0}, Lokhttp3/Request;->body()Lokhttp3/RequestBody; move-result-object v2 const-string v3, "Content-Type" const-wide/16 v4, -0x1 const-string v6, "Content-Length" if-eqz v2, :cond_2 .line 43 invoke-virtual {v2}, Lokhttp3/RequestBody;->contentType()Lokhttp3/MediaType; move-result-object v7 if-eqz v7, :cond_0 .line 45 invoke-virtual {v7}, Lokhttp3/MediaType;->toString()Ljava/lang/String; move-result-object v7 invoke-virtual {v1, v3, v7}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; .line 48 :cond_0 invoke-virtual {v2}, Lokhttp3/RequestBody;->contentLength()J move-result-wide v7 cmp-long v2, v7, v4 const-string v9, "Transfer-Encoding" if-eqz v2, :cond_1 .line 50 invoke-static {v7, v8}, Ljava/lang/String;->valueOf(J)Ljava/lang/String; move-result-object v2 invoke-virtual {v1, v6, v2}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; .line 51 invoke-virtual {v1, v9}, Lokhttp3/Request$Builder;->removeHeader(Ljava/lang/String;)Lokhttp3/Request$Builder; goto :goto_0 :cond_1 const-string v2, "chunked" .line 53 invoke-virtual {v1, v9, v2}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; .line 54 invoke-virtual {v1, v6}, Lokhttp3/Request$Builder;->removeHeader(Ljava/lang/String;)Lokhttp3/Request$Builder; :cond_2 :goto_0 const-string v2, "Host" .line 58 invoke-virtual {v0, v2}, Lokhttp3/Request;->header(Ljava/lang/String;)Ljava/lang/String; move-result-object v7 const/4 v8, 0x0 const/4 v9, 0x1 const/4 v10, 0x0 if-nez v7, :cond_3 .line 59 invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl; move-result-object v7 invoke-static {v7, v8, v9, v10}, Lokhttp3/internal/Util;->toHostHeader$default(Lokhttp3/HttpUrl;ZILjava/lang/Object;)Ljava/lang/String; move-result-object v7 invoke-virtual {v1, v2, v7}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; :cond_3 const-string v2, "Connection" .line 62 invoke-virtual {v0, v2}, Lokhttp3/Request;->header(Ljava/lang/String;)Ljava/lang/String; move-result-object v7 if-nez v7, :cond_4 const-string v7, "Keep-Alive" .line 63 invoke-virtual {v1, v2, v7}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; :cond_4 const-string v2, "Accept-Encoding" .line 69 invoke-virtual {v0, v2}, Lokhttp3/Request;->header(Ljava/lang/String;)Ljava/lang/String; move-result-object v7 const-string v11, "gzip" if-nez v7, :cond_5 const-string v7, "Range" invoke-virtual {v0, v7}, Lokhttp3/Request;->header(Ljava/lang/String;)Ljava/lang/String; move-result-object v7 if-nez v7, :cond_5 .line 71 invoke-virtual {v1, v2, v11}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; move v8, v9 :cond_5 iget-object v2, p0, Lokhttp3/internal/http/BridgeInterceptor;->cookieJar:Lokhttp3/CookieJar; .line 74 invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl; move-result-object v7 invoke-interface {v2, v7}, Lokhttp3/CookieJar;->loadForRequest(Lokhttp3/HttpUrl;)Ljava/util/List; move-result-object v2 .line 75 move-object v7, v2 check-cast v7, Ljava/util/Collection; invoke-interface {v7}, Ljava/util/Collection;->isEmpty()Z move-result v7 xor-int/2addr v7, v9 if-eqz v7, :cond_6 const-string v7, "Cookie" .line 76 invoke-direct {p0, v2}, Lokhttp3/internal/http/BridgeInterceptor;->cookieHeader(Ljava/util/List;)Ljava/lang/String; move-result-object v2 invoke-virtual {v1, v7, v2}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; :cond_6 const-string v2, "User-Agent" .line 79 invoke-virtual {v0, v2}, Lokhttp3/Request;->header(Ljava/lang/String;)Ljava/lang/String; move-result-object v7 if-nez v7, :cond_7 const-string v7, "okhttp/4.9.1" .line 80 invoke-virtual {v1, v2, v7}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; .line 83 :cond_7 invoke-virtual {v1}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request; move-result-object v1 invoke-interface {p1, v1}, Lokhttp3/Interceptor$Chain;->proceed(Lokhttp3/Request;)Lokhttp3/Response; move-result-object p1 iget-object p0, p0, Lokhttp3/internal/http/BridgeInterceptor;->cookieJar:Lokhttp3/CookieJar; .line 85 invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl; move-result-object v1 invoke-virtual {p1}, Lokhttp3/Response;->headers()Lokhttp3/Headers; move-result-object v2 invoke-static {p0, v1, v2}, Lokhttp3/internal/http/HttpHeaders;->receiveHeaders(Lokhttp3/CookieJar;Lokhttp3/HttpUrl;Lokhttp3/Headers;)V .line 87 invoke-virtual {p1}, Lokhttp3/Response;->newBuilder()Lokhttp3/Response$Builder; move-result-object p0 .line 88 invoke-virtual {p0, v0}, Lokhttp3/Response$Builder;->request(Lokhttp3/Request;)Lokhttp3/Response$Builder; move-result-object p0 if-eqz v8, :cond_8 const-string v0, "Content-Encoding" const/4 v1, 0x2 .line 91 invoke-static {p1, v0, v10, v1, v10}, Lokhttp3/Response;->header$default(Lokhttp3/Response;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String; move-result-object v2 invoke-static {v11, v2, v9}, Lkotlin/text/StringsKt;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z move-result v2 if-eqz v2, :cond_8 .line 92 invoke-static {p1}, Lokhttp3/internal/http/HttpHeaders;->promisesBody(Lokhttp3/Response;)Z move-result v2 if-eqz v2, :cond_8 .line 93 invoke-virtual {p1}, Lokhttp3/Response;->body()Lokhttp3/ResponseBody; move-result-object v2 if-eqz v2, :cond_8 .line 95 new-instance v7, Lokio/GzipSource; invoke-virtual {v2}, Lokhttp3/ResponseBody;->source()Lokio/BufferedSource; move-result-object v2 check-cast v2, Lokio/Source; invoke-direct {v7, v2}, Lokio/GzipSource;->(Lokio/Source;)V .line 96 invoke-virtual {p1}, Lokhttp3/Response;->headers()Lokhttp3/Headers; move-result-object v2 invoke-virtual {v2}, Lokhttp3/Headers;->newBuilder()Lokhttp3/Headers$Builder; move-result-object v2 .line 97 invoke-virtual {v2, v0}, Lokhttp3/Headers$Builder;->removeAll(Ljava/lang/String;)Lokhttp3/Headers$Builder; move-result-object v0 .line 98 invoke-virtual {v0, v6}, Lokhttp3/Headers$Builder;->removeAll(Ljava/lang/String;)Lokhttp3/Headers$Builder; move-result-object v0 .line 99 invoke-virtual {v0}, Lokhttp3/Headers$Builder;->build()Lokhttp3/Headers; move-result-object v0 .line 100 invoke-virtual {p0, v0}, Lokhttp3/Response$Builder;->headers(Lokhttp3/Headers;)Lokhttp3/Response$Builder; .line 101 invoke-static {p1, v3, v10, v1, v10}, Lokhttp3/Response;->header$default(Lokhttp3/Response;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String; move-result-object p1 .line 102 new-instance v0, Lokhttp3/internal/http/RealResponseBody; check-cast v7, Lokio/Source; invoke-static {v7}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource; move-result-object v1 invoke-direct {v0, p1, v4, v5, v1}, Lokhttp3/internal/http/RealResponseBody;->(Ljava/lang/String;JLokio/BufferedSource;)V check-cast v0, Lokhttp3/ResponseBody; invoke-virtual {p0, v0}, Lokhttp3/Response$Builder;->body(Lokhttp3/ResponseBody;)Lokhttp3/Response$Builder; .line 106 :cond_8 invoke-virtual {p0}, Lokhttp3/Response$Builder;->build()Lokhttp3/Response; move-result-object p0 return-object p0 .end method