granularity level: instruction
.class public final Lh1/t;
.super Ljava/lang/Object;
.source "SourceFile"
.field public final a:Landroid/content/Context;
.field public b:Ljava/lang/String;
.field public c:Ljava/lang/String;
.field public d:I
.field public e:I
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
iput v0, p0, Lh1/t;->e:I
iput-object p1, p0, Lh1/t;->a:Landroid/content/Context;
return-void
.end method
.method public static a(Lp0/g;)Ljava/lang/String;
.locals 3
invoke-virtual {p0}, Lp0/g;->a()V
iget-object v0, p0, Lp0/g;->c:Lp0/h;
iget-object v0, v0, Lp0/h;->e:Ljava/lang/String;
if-eqz v0, :cond_0
return-object v0
:cond_0
invoke-virtual {p0}, Lp0/g;->a()V
iget-object p0, p0, Lp0/g;->c:Lp0/h;
iget-object p0, p0, Lp0/h;->b:Ljava/lang/String;
const-string v0, "1:"
invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_1
return-object p0
:cond_1
const-string v0, ":"
invoke-virtual {p0, v0}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object p0
array-length v0, p0
const/4 v1, 0x2
const/4 v2, 0x0
if-ge v0, v1, :cond_2
return-object v2
:cond_2
const/4 v0, 0x1
aget-object p0, p0, v0
invoke-virtual {p0}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-eqz v0, :cond_3
return-object v2
:cond_3
return-object p0
.end method
.method public final b(Ljava/lang/String;)Landroid/content/pm/PackageInfo;
.locals 2
:try_start_0
iget-object v0, p0, Lh1/t;->a:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
const/4 v1, 0x0
invoke-virtual {v0, p1, v1}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
move-result-object p1
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
return-object p1
:catch_0
move-exception p1
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "Failed to find package "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
const-string v0, "FirebaseMessaging"
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
const/4 p1, 0x0
return-object p1
.end method
.method public final c()Z
.locals 6
monitor-enter p0
:try_start_0
iget v0, p0, Lh1/t;->e:I
const/4 v1, 0x2
const/4 v2, 0x1
const/4 v3, 0x0
if-eqz v0, :cond_0
goto/16 :goto_1
:cond_0
iget-object v0, p0, Lh1/t;->a:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
const-string v4, "com.google.android.c2dm.permission.SEND"
const-string v5, "com.google.android.gms"
invoke-virtual {v0, v4, v5}, Landroid/content/pm/PackageManager;->checkPermission(Ljava/lang/String;Ljava/lang/String;)I
move-result v4
const/4 v5, -0x1
if-ne v4, v5, :cond_1
const-string v0, "FirebaseMessaging"
const-string v1, "Google Play services missing or without correct permission."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
const/4 v1, 0x0
goto :goto_2
:try_start_1
:cond_1
invoke-static {}, Lp0/a;->u()Z
move-result v4
if-nez v4, :cond_2
new-instance v4, Landroid/content/Intent;
const-string v5, "com.google.android.c2dm.intent.REGISTER"
invoke-direct {v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v5, "com.google.android.gms"
invoke-virtual {v4, v5}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;
invoke-virtual {v0, v4, v3}, Landroid/content/pm/PackageManager;->queryIntentServices(Landroid/content/Intent;I)Ljava/util/List;
move-result-object v4
if-eqz v4, :cond_2
invoke-interface {v4}, Ljava/util/List;->size()I
move-result v4
if-lez v4, :cond_2
iput v2, p0, Lh1/t;->e:I
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
monitor-exit p0
const/4 v1, 0x1
goto :goto_2
:try_start_2
:cond_2
new-instance v4, Landroid/content/Intent;
const-string v5, "com.google.iid.TOKEN_REQUEST"
invoke-direct {v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v5, "com.google.android.gms"
invoke-virtual {v4, v5}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;
invoke-virtual {v0, v4, v3}, Landroid/content/pm/PackageManager;->queryBroadcastReceivers(Landroid/content/Intent;I)Ljava/util/List;
move-result-object v0
if-eqz v0, :cond_3
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
if-lez v0, :cond_3
iput v1, p0, Lh1/t;->e:I
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
monitor-exit p0
goto :goto_2
:try_start_3
:cond_3
const-string v0, "FirebaseMessaging"
const-string v4, "Failed to resolve IID implementation package, falling back"
invoke-static {v0, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
invoke-static {}, Lp0/a;->u()Z
move-result v0
if-eqz v0, :cond_4
iput v1, p0, Lh1/t;->e:I
goto :goto_0
:cond_4
iput v2, p0, Lh1/t;->e:I
:goto_0
iget v0, p0, Lh1/t;->e:I
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
:goto_1
monitor-exit p0
move v1, v0
:goto_2
if-eqz v1, :cond_5
goto :goto_3
:cond_5
const/4 v2, 0x0
:goto_3
return v2
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final declared-synchronized d()V
.locals 2
monitor-enter p0
:try_start_0
iget-object v0, p0, Lh1/t;->a:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v0
invoke-virtual {p0, v0}, Lh1/t;->b(Ljava/lang/String;)Landroid/content/pm/PackageInfo;
move-result-object v0
if-eqz v0, :cond_0
iget v1, v0, Landroid/content/pm/PackageInfo;->versionCode:I
invoke-static {v1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v1
iput-object v1, p0, Lh1/t;->b:Ljava/lang/String;
iget-object v0, v0, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;
iput-object v0, p0, Lh1/t;->c:Ljava/lang/String;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_0
monitor-exit p0
return-void
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method