.class public final Ll5/u;
.super Ljava/lang/Object;
.source ""


# instance fields
.field public final a:Landroid/content/Context;

.field public b:I
    .annotation build Ljavax/annotation/concurrent/GuardedBy;
        value = "this"
    .end annotation
.end field

.field public c:I
    .annotation build Ljavax/annotation/concurrent/GuardedBy;
        value = "this"
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .registers 3

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

    const/4 v0, 0x0

    iput v0, p0, Ll5/u;->c:I

    iput-object p1, p0, Ll5/u;->a:Landroid/content/Context;

    return-void
.end method


# virtual methods
.method public final declared-synchronized a()I
    .registers 6

    monitor-enter p0

    :try_start_1
    iget v0, p0, Ll5/u;->c:I
    :try_end_3
    .catchall {:try_start_1 .. :try_end_3} :catchall_85

    if-eqz v0, :cond_7

    monitor-exit p0

    return v0

    :cond_7
    :try_start_7
    iget-object v0, p0, Ll5/u;->a:Landroid/content/Context;

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

    move-result-object v0

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

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

    move-result-object v1

    const-string v2, "com.google.android.c2dm.permission.SEND"

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

    .line 1
    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, v2, v3}, Landroid/content/pm/PackageManager;->checkPermission(Ljava/lang/String;Ljava/lang/String;)I

    move-result v1

    const/4 v2, -0x1

    const/4 v3, 0x0

    if-ne v1, v2, :cond_2e

    const-string v0, "Metadata"

    const-string v1, "Google Play services missing or without correct permission."

    .line 2
    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_2c
    .catchall {:try_start_7 .. :try_end_2c} :catchall_85

    monitor-exit p0

    return v3

    :cond_2e
    :try_start_2e
    invoke-static {}, Lu5/j;->a()Z

    move-result v1

    const/4 v2, 0x1

    if-nez v1, :cond_52

    new-instance v1, Landroid/content/Intent;

    const-string v4, "com.google.android.c2dm.intent.REGISTER"

    invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

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

    invoke-virtual {v1, v4}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    invoke-virtual {v0, v1, v3}, Landroid/content/pm/PackageManager;->queryIntentServices(Landroid/content/Intent;I)Ljava/util/List;

    move-result-object v1

    if-eqz v1, :cond_52

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-gtz v1, :cond_4e

    goto :goto_52

    :cond_4e
    iput v2, p0, Ll5/u;->c:I
    :try_end_50
    .catchall {:try_start_2e .. :try_end_50} :catchall_85

    monitor-exit p0

    return v2

    :cond_52
    :goto_52
    :try_start_52
    new-instance v1, Landroid/content/Intent;

    const-string v4, "com.google.iid.TOKEN_REQUEST"

    invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

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

    invoke-virtual {v1, v4}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    invoke-virtual {v0, v1, v3}, Landroid/content/pm/PackageManager;->queryBroadcastReceivers(Landroid/content/Intent;I)Ljava/util/List;

    move-result-object v0

    const/4 v1, 0x2

    if-eqz v0, :cond_70

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-gtz v0, :cond_6c

    goto :goto_70

    :cond_6c
    iput v1, p0, Ll5/u;->c:I
    :try_end_6e
    .catchall {:try_start_52 .. :try_end_6e} :catchall_85

    monitor-exit p0

    return v1

    :cond_70
    :goto_70
    :try_start_70
    const-string v0, "Metadata"

    const-string v3, "Failed to resolve IID implementation package, falling back"

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

    invoke-static {}, Lu5/j;->a()Z

    move-result v0

    if-eqz v0, :cond_81

    iput v1, p0, Ll5/u;->c:I

    move v2, v1

    goto :goto_83

    :cond_81
    iput v2, p0, Ll5/u;->c:I
    :try_end_83
    .catchall {:try_start_70 .. :try_end_83} :catchall_85

    :goto_83
    monitor-exit p0

    return v2

    :catchall_85
    move-exception v0

    monitor-exit p0

    throw v0
.end method
