.class public Lk8/q;
.super Ljava/lang/Object;
.source ""


# instance fields
.field public final a:Lcom/google/firebase/a;

.field public final b:Lcom/google/firebase/messaging/b;

.field public final c:Ll5/c;

.field public final d:Le8/a;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Le8/a<",
            "Lm8/h;",
            ">;"
        }
    .end annotation
.end field

.field public final e:Le8/a;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Le8/a<",
            "Lc8/e;",
            ">;"
        }
    .end annotation
.end field

.field public final f:Lf8/d;


# direct methods
.method public constructor <init>(Lcom/google/firebase/a;Lcom/google/firebase/messaging/b;Le8/a;Le8/a;Lf8/d;)V
    .registers 8
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/google/firebase/a;",
            "Lcom/google/firebase/messaging/b;",
            "Le8/a<",
            "Lm8/h;",
            ">;",
            "Le8/a<",
            "Lc8/e;",
            ">;",
            "Lf8/d;",
            ")V"
        }
    .end annotation

    new-instance v0, Ll5/c;

    .line 1
    invoke-virtual {p1}, Lcom/google/firebase/a;->a()V

    iget-object v1, p1, Lcom/google/firebase/a;->a:Landroid/content/Context;

    .line 2
    invoke-direct {v0, v1}, Ll5/c;-><init>(Landroid/content/Context;)V

    .line 3
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lk8/q;->a:Lcom/google/firebase/a;

    iput-object p2, p0, Lk8/q;->b:Lcom/google/firebase/messaging/b;

    iput-object v0, p0, Lk8/q;->c:Ll5/c;

    iput-object p3, p0, Lk8/q;->d:Le8/a;

    iput-object p4, p0, Lk8/q;->e:Le8/a;

    iput-object p5, p0, Lk8/q;->f:Lf8/d;

    return-void
.end method


# virtual methods
.method public final a(Ln6/i;)Ln6/i;
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ln6/i<",
            "Landroid/os/Bundle;",
            ">;)",
            "Ln6/i<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    sget-object v0, Lk8/p;->r:Lk8/p;

    new-instance v1, Lf/o;

    invoke-direct {v1, p0}, Lf/o;-><init>(Lk8/q;)V

    invoke-virtual {p1, v0, v1}, Ln6/i;->f(Ljava/util/concurrent/Executor;Ln6/a;)Ln6/i;

    move-result-object p1

    return-object p1
.end method

.method public final b(Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)V
    .registers 5

    const-string v0, "scope"

    invoke-virtual {p3, v0, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p2, "sender"

    invoke-virtual {p3, p2, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p2, "subtype"

    invoke-virtual {p3, p2, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p1, "gmp_app_id"

    iget-object p2, p0, Lk8/q;->a:Lcom/google/firebase/a;

    .line 1
    invoke-virtual {p2}, Lcom/google/firebase/a;->a()V

    iget-object p2, p2, Lcom/google/firebase/a;->c:Lr7/d;

    .line 2
    iget-object p2, p2, Lr7/d;->b:Ljava/lang/String;

    .line 3
    invoke-virtual {p3, p1, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p1, "gmsv"

    iget-object p2, p0, Lk8/q;->b:Lcom/google/firebase/messaging/b;

    .line 4
    monitor-enter p2

    :try_start_22
    iget v0, p2, Lcom/google/firebase/messaging/b;->d:I

    if-nez v0, :cond_32

    const-string v0, "com.google.android.gms"

    invoke-virtual {p2, v0}, Lcom/google/firebase/messaging/b;->c(Ljava/lang/String;)Landroid/content/pm/PackageInfo;

    move-result-object v0

    if-eqz v0, :cond_32

    iget v0, v0, Landroid/content/pm/PackageInfo;->versionCode:I

    iput v0, p2, Lcom/google/firebase/messaging/b;->d:I

    :cond_32
    iget v0, p2, Lcom/google/firebase/messaging/b;->d:I
    :try_end_34
    .catchall {:try_start_22 .. :try_end_34} :catchall_105

    monitor-exit p2

    .line 5
    invoke-static {v0}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object p2

    invoke-virtual {p3, p1, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p1, "osv"

    sget p2, Landroid/os/Build$VERSION;->SDK_INT:I

    invoke-static {p2}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object p2

    invoke-virtual {p3, p1, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p1, "app_ver"

    iget-object p2, p0, Lk8/q;->b:Lcom/google/firebase/messaging/b;

    invoke-virtual {p2}, Lcom/google/firebase/messaging/b;->a()Ljava/lang/String;

    move-result-object p2

    invoke-virtual {p3, p1, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p1, "app_ver_name"

    iget-object p2, p0, Lk8/q;->b:Lcom/google/firebase/messaging/b;

    .line 6
    monitor-enter p2

    :try_start_57
    iget-object v0, p2, Lcom/google/firebase/messaging/b;->c:Ljava/lang/String;

    if-nez v0, :cond_5e

    invoke-virtual {p2}, Lcom/google/firebase/messaging/b;->e()V

    :cond_5e
    iget-object v0, p2, Lcom/google/firebase/messaging/b;->c:Ljava/lang/String;
    :try_end_60
    .catchall {:try_start_57 .. :try_end_60} :catchall_102

    monitor-exit p2

    .line 7
    invoke-virtual {p3, p1, v0}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p1, "firebase-app-name-hash"

    .line 8
    iget-object p2, p0, Lk8/q;->a:Lcom/google/firebase/a;

    .line 9
    invoke-virtual {p2}, Lcom/google/firebase/a;->a()V

    iget-object p2, p2, Lcom/google/firebase/a;->b:Ljava/lang/String;

    const-string v0, "SHA-1"

    .line 10
    :try_start_6f
    invoke-static {v0}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;

    move-result-object v0

    invoke-virtual {p2}, Ljava/lang/String;->getBytes()[B

    move-result-object p2

    invoke-virtual {v0, p2}, Ljava/security/MessageDigest;->digest([B)[B

    move-result-object p2

    const/16 v0, 0xb

    .line 11
    invoke-static {p2, v0}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;

    move-result-object p2
    :try_end_81
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_6f .. :try_end_81} :catch_82

    goto :goto_84

    :catch_82
    const-string p2, "[HASH-ERROR]"

    .line 12
    :goto_84
    invoke-virtual {p3, p1, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    :try_start_87
    iget-object p1, p0, Lk8/q;->f:Lf8/d;

    const/4 p2, 0x0

    invoke-interface {p1, p2}, Lf8/d;->a(Z)Ln6/i;

    move-result-object p1

    invoke-static {p1}, Ln6/l;->a(Ln6/i;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/google/firebase/installations/a;

    invoke-virtual {p1}, Lcom/google/firebase/installations/a;->a()Ljava/lang/String;

    move-result-object p1

    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p2

    if-nez p2, :cond_a4

    const-string p2, "Goog-Firebase-Installations-Auth"

    invoke-virtual {p3, p2, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_b6

    :cond_a4
    const-string p1, "FirebaseMessaging"

    const-string p2, "FIS auth token is empty"

    invoke-static {p1, p2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_ab
    .catch Ljava/util/concurrent/ExecutionException; {:try_start_87 .. :try_end_ab} :catch_ae
    .catch Ljava/lang/InterruptedException; {:try_start_87 .. :try_end_ab} :catch_ac

    goto :goto_b6

    :catch_ac
    move-exception p1

    goto :goto_af

    :catch_ae
    move-exception p1

    :goto_af
    const-string p2, "FirebaseMessaging"

    const-string v0, "Failed to get FIS auth token"

    invoke-static {p2, v0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    :goto_b6
    const-string p1, "appid"

    iget-object p2, p0, Lk8/q;->f:Lf8/d;

    invoke-interface {p2}, Lf8/d;->getId()Ln6/i;

    move-result-object p2

    invoke-static {p2}, Ln6/l;->a(Ln6/i;)Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Ljava/lang/String;

    invoke-virtual {p3, p1, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p1, "cliv"

    const-string p2, "fcm-23.0.0"

    invoke-virtual {p3, p1, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    iget-object p1, p0, Lk8/q;->e:Le8/a;

    invoke-interface {p1}, Le8/a;->get()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lc8/e;

    iget-object p2, p0, Lk8/q;->d:Le8/a;

    invoke-interface {p2}, Le8/a;->get()Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Lm8/h;

    if-eqz p1, :cond_101

    if-eqz p2, :cond_101

    const-string v0, "fire-iid"

    invoke-interface {p1, v0}, Lc8/e;->a(Ljava/lang/String;)I

    move-result p1

    const/4 v0, 0x1

    if-eq p1, v0, :cond_101

    const-string v0, "Firebase-Client-Log-Type"

    .line 13
    invoke-static {p1}, Ls/f;->a(I)I

    move-result p1

    .line 14
    invoke-static {p1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p3, v0, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string p1, "Firebase-Client"

    invoke-interface {p2}, Lm8/h;->a()Ljava/lang/String;

    move-result-object p2

    invoke-virtual {p3, p1, p2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    :cond_101
    return-void

    :catchall_102
    move-exception p1

    .line 15
    monitor-exit p2

    throw p1

    :catchall_105
    move-exception p1

    .line 16
    monitor-exit p2

    throw p1
.end method

.method public final c(Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)Ln6/i;
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Landroid/os/Bundle;",
            ")",
            "Ln6/i<",
            "Landroid/os/Bundle;",
            ">;"
        }
    .end annotation

    :try_start_0
    invoke-virtual {p0, p1, p2, p3}, Lk8/q;->b(Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)V
    :try_end_3
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_3} :catch_9c
    .catch Ljava/util/concurrent/ExecutionException; {:try_start_0 .. :try_end_3} :catch_9a

    iget-object p1, p0, Lk8/q;->c:Ll5/c;

    .line 1
    iget-object p2, p1, Ll5/c;->c:Ll5/u;

    .line 2
    monitor-enter p2

    :try_start_8
    iget v0, p2, Ll5/u;->b:I

    if-nez v0, :cond_48

    const-string v0, "com.google.android.gms"
    :try_end_e
    .catchall {:try_start_8 .. :try_end_e} :catchall_97

    :try_start_e
    iget-object v1, p2, Ll5/u;->a:Landroid/content/Context;

    invoke-static {v1}, Lw5/c;->a(Landroid/content/Context;)Lw5/b;

    move-result-object v1

    const/4 v2, 0x0

    .line 3
    iget-object v1, v1, Lw5/b;->a:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v1

    invoke-virtual {v1, v0, v2}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object v0
    :try_end_1f
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_e .. :try_end_1f} :catch_20
    .catchall {:try_start_e .. :try_end_1f} :catchall_97

    goto :goto_42

    :catch_20
    move-exception v0

    .line 4
    :try_start_21
    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v1

    new-instance v2, Ljava/lang/StringBuilder;

    add-int/lit8 v1, v1, 0x17

    invoke-direct {v2, v1}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v1, "Failed to find package "

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v0, "Metadata"

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    const/4 v0, 0x0

    :goto_42
    if-eqz v0, :cond_48

    iget v0, v0, Landroid/content/pm/PackageInfo;->versionCode:I

    iput v0, p2, Ll5/u;->b:I

    :cond_48
    iget v0, p2, Ll5/u;->b:I
    :try_end_4a
    .catchall {:try_start_21 .. :try_end_4a} :catchall_97

    monitor-exit p2

    const p2, 0xb71b00

    if-ge v0, p2, :cond_74

    .line 5
    iget-object p2, p1, Ll5/c;->c:Ll5/u;

    invoke-virtual {p2}, Ll5/u;->a()I

    move-result p2

    if-eqz p2, :cond_68

    invoke-virtual {p1, p3}, Ll5/c;->a(Landroid/os/Bundle;)Ln6/i;

    move-result-object p2

    sget-object v0, Ll5/y;->r:Ll5/y;

    new-instance v1, Lm3/t;

    invoke-direct {v1, p1, p3}, Lm3/t;-><init>(Ll5/c;Landroid/os/Bundle;)V

    invoke-virtual {p2, v0, v1}, Ln6/i;->g(Ljava/util/concurrent/Executor;Ln6/a;)Ln6/i;

    move-result-object p1

    goto :goto_93

    :cond_68
    new-instance p1, Ljava/io/IOException;

    const-string p2, "MISSING_INSTANCEID_SERVICE"

    invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    invoke-static {p1}, Ln6/l;->d(Ljava/lang/Exception;)Ln6/i;

    move-result-object p1

    goto :goto_93

    :cond_74
    iget-object p1, p1, Ll5/c;->b:Landroid/content/Context;

    invoke-static {p1}, Ll5/t;->a(Landroid/content/Context;)Ll5/t;

    move-result-object p1

    .line 6
    new-instance p2, Ll5/s;

    .line 7
    monitor-enter p1

    :try_start_7d
    iget v0, p1, Ll5/t;->d:I

    add-int/lit8 v1, v0, 0x1

    iput v1, p1, Ll5/t;->d:I
    :try_end_83
    .catchall {:try_start_7d .. :try_end_83} :catchall_94

    monitor-exit p1

    .line 8
    invoke-direct {p2, v0, p3}, Ll5/s;-><init>(ILandroid/os/Bundle;)V

    invoke-virtual {p1, p2}, Ll5/t;->b(Ll5/q;)Ln6/i;

    move-result-object p1

    .line 9
    sget-object p2, Ll5/y;->r:Ll5/y;

    sget-object p3, Ll5/v;->r:Ll5/v;

    invoke-virtual {p1, p2, p3}, Ln6/i;->f(Ljava/util/concurrent/Executor;Ln6/a;)Ln6/i;

    move-result-object p1

    :goto_93
    return-object p1

    :catchall_94
    move-exception p2

    .line 10
    monitor-exit p1

    throw p2

    :catchall_97
    move-exception p1

    .line 11
    monitor-exit p2

    throw p1

    :catch_9a
    move-exception p1

    goto :goto_9d

    :catch_9c
    move-exception p1

    .line 12
    :goto_9d
    invoke-static {p1}, Ln6/l;->d(Ljava/lang/Exception;)Ln6/i;

    move-result-object p1

    return-object p1
.end method
