granularity level: instruction

		.class public Lcom/google/firebase/messaging/MessagingAnalytics;
.super Ljava/lang/Object;
.source "MessagingAnalytics.java"


.field private static final DELIVERY_METRICS_EXPORT_TO_BIG_QUERY_PREF:Ljava/lang/String; = "export_to_big_query"
.field private static final FCM_PREFERENCES:Ljava/lang/String; = "com.google.firebase.messaging"
.field private static final MANIFEST_DELIVERY_METRICS_EXPORT_TO_BIG_QUERY_ENABLED:Ljava/lang/String; = "delivery_metrics_exported_to_big_query_enabled"
.field private static final REENGAGEMENT_MEDIUM:Ljava/lang/String; = "notification"
.field private static final REENGAGEMENT_SOURCE:Ljava/lang/String; = "Firebase"


.method public constructor <init>()V
	.locals 0

	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	return-void
.end method

.method static deliveryMetricsExportToBigQueryEnabled()Z
	.locals 6

	const-string v0, "delivery_metrics_exported_to_big_query_enabled"
	const/4 v1, 0x0
	:try_start_0
	invoke-static {}, Lcom/google/firebase/FirebaseApp;->getInstance()Lcom/google/firebase/FirebaseApp;
	:try_end_0
	.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_1
	invoke-static {}, Lcom/google/firebase/FirebaseApp;->getInstance()Lcom/google/firebase/FirebaseApp;
	move-result-object v2
	invoke-virtual {v2}, Lcom/google/firebase/FirebaseApp;->getApplicationContext()Landroid/content/Context;
	move-result-object v2
	const-string v3, "com.google.firebase.messaging"
	invoke-virtual {v2, v3, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
	move-result-object v3
	const-string v4, "export_to_big_query"
	invoke-interface {v3, v4}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z
	move-result v5
	if-eqz v5, :cond_0
	invoke-interface {v3, v4, v1}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
	move-result v0
	return v0
	:try_start_1
	:cond_0
	invoke-virtual {v2}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
	move-result-object v3
	if-eqz v3, :cond_1
	invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
	move-result-object v2
	const/16 v4, 0x80
	invoke-virtual {v3, v2, v4}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
	move-result-object v2
	if-eqz v2, :cond_1
	iget-object v3, v2, Landroid/content/pm/ApplicationInfo;->metaData:Landroid/os/Bundle;
	if-eqz v3, :cond_1
	iget-object v3, v2, Landroid/content/pm/ApplicationInfo;->metaData:Landroid/os/Bundle;
	invoke-virtual {v3, v0}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z
	move-result v3
	if-eqz v3, :cond_1
	iget-object v2, v2, Landroid/content/pm/ApplicationInfo;->metaData:Landroid/os/Bundle;
	invoke-virtual {v2, v0, v1}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z
	move-result v0
	:try_end_1
	.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_1 .. :try_end_1} :catch_0
	return v0
	:catch_0
	:cond_1
	return v1
	:catch_1
	const-string v0, "FirebaseMessaging"
	const-string v2, "FirebaseApp has not being initialized. Device might be in direct boot mode. Skip exporting delivery metrics to Big Query"
	invoke-static {v0, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
	return v1
.end method

.method static eventToProto(Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Event;Landroid/content/Intent;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent;
	.locals 4

	if-nez p1, :cond_0
	const/4 p0, 0x0
	return-object p0
	:cond_0
	invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
	move-result-object p1
	if-nez p1, :cond_1
	sget-object p1, Landroid/os/Bundle;->EMPTY:Landroid/os/Bundle;
	:cond_1
	invoke-static {}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent;->newBuilder()Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	move-result-object v0
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getTtl(Landroid/os/Bundle;)I
	move-result v1
	invoke-virtual {v0, v1}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setTtl(I)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	move-result-object v0
	invoke-virtual {v0, p0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setEvent(Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Event;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	move-result-object p0
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getInstanceId(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v0
	invoke-virtual {p0, v0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setInstanceId(Ljava/lang/String;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	move-result-object p0
	invoke-static {}, Lcom/google/firebase/messaging/MessagingAnalytics;->getPackageName()Ljava/lang/String;
	move-result-object v0
	invoke-virtual {p0, v0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setPackageName(Ljava/lang/String;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	move-result-object p0
	sget-object v0, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$SDKPlatform;->ANDROID:Lcom/google/firebase/messaging/reporting/MessagingClientEvent$SDKPlatform;
	invoke-virtual {p0, v0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setSdkPlatform(Lcom/google/firebase/messaging/reporting/MessagingClientEvent$SDKPlatform;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	move-result-object p0
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getMessageTypeForFirelog(Landroid/os/Bundle;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$MessageType;
	move-result-object v0
	invoke-virtual {p0, v0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setMessageType(Lcom/google/firebase/messaging/reporting/MessagingClientEvent$MessageType;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	move-result-object p0
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getMessageId(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v0
	if-eqz v0, :cond_2
	invoke-virtual {p0, v0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setMessageId(Ljava/lang/String;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	:cond_2
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getTopic(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v0
	if-eqz v0, :cond_3
	invoke-virtual {p0, v0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setTopic(Ljava/lang/String;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	:cond_3
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getCollapseKey(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v0
	if-eqz v0, :cond_4
	invoke-virtual {p0, v0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setCollapseKey(Ljava/lang/String;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	:cond_4
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getMessageLabel(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v0
	if-eqz v0, :cond_5
	invoke-virtual {p0, v0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setAnalyticsLabel(Ljava/lang/String;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	:cond_5
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getComposerLabel(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v0
	if-eqz v0, :cond_6
	invoke-virtual {p0, v0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setComposerLabel(Ljava/lang/String;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	:cond_6
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getProjectNumber(Landroid/os/Bundle;)J
	move-result-wide v0
	const-wide/16 v2, 0x0
	cmp-long p1, v0, v2
	if-lez p1, :cond_7
	invoke-virtual {p0, v0, v1}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->setProjectNumber(J)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;
	:cond_7
	invoke-virtual {p0}, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Builder;->build()Lcom/google/firebase/messaging/reporting/MessagingClientEvent;
	move-result-object p0
	return-object p0
.end method

.method static getCollapseKey(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 1

	const-string v0, "collapse_key"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	return-object p0
.end method

.method static getComposerId(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 1

	const-string v0, "google.c.a.c_id"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	return-object p0
.end method

.method static getComposerLabel(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 1

	const-string v0, "google.c.a.c_l"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	return-object p0
.end method

.method static getInstanceId(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 1

	const-string v0, "google.to"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
	move-result v0
	if-nez v0, :cond_0
	return-object p0
	:try_start_0
	:cond_0
	invoke-static {}, Lcom/google/firebase/FirebaseApp;->getInstance()Lcom/google/firebase/FirebaseApp;
	move-result-object p0
	invoke-static {p0}, Lcom/google/firebase/installations/FirebaseInstallations;->getInstance(Lcom/google/firebase/FirebaseApp;)Lcom/google/firebase/installations/FirebaseInstallations;
	move-result-object p0
	invoke-virtual {p0}, Lcom/google/firebase/installations/FirebaseInstallations;->getId()Lcom/google/android/gms/tasks/Task;
	move-result-object p0
	invoke-static {p0}, Lcom/google/android/gms/tasks/Tasks;->await(Lcom/google/android/gms/tasks/Task;)Ljava/lang/Object;
	move-result-object p0
	check-cast p0, Ljava/lang/String;
	:try_end_0
	.catch Ljava/util/concurrent/ExecutionException; {:try_start_0 .. :try_end_0} :catch_1
	.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
	return-object p0
	:catch_0
	move-exception p0
	goto :goto_0
	:catch_1
	move-exception p0
	:goto_0
	new-instance v0, Ljava/lang/RuntimeException;
	invoke-direct {v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
	throw v0
.end method

.method static getMessageChannel(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 1

	const-string v0, "google.c.a.m_c"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	return-object p0
.end method

.method static getMessageId(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 1

	const-string v0, "google.message_id"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object v0
	if-nez v0, :cond_0
	const-string v0, "message_id"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object v0
	:cond_0
	return-object v0
.end method

.method static getMessageLabel(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 1

	const-string v0, "google.c.a.m_l"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	return-object p0
.end method

.method private static getMessagePriority(Ljava/lang/String;)I
	.locals 1

	const-string v0, "high"
	invoke-virtual {v0, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v0
	if-eqz v0, :cond_0
	const/4 p0, 0x1
	return p0
	:cond_0
	const-string v0, "normal"
	invoke-virtual {v0, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result p0
	if-eqz p0, :cond_1
	const/4 p0, 0x2
	return p0
	:cond_1
	const/4 p0, 0x0
	return p0
.end method

.method static getMessagePriorityForFirelog(Landroid/os/Bundle;)I
	.locals 1

	invoke-static {p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->getPriority(Landroid/os/Bundle;)I
	move-result p0
	const/4 v0, 0x2
	if-ne p0, v0, :cond_0
	const/4 p0, 0x5
	return p0
	:cond_0
	const/4 v0, 0x1
	if-ne p0, v0, :cond_1
	const/16 p0, 0xa
	return p0
	:cond_1
	const/4 p0, 0x0
	return p0
.end method

.method static getMessageTime(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 1

	const-string v0, "google.c.a.ts"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	return-object p0
.end method

.method static getMessageTypeForFirelog(Landroid/os/Bundle;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent$MessageType;
	.locals 0

	if-eqz p0, :cond_0
	invoke-static {p0}, Lcom/google/firebase/messaging/NotificationParams;->isNotification(Landroid/os/Bundle;)Z
	move-result p0
	if-eqz p0, :cond_0
	sget-object p0, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$MessageType;->DISPLAY_NOTIFICATION:Lcom/google/firebase/messaging/reporting/MessagingClientEvent$MessageType;
	goto :goto_0
	:cond_0
	sget-object p0, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$MessageType;->DATA_MESSAGE:Lcom/google/firebase/messaging/reporting/MessagingClientEvent$MessageType;
	:goto_0
	return-object p0
.end method

.method static getMessageTypeForScion(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 0

	if-eqz p0, :cond_0
	invoke-static {p0}, Lcom/google/firebase/messaging/NotificationParams;->isNotification(Landroid/os/Bundle;)Z
	move-result p0
	if-eqz p0, :cond_0
	const-string p0, "display"
	goto :goto_0
	:cond_0
	const-string p0, "data"
	:goto_0
	return-object p0
.end method

.method static getPackageName()Ljava/lang/String;
	.locals 1

	invoke-static {}, Lcom/google/firebase/FirebaseApp;->getInstance()Lcom/google/firebase/FirebaseApp;
	move-result-object v0
	invoke-virtual {v0}, Lcom/google/firebase/FirebaseApp;->getApplicationContext()Landroid/content/Context;
	move-result-object v0
	invoke-virtual {v0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
	move-result-object v0
	return-object v0
.end method

.method static getPriority(Landroid/os/Bundle;)I
	.locals 2

	const-string v0, "google.delivered_priority"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object v0
	if-nez v0, :cond_1
	const-string v0, "google.priority_reduced"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object v0
	const-string v1, "1"
	invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v0
	if-eqz v0, :cond_0
	const/4 p0, 0x2
	return p0
	:cond_0
	const-string v0, "google.priority"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object v0
	:cond_1
	invoke-static {v0}, Lcom/google/firebase/messaging/MessagingAnalytics;->getMessagePriority(Ljava/lang/String;)I
	move-result p0
	return p0
.end method

.method static getProjectNumber(Landroid/os/Bundle;)J
	.locals 6

	const-string v0, "google.c.sender.id"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z
	move-result v1
	const-string v2, "FirebaseMessaging"
	if-eqz v1, :cond_0
	:try_start_0
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	invoke-static {p0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
	move-result-wide v0
	:try_end_0
	.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
	return-wide v0
	:catch_0
	move-exception p0
	const-string v0, "error parsing project number"
	invoke-static {v2, v0, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
	:cond_0
	invoke-static {}, Lcom/google/firebase/FirebaseApp;->getInstance()Lcom/google/firebase/FirebaseApp;
	move-result-object p0
	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
	if-eqz v0, :cond_1
	:try_start_1
	invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
	move-result-wide v0
	:try_end_1
	.catch Ljava/lang/NumberFormatException; {:try_start_1 .. :try_end_1} :catch_1
	return-wide v0
	:catch_1
	move-exception v0
	const-string v1, "error parsing sender ID"
	invoke-static {v2, v1, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
	:cond_1
	invoke-virtual {p0}, Lcom/google/firebase/FirebaseApp;->getOptions()Lcom/google/firebase/FirebaseOptions;
	move-result-object p0
	invoke-virtual {p0}, Lcom/google/firebase/FirebaseOptions;->getApplicationId()Ljava/lang/String;
	move-result-object p0
	const-string v0, "1:"
	invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
	move-result v0
	const-string v1, "error parsing app ID"
	const-wide/16 v3, 0x0
	if-nez v0, :cond_2
	:try_start_2
	invoke-static {p0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
	move-result-wide v0
	:try_end_2
	.catch Ljava/lang/NumberFormatException; {:try_start_2 .. :try_end_2} :catch_2
	return-wide v0
	:catch_2
	move-exception p0
	invoke-static {v2, v1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
	goto :goto_0
	:cond_2
	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 v5, 0x2
	if-ge v0, v5, :cond_3
	return-wide v3
	:cond_3
	const/4 v0, 0x1
	aget-object p0, p0, v0
	invoke-virtual {p0}, Ljava/lang/String;->isEmpty()Z
	move-result v0
	if-eqz v0, :cond_4
	return-wide v3
	:try_start_3
	:cond_4
	invoke-static {p0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
	move-result-wide v0
	:try_end_3
	.catch Ljava/lang/NumberFormatException; {:try_start_3 .. :try_end_3} :catch_3
	return-wide v0
	:catch_3
	move-exception p0
	invoke-static {v2, v1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
	:goto_0
	return-wide v3
.end method

.method static getTopic(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 1

	const-string v0, "from"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	if-eqz p0, :cond_0
	const-string v0, "/topics/"
	invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
	move-result v0
	if-eqz v0, :cond_0
	goto :goto_0
	:cond_0
	const/4 p0, 0x0
	:goto_0
	return-object p0
.end method

.method static getTtl(Landroid/os/Bundle;)I
	.locals 2

	const-string v0, "google.ttl"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;
	move-result-object p0
	instance-of v0, p0, Ljava/lang/Integer;
	if-eqz v0, :cond_0
	check-cast p0, Ljava/lang/Integer;
	invoke-virtual {p0}, Ljava/lang/Integer;->intValue()I
	move-result p0
	return p0
	:cond_0
	instance-of v0, p0, Ljava/lang/String;
	if-eqz v0, :cond_1
	:try_start_0
	move-object v0, p0
	check-cast v0, Ljava/lang/String;
	invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
	move-result p0
	:try_end_0
	.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
	return p0
	:catch_0
	new-instance v0, Ljava/lang/StringBuilder;
	invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
	const-string v1, "Invalid TTL: "
	invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
	invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object p0
	const-string v0, "FirebaseMessaging"
	invoke-static {v0, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
	:cond_1
	const/4 p0, 0x0
	return p0
.end method

.method static getUseDeviceTime(Landroid/os/Bundle;)Ljava/lang/String;
	.locals 2

	const-string v0, "google.c.a.udt"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z
	move-result v1
	if-eqz v1, :cond_0
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	return-object p0
	:cond_0
	const/4 p0, 0x0
	return-object p0
.end method

.method private static isDirectBootMessage(Landroid/content/Intent;)Z
	.locals 1

	invoke-virtual {p0}, Landroid/content/Intent;->getAction()Ljava/lang/String;
	move-result-object p0
	const-string v0, "com.google.firebase.messaging.RECEIVE_DIRECT_BOOT"
	invoke-virtual {v0, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result p0
	return p0
.end method

.method public static logNotificationDismiss(Landroid/content/Intent;)V
	.locals 1

	invoke-virtual {p0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
	move-result-object p0
	const-string v0, "_nd"
	invoke-static {v0, p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->logToScion(Ljava/lang/String;Landroid/os/Bundle;)V
	return-void
.end method

.method public static logNotificationForeground(Landroid/content/Intent;)V
	.locals 1

	invoke-virtual {p0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
	move-result-object p0
	const-string v0, "_nf"
	invoke-static {v0, p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->logToScion(Ljava/lang/String;Landroid/os/Bundle;)V
	return-void
.end method

.method public static logNotificationOpen(Landroid/os/Bundle;)V
	.locals 1

	invoke-static {p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->setUserPropertyIfRequired(Landroid/os/Bundle;)V
	const-string v0, "_no"
	invoke-static {v0, p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->logToScion(Ljava/lang/String;Landroid/os/Bundle;)V
	return-void
.end method

.method public static logNotificationReceived(Landroid/content/Intent;)V
	.locals 2

	invoke-static {p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->shouldUploadScionMetrics(Landroid/content/Intent;)Z
	move-result v0
	if-eqz v0, :cond_0
	invoke-virtual {p0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
	move-result-object v0
	const-string v1, "_nr"
	invoke-static {v1, v0}, Lcom/google/firebase/messaging/MessagingAnalytics;->logToScion(Ljava/lang/String;Landroid/os/Bundle;)V
	:cond_0
	invoke-static {p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->shouldUploadFirelogAnalytics(Landroid/content/Intent;)Z
	move-result v0
	if-eqz v0, :cond_1
	sget-object v0, Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Event;->MESSAGE_DELIVERED:Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Event;
	invoke-static {}, Lcom/google/firebase/messaging/FirebaseMessaging;->getTransportFactory()Lcom/google/android/datatransport/TransportFactory;
	move-result-object v1
	invoke-static {v0, p0, v1}, Lcom/google/firebase/messaging/MessagingAnalytics;->logToFirelog(Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Event;Landroid/content/Intent;Lcom/google/android/datatransport/TransportFactory;)V
	:cond_1
	return-void
.end method

.method private static logToFirelog(Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Event;Landroid/content/Intent;Lcom/google/android/datatransport/TransportFactory;)V
	.locals 4

	const-string v0, "FirebaseMessaging"
	if-nez p2, :cond_0
	const-string p0, "TransportFactory is null. Skip exporting message delivery metrics to Big Query"
	invoke-static {v0, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
	return-void
	:cond_0
	invoke-static {p0, p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->eventToProto(Lcom/google/firebase/messaging/reporting/MessagingClientEvent$Event;Landroid/content/Intent;)Lcom/google/firebase/messaging/reporting/MessagingClientEvent;
	move-result-object p0
	if-nez p0, :cond_1
	return-void
	:try_start_0
	:cond_1
	const-string p1, "FCM_CLIENT_EVENT_LOGGING"
	const-class v1, Lcom/google/firebase/messaging/reporting/MessagingClientEventExtension;
	const-string v2, "proto"
	invoke-static {v2}, Lcom/google/android/datatransport/Encoding;->of(Ljava/lang/String;)Lcom/google/android/datatransport/Encoding;
	move-result-object v2
	new-instance v3, Lcom/google/firebase/messaging/MessagingAnalytics$$ExternalSyntheticLambda0;
	invoke-direct {v3}, Lcom/google/firebase/messaging/MessagingAnalytics$$ExternalSyntheticLambda0;-><init>()V
	invoke-interface {p2, p1, v1, v2, v3}, Lcom/google/android/datatransport/TransportFactory;->getTransport(Ljava/lang/String;Ljava/lang/Class;Lcom/google/android/datatransport/Encoding;Lcom/google/android/datatransport/Transformer;)Lcom/google/android/datatransport/Transport;
	move-result-object p1
	invoke-static {}, Lcom/google/firebase/messaging/reporting/MessagingClientEventExtension;->newBuilder()Lcom/google/firebase/messaging/reporting/MessagingClientEventExtension$Builder;
	move-result-object p2
	invoke-virtual {p2, p0}, Lcom/google/firebase/messaging/reporting/MessagingClientEventExtension$Builder;->setMessagingClientEvent(Lcom/google/firebase/messaging/reporting/MessagingClientEvent;)Lcom/google/firebase/messaging/reporting/MessagingClientEventExtension$Builder;
	move-result-object p0
	invoke-virtual {p0}, Lcom/google/firebase/messaging/reporting/MessagingClientEventExtension$Builder;->build()Lcom/google/firebase/messaging/reporting/MessagingClientEventExtension;
	move-result-object p0
	invoke-static {p0}, Lcom/google/android/datatransport/Event;->ofData(Ljava/lang/Object;)Lcom/google/android/datatransport/Event;
	move-result-object p0
	invoke-interface {p1, p0}, Lcom/google/android/datatransport/Transport;->send(Lcom/google/android/datatransport/Event;)V
	:try_end_0
	.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
	goto :goto_0
	:catch_0
	move-exception p0
	const-string p1, "Failed to send big query analytics payload."
	invoke-static {v0, p1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
	:goto_0
	return-void
.end method

.method static logToScion(Ljava/lang/String;Landroid/os/Bundle;)V
	.locals 4

	const-string v0, "FirebaseMessaging"
	:try_start_0
	invoke-static {}, Lcom/google/firebase/FirebaseApp;->getInstance()Lcom/google/firebase/FirebaseApp;
	:try_end_0
	.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_2
	if-nez p1, :cond_0
	new-instance p1, Landroid/os/Bundle;
	invoke-direct {p1}, Landroid/os/Bundle;-><init>()V
	:cond_0
	new-instance v1, Landroid/os/Bundle;
	invoke-direct {v1}, Landroid/os/Bundle;-><init>()V
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getComposerId(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v2
	if-eqz v2, :cond_1
	const-string v3, "_nmid"
	invoke-virtual {v1, v3, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	:cond_1
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getComposerLabel(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v2
	if-eqz v2, :cond_2
	const-string v3, "_nmn"
	invoke-virtual {v1, v3, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	:cond_2
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getMessageLabel(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v2
	invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
	move-result v3
	if-nez v3, :cond_3
	const-string v3, "label"
	invoke-virtual {v1, v3, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	:cond_3
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getMessageChannel(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v2
	invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
	move-result v3
	if-nez v3, :cond_4
	const-string v3, "message_channel"
	invoke-virtual {v1, v3, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	:cond_4
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getTopic(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v2
	if-eqz v2, :cond_5
	const-string v3, "_nt"
	invoke-virtual {v1, v3, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	:cond_5
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getMessageTime(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v2
	if-eqz v2, :cond_6
	:try_start_1
	const-string v3, "_nmt"
	invoke-static {v2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
	move-result v2
	invoke-virtual {v1, v3, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
	:try_end_1
	.catch Ljava/lang/NumberFormatException; {:try_start_1 .. :try_end_1} :catch_0
	goto :goto_0
	:catch_0
	move-exception v2
	const-string v3, "Error while parsing timestamp in GCM event"
	invoke-static {v0, v3, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
	:goto_0
	:cond_6
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getUseDeviceTime(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object v2
	if-eqz v2, :cond_7
	:try_start_2
	const-string v3, "_ndt"
	invoke-static {v2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
	move-result v2
	invoke-virtual {v1, v3, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
	:try_end_2
	.catch Ljava/lang/NumberFormatException; {:try_start_2 .. :try_end_2} :catch_1
	goto :goto_1
	:catch_1
	move-exception v2
	const-string v3, "Error while parsing use_device_time in GCM event"
	invoke-static {v0, v3, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
	:goto_1
	:cond_7
	invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->getMessageTypeForScion(Landroid/os/Bundle;)Ljava/lang/String;
	move-result-object p1
	const-string v2, "_nr"
	invoke-virtual {v2, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v2
	if-nez v2, :cond_8
	const-string v2, "_nf"
	invoke-virtual {v2, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v2
	if-eqz v2, :cond_9
	:cond_8
	const-string v2, "_nmc"
	invoke-virtual {v1, v2, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	:cond_9
	const/4 p1, 0x3
	invoke-static {v0, p1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result p1
	if-eqz p1, :cond_a
	new-instance p1, Ljava/lang/StringBuilder;
	invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
	const-string v2, "Logging to scion event="
	invoke-virtual {p1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {p1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	const-string v2, " scionPayload="
	invoke-virtual {p1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
	invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object p1
	invoke-static {v0, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
	:cond_a
	invoke-static {}, Lcom/google/firebase/FirebaseApp;->getInstance()Lcom/google/firebase/FirebaseApp;
	move-result-object p1
	const-class v2, Lcom/google/firebase/analytics/connector/AnalyticsConnector;
	invoke-virtual {p1, v2}, Lcom/google/firebase/FirebaseApp;->get(Ljava/lang/Class;)Ljava/lang/Object;
	move-result-object p1
	check-cast p1, Lcom/google/firebase/analytics/connector/AnalyticsConnector;
	if-eqz p1, :cond_b
	const-string v0, "fcm"
	invoke-interface {p1, v0, p0, v1}, Lcom/google/firebase/analytics/connector/AnalyticsConnector;->logEvent(Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)V
	goto :goto_2
	:cond_b
	const-string p0, "Unable to log event: analytics library is missing"
	invoke-static {v0, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
	:goto_2
	return-void
	:catch_2
	const-string p0, "Default FirebaseApp has not been initialized. Skip logging event to GA."
	invoke-static {v0, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
	return-void
.end method

.method static setDeliveryMetricsExportToBigQuery(Z)V
	.locals 3

	invoke-static {}, Lcom/google/firebase/FirebaseApp;->getInstance()Lcom/google/firebase/FirebaseApp;
	move-result-object v0
	invoke-virtual {v0}, Lcom/google/firebase/FirebaseApp;->getApplicationContext()Landroid/content/Context;
	move-result-object v0
	const-string v1, "com.google.firebase.messaging"
	const/4 v2, 0x0
	invoke-virtual {v0, v1, v2}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
	move-result-object v0
	invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
	move-result-object v0
	const-string v1, "export_to_big_query"
	invoke-interface {v0, v1, p0}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
	move-result-object p0
	invoke-interface {p0}, Landroid/content/SharedPreferences$Editor;->apply()V
	return-void
.end method

.method private static setUserPropertyIfRequired(Landroid/os/Bundle;)V
	.locals 5

	if-nez p0, :cond_0
	return-void
	:cond_0
	const-string v0, "google.c.a.tc"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object v0
	const-string v1, "1"
	invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v0
	const/4 v1, 0x3
	const-string v2, "FirebaseMessaging"
	if-eqz v0, :cond_3
	invoke-static {}, Lcom/google/firebase/FirebaseApp;->getInstance()Lcom/google/firebase/FirebaseApp;
	move-result-object v0
	const-class v3, Lcom/google/firebase/analytics/connector/AnalyticsConnector;
	invoke-virtual {v0, v3}, Lcom/google/firebase/FirebaseApp;->get(Ljava/lang/Class;)Ljava/lang/Object;
	move-result-object v0
	check-cast v0, Lcom/google/firebase/analytics/connector/AnalyticsConnector;
	invoke-static {v2, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result v1
	if-eqz v1, :cond_1
	const-string v1, "Received event with track-conversion=true. Setting user property and reengagement event"
	invoke-static {v2, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
	:cond_1
	if-eqz v0, :cond_2
	const-string v1, "google.c.a.c_id"
	invoke-virtual {p0, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	const-string v1, "fcm"
	const-string v2, "_ln"
	invoke-interface {v0, v1, v2, p0}, Lcom/google/firebase/analytics/connector/AnalyticsConnector;->setUserProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V
	new-instance v2, Landroid/os/Bundle;
	invoke-direct {v2}, Landroid/os/Bundle;-><init>()V
	const-string v3, "source"
	const-string v4, "Firebase"
	invoke-virtual {v2, v3, v4}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	const-string v3, "medium"
	const-string v4, "notification"
	invoke-virtual {v2, v3, v4}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	const-string v3, "campaign"
	invoke-virtual {v2, v3, p0}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	const-string p0, "_cmp"
	invoke-interface {v0, v1, p0, v2}, Lcom/google/firebase/analytics/connector/AnalyticsConnector;->logEvent(Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)V
	goto :goto_0
	:cond_2
	const-string p0, "Unable to set user property for conversion tracking:  analytics library is missing"
	invoke-static {v2, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
	goto :goto_0
	:cond_3
	invoke-static {v2, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result p0
	if-eqz p0, :cond_4
	const-string p0, "Received event with track-conversion=false. Do not set user property"
	invoke-static {v2, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
	:goto_0
	:cond_4
	return-void
.end method

.method public static shouldUploadFirelogAnalytics(Landroid/content/Intent;)Z
	.locals 0

	if-eqz p0, :cond_1
	invoke-static {p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->isDirectBootMessage(Landroid/content/Intent;)Z
	move-result p0
	if-eqz p0, :cond_0
	goto :goto_0
	:cond_0
	invoke-static {}, Lcom/google/firebase/messaging/MessagingAnalytics;->deliveryMetricsExportToBigQueryEnabled()Z
	move-result p0
	return p0
	:cond_1
	:goto_0
	const/4 p0, 0x0
	return p0
.end method

.method public static shouldUploadScionMetrics(Landroid/content/Intent;)Z
	.locals 1

	if-eqz p0, :cond_1
	invoke-static {p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->isDirectBootMessage(Landroid/content/Intent;)Z
	move-result v0
	if-eqz v0, :cond_0
	goto :goto_0
	:cond_0
	invoke-virtual {p0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
	move-result-object p0
	invoke-static {p0}, Lcom/google/firebase/messaging/MessagingAnalytics;->shouldUploadScionMetrics(Landroid/os/Bundle;)Z
	move-result p0
	return p0
	:cond_1
	:goto_0
	const/4 p0, 0x0
	return p0
.end method

.method public static shouldUploadScionMetrics(Landroid/os/Bundle;)Z
	.locals 1

	if-nez p0, :cond_0
	const/4 p0, 0x0
	return p0
	:cond_0
	const-string v0, "google.c.a.e"
	invoke-virtual {p0, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p0
	const-string v0, "1"
	invoke-virtual {v0, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result p0
	return p0
.end method