granularity level: instruction
.class public final Lcom/google/android/gms/cloudmessaging/zzt;
.super Ljava/lang/Object;
.source "com.google.android.gms:play-services-cloud-messaging@@17.0.0"
.field private final zza:Landroid/content/Context;
.field private zzb:I
.field private zzc: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, Lcom/google/android/gms/cloudmessaging/zzt;->zzc:I
iput-object p1, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zza:Landroid/content/Context;
return-void
.end method
.method public final declared-synchronized zza()I
.locals 3
monitor-enter p0
:try_start_0
iget v0, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zzb:I
if-nez v0, :cond_0
const-string v0, "com.google.android.gms"
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:try_start_1
iget-object v1, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zza:Landroid/content/Context;
invoke-static {v1}, Lcom/google/android/gms/common/wrappers/Wrappers;->packageManager(Landroid/content/Context;)Lcom/google/android/gms/common/wrappers/PackageManagerWrapper;
move-result-object v1
const/4 v2, 0x0
invoke-virtual {v1, v0, v2}, Lcom/google/android/gms/common/wrappers/PackageManagerWrapper;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
move-result-object v0
:try_end_1
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_0
goto :goto_0
:catch_0
move-exception v0
:try_start_2
invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v1
invoke-virtual {v1}, 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_0
if-eqz v0, :cond_0
iget v0, v0, Landroid/content/pm/PackageInfo;->versionCode:I
iput v0, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zzb:I
:cond_0
iget v0, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zzb:I
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final declared-synchronized zzb()I
.locals 5
monitor-enter p0
:try_start_0
iget v0, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zzc:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v0, :cond_0
monitor-exit p0
return v0
:try_start_1
:cond_0
iget-object v0, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zza:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
iget-object v1, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zza:Landroid/content/Context;
invoke-static {v1}, Lcom/google/android/gms/common/wrappers/Wrappers;->packageManager(Landroid/content/Context;)Lcom/google/android/gms/common/wrappers/PackageManagerWrapper;
move-result-object v1
const-string v2, "com.google.android.c2dm.permission.SEND"
const-string v3, "com.google.android.gms"
invoke-virtual {v1, v2, v3}, Lcom/google/android/gms/common/wrappers/PackageManagerWrapper;->checkPermission(Ljava/lang/String;Ljava/lang/String;)I
move-result v1
const/4 v2, -0x1
const/4 v3, 0x0
if-ne v1, v2, :cond_1
const-string v0, "Metadata"
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_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
monitor-exit p0
return v3
:try_start_2
:cond_1
invoke-static {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastO()Z
move-result v1
const/4 v2, 0x1
if-nez v1, :cond_3
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_3
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v1
if-gtz v1, :cond_2
goto :goto_0
:cond_2
iput v2, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zzc:I
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
monitor-exit p0
return v2
:goto_0
:try_start_3
:cond_3
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_5
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
if-gtz v0, :cond_4
goto :goto_1
:cond_4
iput v1, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zzc:I
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
monitor-exit p0
return v1
:try_start_4
:goto_1
:cond_5
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 {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastO()Z
move-result v0
if-eqz v0, :cond_6
iput v1, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zzc:I
const/4 v2, 0x2
goto :goto_2
:cond_6
iput v2, p0, Lcom/google/android/gms/cloudmessaging/zzt;->zzc:I
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_0
:goto_2
monitor-exit p0
return v2
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method