410 lines
10 KiB
Smali
410 lines
10 KiB
Smali
.class final Lcom/google/firebase/messaging/ProxyNotificationInitializer;
|
|
.super Ljava/lang/Object;
|
|
.source "com.google.firebase:firebase-messaging@@23.0.0"
|
|
|
|
|
|
# direct methods
|
|
.method private static allowedToUse(Landroid/content/Context;)Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-static {}, Landroid/os/Binder;->getCallingUid()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
|
|
|
|
move-result-object p0
|
|
|
|
iget p0, p0, Landroid/content/pm/ApplicationInfo;->uid:I
|
|
|
|
if-ne v0, p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static initialize(Landroid/content/Context;)V
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/WorkerThread;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {p0}, Lcom/google/firebase/messaging/ProxyNotificationPreferences;->isProxyNotificationInitialized(Landroid/content/Context;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
sget-object v0, Lcom/google/firebase/messaging/ProxyNotificationInitializer$$ExternalSyntheticLambda1;->INSTANCE:Lcom/google/firebase/messaging/ProxyNotificationInitializer$$ExternalSyntheticLambda1;
|
|
|
|
.line 2
|
|
invoke-static {p0}, Lcom/google/firebase/messaging/ProxyNotificationInitializer;->shouldEnableProxyNotification(Landroid/content/Context;)Z
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v0, p0, v1}, Lcom/google/firebase/messaging/ProxyNotificationInitializer;->setEnableProxyNotification(Ljava/util/concurrent/Executor;Landroid/content/Context;Z)Lcom/google/android/gms/tasks/Task;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static isProxyNotificationEnabled(Landroid/content/Context;)Z
|
|
.locals 4
|
|
|
|
.line 1
|
|
invoke-static {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastQ()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const-string v3, "FirebaseMessaging"
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 2
|
|
invoke-static {v3, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const-string p0, "Platform doesn\'t support proxying."
|
|
|
|
.line 3
|
|
invoke-static {v3, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:cond_0
|
|
return v2
|
|
|
|
.line 4
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/google/firebase/messaging/ProxyNotificationInitializer;->allowedToUse(Landroid/content/Context;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_3
|
|
|
|
.line 5
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "error retrieving notification delegate for package "
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
new-instance p0, Ljava/lang/String;
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
|
|
|
|
:goto_0
|
|
invoke-static {v3, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return v2
|
|
|
|
:cond_3
|
|
const-class v0, Landroid/app/NotificationManager;
|
|
|
|
.line 6
|
|
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/Class;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Landroid/app/NotificationManager;
|
|
|
|
.line 7
|
|
invoke-virtual {p0}, Landroid/app/NotificationManager;->getNotificationDelegate()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "com.google.android.gms"
|
|
|
|
.line 8
|
|
invoke-virtual {v0, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_5
|
|
|
|
.line 9
|
|
invoke-static {v3, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_4
|
|
|
|
const-string p0, "GMS core is set for proxying"
|
|
|
|
.line 10
|
|
invoke-static {v3, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:cond_4
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_5
|
|
return v2
|
|
.end method
|
|
|
|
.method public static synthetic lambda$setEnableProxyNotification$0(Landroid/content/Context;ZLcom/google/android/gms/tasks/TaskCompletionSource;)V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-static {p0}, Lcom/google/firebase/messaging/ProxyNotificationInitializer;->allowedToUse(Landroid/content/Context;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
const-string p1, "FirebaseMessaging"
|
|
|
|
const-string v1, "error configuring notification delegate for package "
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
.line 3
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/String;
|
|
|
|
.line 4
|
|
invoke-direct {p0, v1}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 5
|
|
:goto_0
|
|
invoke-static {p1, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 6
|
|
invoke-virtual {p2, v0}, Lcom/google/android/gms/tasks/TaskCompletionSource;->trySetResult(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const/4 v1, 0x1
|
|
|
|
.line 7
|
|
:try_start_1
|
|
invoke-static {p0, v1}, Lcom/google/firebase/messaging/ProxyNotificationPreferences;->setProxyNotificationsInitialized(Landroid/content/Context;Z)V
|
|
|
|
const-class v1, Landroid/app/NotificationManager;
|
|
|
|
.line 8
|
|
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/Class;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Landroid/app/NotificationManager;
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
const-string v1, "com.google.android.gms"
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
.line 9
|
|
:try_start_2
|
|
invoke-virtual {p0, v1}, Landroid/app/NotificationManager;->setNotificationDelegate(Ljava/lang/String;)V
|
|
|
|
goto :goto_1
|
|
|
|
.line 10
|
|
:cond_2
|
|
invoke-virtual {p0}, Landroid/app/NotificationManager;->getNotificationDelegate()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 11
|
|
invoke-virtual {p0, v0}, Landroid/app/NotificationManager;->setNotificationDelegate(Ljava/lang/String;)V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
.line 12
|
|
:cond_3
|
|
:goto_1
|
|
invoke-virtual {p2, v0}, Lcom/google/android/gms/tasks/TaskCompletionSource;->trySetResult(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
invoke-virtual {p2, v0}, Lcom/google/android/gms/tasks/TaskCompletionSource;->trySetResult(Ljava/lang/Object;)Z
|
|
|
|
.line 13
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static setEnableProxyNotification(Ljava/util/concurrent/Executor;Landroid/content/Context;Z)Lcom/google/android/gms/tasks/Task;
|
|
.locals 2
|
|
.annotation build Landroid/annotation/TargetApi;
|
|
value = 0x1d
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/concurrent/Executor;",
|
|
"Landroid/content/Context;",
|
|
"Z)",
|
|
"Lcom/google/android/gms/tasks/Task<",
|
|
"Ljava/lang/Void;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastQ()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
.line 2
|
|
invoke-static {p0}, Lcom/google/android/gms/tasks/Tasks;->forResult(Ljava/lang/Object;)Lcom/google/android/gms/tasks/Task;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 3
|
|
:cond_0
|
|
new-instance v0, Lcom/google/android/gms/tasks/TaskCompletionSource;
|
|
|
|
invoke-direct {v0}, Lcom/google/android/gms/tasks/TaskCompletionSource;-><init>()V
|
|
|
|
new-instance v1, Lcom/google/firebase/messaging/ProxyNotificationInitializer$$ExternalSyntheticLambda0;
|
|
|
|
invoke-direct {v1, p1, p2, v0}, Lcom/google/firebase/messaging/ProxyNotificationInitializer$$ExternalSyntheticLambda0;-><init>(Landroid/content/Context;ZLcom/google/android/gms/tasks/TaskCompletionSource;)V
|
|
|
|
.line 4
|
|
invoke-interface {p0, v1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
|
|
|
.line 5
|
|
invoke-virtual {v0}, Lcom/google/android/gms/tasks/TaskCompletionSource;->getTask()Lcom/google/android/gms/tasks/Task;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static shouldEnableProxyNotification(Landroid/content/Context;)Z
|
|
.locals 3
|
|
|
|
const-string v0, "firebase_messaging_notification_delegation_enabled"
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object p0
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 3
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const/16 v2, 0x80
|
|
|
|
.line 4
|
|
invoke-virtual {v1, p0, v2}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 5
|
|
iget-object v1, p0, Landroid/content/pm/ApplicationInfo;->metaData:Landroid/os/Bundle;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 6
|
|
invoke-virtual {v1, v0}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 7
|
|
iget-object p0, p0, Landroid/content/pm/ApplicationInfo;->metaData:Landroid/os/Bundle;
|
|
|
|
invoke-virtual {p0, v0}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;)Z
|
|
|
|
move-result p0
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return p0
|
|
|
|
:catch_0
|
|
:cond_0
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
.end method
|