- Imported from https://github.com/supermegamestre/Project-Real-Resurrection-3 - APKTool decompilation (Smali bytecode) for modding and rebuilding APK - Supports both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) architectures - Includes full Smali source, resources, and native libraries - Ready to rebuild APK after modifications with apktool b command - Added comprehensive README-apktool.md with modding guide This branch complements the JADX branches: - Use JADX (main/discord-community) to UNDERSTAND code (readable Java) - Use APKTool (this branch) to MODIFY and REBUILD APK (editable Smali) Total: 44,417 files, 538.51 MB Smali source code
362 lines
11 KiB
Smali
362 lines
11 KiB
Smali
.class public Lcom/google/firebase/messaging/DisplayNotification;
|
|
.super Ljava/lang/Object;
|
|
.source "SourceFile"
|
|
|
|
|
|
# instance fields
|
|
.field public final context:Landroid/content/Context;
|
|
|
|
.field public final networkIoExecutor:Ljava/util/concurrent/ExecutorService;
|
|
|
|
.field public final params:Lcom/google/firebase/messaging/NotificationParams;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;Lcom/google/firebase/messaging/NotificationParams;Ljava/util/concurrent/ExecutorService;)V
|
|
.locals 0
|
|
|
|
.line 54
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p3, p0, Lcom/google/firebase/messaging/DisplayNotification;->networkIoExecutor:Ljava/util/concurrent/ExecutorService;
|
|
|
|
iput-object p1, p0, Lcom/google/firebase/messaging/DisplayNotification;->context:Landroid/content/Context;
|
|
|
|
iput-object p2, p0, Lcom/google/firebase/messaging/DisplayNotification;->params:Lcom/google/firebase/messaging/NotificationParams;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public handleNotification()Z
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Lcom/google/firebase/messaging/DisplayNotification;->params:Lcom/google/firebase/messaging/NotificationParams;
|
|
|
|
const-string v1, "gcm.n.noui"
|
|
|
|
.line 100
|
|
invoke-virtual {v0, v1}, Lcom/google/firebase/messaging/NotificationParams;->getBoolean(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return v1
|
|
|
|
.line 104
|
|
:cond_0
|
|
invoke-virtual {p0}, Lcom/google/firebase/messaging/DisplayNotification;->isAppForeground()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
|
|
.line 107
|
|
:cond_1
|
|
invoke-virtual {p0}, Lcom/google/firebase/messaging/DisplayNotification;->startImageDownloadInBackground()Lcom/google/firebase/messaging/ImageDownload;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v2, p0, Lcom/google/firebase/messaging/DisplayNotification;->context:Landroid/content/Context;
|
|
|
|
iget-object v3, p0, Lcom/google/firebase/messaging/DisplayNotification;->params:Lcom/google/firebase/messaging/NotificationParams;
|
|
|
|
.line 109
|
|
invoke-static {v2, v3}, Lcom/google/firebase/messaging/CommonNotificationBuilder;->createNotificationInfo(Landroid/content/Context;Lcom/google/firebase/messaging/NotificationParams;)Lcom/google/firebase/messaging/CommonNotificationBuilder$DisplayNotificationInfo;
|
|
|
|
move-result-object v2
|
|
|
|
.line 110
|
|
iget-object v3, v2, Lcom/google/firebase/messaging/CommonNotificationBuilder$DisplayNotificationInfo;->notificationBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
invoke-virtual {p0, v3, v0}, Lcom/google/firebase/messaging/DisplayNotification;->waitForAndApplyImageDownload(Landroidx/core/app/NotificationCompat$Builder;Lcom/google/firebase/messaging/ImageDownload;)V
|
|
|
|
.line 111
|
|
invoke-virtual {p0, v2}, Lcom/google/firebase/messaging/DisplayNotification;->showNotification(Lcom/google/firebase/messaging/CommonNotificationBuilder$DisplayNotificationInfo;)V
|
|
|
|
return v1
|
|
.end method
|
|
|
|
.method public final isAppForeground()Z
|
|
.locals 5
|
|
|
|
iget-object v0, p0, Lcom/google/firebase/messaging/DisplayNotification;->context:Landroid/content/Context;
|
|
|
|
const-string v1, "keyguard"
|
|
|
|
.line 62
|
|
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/app/KeyguardManager;
|
|
|
|
.line 63
|
|
invoke-virtual {v0}, Landroid/app/KeyguardManager;->inKeyguardRestrictedInputMode()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return v1
|
|
|
|
.line 68
|
|
:cond_0
|
|
invoke-static {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastLollipop()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const-wide/16 v2, 0xa
|
|
|
|
.line 76
|
|
invoke-static {v2, v3}, Landroid/os/SystemClock;->sleep(J)V
|
|
|
|
.line 78
|
|
:cond_1
|
|
invoke-static {}, Landroid/os/Process;->myPid()I
|
|
|
|
move-result v0
|
|
|
|
iget-object v2, p0, Lcom/google/firebase/messaging/DisplayNotification;->context:Landroid/content/Context;
|
|
|
|
const-string v3, "activity"
|
|
|
|
.line 79
|
|
invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Landroid/app/ActivityManager;
|
|
|
|
.line 80
|
|
invoke-virtual {v2}, Landroid/app/ActivityManager;->getRunningAppProcesses()Ljava/util/List;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
.line 82
|
|
invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_2
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Landroid/app/ActivityManager$RunningAppProcessInfo;
|
|
|
|
.line 83
|
|
iget v4, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->pid:I
|
|
|
|
if-ne v4, v0, :cond_2
|
|
|
|
.line 84
|
|
iget v0, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->importance:I
|
|
|
|
const/16 v2, 0x64
|
|
|
|
if-ne v0, v2, :cond_3
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:cond_3
|
|
return v1
|
|
.end method
|
|
|
|
.method public final showNotification(Lcom/google/firebase/messaging/CommonNotificationBuilder$DisplayNotificationInfo;)V
|
|
.locals 3
|
|
|
|
const-string v0, "FirebaseMessaging"
|
|
|
|
const/4 v1, 0x3
|
|
|
|
.line 170
|
|
invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
|
|
|
|
iget-object v0, p0, Lcom/google/firebase/messaging/DisplayNotification;->context:Landroid/content/Context;
|
|
|
|
const-string v1, "notification"
|
|
|
|
.line 175
|
|
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/app/NotificationManager;
|
|
|
|
.line 177
|
|
iget-object v1, p1, Lcom/google/firebase/messaging/CommonNotificationBuilder$DisplayNotificationInfo;->tag:Ljava/lang/String;
|
|
|
|
iget v2, p1, Lcom/google/firebase/messaging/CommonNotificationBuilder$DisplayNotificationInfo;->id:I
|
|
|
|
iget-object p1, p1, Lcom/google/firebase/messaging/CommonNotificationBuilder$DisplayNotificationInfo;->notificationBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
invoke-virtual {p1}, Landroidx/core/app/NotificationCompat$Builder;->build()Landroid/app/Notification;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, v1, v2, p1}, Landroid/app/NotificationManager;->notify(Ljava/lang/String;ILandroid/app/Notification;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final startImageDownloadInBackground()Lcom/google/firebase/messaging/ImageDownload;
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/google/firebase/messaging/DisplayNotification;->params:Lcom/google/firebase/messaging/NotificationParams;
|
|
|
|
const-string v1, "gcm.n.image"
|
|
|
|
.line 117
|
|
invoke-virtual {v0, v1}, Lcom/google/firebase/messaging/NotificationParams;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 118
|
|
invoke-static {v0}, Lcom/google/firebase/messaging/ImageDownload;->create(Ljava/lang/String;)Lcom/google/firebase/messaging/ImageDownload;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/google/firebase/messaging/DisplayNotification;->networkIoExecutor:Ljava/util/concurrent/ExecutorService;
|
|
|
|
.line 120
|
|
invoke-virtual {v0, v1}, Lcom/google/firebase/messaging/ImageDownload;->start(Ljava/util/concurrent/ExecutorService;)V
|
|
|
|
:cond_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final waitForAndApplyImageDownload(Landroidx/core/app/NotificationCompat$Builder;Lcom/google/firebase/messaging/ImageDownload;)V
|
|
.locals 5
|
|
|
|
const-string v0, "FirebaseMessaging"
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 138
|
|
:cond_0
|
|
:try_start_0
|
|
invoke-virtual {p2}, Lcom/google/firebase/messaging/ImageDownload;->getTask()Lcom/google/android/gms/tasks/Task;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
const-wide/16 v3, 0x5
|
|
|
|
invoke-static {v1, v3, v4, v2}, Lcom/google/android/gms/tasks/Tasks;->await(Lcom/google/android/gms/tasks/Task;JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroid/graphics/Bitmap;
|
|
|
|
.line 146
|
|
invoke-virtual {p1, v1}, Landroidx/core/app/NotificationCompat$Builder;->setLargeIcon(Landroid/graphics/Bitmap;)Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
.line 147
|
|
new-instance v2, Landroidx/core/app/NotificationCompat$BigPictureStyle;
|
|
|
|
invoke-direct {v2}, Landroidx/core/app/NotificationCompat$BigPictureStyle;-><init>()V
|
|
|
|
invoke-virtual {v2, v1}, Landroidx/core/app/NotificationCompat$BigPictureStyle;->bigPicture(Landroid/graphics/Bitmap;)Landroidx/core/app/NotificationCompat$BigPictureStyle;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {v1, v2}, Landroidx/core/app/NotificationCompat$BigPictureStyle;->bigLargeIcon(Landroid/graphics/Bitmap;)Landroidx/core/app/NotificationCompat$BigPictureStyle;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p1, v1}, Landroidx/core/app/NotificationCompat$Builder;->setStyle(Landroidx/core/app/NotificationCompat$Style;)Landroidx/core/app/NotificationCompat$Builder;
|
|
:try_end_0
|
|
.catch Ljava/util/concurrent/ExecutionException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catch Ljava/util/concurrent/TimeoutException; {:try_start_0 .. :try_end_0} :catch_1
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
const-string p1, "Failed to download image in time, showing notification without it"
|
|
|
|
.line 158
|
|
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
.line 159
|
|
invoke-virtual {p2}, Lcom/google/firebase/messaging/ImageDownload;->close()V
|
|
|
|
goto :goto_1
|
|
|
|
:catch_2
|
|
const-string p1, "Interrupted while downloading image, showing notification without it"
|
|
|
|
.line 154
|
|
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
.line 155
|
|
invoke-virtual {p2}, Lcom/google/firebase/messaging/ImageDownload;->close()V
|
|
|
|
.line 156
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Thread;->interrupt()V
|
|
|
|
goto :goto_1
|
|
|
|
.line 152
|
|
:goto_0
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Failed to download image: "
|
|
|
|
invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:goto_1
|
|
return-void
|
|
.end method
|