.class public final Lokhttp3/internal/http/OkHeaders; .super Ljava/lang/Object; .source "OkHeaders.java" # static fields .field static final PREFIX:Ljava/lang/String; .field public static final RECEIVED_MILLIS:Ljava/lang/String; .field public static final RESPONSE_SOURCE:Ljava/lang/String; .field public static final SELECTED_PROTOCOL:Ljava/lang/String; .field public static final SENT_MILLIS:Ljava/lang/String; # direct methods .method static constructor ()V .locals 2 .prologue invoke-static {}, Lokhttp3/internal/Platform;->get()Lokhttp3/internal/Platform; move-result-object v0 invoke-virtual {v0}, Lokhttp3/internal/Platform;->getPrefix()Ljava/lang/String; move-result-object v0 sput-object v0, Lokhttp3/internal/http/OkHeaders;->PREFIX:Ljava/lang/String; new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V sget-object v1, Lokhttp3/internal/http/OkHeaders;->PREFIX:Ljava/lang/String; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, "-Sent-Millis" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 sput-object v0, Lokhttp3/internal/http/OkHeaders;->SENT_MILLIS:Ljava/lang/String; new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V sget-object v1, Lokhttp3/internal/http/OkHeaders;->PREFIX:Ljava/lang/String; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, "-Received-Millis" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 sput-object v0, Lokhttp3/internal/http/OkHeaders;->RECEIVED_MILLIS:Ljava/lang/String; new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V sget-object v1, Lokhttp3/internal/http/OkHeaders;->PREFIX:Ljava/lang/String; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, "-Selected-Protocol" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 sput-object v0, Lokhttp3/internal/http/OkHeaders;->SELECTED_PROTOCOL:Ljava/lang/String; new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V sget-object v1, Lokhttp3/internal/http/OkHeaders;->PREFIX:Ljava/lang/String; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, "-Response-Source" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 sput-object v0, Lokhttp3/internal/http/OkHeaders;->RESPONSE_SOURCE:Ljava/lang/String; return-void .end method .method private constructor ()V .locals 0 .prologue invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public static contentLength(Lokhttp3/Headers;)J .locals 2 .param p0, "headers" # Lokhttp3/Headers; .prologue const-string v0, "Content-Length" invoke-virtual {p0, v0}, Lokhttp3/Headers;->get(Ljava/lang/String;)Ljava/lang/String; move-result-object v0 invoke-static {v0}, Lokhttp3/internal/http/OkHeaders;->stringToLong(Ljava/lang/String;)J move-result-wide v0 return-wide v0 .end method .method public static contentLength(Lokhttp3/Request;)J .locals 2 .param p0, "request" # Lokhttp3/Request; .prologue invoke-virtual {p0}, Lokhttp3/Request;->headers()Lokhttp3/Headers; move-result-object v0 invoke-static {v0}, Lokhttp3/internal/http/OkHeaders;->contentLength(Lokhttp3/Headers;)J move-result-wide v0 return-wide v0 .end method .method public static contentLength(Lokhttp3/Response;)J .locals 2 .param p0, "response" # Lokhttp3/Response; .prologue invoke-virtual {p0}, Lokhttp3/Response;->headers()Lokhttp3/Headers; move-result-object v0 invoke-static {v0}, Lokhttp3/internal/http/OkHeaders;->contentLength(Lokhttp3/Headers;)J move-result-wide v0 return-wide v0 .end method .method public static hasVaryAll(Lokhttp3/Headers;)Z .locals 2 .param p0, "responseHeaders" # Lokhttp3/Headers; .prologue invoke-static {p0}, Lokhttp3/internal/http/OkHeaders;->varyFields(Lokhttp3/Headers;)Ljava/util/Set; move-result-object v0 const-string v1, "*" invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z move-result v0 return v0 .end method .method public static hasVaryAll(Lokhttp3/Response;)Z .locals 1 .param p0, "response" # Lokhttp3/Response; .prologue invoke-virtual {p0}, Lokhttp3/Response;->headers()Lokhttp3/Headers; move-result-object v0 invoke-static {v0}, Lokhttp3/internal/http/OkHeaders;->hasVaryAll(Lokhttp3/Headers;)Z move-result v0 return v0 .end method .method static isEndToEnd(Ljava/lang/String;)Z .locals 1 .param p0, "fieldName" # Ljava/lang/String; .prologue const-string v0, "Connection" invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v0 if-nez v0, :cond_0 const-string v0, "Keep-Alive" invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v0 if-nez v0, :cond_0 const-string v0, "Proxy-Authenticate" invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v0 if-nez v0, :cond_0 const-string v0, "Proxy-Authorization" invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v0 if-nez v0, :cond_0 const-string v0, "TE" invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v0 if-nez v0, :cond_0 const-string v0, "Trailers" invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v0 if-nez v0, :cond_0 const-string v0, "Transfer-Encoding" invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v0 if-nez v0, :cond_0 const-string v0, "Upgrade" invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v0 if-nez v0, :cond_0 const/4 v0, 0x1 :goto_0 return v0 :cond_0 const/4 v0, 0x0 goto :goto_0 .end method .method public static parseChallenges(Lokhttp3/Headers;Ljava/lang/String;)Ljava/util/List; .locals 13 .param p0, "responseHeaders" # Lokhttp3/Headers; .param p1, "challengeHeader" # Ljava/lang/String; .annotation system Ldalvik/annotation/Signature; value = { "(", "Lokhttp3/Headers;", "Ljava/lang/String;", ")", "Ljava/util/List", "<", "Lokhttp3/Challenge;", ">;" } .end annotation .prologue new-instance v9, Ljava/util/ArrayList; invoke-direct {v9}, Ljava/util/ArrayList;->()V .local v9, "result":Ljava/util/List;, "Ljava/util/List;" const/4 v6, 0x0 .local v6, "i":I invoke-virtual {p0}, Lokhttp3/Headers;->size()I move-result v11 .local v11, "size":I :goto_0 if-ge v6, v11, :cond_2 invoke-virtual {p0, v6}, Lokhttp3/Headers;->name(I)Ljava/lang/String; move-result-object v1 invoke-virtual {p1, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v1 if-nez v1, :cond_1 :cond_0 add-int/lit8 v6, v6, 0x1 goto :goto_0 :cond_1 invoke-virtual {p0, v6}, Lokhttp3/Headers;->value(I)Ljava/lang/String; move-result-object v0 .local v0, "value":Ljava/lang/String; const/4 v2, 0x0 .local v2, "pos":I :goto_1 invoke-virtual {v0}, Ljava/lang/String;->length()I move-result v1 if-ge v2, v1, :cond_0 move v12, v2 .local v12, "tokenStart":I const-string v1, " " invoke-static {v0, v2, v1}, Lokhttp3/internal/http/HeaderParser;->skipUntil(Ljava/lang/String;ILjava/lang/String;)I move-result v2 invoke-virtual {v0, v12, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String; move-result-object v1 invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String; move-result-object v10 .local v10, "scheme":Ljava/lang/String; invoke-static {v0, v2}, Lokhttp3/internal/http/HeaderParser;->skipWhitespace(Ljava/lang/String;I)I move-result v2 const/4 v1, 0x1 const-string v3, "realm=\"" const/4 v4, 0x0 const-string v5, "realm=\"" invoke-virtual {v5}, Ljava/lang/String;->length()I move-result v5 invoke-virtual/range {v0 .. v5}, Ljava/lang/String;->regionMatches(ZILjava/lang/String;II)Z move-result v1 if-eqz v1, :cond_0 const-string v1, "realm=\"" invoke-virtual {v1}, Ljava/lang/String;->length()I move-result v1 add-int/2addr v2, v1 move v8, v2 .local v8, "realmStart":I const-string v1, "\"" invoke-static {v0, v2, v1}, Lokhttp3/internal/http/HeaderParser;->skipUntil(Ljava/lang/String;ILjava/lang/String;)I move-result v2 invoke-virtual {v0, v8, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String; move-result-object v7 .local v7, "realm":Ljava/lang/String; add-int/lit8 v2, v2, 0x1 const-string v1, "," invoke-static {v0, v2, v1}, Lokhttp3/internal/http/HeaderParser;->skipUntil(Ljava/lang/String;ILjava/lang/String;)I move-result v2 add-int/lit8 v2, v2, 0x1 invoke-static {v0, v2}, Lokhttp3/internal/http/HeaderParser;->skipWhitespace(Ljava/lang/String;I)I move-result v2 new-instance v1, Lokhttp3/Challenge; invoke-direct {v1, v10, v7}, Lokhttp3/Challenge;->(Ljava/lang/String;Ljava/lang/String;)V invoke-interface {v9, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z goto :goto_1 .end local v0 # "value":Ljava/lang/String; .end local v2 # "pos":I .end local v7 # "realm":Ljava/lang/String; .end local v8 # "realmStart":I .end local v10 # "scheme":Ljava/lang/String; .end local v12 # "tokenStart":I :cond_2 return-object v9 .end method .method private static stringToLong(Ljava/lang/String;)J .locals 4 .param p0, "s" # Ljava/lang/String; .prologue const-wide/16 v2, -0x1 if-nez p0, :cond_0 :goto_0 return-wide v2 :cond_0 :try_start_0 invoke-static {p0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J :try_end_0 .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0 move-result-wide v2 goto :goto_0 :catch_0 move-exception v0 .local v0, "e":Ljava/lang/NumberFormatException; goto :goto_0 .end method .method public static varyFields(Lokhttp3/Headers;)Ljava/util/Set; .locals 9 .param p0, "responseHeaders" # Lokhttp3/Headers; .annotation system Ldalvik/annotation/Signature; value = { "(", "Lokhttp3/Headers;", ")", "Ljava/util/Set", "<", "Ljava/lang/String;", ">;" } .end annotation .prologue invoke-static {}, Ljava/util/Collections;->emptySet()Ljava/util/Set; move-result-object v1 .local v1, "result":Ljava/util/Set;, "Ljava/util/Set;" const/4 v0, 0x0 .local v0, "i":I invoke-virtual {p0}, Lokhttp3/Headers;->size()I move-result v2 .local v2, "size":I :goto_0 if-ge v0, v2, :cond_3 const-string v5, "Vary" invoke-virtual {p0, v0}, Lokhttp3/Headers;->name(I)Ljava/lang/String; move-result-object v6 invoke-virtual {v5, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v5 if-nez v5, :cond_1 :cond_0 add-int/lit8 v0, v0, 0x1 goto :goto_0 :cond_1 invoke-virtual {p0, v0}, Lokhttp3/Headers;->value(I)Ljava/lang/String; move-result-object v3 .local v3, "value":Ljava/lang/String; invoke-interface {v1}, Ljava/util/Set;->isEmpty()Z move-result v5 if-eqz v5, :cond_2 new-instance v1, Ljava/util/TreeSet; .end local v1 # "result":Ljava/util/Set;, "Ljava/util/Set;" sget-object v5, Ljava/lang/String;->CASE_INSENSITIVE_ORDER:Ljava/util/Comparator; invoke-direct {v1, v5}, Ljava/util/TreeSet;->(Ljava/util/Comparator;)V .restart local v1 # "result":Ljava/util/Set;, "Ljava/util/Set;" :cond_2 const-string v5, "," invoke-virtual {v3, v5}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String; move-result-object v6 array-length v7, v6 const/4 v5, 0x0 :goto_1 if-ge v5, v7, :cond_0 aget-object v4, v6, v5 .local v4, "varyField":Ljava/lang/String; invoke-virtual {v4}, Ljava/lang/String;->trim()Ljava/lang/String; move-result-object v8 invoke-interface {v1, v8}, Ljava/util/Set;->add(Ljava/lang/Object;)Z add-int/lit8 v5, v5, 0x1 goto :goto_1 .end local v3 # "value":Ljava/lang/String; .end local v4 # "varyField":Ljava/lang/String; :cond_3 return-object v1 .end method .method private static varyFields(Lokhttp3/Response;)Ljava/util/Set; .locals 1 .param p0, "response" # Lokhttp3/Response; .annotation system Ldalvik/annotation/Signature; value = { "(", "Lokhttp3/Response;", ")", "Ljava/util/Set", "<", "Ljava/lang/String;", ">;" } .end annotation .prologue invoke-virtual {p0}, Lokhttp3/Response;->headers()Lokhttp3/Headers; move-result-object v0 invoke-static {v0}, Lokhttp3/internal/http/OkHeaders;->varyFields(Lokhttp3/Headers;)Ljava/util/Set; move-result-object v0 return-object v0 .end method .method public static varyHeaders(Lokhttp3/Headers;Lokhttp3/Headers;)Lokhttp3/Headers; .locals 6 .param p0, "requestHeaders" # Lokhttp3/Headers; .param p1, "responseHeaders" # Lokhttp3/Headers; .prologue invoke-static {p1}, Lokhttp3/internal/http/OkHeaders;->varyFields(Lokhttp3/Headers;)Ljava/util/Set; move-result-object v4 .local v4, "varyFields":Ljava/util/Set;, "Ljava/util/Set;" invoke-interface {v4}, Ljava/util/Set;->isEmpty()Z move-result v5 if-eqz v5, :cond_0 new-instance v5, Lokhttp3/Headers$Builder; invoke-direct {v5}, Lokhttp3/Headers$Builder;->()V invoke-virtual {v5}, Lokhttp3/Headers$Builder;->build()Lokhttp3/Headers; move-result-object v5 :goto_0 return-object v5 :cond_0 new-instance v2, Lokhttp3/Headers$Builder; invoke-direct {v2}, Lokhttp3/Headers$Builder;->()V .local v2, "result":Lokhttp3/Headers$Builder; const/4 v1, 0x0 .local v1, "i":I invoke-virtual {p0}, Lokhttp3/Headers;->size()I move-result v3 .local v3, "size":I :goto_1 if-ge v1, v3, :cond_2 invoke-virtual {p0, v1}, Lokhttp3/Headers;->name(I)Ljava/lang/String; move-result-object v0 .local v0, "fieldName":Ljava/lang/String; invoke-interface {v4, v0}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z move-result v5 if-eqz v5, :cond_1 invoke-virtual {p0, v1}, Lokhttp3/Headers;->value(I)Ljava/lang/String; move-result-object v5 invoke-virtual {v2, v0, v5}, Lokhttp3/Headers$Builder;->add(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder; :cond_1 add-int/lit8 v1, v1, 0x1 goto :goto_1 .end local v0 # "fieldName":Ljava/lang/String; :cond_2 invoke-virtual {v2}, Lokhttp3/Headers$Builder;->build()Lokhttp3/Headers; move-result-object v5 goto :goto_0 .end method .method public static varyHeaders(Lokhttp3/Response;)Lokhttp3/Headers; .locals 3 .param p0, "response" # Lokhttp3/Response; .prologue invoke-virtual {p0}, Lokhttp3/Response;->networkResponse()Lokhttp3/Response; move-result-object v2 invoke-virtual {v2}, Lokhttp3/Response;->request()Lokhttp3/Request; move-result-object v2 invoke-virtual {v2}, Lokhttp3/Request;->headers()Lokhttp3/Headers; move-result-object v0 .local v0, "requestHeaders":Lokhttp3/Headers; invoke-virtual {p0}, Lokhttp3/Response;->headers()Lokhttp3/Headers; move-result-object v1 .local v1, "responseHeaders":Lokhttp3/Headers; invoke-static {v0, v1}, Lokhttp3/internal/http/OkHeaders;->varyHeaders(Lokhttp3/Headers;Lokhttp3/Headers;)Lokhttp3/Headers; move-result-object v2 return-object v2 .end method .method public static varyMatches(Lokhttp3/Response;Lokhttp3/Headers;Lokhttp3/Request;)Z .locals 4 .param p0, "cachedResponse" # Lokhttp3/Response; .param p1, "cachedRequest" # Lokhttp3/Headers; .param p2, "newRequest" # Lokhttp3/Request; .prologue invoke-static {p0}, Lokhttp3/internal/http/OkHeaders;->varyFields(Lokhttp3/Response;)Ljava/util/Set; move-result-object v1 invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator; move-result-object v1 :cond_0 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v2 if-eqz v2, :cond_1 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/lang/String; .local v0, "field":Ljava/lang/String; invoke-virtual {p1, v0}, Lokhttp3/Headers;->values(Ljava/lang/String;)Ljava/util/List; move-result-object v2 invoke-virtual {p2, v0}, Lokhttp3/Request;->headers(Ljava/lang/String;)Ljava/util/List; move-result-object v3 invoke-static {v2, v3}, Lokhttp3/internal/Util;->equal(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v2 if-nez v2, :cond_0 const/4 v1, 0x0 .end local v0 # "field":Ljava/lang/String; :goto_0 return v1 :cond_1 const/4 v1, 0x1 goto :goto_0 .end method