862 lines
25 KiB
Smali
862 lines
25 KiB
Smali
.class public Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;
|
|
.super Ljava/lang/Object;
|
|
.source "ConfigFetchHttpClient.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final h:Ljava/util/regex/Pattern;
|
|
|
|
|
|
# instance fields
|
|
.field public final a:Landroid/content/Context;
|
|
|
|
.field public final b:Ljava/lang/String;
|
|
|
|
.field public final c:Ljava/lang/String;
|
|
|
|
.field public final d:Ljava/lang/String;
|
|
|
|
.field public final e:Ljava/lang/String;
|
|
|
|
.field public final f:J
|
|
|
|
.field public final g:J
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const-string v0, "^[^:]+:([0-9]+):(android|ios|web):([0-9a-f]+)"
|
|
|
|
invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->h:Ljava/util/regex/Pattern;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JJ)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
iput-object p2, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->b:Ljava/lang/String;
|
|
|
|
iput-object p3, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->c:Ljava/lang/String;
|
|
|
|
sget-object p1, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->h:Ljava/util/regex/Pattern;
|
|
|
|
invoke-virtual {p1, p2}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/util/regex/Matcher;->matches()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
const/4 p2, 0x1
|
|
|
|
invoke-virtual {p1, p2}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
iput-object p1, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->d:Ljava/lang/String;
|
|
|
|
iput-object p4, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->e:Ljava/lang/String;
|
|
|
|
iput-wide p5, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->f:J
|
|
|
|
iput-wide p7, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->g:J
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lorg/json/JSONObject;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/String;",
|
|
">;)",
|
|
"Lorg/json/JSONObject;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigClientException;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
const-string v1, "appInstanceId"
|
|
|
|
invoke-virtual {v0, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
const-string p1, "appInstanceIdToken"
|
|
|
|
invoke-virtual {v0, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iget-object p1, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->b:Ljava/lang/String;
|
|
|
|
const-string p2, "appId"
|
|
|
|
invoke-virtual {v0, p2, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iget-object p1, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p1, p1, Landroid/content/res/Configuration;->locale:Ljava/util/Locale;
|
|
|
|
invoke-virtual {p1}, Ljava/util/Locale;->getCountry()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v1, "countryCode"
|
|
|
|
invoke-virtual {v0, v1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
invoke-virtual {p1}, Ljava/util/Locale;->toLanguageTag()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "languageCode"
|
|
|
|
invoke-virtual {v0, p2, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "platformVersion"
|
|
|
|
invoke-virtual {v0, p2, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
invoke-static {}, Ljava/util/TimeZone;->getDefault()Ljava/util/TimeZone;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/util/TimeZone;->getID()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "timeZone"
|
|
|
|
invoke-virtual {v0, p2, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:try_start_0
|
|
iget-object p1, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p2, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {p2}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {p1, p2, v1}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const-string p2, "appVersion"
|
|
|
|
iget-object p1, p1, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, p2, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:catch_0
|
|
:cond_0
|
|
iget-object p1, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "packageName"
|
|
|
|
invoke-virtual {v0, p2, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
const-string p1, "sdkVersion"
|
|
|
|
const-string p2, "19.2.0"
|
|
|
|
invoke-virtual {v0, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
new-instance p1, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {p1, p3}, Lorg/json/JSONObject;-><init>(Ljava/util/Map;)V
|
|
|
|
const-string p2, "analyticsUserProperties"
|
|
|
|
invoke-virtual {v0, p2, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
new-instance p1, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {p1, v0}, Lorg/json/JSONObject;-><init>(Ljava/util/Map;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
new-instance p1, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigClientException;
|
|
|
|
const-string p2, "Fetch failed: Firebase installation id is null."
|
|
|
|
invoke-direct {p1, p2}, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigClientException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public b()Ljava/net/HttpURLConnection;
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigException;
|
|
}
|
|
.end annotation
|
|
|
|
:try_start_0
|
|
new-instance v0, Ljava/net/URL;
|
|
|
|
iget-object v1, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->d:Ljava/lang/String;
|
|
|
|
iget-object v2, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->e:Ljava/lang/String;
|
|
|
|
const/4 v3, 0x2
|
|
|
|
new-array v3, v3, [Ljava/lang/Object;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
aput-object v1, v3, v4
|
|
|
|
const/4 v1, 0x1
|
|
|
|
aput-object v2, v3, v1
|
|
|
|
const-string v1, "https://firebaseremoteconfig.googleapis.com/v1/projects/%s/namespaces/%s:fetch"
|
|
|
|
invoke-static {v1, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/net/HttpURLConnection;
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object v0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
new-instance v1, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigException;
|
|
|
|
invoke-virtual {v0}, Ljava/io/IOException;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v1, v0}, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public final c(Ljava/net/URLConnection;)Lorg/json/JSONObject;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;,
|
|
Lorg/json/JSONException;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/io/BufferedReader;
|
|
|
|
new-instance v1, Ljava/io/InputStreamReader;
|
|
|
|
invoke-virtual {p1}, Ljava/net/URLConnection;->getInputStream()Ljava/io/InputStream;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v2, "utf-8"
|
|
|
|
invoke-direct {v1, p1, v2}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;Ljava/lang/String;)V
|
|
|
|
invoke-direct {v0, v1}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
|
|
|
|
new-instance p1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
:goto_0
|
|
invoke-virtual {v0}, Ljava/io/BufferedReader;->read()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, -0x1
|
|
|
|
if-eq v1, v2, :cond_0
|
|
|
|
int-to-char v1, v1
|
|
|
|
invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v0, Lorg/json/JSONObject;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final d(Ljava/net/HttpURLConnection;[B)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
array-length v0, p2
|
|
|
|
invoke-virtual {p1, v0}, Ljava/net/HttpURLConnection;->setFixedLengthStreamingMode(I)V
|
|
|
|
new-instance v0, Ljava/io/BufferedOutputStream;
|
|
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->getOutputStream()Ljava/io/OutputStream;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;)V
|
|
|
|
invoke-virtual {v0, p2}, Ljava/io/OutputStream;->write([B)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/OutputStream;->flush()V
|
|
|
|
invoke-virtual {v0}, Ljava/io/OutputStream;->close()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public fetch(Ljava/net/HttpURLConnection;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;Ljava/util/Map;Ljava/util/Date;)Lf/h/c/w/k/k$a;
|
|
.locals 6
|
|
.annotation build Landroidx/annotation/Keep;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/net/HttpURLConnection;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/String;",
|
|
">;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/String;",
|
|
">;",
|
|
"Ljava/util/Date;",
|
|
")",
|
|
"Lf/h/c/w/k/k$a;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-virtual {p1, v0}, Ljava/net/HttpURLConnection;->setDoOutput(Z)V
|
|
|
|
sget-object v1, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
iget-wide v2, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->f:J
|
|
|
|
invoke-virtual {v1, v2, v3}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
move-result-wide v1
|
|
|
|
long-to-int v2, v1
|
|
|
|
invoke-virtual {p1, v2}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V
|
|
|
|
sget-object v1, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
iget-wide v2, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->g:J
|
|
|
|
invoke-virtual {v1, v2, v3}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
move-result-wide v1
|
|
|
|
long-to-int v2, v1
|
|
|
|
invoke-virtual {p1, v2}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V
|
|
|
|
const-string v1, "If-None-Match"
|
|
|
|
invoke-virtual {p1, v1, p5}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
iget-object p5, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->c:Ljava/lang/String;
|
|
|
|
const-string v1, "X-Goog-Api-Key"
|
|
|
|
invoke-virtual {p1, v1, p5}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
iget-object p5, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {p5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p5
|
|
|
|
const-string v1, "X-Android-Package"
|
|
|
|
invoke-virtual {p1, v1, p5}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string p5, "FirebaseRemoteConfig"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:try_start_0
|
|
iget-object v3, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
iget-object v4, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {v4}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-static {v3, v4}, Lf/h/a/f/f/n/a;->a(Landroid/content/Context;Ljava/lang/String;)[B
|
|
|
|
move-result-object v3
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v4, "Could not get fingerprint hash for package: "
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v4, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {v4}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {p5, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-static {v3, v1}, Lf/h/a/f/f/n/d;->a([BZ)Ljava/lang/String;
|
|
|
|
move-result-object p5
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
move-exception v3
|
|
|
|
const-string v4, "No such package: "
|
|
|
|
invoke-static {v4}, Lf/e/c/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v4
|
|
|
|
iget-object v5, p0, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-static {p5, v4, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:goto_0
|
|
move-object p5, v2
|
|
|
|
:goto_1
|
|
const-string v3, "X-Android-Cert"
|
|
|
|
invoke-virtual {p1, v3, p5}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string p5, "X-Google-GFE-Can-Retry"
|
|
|
|
const-string v3, "yes"
|
|
|
|
invoke-virtual {p1, p5, v3}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string p5, "X-Goog-Firebase-Installations-Auth"
|
|
|
|
invoke-virtual {p1, p5, p3}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string p5, "application/json"
|
|
|
|
const-string v3, "Content-Type"
|
|
|
|
invoke-virtual {p1, v3, p5}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string v3, "Accept"
|
|
|
|
invoke-virtual {p1, v3, p5}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-interface {p6}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object p5
|
|
|
|
invoke-interface {p5}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p5
|
|
|
|
:goto_2
|
|
invoke-interface {p5}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p6
|
|
|
|
if-eqz p6, :cond_1
|
|
|
|
invoke-interface {p5}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p6
|
|
|
|
check-cast p6, Ljava/util/Map$Entry;
|
|
|
|
invoke-interface {p6}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/lang/String;
|
|
|
|
invoke-interface {p6}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object p6
|
|
|
|
check-cast p6, Ljava/lang/String;
|
|
|
|
invoke-virtual {p1, v3, p6}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
invoke-virtual {p0, p2, p3, p4}, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->a(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lorg/json/JSONObject;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
const-string p3, "utf-8"
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->d(Ljava/net/HttpURLConnection;[B)V
|
|
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->connect()V
|
|
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->getResponseCode()I
|
|
|
|
move-result p2
|
|
|
|
const/16 p3, 0xc8
|
|
|
|
if-ne p2, p3, :cond_5
|
|
|
|
const-string p2, "ETag"
|
|
|
|
invoke-virtual {p1, p2}, Ljava/net/HttpURLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p0, p1}, Lcom/google/firebase/remoteconfig/internal/ConfigFetchHttpClient;->c(Ljava/net/URLConnection;)Lorg/json/JSONObject;
|
|
|
|
move-result-object p3
|
|
:try_end_1
|
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_9
|
|
.catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_8
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->disconnect()V
|
|
|
|
:try_start_2
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
|
|
:try_end_2
|
|
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1
|
|
|
|
:catch_1
|
|
:try_start_3
|
|
const-string p1, "state"
|
|
|
|
invoke-virtual {p3, p1}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p4, "NO_CHANGE"
|
|
|
|
invoke-virtual {p1, p4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
:try_end_3
|
|
.catch Lorg/json/JSONException; {:try_start_3 .. :try_end_3} :catch_2
|
|
|
|
xor-int/2addr p1, v0
|
|
|
|
goto :goto_3
|
|
|
|
:catch_2
|
|
const/4 p1, 0x1
|
|
|
|
:goto_3
|
|
if-nez p1, :cond_2
|
|
|
|
new-instance p1, Lf/h/c/w/k/k$a;
|
|
|
|
invoke-direct {p1, p7, v0, v2, v2}, Lf/h/c/w/k/k$a;-><init>(Ljava/util/Date;ILf/h/c/w/k/f;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_2
|
|
:try_start_4
|
|
invoke-static {}, Lf/h/c/w/k/f;->b()Lf/h/c/w/k/f$b;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p7, p1, Lf/h/c/w/k/f$b;->b:Ljava/util/Date;
|
|
:try_end_4
|
|
.catch Lorg/json/JSONException; {:try_start_4 .. :try_end_4} :catch_7
|
|
|
|
:try_start_5
|
|
const-string p4, "entries"
|
|
|
|
invoke-virtual {p3, p4}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
|
|
|
|
move-result-object p4
|
|
:try_end_5
|
|
.catch Lorg/json/JSONException; {:try_start_5 .. :try_end_5} :catch_3
|
|
|
|
goto :goto_4
|
|
|
|
:catch_3
|
|
move-object p4, v2
|
|
|
|
:goto_4
|
|
if-eqz p4, :cond_3
|
|
|
|
:try_start_6
|
|
new-instance p5, Lorg/json/JSONObject;
|
|
|
|
invoke-virtual {p4}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-direct {p5, p4}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
|
|
|
|
iput-object p5, p1, Lf/h/c/w/k/f$b;->a:Lorg/json/JSONObject;
|
|
:try_end_6
|
|
.catch Lorg/json/JSONException; {:try_start_6 .. :try_end_6} :catch_4
|
|
|
|
:catch_4
|
|
:cond_3
|
|
:try_start_7
|
|
const-string p4, "experimentDescriptions"
|
|
|
|
invoke-virtual {p3, p4}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
|
|
|
|
move-result-object v2
|
|
:try_end_7
|
|
.catch Lorg/json/JSONException; {:try_start_7 .. :try_end_7} :catch_5
|
|
|
|
goto :goto_5
|
|
|
|
:catch_5
|
|
nop
|
|
|
|
:goto_5
|
|
if-eqz v2, :cond_4
|
|
|
|
:try_start_8
|
|
new-instance p3, Lorg/json/JSONArray;
|
|
|
|
invoke-virtual {v2}, Lorg/json/JSONArray;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-direct {p3, p4}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V
|
|
|
|
iput-object p3, p1, Lf/h/c/w/k/f$b;->c:Lorg/json/JSONArray;
|
|
:try_end_8
|
|
.catch Lorg/json/JSONException; {:try_start_8 .. :try_end_8} :catch_6
|
|
|
|
:catch_6
|
|
:cond_4
|
|
:try_start_9
|
|
new-instance p3, Lf/h/c/w/k/f;
|
|
|
|
iget-object p4, p1, Lf/h/c/w/k/f$b;->a:Lorg/json/JSONObject;
|
|
|
|
iget-object p5, p1, Lf/h/c/w/k/f$b;->b:Ljava/util/Date;
|
|
|
|
iget-object p1, p1, Lf/h/c/w/k/f$b;->c:Lorg/json/JSONArray;
|
|
|
|
invoke-direct {p3, p4, p5, p1}, Lf/h/c/w/k/f;-><init>(Lorg/json/JSONObject;Ljava/util/Date;Lorg/json/JSONArray;)V
|
|
:try_end_9
|
|
.catch Lorg/json/JSONException; {:try_start_9 .. :try_end_9} :catch_7
|
|
|
|
new-instance p1, Lf/h/c/w/k/k$a;
|
|
|
|
iget-object p4, p3, Lf/h/c/w/k/f;->c:Ljava/util/Date;
|
|
|
|
invoke-direct {p1, p4, v1, p3, p2}, Lf/h/c/w/k/k$a;-><init>(Ljava/util/Date;ILf/h/c/w/k/f;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:catch_7
|
|
move-exception p1
|
|
|
|
new-instance p2, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigClientException;
|
|
|
|
const-string p3, "Fetch failed: fetch response could not be parsed."
|
|
|
|
invoke-direct {p2, p3, p1}, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigClientException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p2
|
|
|
|
:cond_5
|
|
:try_start_a
|
|
new-instance p3, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigServerException;
|
|
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->getResponseMessage()Ljava/lang/String;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-direct {p3, p2, p4}, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigServerException;-><init>(ILjava/lang/String;)V
|
|
|
|
throw p3
|
|
:try_end_a
|
|
.catch Ljava/io/IOException; {:try_start_a .. :try_end_a} :catch_9
|
|
.catch Lorg/json/JSONException; {:try_start_a .. :try_end_a} :catch_8
|
|
.catchall {:try_start_a .. :try_end_a} :catchall_0
|
|
|
|
:catchall_0
|
|
move-exception p2
|
|
|
|
goto :goto_7
|
|
|
|
:catch_8
|
|
move-exception p2
|
|
|
|
goto :goto_6
|
|
|
|
:catch_9
|
|
move-exception p2
|
|
|
|
:goto_6
|
|
:try_start_b
|
|
new-instance p3, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigClientException;
|
|
|
|
const-string p4, "The client had an error while calling the backend!"
|
|
|
|
invoke-direct {p3, p4, p2}, Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigClientException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p3
|
|
:try_end_b
|
|
.catchall {:try_start_b .. :try_end_b} :catchall_0
|
|
|
|
:goto_7
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->disconnect()V
|
|
|
|
:try_start_c
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
|
|
:try_end_c
|
|
.catch Ljava/io/IOException; {:try_start_c .. :try_end_c} :catch_a
|
|
|
|
:catch_a
|
|
throw p2
|
|
.end method
|