granularity level: instruction
.class Lcom/google/firebase/messaging/Metadata;
.super Ljava/lang/Object;
.source "Metadata.java"
.field private static final ACTION_C2DM_REGISTER:Ljava/lang/String; = "com.google.android.c2dm.intent.REGISTER"
.field private static final ACTION_IID_TOKEN_REQUEST:Ljava/lang/String; = "com.google.iid.TOKEN_REQUEST"
.field static final GMSCORE_NOT_FOUND:I = 0x0
.field private static final GMSCORE_SEND_PERMISSION:Ljava/lang/String; = "com.google.android.c2dm.permission.SEND"
.field static final GMS_PACKAGE:Ljava/lang/String; = "com.google.android.gms"
.field static final IID_VIA_RECEIVER:I = 0x2
.field static final IID_VIA_SERVICE:I = 0x1
.field private appVersionCode:Ljava/lang/String;
.field private appVersionName:Ljava/lang/String;
.field private final context:Landroid/content/Context;
.field private gmsVersionCode:I
.field private iidImplementation:I
.method 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/firebase/messaging/Metadata;->iidImplementation:I
iput-object p1, p0, Lcom/google/firebase/messaging/Metadata;->context:Landroid/content/Context;
return-void
.end method
.method static getDefaultSenderId(Lcom/google/firebase/FirebaseApp;)Ljava/lang/String;
.locals 3
invoke-virtual {p0}, Lcom/google/firebase/FirebaseApp;->getOptions()Lcom/google/firebase/FirebaseOptions;
move-result-object v0
invoke-virtual {v0}, Lcom/google/firebase/FirebaseOptions;->getGcmSenderId()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method private getPackageInfo(Ljava/lang/String;)Landroid/content/pm/PackageInfo;
.locals 2
iget-object v0, p0, Lcom/google/firebase/messaging/Metadata;->context: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
return-object p1
.end method
.method private declared-synchronized populateAppVersionInfo()V
.locals 2
monitor-enter p0
:try_start_0
iget-object v0, p0, Lcom/google/firebase/messaging/Metadata;->context:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Lcom/google/firebase/messaging/Metadata;->getPackageInfo(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, Lcom/google/firebase/messaging/Metadata;->appVersionCode:Ljava/lang/String;
iget-object v0, v0, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;
iput-object v0, p0, Lcom/google/firebase/messaging/Metadata;->appVersionName: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
.method declared-synchronized getAppVersionCode()Ljava/lang/String;
.locals 1
monitor-enter p0
:try_start_0
iget-object v0, p0, Lcom/google/firebase/messaging/Metadata;->appVersionCode:Ljava/lang/String;
if-nez v0, :cond_0
invoke-direct {p0}, Lcom/google/firebase/messaging/Metadata;->populateAppVersionInfo()V
:cond_0
iget-object v0, p0, Lcom/google/firebase/messaging/Metadata;->appVersionCode:Ljava/lang/String;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-object v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method declared-synchronized getAppVersionName()Ljava/lang/String;
.locals 1
monitor-enter p0
:try_start_0
iget-object v0, p0, Lcom/google/firebase/messaging/Metadata;->appVersionName:Ljava/lang/String;
iget-object v0, p0, Lcom/google/firebase/messaging/Metadata;->appVersionName:Ljava/lang/String;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-object v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method declared-synchronized getGmsVersionCode()I
.locals 1
monitor-enter p0
:try_start_0
iget v0, p0, Lcom/google/firebase/messaging/Metadata;->gmsVersionCode:I
if-nez v0, :cond_0
const-string v0, "com.google.android.gms"
invoke-direct {p0, v0}, Lcom/google/firebase/messaging/Metadata;->getPackageInfo(Ljava/lang/String;)Landroid/content/pm/PackageInfo;
move-result-object v0
if-eqz v0, :cond_0
iget v0, v0, Landroid/content/pm/PackageInfo;->versionCode:I
iput v0, p0, Lcom/google/firebase/messaging/Metadata;->gmsVersionCode:I
:cond_0
iget v0, p0, Lcom/google/firebase/messaging/Metadata;->gmsVersionCode:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method declared-synchronized getIidImplementation()I
.locals 5
monitor-enter p0
:try_start_0
iget v0, p0, Lcom/google/firebase/messaging/Metadata;->iidImplementation:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v0, :cond_0
monitor-exit p0
return v0
:cond_0
iget-object v0, p0, Lcom/google/firebase/messaging/Metadata;->context:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
const-string v1, "com.google.android.c2dm.permission.SEND"
const-string v2, "com.google.android.gms"
invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->checkPermission(Ljava/lang/String;Ljava/lang/String;)I
move-result v1
const/4 v2, -0x1
const/4 v3, 0x0
invoke-static {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastO()Z
move-result v1
const/4 v2, 0x1
:try_start_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
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
iput v1, p0, Lcom/google/firebase/messaging/Metadata;->iidImplementation:I
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
monitor-exit p0
return v1
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method isGmscorePresent()Z
.locals 1
invoke-virtual {p0}, Lcom/google/firebase/messaging/Metadata;->getIidImplementation()I
move-result v0
const/4 v0, 0x1
return v0
.end method