First Upload

Just the APK
Force update disabled, will only work offline.
This commit is contained in:
supermegamestre
2026-01-26 00:26:29 -03:00
commit 4bbd74a497
44413 changed files with 11043538 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
.class public interface abstract Lcom/helpshift/notification/CoreNotificationManager;
.super Ljava/lang/Object;
.source "SourceFile"
# virtual methods
.method public abstract cancelNotifications()V
.end method
.method public abstract setNotificationChannelId(Ljava/lang/String;)V
.end method
.method public abstract setNotificationIcon(I)V
.end method
.method public abstract setNotificationLargeIcon(I)V
.end method
.method public abstract setNotificationReceivedCallback(Lcom/helpshift/notification/NotificationReceivedCallback;)V
.end method
.method public abstract setNotificationSoundId(I)V
.end method
.method public abstract showDebugLogNotification()V
.end method
.method public abstract showNotification(Ljava/lang/String;Z)V
.end method

View File

@@ -0,0 +1,254 @@
.class public abstract Lcom/helpshift/notification/HSNotification;
.super Ljava/lang/Object;
.source "SourceFile"
# direct methods
.method public static createNotification(Landroid/content/Context;Lcom/helpshift/platform/Device;Ljava/lang/String;IIILjava/lang/Class;)Landroidx/core/app/NotificationCompat$Builder;
.locals 2
.line 47
invoke-interface {p1}, Lcom/helpshift/platform/Device;->getAppName()Ljava/lang/String;
move-result-object p1
.line 48
invoke-static {p2}, Lcom/helpshift/util/Utils;->isNotEmpty(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
goto :goto_0
:cond_0
const-string p2, ""
.line 50
:goto_0
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "Creating Support notification :\n Title : "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v1, "SDKXNotif"
invoke-static {v1, v0}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
.line 52
invoke-static {p0}, Lcom/helpshift/util/ApplicationUtil;->getLogoResourceValue(Landroid/content/Context;)I
move-result v0
.line 55
invoke-static {p0, p3}, Lcom/helpshift/util/AssetsUtil;->resourceExists(Landroid/content/Context;I)Z
move-result v1
if-eqz v1, :cond_1
goto :goto_1
:cond_1
move p3, v0
.line 59
:goto_1
invoke-static {p0, p4}, Lcom/helpshift/util/AssetsUtil;->resourceExists(Landroid/content/Context;I)Z
move-result v0
if-eqz v0, :cond_2
.line 60
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
invoke-static {v0, p4}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
move-result-object p4
goto :goto_2
:cond_2
const/4 p4, 0x0
.line 63
:goto_2
new-instance v0, Landroid/content/Intent;
invoke-direct {v0, p0, p6}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
const-string p6, "SERVICE_MODE"
const-string v1, "WEBCHAT_SERVICE_FLAG"
.line 64
invoke-virtual {v0, p6, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const-string p6, "source"
const-string v1, "notification"
.line 65
invoke-virtual {v0, p6, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 p6, 0x10000000
.line 66
invoke-virtual {v0, p6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
const/16 p6, 0x32
const/high16 v1, 0x4000000
.line 71
invoke-static {p0, p6, v0, v1}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
move-result-object p6
.line 70
invoke-static {p0, p6}, Lcom/helpshift/HSPluginEventBridge;->getPendingIntentForNotification(Landroid/content/Context;Landroid/app/PendingIntent;)Landroid/app/PendingIntent;
move-result-object p6
.line 73
new-instance v0, Landroidx/core/app/NotificationCompat$Builder;
invoke-direct {v0, p0}, Landroidx/core/app/NotificationCompat$Builder;-><init>(Landroid/content/Context;)V
.line 74
invoke-virtual {v0, p3}, Landroidx/core/app/NotificationCompat$Builder;->setSmallIcon(I)Landroidx/core/app/NotificationCompat$Builder;
.line 75
invoke-virtual {v0, p1}, Landroidx/core/app/NotificationCompat$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroidx/core/app/NotificationCompat$Builder;
.line 76
invoke-virtual {v0, p2}, Landroidx/core/app/NotificationCompat$Builder;->setContentText(Ljava/lang/CharSequence;)Landroidx/core/app/NotificationCompat$Builder;
.line 77
invoke-virtual {v0, p6}, Landroidx/core/app/NotificationCompat$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroidx/core/app/NotificationCompat$Builder;
const/4 p1, 0x1
.line 78
invoke-virtual {v0, p1}, Landroidx/core/app/NotificationCompat$Builder;->setAutoCancel(Z)Landroidx/core/app/NotificationCompat$Builder;
if-eqz p4, :cond_3
.line 81
invoke-virtual {v0, p4}, Landroidx/core/app/NotificationCompat$Builder;->setLargeIcon(Landroid/graphics/Bitmap;)Landroidx/core/app/NotificationCompat$Builder;
.line 84
:cond_3
invoke-static {p0, p5}, Lcom/helpshift/notification/HSNotification;->getNotificationSoundUri(Landroid/content/Context;I)Landroid/net/Uri;
move-result-object p1
const-string p2, "android.permission.VIBRATE"
if-nez p1, :cond_5
.line 86
invoke-static {p0, p2}, Lcom/helpshift/util/ApplicationUtil;->isPermissionGranted(Landroid/content/Context;Ljava/lang/String;)Z
move-result p0
if-eqz p0, :cond_4
const/4 p0, -0x1
.line 87
invoke-virtual {v0, p0}, Landroidx/core/app/NotificationCompat$Builder;->setDefaults(I)Landroidx/core/app/NotificationCompat$Builder;
goto :goto_3
:cond_4
const/4 p0, 0x5
.line 90
invoke-virtual {v0, p0}, Landroidx/core/app/NotificationCompat$Builder;->setDefaults(I)Landroidx/core/app/NotificationCompat$Builder;
goto :goto_3
.line 95
:cond_5
invoke-virtual {v0, p1}, Landroidx/core/app/NotificationCompat$Builder;->setSound(Landroid/net/Uri;)Landroidx/core/app/NotificationCompat$Builder;
.line 96
invoke-static {p0, p2}, Lcom/helpshift/util/ApplicationUtil;->isPermissionGranted(Landroid/content/Context;Ljava/lang/String;)Z
move-result p0
if-eqz p0, :cond_6
const/4 p0, 0x6
.line 97
invoke-virtual {v0, p0}, Landroidx/core/app/NotificationCompat$Builder;->setDefaults(I)Landroidx/core/app/NotificationCompat$Builder;
goto :goto_3
:cond_6
const/4 p0, 0x4
.line 101
invoke-virtual {v0, p0}, Landroidx/core/app/NotificationCompat$Builder;->setDefaults(I)Landroidx/core/app/NotificationCompat$Builder;
:goto_3
return-object v0
.end method
.method public static getNotificationSoundUri(Landroid/content/Context;I)Landroid/net/Uri;
.locals 2
if-eqz p1, :cond_0
.line 111
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "android.resource://"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object p0
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p0, "/"
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
.line 112
invoke-static {p0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object p0
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return-object p0
.end method

View File

@@ -0,0 +1,61 @@
.class public Lcom/helpshift/notification/HSNotificationManager$1;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/helpshift/notification/HSNotificationManager;->showNotification(Ljava/lang/String;Z)V
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lcom/helpshift/notification/HSNotificationManager;
# direct methods
.method public constructor <init>(Lcom/helpshift/notification/HSNotificationManager;)V
.locals 0
iput-object p1, p0, Lcom/helpshift/notification/HSNotificationManager$1;->this$0:Lcom/helpshift/notification/HSNotificationManager;
.line 94
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.locals 1
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager$1;->this$0:Lcom/helpshift/notification/HSNotificationManager;
.line 97
invoke-static {v0}, Lcom/helpshift/notification/HSNotificationManager;->access$000(Lcom/helpshift/notification/HSNotificationManager;)Ljava/lang/ref/WeakReference;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/helpshift/notification/NotificationReceivedCallback;
if-eqz v0, :cond_0
.line 99
invoke-interface {v0}, Lcom/helpshift/notification/NotificationReceivedCallback;->onNotificationReceived()V
:cond_0
return-void
.end method

View File

@@ -0,0 +1,55 @@
.class public Lcom/helpshift/notification/HSNotificationManager$2;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/helpshift/notification/HSNotificationManager;->showNotification(Ljava/lang/String;Z)V
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lcom/helpshift/notification/HSNotificationManager;
.field public final synthetic val$notificationText:Ljava/lang/String;
# direct methods
.method public constructor <init>(Lcom/helpshift/notification/HSNotificationManager;Ljava/lang/String;)V
.locals 0
iput-object p1, p0, Lcom/helpshift/notification/HSNotificationManager$2;->this$0:Lcom/helpshift/notification/HSNotificationManager;
iput-object p2, p0, Lcom/helpshift/notification/HSNotificationManager$2;->val$notificationText:Ljava/lang/String;
.line 107
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.locals 3
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager$2;->this$0:Lcom/helpshift/notification/HSNotificationManager;
iget-object v1, p0, Lcom/helpshift/notification/HSNotificationManager$2;->val$notificationText:Ljava/lang/String;
const-class v2, Lcom/helpshift/activities/HSMainActivity;
.line 110
invoke-static {v0, v1, v2}, Lcom/helpshift/notification/HSNotificationManager;->access$100(Lcom/helpshift/notification/HSNotificationManager;Ljava/lang/String;Ljava/lang/Class;)V
return-void
.end method

View File

@@ -0,0 +1,51 @@
.class public Lcom/helpshift/notification/HSNotificationManager$3;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/helpshift/notification/HSNotificationManager;->showDebugLogNotification()V
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lcom/helpshift/notification/HSNotificationManager;
# direct methods
.method public constructor <init>(Lcom/helpshift/notification/HSNotificationManager;)V
.locals 0
iput-object p1, p0, Lcom/helpshift/notification/HSNotificationManager$3;->this$0:Lcom/helpshift/notification/HSNotificationManager;
.line 119
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.locals 3
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager$3;->this$0:Lcom/helpshift/notification/HSNotificationManager;
const-string v1, "Helpshift Debugger: Tap to share debug logs"
const-class v2, Lcom/helpshift/activities/HSDebugActivity;
.line 122
invoke-static {v0, v1, v2}, Lcom/helpshift/notification/HSNotificationManager;->access$100(Lcom/helpshift/notification/HSNotificationManager;Ljava/lang/String;Ljava/lang/Class;)V
return-void
.end method

View File

@@ -0,0 +1,421 @@
.class public Lcom/helpshift/notification/HSNotificationManager;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/helpshift/notification/CoreNotificationManager;
# instance fields
.field public context:Landroid/content/Context;
.field public device:Lcom/helpshift/platform/Device;
.field public notificationReceivedCallback:Ljava/lang/ref/WeakReference;
.field public persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.field public threadingService:Lcom/helpshift/concurrency/HSThreadingService;
# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/helpshift/platform/Device;Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/concurrency/HSThreadingService;)V
.locals 0
.line 46
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/helpshift/notification/HSNotificationManager;->context:Landroid/content/Context;
iput-object p2, p0, Lcom/helpshift/notification/HSNotificationManager;->device:Lcom/helpshift/platform/Device;
iput-object p3, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iput-object p4, p0, Lcom/helpshift/notification/HSNotificationManager;->threadingService:Lcom/helpshift/concurrency/HSThreadingService;
return-void
.end method
.method public static synthetic access$000(Lcom/helpshift/notification/HSNotificationManager;)Ljava/lang/ref/WeakReference;
.locals 0
.line 33
iget-object p0, p0, Lcom/helpshift/notification/HSNotificationManager;->notificationReceivedCallback:Ljava/lang/ref/WeakReference;
return-object p0
.end method
.method public static synthetic access$100(Lcom/helpshift/notification/HSNotificationManager;Ljava/lang/String;Ljava/lang/Class;)V
.locals 0
.line 33
invoke-virtual {p0, p1, p2}, Lcom/helpshift/notification/HSNotificationManager;->showNotificationInternal(Ljava/lang/String;Ljava/lang/Class;)V
return-void
.end method
# virtual methods
.method public final attachChannelId(Landroid/app/Notification;Landroid/content/Context;)Landroid/app/Notification;
.locals 2
.line 156
invoke-static {p2}, Lcom/helpshift/util/ApplicationUtil;->getTargetSDKVersion(Landroid/content/Context;)I
move-result v0
const/16 v1, 0x1a
if-lt v0, v1, :cond_0
.line 159
invoke-static {p2, p1}, Landroid/app/Notification$Builder;->recoverBuilder(Landroid/content/Context;Landroid/app/Notification;)Landroid/app/Notification$Builder;
move-result-object p1
.line 160
invoke-virtual {p0, p2}, Lcom/helpshift/notification/HSNotificationManager;->getActiveNotificationChannel(Landroid/content/Context;)Ljava/lang/String;
move-result-object p2
invoke-virtual {p1, p2}, Landroid/app/Notification$Builder;->setChannelId(Ljava/lang/String;)Landroid/app/Notification$Builder;
.line 161
invoke-virtual {p1}, Landroid/app/Notification$Builder;->build()Landroid/app/Notification;
move-result-object p1
:cond_0
return-object p1
.end method
.method public cancelNotifications()V
.locals 1
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->context:Landroid/content/Context;
.line 214
invoke-static {v0}, Lcom/helpshift/util/ApplicationUtil;->cancelNotification(Landroid/content/Context;)V
return-void
.end method
.method public final deleteDefaultNotificationChannel(Landroid/content/Context;)V
.locals 2
.line 181
invoke-static {p1}, Lcom/helpshift/util/ApplicationUtil;->getNotificationManager(Landroid/content/Context;)Landroid/app/NotificationManager;
move-result-object p1
if-eqz p1, :cond_0
const-string v0, "In-app Support"
.line 184
invoke-virtual {p1, v0}, Landroid/app/NotificationManager;->getNotificationChannel(Ljava/lang/String;)Landroid/app/NotificationChannel;
move-result-object v1
if-eqz v1, :cond_0
.line 185
invoke-virtual {p1, v0}, Landroid/app/NotificationManager;->deleteNotificationChannel(Ljava/lang/String;)V
:cond_0
return-void
.end method
.method public final ensureDefaultNotificationChannelCreated(Landroid/content/Context;)V
.locals 4
.line 192
invoke-static {p1}, Lcom/helpshift/util/ApplicationUtil;->getNotificationManager(Landroid/content/Context;)Landroid/app/NotificationManager;
move-result-object v0
if-eqz v0, :cond_1
const-string v1, "In-app Support"
.line 194
invoke-virtual {v0, v1}, Landroid/app/NotificationManager;->getNotificationChannel(Ljava/lang/String;)Landroid/app/NotificationChannel;
move-result-object v2
if-nez v2, :cond_1
.line 200
new-instance v2, Landroid/app/NotificationChannel;
const/4 v3, 0x3
invoke-direct {v2, v1, v1, v3}, Landroid/app/NotificationChannel;-><init>(Ljava/lang/String;Ljava/lang/CharSequence;I)V
const-string v1, ""
.line 201
invoke-virtual {v2, v1}, Landroid/app/NotificationChannel;->setDescription(Ljava/lang/String;)V
iget-object v1, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 203
invoke-virtual {v1}, Lcom/helpshift/storage/HSPersistentStorage;->getNotificationSoundId()I
move-result v1
invoke-static {p1, v1}, Lcom/helpshift/notification/HSNotification;->getNotificationSoundUri(Landroid/content/Context;I)Landroid/net/Uri;
move-result-object p1
if-eqz p1, :cond_0
.line 205
new-instance v1, Landroid/media/AudioAttributes$Builder;
invoke-direct {v1}, Landroid/media/AudioAttributes$Builder;-><init>()V
invoke-virtual {v1}, Landroid/media/AudioAttributes$Builder;->build()Landroid/media/AudioAttributes;
move-result-object v1
invoke-virtual {v2, p1, v1}, Landroid/app/NotificationChannel;->setSound(Landroid/net/Uri;Landroid/media/AudioAttributes;)V
.line 207
:cond_0
invoke-virtual {v0, v2}, Landroid/app/NotificationManager;->createNotificationChannel(Landroid/app/NotificationChannel;)V
:cond_1
return-void
.end method
.method public final getActiveNotificationChannel(Landroid/content/Context;)Ljava/lang/String;
.locals 2
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 168
invoke-virtual {v0}, Lcom/helpshift/storage/HSPersistentStorage;->getNotificationChannelId()Ljava/lang/String;
move-result-object v0
.line 169
invoke-static {v0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v1
if-eqz v1, :cond_0
.line 170
invoke-virtual {p0, p1}, Lcom/helpshift/notification/HSNotificationManager;->ensureDefaultNotificationChannelCreated(Landroid/content/Context;)V
const-string v0, "In-app Support"
goto :goto_0
.line 174
:cond_0
invoke-virtual {p0, p1}, Lcom/helpshift/notification/HSNotificationManager;->deleteDefaultNotificationChannel(Landroid/content/Context;)V
:goto_0
return-object v0
.end method
.method public setNotificationChannelId(Ljava/lang/String;)V
.locals 1
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 56
invoke-virtual {v0, p1}, Lcom/helpshift/storage/HSPersistentStorage;->setNotificationChannelId(Ljava/lang/String;)V
return-void
.end method
.method public setNotificationIcon(I)V
.locals 1
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 66
invoke-virtual {v0, p1}, Lcom/helpshift/storage/HSPersistentStorage;->setNotificationIcon(I)V
return-void
.end method
.method public setNotificationLargeIcon(I)V
.locals 1
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 71
invoke-virtual {v0, p1}, Lcom/helpshift/storage/HSPersistentStorage;->setNotificationLargeIcon(I)V
return-void
.end method
.method public setNotificationReceivedCallback(Lcom/helpshift/notification/NotificationReceivedCallback;)V
.locals 1
.line 76
new-instance v0, Ljava/lang/ref/WeakReference;
invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V
iput-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->notificationReceivedCallback:Ljava/lang/ref/WeakReference;
return-void
.end method
.method public setNotificationSoundId(I)V
.locals 1
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 61
invoke-virtual {v0, p1}, Lcom/helpshift/storage/HSPersistentStorage;->setNotificationSoundId(I)V
return-void
.end method
.method public showDebugLogNotification()V
.locals 2
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->threadingService:Lcom/helpshift/concurrency/HSThreadingService;
.line 119
new-instance v1, Lcom/helpshift/notification/HSNotificationManager$3;
invoke-direct {v1, p0}, Lcom/helpshift/notification/HSNotificationManager$3;-><init>(Lcom/helpshift/notification/HSNotificationManager;)V
invoke-virtual {v0, v1}, Lcom/helpshift/concurrency/HSThreadingService;->runOnUIThread(Ljava/lang/Runnable;)V
return-void
.end method
.method public showNotification(Ljava/lang/String;Z)V
.locals 2
.line 91
invoke-static {}, Lcom/helpshift/core/HSContext;->getInstance()Lcom/helpshift/core/HSContext;
move-result-object v0
.line 93
invoke-virtual {v0}, Lcom/helpshift/core/HSContext;->isSdkOpen()Z
move-result v1
if-eqz v1, :cond_0
iget-object p1, p0, Lcom/helpshift/notification/HSNotificationManager;->threadingService:Lcom/helpshift/concurrency/HSThreadingService;
.line 94
new-instance p2, Lcom/helpshift/notification/HSNotificationManager$1;
invoke-direct {p2, p0}, Lcom/helpshift/notification/HSNotificationManager$1;-><init>(Lcom/helpshift/notification/HSNotificationManager;)V
invoke-virtual {p1, p2}, Lcom/helpshift/concurrency/HSThreadingService;->runOnUIThread(Ljava/lang/Runnable;)V
goto :goto_0
.line 105
:cond_0
invoke-virtual {v0}, Lcom/helpshift/core/HSContext;->isWebchatUIOpen()Z
move-result v0
if-nez v0, :cond_2
if-nez p2, :cond_1
iget-object p2, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 106
invoke-virtual {p2}, Lcom/helpshift/storage/HSPersistentStorage;->getEnableInAppNotification()Z
move-result p2
if-eqz p2, :cond_2
:cond_1
iget-object p2, p0, Lcom/helpshift/notification/HSNotificationManager;->threadingService:Lcom/helpshift/concurrency/HSThreadingService;
.line 107
new-instance v0, Lcom/helpshift/notification/HSNotificationManager$2;
invoke-direct {v0, p0, p1}, Lcom/helpshift/notification/HSNotificationManager$2;-><init>(Lcom/helpshift/notification/HSNotificationManager;Ljava/lang/String;)V
invoke-virtual {p2, v0}, Lcom/helpshift/concurrency/HSThreadingService;->runOnUIThread(Ljava/lang/Runnable;)V
:cond_2
:goto_0
return-void
.end method
.method public final showNotificationInternal(Ljava/lang/String;Ljava/lang/Class;)V
.locals 7
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->context:Landroid/content/Context;
iget-object v1, p0, Lcom/helpshift/notification/HSNotificationManager;->device:Lcom/helpshift/platform/Device;
iget-object v2, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 137
invoke-virtual {v2}, Lcom/helpshift/storage/HSPersistentStorage;->getNotificationIcon()I
move-result v3
iget-object v2, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 138
invoke-virtual {v2}, Lcom/helpshift/storage/HSPersistentStorage;->getNotificationLargeIcon()I
move-result v4
iget-object v2, p0, Lcom/helpshift/notification/HSNotificationManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 139
invoke-virtual {v2}, Lcom/helpshift/storage/HSPersistentStorage;->getNotificationSoundId()I
move-result v5
move-object v2, p1
move-object v6, p2
.line 134
invoke-static/range {v0 .. v6}, Lcom/helpshift/notification/HSNotification;->createNotification(Landroid/content/Context;Lcom/helpshift/platform/Device;Ljava/lang/String;IIILjava/lang/Class;)Landroidx/core/app/NotificationCompat$Builder;
move-result-object p1
if-eqz p1, :cond_0
.line 144
invoke-virtual {p1}, Landroidx/core/app/NotificationCompat$Builder;->build()Landroid/app/Notification;
move-result-object p1
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->context:Landroid/content/Context;
.line 145
invoke-virtual {p0, p1, v0}, Lcom/helpshift/notification/HSNotificationManager;->attachChannelId(Landroid/app/Notification;Landroid/content/Context;)Landroid/app/Notification;
move-result-object p1
const-string v0, "notifMngr"
const-string v1, "Notification built, trying to post now."
.line 147
invoke-static {v0, v1}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lcom/helpshift/notification/HSNotificationManager;->context:Landroid/content/Context;
.line 148
invoke-static {v0, p1, p2}, Lcom/helpshift/util/ApplicationUtil;->showNotification(Landroid/content/Context;Landroid/app/Notification;Ljava/lang/Class;)V
:cond_0
return-void
.end method

View File

@@ -0,0 +1,172 @@
.class public Lcom/helpshift/notification/HSPushTokenManager$1;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/helpshift/notification/HSPushTokenManager;->makePushTokenRequest(Lcom/helpshift/network/HSNetwork;Lcom/helpshift/network/HSRequestData;ZLcom/helpshift/util/ValueListener;)V
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lcom/helpshift/notification/HSPushTokenManager;
.field public final synthetic val$deregister:Z
.field public final synthetic val$network:Lcom/helpshift/network/HSNetwork;
.field public final synthetic val$pushSyncStatusUpdater:Lcom/helpshift/util/ValueListener;
.field public final synthetic val$requestData:Lcom/helpshift/network/HSRequestData;
# direct methods
.method public constructor <init>(Lcom/helpshift/notification/HSPushTokenManager;Lcom/helpshift/network/HSNetwork;Lcom/helpshift/network/HSRequestData;ZLcom/helpshift/util/ValueListener;)V
.locals 0
iput-object p1, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->this$0:Lcom/helpshift/notification/HSPushTokenManager;
iput-object p2, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$network:Lcom/helpshift/network/HSNetwork;
iput-object p3, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$requestData:Lcom/helpshift/network/HSRequestData;
iput-boolean p4, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$deregister:Z
iput-object p5, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$pushSyncStatusUpdater:Lcom/helpshift/util/ValueListener;
.line 113
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.locals 3
:try_start_0
iget-object v0, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$network:Lcom/helpshift/network/HSNetwork;
iget-object v1, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$requestData:Lcom/helpshift/network/HSRequestData;
.line 117
invoke-interface {v0, v1}, Lcom/helpshift/network/HSNetwork;->makeRequest(Lcom/helpshift/network/HSRequestData;)Lcom/helpshift/network/HSResponse;
move-result-object v0
iget-boolean v1, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$deregister:Z
if-eqz v1, :cond_0
return-void
.line 123
:cond_0
invoke-virtual {v0}, Lcom/helpshift/network/HSResponse;->getStatus()I
move-result v0
iget-object v1, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$pushSyncStatusUpdater:Lcom/helpshift/util/ValueListener;
const/16 v2, 0xc8
if-lt v0, v2, :cond_1
const/16 v2, 0x12c
if-ge v0, v2, :cond_1
const/4 v0, 0x1
goto :goto_0
:cond_1
const/4 v0, 0x0
.line 124
:goto_0
invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v0
invoke-interface {v1, v0}, Lcom/helpshift/util/ValueListener;->update(Ljava/lang/Object;)V
:try_end_0
.catch Lcom/helpshift/network/exception/HSRootApiException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_1
:catch_0
move-exception v0
iget-boolean v1, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$deregister:Z
if-nez v1, :cond_3
iget-object v1, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->val$pushSyncStatusUpdater:Lcom/helpshift/util/ValueListener;
sget-object v2, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
.line 128
invoke-interface {v1, v2}, Lcom/helpshift/util/ValueListener;->update(Ljava/lang/Object;)V
iget-object v0, v0, Lcom/helpshift/network/exception/HSRootApiException;->exceptionType:Lcom/helpshift/network/exception/HSRootApiException$ExceptionType;
.line 134
sget-object v1, Lcom/helpshift/network/exception/NetworkException;->INVALID_AUTH_TOKEN:Lcom/helpshift/network/exception/NetworkException;
if-ne v0, v1, :cond_2
iget-object v0, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->this$0:Lcom/helpshift/notification/HSPushTokenManager;
.line 135
invoke-static {v0}, Lcom/helpshift/notification/HSPushTokenManager;->access$000(Lcom/helpshift/notification/HSPushTokenManager;)Lcom/helpshift/chat/HSEventProxy;
move-result-object v0
const-string v1, "invalid user auth token"
invoke-virtual {v0, v1}, Lcom/helpshift/chat/HSEventProxy;->sendAuthFailureEvent(Ljava/lang/String;)V
goto :goto_1
.line 137
:cond_2
sget-object v1, Lcom/helpshift/network/exception/NetworkException;->AUTH_TOKEN_NOT_PROVIDED:Lcom/helpshift/network/exception/NetworkException;
if-ne v0, v1, :cond_4
iget-object v0, p0, Lcom/helpshift/notification/HSPushTokenManager$1;->this$0:Lcom/helpshift/notification/HSPushTokenManager;
.line 138
invoke-static {v0}, Lcom/helpshift/notification/HSPushTokenManager;->access$000(Lcom/helpshift/notification/HSPushTokenManager;)Lcom/helpshift/chat/HSEventProxy;
move-result-object v0
const-string v1, "missing user auth token"
invoke-virtual {v0, v1}, Lcom/helpshift/chat/HSEventProxy;->sendAuthFailureEvent(Ljava/lang/String;)V
goto :goto_1
:cond_3
const-string v1, "pshTknManagr"
const-string v2, "Network error for deregister push token request"
.line 143
invoke-static {v1, v2, v0}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_4
:goto_1
return-void
.end method

View File

@@ -0,0 +1,272 @@
.class public Lcom/helpshift/notification/HSPushTokenManager;
.super Ljava/lang/Object;
.source "SourceFile"
# instance fields
.field public device:Lcom/helpshift/platform/Device;
.field public genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
.field public hsEventProxy:Lcom/helpshift/chat/HSEventProxy;
.field public hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
.field public httpTransport:Lcom/helpshift/network/HTTPTransport;
.field public persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
# direct methods
.method public constructor <init>(Lcom/helpshift/platform/Device;Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/concurrency/HSThreadingService;Lcom/helpshift/chat/HSEventProxy;Lcom/helpshift/network/HTTPTransport;Lcom/helpshift/storage/HSGenericDataManager;)V
.locals 0
.line 42
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/helpshift/notification/HSPushTokenManager;->device:Lcom/helpshift/platform/Device;
iput-object p2, p0, Lcom/helpshift/notification/HSPushTokenManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iput-object p3, p0, Lcom/helpshift/notification/HSPushTokenManager;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
iput-object p4, p0, Lcom/helpshift/notification/HSPushTokenManager;->hsEventProxy:Lcom/helpshift/chat/HSEventProxy;
iput-object p5, p0, Lcom/helpshift/notification/HSPushTokenManager;->httpTransport:Lcom/helpshift/network/HTTPTransport;
iput-object p6, p0, Lcom/helpshift/notification/HSPushTokenManager;->genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
return-void
.end method
.method public static synthetic access$000(Lcom/helpshift/notification/HSPushTokenManager;)Lcom/helpshift/chat/HSEventProxy;
.locals 0
.line 26
iget-object p0, p0, Lcom/helpshift/notification/HSPushTokenManager;->hsEventProxy:Lcom/helpshift/chat/HSEventProxy;
return-object p0
.end method
# virtual methods
.method public deregisterPushTokenForUser(Ljava/util/Map;Lcom/helpshift/util/ValueListener;)V
.locals 2
const-string v0, "unreg"
const/4 v1, 0x1
.line 70
invoke-virtual {p0, v0, p1, v1, p2}, Lcom/helpshift/notification/HSPushTokenManager;->pushTokenRequest(Ljava/lang/String;Ljava/util/Map;ZLcom/helpshift/util/ValueListener;)V
return-void
.end method
.method public final makePushTokenRequest(Lcom/helpshift/network/HSNetwork;Lcom/helpshift/network/HSRequestData;ZLcom/helpshift/util/ValueListener;)V
.locals 8
iget-object v0, p0, Lcom/helpshift/notification/HSPushTokenManager;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
.line 113
invoke-virtual {v0}, Lcom/helpshift/concurrency/HSThreadingService;->getNetworkService()Lcom/helpshift/concurrency/HSThreader;
move-result-object v0
new-instance v7, Lcom/helpshift/notification/HSPushTokenManager$1;
move-object v1, v7
move-object v2, p0
move-object v3, p1
move-object v4, p2
move v5, p3
move-object v6, p4
invoke-direct/range {v1 .. v6}, Lcom/helpshift/notification/HSPushTokenManager$1;-><init>(Lcom/helpshift/notification/HSPushTokenManager;Lcom/helpshift/network/HSNetwork;Lcom/helpshift/network/HSRequestData;ZLcom/helpshift/util/ValueListener;)V
invoke-interface {v0, v7}, Lcom/helpshift/concurrency/HSThreader;->submit(Ljava/lang/Runnable;)V
return-void
.end method
.method public final pushTokenRequest(Ljava/lang/String;Ljava/util/Map;ZLcom/helpshift/util/ValueListener;)V
.locals 6
iget-object v0, p0, Lcom/helpshift/notification/HSPushTokenManager;->device:Lcom/helpshift/platform/Device;
.line 76
invoke-interface {v0}, Lcom/helpshift/platform/Device;->isOnline()Z
move-result v0
const-string v1, "pshTknManagr"
if-eqz v0, :cond_3
invoke-static {p1}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_3
invoke-static {p2}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/util/Map;)Z
move-result v0
if-eqz v0, :cond_0
goto :goto_2
:cond_0
iget-object v0, p0, Lcom/helpshift/notification/HSPushTokenManager;->genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
.line 81
invoke-virtual {v0}, Lcom/helpshift/storage/HSGenericDataManager;->getNetworkHeaders()Ljava/util/Map;
move-result-object v0
iget-object v2, p0, Lcom/helpshift/notification/HSPushTokenManager;->genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
.line 82
invoke-virtual {v2}, Lcom/helpshift/storage/HSGenericDataManager;->getPushTokenSyncRoute()Ljava/lang/String;
move-result-object v2
iget-object v3, p0, Lcom/helpshift/notification/HSPushTokenManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 83
invoke-virtual {v3}, Lcom/helpshift/storage/HSPersistentStorage;->getPlatformId()Ljava/lang/String;
move-result-object v3
iget-object v4, p0, Lcom/helpshift/notification/HSPushTokenManager;->device:Lcom/helpshift/platform/Device;
.line 84
invoke-interface {v4}, Lcom/helpshift/platform/Device;->getDeviceId()Ljava/lang/String;
move-result-object v4
.line 85
invoke-static {v0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/util/Map;)Z
move-result v5
if-nez v5, :cond_2
invoke-static {v2}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v5
if-nez v5, :cond_2
invoke-static {v3}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v5
if-nez v5, :cond_2
invoke-static {v4}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v5
if-eqz v5, :cond_1
goto :goto_1
:cond_1
:try_start_0
const-string v5, "token"
.line 91
invoke-interface {p2, v5, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string p1, "did"
.line 92
invoke-interface {p2, p1, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string p1, "platform-id"
.line 93
invoke-interface {p2, p1, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 94
new-instance p1, Lcom/helpshift/network/HSRequestData;
invoke-direct {p1, v0, p2}, Lcom/helpshift/network/HSRequestData;-><init>(Ljava/util/Map;Ljava/util/Map;)V
.line 95
new-instance p2, Lcom/helpshift/network/POSTNetwork;
iget-object v0, p0, Lcom/helpshift/notification/HSPushTokenManager;->httpTransport:Lcom/helpshift/network/HTTPTransport;
invoke-direct {p2, v0, v2}, Lcom/helpshift/network/POSTNetwork;-><init>(Lcom/helpshift/network/HTTPTransport;Ljava/lang/String;)V
.line 96
new-instance v0, Lcom/helpshift/network/AuthenticationFailureNetwork;
invoke-direct {v0, p2}, Lcom/helpshift/network/AuthenticationFailureNetwork;-><init>(Lcom/helpshift/network/HSNetwork;)V
.line 97
invoke-virtual {p0, v0, p1, p3, p4}, Lcom/helpshift/notification/HSPushTokenManager;->makePushTokenRequest(Lcom/helpshift/network/HSNetwork;Lcom/helpshift/network/HSRequestData;ZLcom/helpshift/util/ValueListener;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception p1
const-string p2, "Error in syncing push token"
.line 100
invoke-static {v1, p2, p1}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
:goto_0
return-void
:cond_2
:goto_1
const-string p1, "Error in reading network header and route data"
.line 86
invoke-static {v1, p1}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;)V
return-void
:cond_3
:goto_2
const-string p1, "Error in syncing push token, preconditions failed."
.line 77
invoke-static {v1, p1}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;)V
return-void
.end method
.method public registerPushTokenWithBackend(Ljava/lang/String;Ljava/util/Map;Lcom/helpshift/util/ValueListener;)V
.locals 1
const/4 v0, 0x0
.line 63
invoke-virtual {p0, p1, p2, v0, p3}, Lcom/helpshift/notification/HSPushTokenManager;->pushTokenRequest(Ljava/lang/String;Ljava/util/Map;ZLcom/helpshift/util/ValueListener;)V
return-void
.end method
.method public savePushToken(Ljava/lang/String;)V
.locals 1
iget-object v0, p0, Lcom/helpshift/notification/HSPushTokenManager;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 53
invoke-virtual {v0, p1}, Lcom/helpshift/storage/HSPersistentStorage;->setCurrentPushToken(Ljava/lang/String;)V
return-void
.end method

View File

@@ -0,0 +1,8 @@
.class public interface abstract Lcom/helpshift/notification/NotificationReceivedCallback;
.super Ljava/lang/Object;
.source "SourceFile"
# virtual methods
.method public abstract onNotificationReceived()V
.end method

View File

@@ -0,0 +1,130 @@
.class public Lcom/helpshift/notification/RequestUnreadMessageCountHandler$1;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->handleRemoteRequest()V
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
# direct methods
.method public constructor <init>(Lcom/helpshift/notification/RequestUnreadMessageCountHandler;)V
.locals 0
iput-object p1, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler$1;->this$0:Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
.line 80
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.locals 5
:try_start_0
iget-object v0, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler$1;->this$0:Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
.line 84
invoke-static {v0}, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->access$000(Lcom/helpshift/notification/RequestUnreadMessageCountHandler;)Lcom/helpshift/poller/FetchNotificationUpdate;
move-result-object v0
invoke-virtual {v0}, Lcom/helpshift/poller/FetchNotificationUpdate;->execute()I
move-result v0
const/16 v1, 0xc8
const/4 v2, 0x0
const/4 v3, 0x1
if-lt v0, v1, :cond_0
const/16 v1, 0x12c
if-ge v0, v1, :cond_0
move v2, v3
.line 87
:cond_0
new-instance v0, Ljava/util/HashMap;
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
const-string v1, "count"
iget-object v4, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler$1;->this$0:Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
.line 88
invoke-static {v4}, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->access$100(Lcom/helpshift/notification/RequestUnreadMessageCountHandler;)Lcom/helpshift/user/UserManager;
move-result-object v4
invoke-virtual {v4}, Lcom/helpshift/user/UserManager;->getUnreadNotificationCount()I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
invoke-interface {v0, v1, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "fromCache"
xor-int/2addr v2, v3
.line 89
invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v2
invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
iget-object v1, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler$1;->this$0:Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
.line 90
invoke-static {v1}, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->access$200(Lcom/helpshift/notification/RequestUnreadMessageCountHandler;)Lcom/helpshift/chat/HSEventProxy;
move-result-object v1
const-string v2, "receivedUnreadMessageCount"
invoke-virtual {v1, v2, v0}, Lcom/helpshift/chat/HSEventProxy;->sendEvent(Ljava/lang/String;Ljava/util/Map;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v0
const-string v1, "rqUnrdCntHdlr"
const-string v2, "Error in fetching unread count from remote"
.line 93
invoke-static {v1, v2, v0}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
:goto_0
return-void
.end method

View File

@@ -0,0 +1,203 @@
.class public Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
.super Ljava/lang/Object;
.source "SourceFile"
# instance fields
.field public final eventProxy:Lcom/helpshift/chat/HSEventProxy;
.field public final fetchNotificationUpdate:Lcom/helpshift/poller/FetchNotificationUpdate;
.field public final persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.field public final threadingService:Lcom/helpshift/concurrency/HSThreadingService;
.field public final userManager:Lcom/helpshift/user/UserManager;
# direct methods
.method public constructor <init>(Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/poller/FetchNotificationUpdate;Lcom/helpshift/user/UserManager;Lcom/helpshift/chat/HSEventProxy;Lcom/helpshift/concurrency/HSThreadingService;)V
.locals 0
.line 35
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iput-object p2, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->fetchNotificationUpdate:Lcom/helpshift/poller/FetchNotificationUpdate;
iput-object p3, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->userManager:Lcom/helpshift/user/UserManager;
iput-object p4, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->eventProxy:Lcom/helpshift/chat/HSEventProxy;
iput-object p5, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->threadingService:Lcom/helpshift/concurrency/HSThreadingService;
return-void
.end method
.method public static synthetic access$000(Lcom/helpshift/notification/RequestUnreadMessageCountHandler;)Lcom/helpshift/poller/FetchNotificationUpdate;
.locals 0
.line 18
iget-object p0, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->fetchNotificationUpdate:Lcom/helpshift/poller/FetchNotificationUpdate;
return-object p0
.end method
.method public static synthetic access$100(Lcom/helpshift/notification/RequestUnreadMessageCountHandler;)Lcom/helpshift/user/UserManager;
.locals 0
.line 18
iget-object p0, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->userManager:Lcom/helpshift/user/UserManager;
return-object p0
.end method
.method public static synthetic access$200(Lcom/helpshift/notification/RequestUnreadMessageCountHandler;)Lcom/helpshift/chat/HSEventProxy;
.locals 0
.line 18
iget-object p0, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->eventProxy:Lcom/helpshift/chat/HSEventProxy;
return-object p0
.end method
# virtual methods
.method public handleLocalCacheRequest()V
.locals 3
const-string v0, "rqUnrdCntHdlr"
const-string v1, "Serving count from local cache."
.line 47
invoke-static {v0, v1}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
.line 48
new-instance v0, Ljava/util/HashMap;
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
iget-object v1, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->userManager:Lcom/helpshift/user/UserManager;
.line 50
invoke-virtual {v1}, Lcom/helpshift/user/UserManager;->getUnreadNotificationCount()I
move-result v1
iget-object v2, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->userManager:Lcom/helpshift/user/UserManager;
invoke-virtual {v2}, Lcom/helpshift/user/UserManager;->getPushUnreadNotificationCount()I
move-result v2
invoke-static {v1, v2}, Ljava/lang/Math;->max(II)I
move-result v1
const-string v2, "count"
.line 51
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-interface {v0, v2, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "fromCache"
sget-object v2, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
.line 52
invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
iget-object v1, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->eventProxy:Lcom/helpshift/chat/HSEventProxy;
const-string v2, "receivedUnreadMessageCount"
.line 53
invoke-virtual {v1, v2, v0}, Lcom/helpshift/chat/HSEventProxy;->sendEvent(Ljava/lang/String;Ljava/util/Map;)V
return-void
.end method
.method public handleRemoteRequest()V
.locals 7
.line 61
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v0
iget-object v2, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 62
invoke-virtual {v2}, Lcom/helpshift/storage/HSPersistentStorage;->getLastRequestUnreadCountApiAccess()J
move-result-wide v2
iget-object v4, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->userManager:Lcom/helpshift/user/UserManager;
.line 66
invoke-virtual {v4}, Lcom/helpshift/user/UserManager;->shouldPoll()Z
move-result v4
if-eqz v4, :cond_0
const v4, 0xea60
goto :goto_0
:cond_0
const v4, 0x493e0
:goto_0
const-wide/16 v5, 0x0
cmp-long v5, v2, v5
if-eqz v5, :cond_1
sub-long v2, v0, v2
int-to-long v4, v4
cmp-long v2, v2, v4
if-gez v2, :cond_1
.line 71
invoke-virtual {p0}, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->handleLocalCacheRequest()V
return-void
:cond_1
iget-object v2, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 77
invoke-virtual {v2, v0, v1}, Lcom/helpshift/storage/HSPersistentStorage;->setLastRequestUnreadCountApiAccess(J)V
const-string v0, "rqUnrdCntHdlr"
const-string v1, "Fetching unread count from remote."
.line 79
invoke-static {v0, v1}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;->threadingService:Lcom/helpshift/concurrency/HSThreadingService;
.line 80
invoke-virtual {v0}, Lcom/helpshift/concurrency/HSThreadingService;->getNetworkService()Lcom/helpshift/concurrency/HSThreader;
move-result-object v0
new-instance v1, Lcom/helpshift/notification/RequestUnreadMessageCountHandler$1;
invoke-direct {v1, p0}, Lcom/helpshift/notification/RequestUnreadMessageCountHandler$1;-><init>(Lcom/helpshift/notification/RequestUnreadMessageCountHandler;)V
invoke-interface {v0, v1}, Lcom/helpshift/concurrency/HSThreader;->submit(Ljava/lang/Runnable;)V
return-void
.end method