Add Discord APKTool decompilation (Smali source for modding)

- 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
This commit is contained in:
2026-02-18 16:13:44 -08:00
parent c080f0d97f
commit f3960ee359
44288 changed files with 10998761 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
.class public abstract synthetic Lcom/helpshift/core/AndroidDevice$$ExternalSyntheticApiModelOutline0;
.super Ljava/lang/Object;
.source "SourceFile"
# direct methods
.method public static bridge synthetic m()Ljava/lang/Class;
.locals 1
.line 0
const-class v0, Landroid/app/LocaleManager;
return-object v0
.end method

View File

@@ -0,0 +1,14 @@
.class public abstract synthetic Lcom/helpshift/core/AndroidDevice$$ExternalSyntheticApiModelOutline1;
.super Ljava/lang/Object;
.source "SourceFile"
# direct methods
.method public static bridge synthetic m(Ljava/lang/Object;)Landroid/app/LocaleManager;
.locals 0
.line 0
check-cast p0, Landroid/app/LocaleManager;
return-object p0
.end method

View File

@@ -0,0 +1,16 @@
.class public abstract synthetic Lcom/helpshift/core/AndroidDevice$$ExternalSyntheticApiModelOutline2;
.super Ljava/lang/Object;
.source "SourceFile"
# direct methods
.method public static bridge synthetic m(Landroid/app/LocaleManager;)Landroid/os/LocaleList;
.locals 0
.line 0
invoke-virtual {p0}, Landroid/app/LocaleManager;->getApplicationLocales()Landroid/os/LocaleList;
move-result-object p0
return-object p0
.end method

View File

@@ -0,0 +1,742 @@
.class public Lcom/helpshift/core/AndroidDevice;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/helpshift/platform/Device;
# instance fields
.field public final context:Landroid/content/Context;
.field public persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/helpshift/storage/HSPersistentStorage;)V
.locals 0
.line 44
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
iput-object p2, p0, Lcom/helpshift/core/AndroidDevice;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
return-void
.end method
# virtual methods
.method public encodeBase64(Ljava/lang/String;)Ljava/lang/String;
.locals 1
.line 265
invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
move-result-object p1
const/4 v0, 0x2
invoke-static {p1, v0}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;
move-result-object p1
return-object p1
.end method
.method public getAppIdentifier()Ljava/lang/String;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
.line 94
invoke-virtual {v0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public getAppName()Ljava/lang/String;
.locals 3
:try_start_0
iget-object v0, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
.line 76
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
iget-object v1, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
.line 77
invoke-virtual {v1}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v1
.line 78
invoke-virtual {v0, v1}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;
move-result-object v0
invoke-interface {v0}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;
move-result-object v0
: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, "Device"
const-string v2, "Error getting application name"
.line 81
invoke-static {v1, v2, v0}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
const/4 v0, 0x0
:goto_0
if-nez v0, :cond_0
const-string v0, "Support"
:cond_0
return-object v0
.end method
.method public getAppVersion()Ljava/lang/String;
.locals 3
.line 61
:try_start_0
invoke-virtual {p0}, Lcom/helpshift/core/AndroidDevice;->getAppIdentifier()Ljava/lang/String;
move-result-object v0
iget-object v1, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
.line 62
invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v1
const/4 v2, 0x0
invoke-virtual {v1, v0, v2}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
move-result-object v0
.line 63
iget-object v0, v0, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;
: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, "Device"
const-string v2, "Error getting app version"
.line 66
invoke-static {v1, v2, v0}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
const/4 v0, 0x0
:goto_0
return-object v0
.end method
.method public getBatteryLevel()Ljava/lang/String;
.locals 4
.line 106
new-instance v0, Landroid/content/IntentFilter;
const-string v1, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
const/4 v2, 0x0
.line 107
invoke-virtual {v1, v2, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v0
if-nez v0, :cond_0
const-string v0, ""
return-object v0
:cond_0
const-string v1, "level"
const/4 v2, -0x1
.line 113
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v1
const-string v3, "scale"
.line 114
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v0
int-to-float v1, v1
int-to-float v0, v0
div-float/2addr v1, v0
const/high16 v0, 0x42c80000 # 100.0f
mul-float/2addr v1, v0
float-to-int v0, v1
.line 116
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v0, "%"
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public getBatteryStatus()Ljava/lang/String;
.locals 4
.line 122
new-instance v0, Landroid/content/IntentFilter;
const-string v1, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
const/4 v2, 0x0
.line 123
invoke-virtual {v1, v2, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v0
const-string v1, "Not charging"
if-nez v0, :cond_0
return-object v1
:cond_0
const-string v2, "status"
const/4 v3, -0x1
.line 129
invoke-virtual {v0, v2, v3}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v0
const/4 v2, 0x2
if-eq v0, v2, :cond_1
const/4 v2, 0x5
if-ne v0, v2, :cond_2
:cond_1
const-string v1, "Charging"
:cond_2
return-object v1
.end method
.method public getCarrierName()Ljava/lang/String;
.locals 2
iget-object v0, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
const-string v1, "phone"
.line 179
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/telephony/TelephonyManager;
if-nez v0, :cond_0
const-string v0, ""
goto :goto_0
.line 180
:cond_0
invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getNetworkOperatorName()Ljava/lang/String;
move-result-object v0
:goto_0
return-object v0
.end method
.method public getCountryCode()Ljava/lang/String;
.locals 2
iget-object v0, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
const-string v1, "phone"
.line 209
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/telephony/TelephonyManager;
if-nez v0, :cond_0
const-string v0, ""
goto :goto_0
.line 210
:cond_0
invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimCountryIso()Ljava/lang/String;
move-result-object v0
:goto_0
return-object v0
.end method
.method public getDeviceId()Ljava/lang/String;
.locals 2
iget-object v0, p0, Lcom/helpshift/core/AndroidDevice;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 276
invoke-virtual {v0}, Lcom/helpshift/storage/HSPersistentStorage;->getHsDeviceId()Ljava/lang/String;
move-result-object v0
.line 277
invoke-static {v0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v1
if-eqz v1, :cond_0
.line 278
invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;
move-result-object v0
invoke-virtual {v0}, Ljava/util/UUID;->toString()Ljava/lang/String;
move-result-object v0
iget-object v1, p0, Lcom/helpshift/core/AndroidDevice;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 279
invoke-virtual {v1, v0}, Lcom/helpshift/storage/HSPersistentStorage;->setHsDeviceId(Ljava/lang/String;)V
:cond_0
return-object v0
.end method
.method public getDeviceModel()Ljava/lang/String;
.locals 1
.line 100
sget-object v0, Landroid/os/Build;->MODEL:Ljava/lang/String;
return-object v0
.end method
.method public getDiskSpace()Lcom/helpshift/util/ValuePair;
.locals 11
.line 141
new-instance v0, Landroid/os/StatFs;
invoke-static {}, Landroid/os/Environment;->getDataDirectory()Ljava/io/File;
move-result-object v1
invoke-virtual {v1}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Landroid/os/StatFs;-><init>(Ljava/lang/String;)V
.line 143
invoke-virtual {v0}, Landroid/os/StatFs;->getAvailableBlocksLong()J
move-result-wide v1
long-to-double v1, v1
.line 144
invoke-virtual {v0}, Landroid/os/StatFs;->getBlockSizeLong()J
move-result-wide v3
long-to-double v3, v3
mul-double/2addr v1, v3
const-wide/high16 v3, 0x41d0000000000000L # 1.073741824E9
div-double/2addr v1, v3
const-wide/high16 v5, 0x4059000000000000L # 100.0
mul-double/2addr v1, v5
.line 145
invoke-static {v1, v2}, Ljava/lang/Math;->round(D)J
move-result-wide v1
long-to-double v1, v1
div-double/2addr v1, v5
.line 147
invoke-virtual {v0}, Landroid/os/StatFs;->getBlockCountLong()J
move-result-wide v7
long-to-double v7, v7
.line 148
invoke-virtual {v0}, Landroid/os/StatFs;->getBlockSizeLong()J
move-result-wide v9
long-to-double v9, v9
mul-double/2addr v7, v9
div-double/2addr v7, v3
mul-double/2addr v7, v5
.line 149
invoke-static {v7, v8}, Ljava/lang/Math;->round(D)J
move-result-wide v3
long-to-double v3, v3
div-double/2addr v3, v5
.line 161
new-instance v0, Lcom/helpshift/util/ValuePair;
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v5, v3, v4}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;
const-string v3, " GB"
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v5, v1, v2}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v4, v1}, Lcom/helpshift/util/ValuePair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
return-object v0
.end method
.method public getLanguage()Ljava/lang/String;
.locals 3
:try_start_0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x21
if-lt v0, v1, :cond_1
iget-object v0, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
.line 229
invoke-static {}, Lcom/helpshift/core/AndroidDevice$$ExternalSyntheticApiModelOutline0;->m()Ljava/lang/Class;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/Class;)Ljava/lang/Object;
move-result-object v0
invoke-static {v0}, Lcom/helpshift/core/AndroidDevice$$ExternalSyntheticApiModelOutline1;->m(Ljava/lang/Object;)Landroid/app/LocaleManager;
move-result-object v0
.line 230
invoke-static {v0}, Lcom/helpshift/core/AndroidDevice$$ExternalSyntheticApiModelOutline2;->m(Landroid/app/LocaleManager;)Landroid/os/LocaleList;
move-result-object v0
if-eqz v0, :cond_0
.line 231
invoke-virtual {v0}, Landroid/os/LocaleList;->isEmpty()Z
move-result v1
if-nez v1, :cond_0
const/4 v1, 0x0
.line 232
invoke-virtual {v0, v1}, Landroid/os/LocaleList;->get(I)Ljava/util/Locale;
move-result-object v0
invoke-virtual {v0}, Ljava/util/Locale;->toLanguageTag()Ljava/lang/String;
move-result-object v0
goto :goto_1
:catch_0
move-exception v0
goto :goto_0
.line 234
:cond_0
invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;
move-result-object v0
invoke-virtual {v0}, Ljava/util/Locale;->toLanguageTag()Ljava/lang/String;
move-result-object v0
goto :goto_1
.line 237
:cond_1
invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;
move-result-object v0
invoke-virtual {v0}, Ljava/util/Locale;->toLanguageTag()Ljava/lang/String;
move-result-object v0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_1
:goto_0
const-string v1, "Device"
const-string v2, "Error getting app language"
.line 242
invoke-static {v1, v2, v0}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
const-string v0, "unknown"
:goto_1
return-object v0
.end method
.method public getNetworkType()Ljava/lang/String;
.locals 3
const/4 v0, 0x0
:try_start_0
iget-object v1, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
const-string v2, "connectivity"
.line 188
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/net/ConnectivityManager;
if-eqz v1, :cond_0
.line 190
invoke-virtual {v1}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;
move-result-object v1
if-eqz v1, :cond_0
.line 192
invoke-virtual {v1}, Landroid/net/NetworkInfo;->getTypeName()Ljava/lang/String;
move-result-object v0
:try_end_0
.catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_0
:catch_0
:cond_0
if-nez v0, :cond_1
const-string v0, "Unknown"
:cond_1
return-object v0
.end method
.method public getOSVersion()Ljava/lang/String;
.locals 1
.line 173
sget-object v0, Landroid/os/Build$VERSION;->RELEASE:Ljava/lang/String;
return-object v0
.end method
.method public getOsType()Ljava/lang/String;
.locals 1
const-string v0, "android"
return-object v0
.end method
.method public getRom()Ljava/lang/String;
.locals 2
.line 216
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "os.version"
invoke-static {v1}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, ":"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
sget-object v1, Landroid/os/Build;->FINGERPRINT:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public getSDKVersion()Ljava/lang/String;
.locals 1
const-string v0, "10.2.2"
return-object v0
.end method
.method public isOnline()Z
.locals 4
const/4 v0, 0x0
:try_start_0
iget-object v1, p0, Lcom/helpshift/core/AndroidDevice;->context:Landroid/content/Context;
const-string v2, "connectivity"
.line 253
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/net/ConnectivityManager;
.line 254
invoke-virtual {v1}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;
move-result-object v1
if-eqz v1, :cond_0
.line 255
invoke-virtual {v1}, Landroid/net/NetworkInfo;->isConnected()Z
move-result v1
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
if-eqz v1, :cond_0
const/4 v0, 0x1
goto :goto_0
:catch_0
move-exception v1
const-string v2, "Device"
const-string v3, "Exception while getting system connectivity service"
.line 258
invoke-static {v2, v3, v1}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_0
:goto_0
return v0
.end method

View File

@@ -0,0 +1,49 @@
.class public Lcom/helpshift/core/HSContext$1;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/util/concurrent/ThreadFactory;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/helpshift/core/HSContext;->initialiseComponents(Landroid/content/Context;)V
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lcom/helpshift/core/HSContext;
# direct methods
.method public constructor <init>(Lcom/helpshift/core/HSContext;)V
.locals 0
iput-object p1, p0, Lcom/helpshift/core/HSContext$1;->this$0:Lcom/helpshift/core/HSContext;
.line 122
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public newThread(Ljava/lang/Runnable;)Ljava/lang/Thread;
.locals 2
.line 125
new-instance v0, Ljava/lang/Thread;
const-string v1, "hs_notif_poller"
invoke-direct {v0, p1, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;Ljava/lang/String;)V
return-object v0
.end method

View File

@@ -0,0 +1,821 @@
.class public Lcom/helpshift/core/HSContext;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field public static installCallSuccessful:Ljava/util/concurrent/atomic/AtomicBoolean;
.field public static instance:Lcom/helpshift/core/HSContext;
# instance fields
.field public analyticsEventDM:Lcom/helpshift/analytics/HSAnalyticsEventDM;
.field public analyticsManager:Lcom/helpshift/analytics/HSWebchatAnalyticsManager;
.field public chatResourceCacheManager:Lcom/helpshift/cache/HelpshiftResourceCacheManager;
.field public configManager:Lcom/helpshift/config/HSConfigManager;
.field public final context:Landroid/content/Context;
.field public conversationPoller:Lcom/helpshift/poller/ConversationPoller;
.field public device:Lcom/helpshift/platform/Device;
.field public genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
.field public helpcenterCacheEvictionManager:Lcom/helpshift/cache/HelpcenterCacheEvictionManager;
.field public helpcenterResourceCacheManager:Lcom/helpshift/cache/HelpshiftResourceCacheManager;
.field public hsEventProxy:Lcom/helpshift/chat/HSEventProxy;
.field public hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
.field public httpTransport:Lcom/helpshift/network/HTTPTransport;
.field public isSDKLoggingEnabled:Z
.field public isSdkOpen:Z
.field public isWebchatOpen:Z
.field public isWebchatOpenedFromHelpcenter:Z
.field public jsGenerator:Lcom/helpshift/core/HSJSGenerator;
.field public final nativeToSdkxMigrator:Lcom/helpshift/migrator/NativeToSdkxMigrator;
.field public notificationManager:Lcom/helpshift/notification/CoreNotificationManager;
.field public persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.field public pushTokenManager:Lcom/helpshift/notification/HSPushTokenManager;
.field public requestUnreadMessageCountHandler:Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
.field public scheduledThreadPoolExecutor:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
.field public userManager:Lcom/helpshift/user/UserManager;
# direct methods
.method static constructor <clinit>()V
.locals 2
.line 92
new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;
const/4 v1, 0x0
invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V
sput-object v0, Lcom/helpshift/core/HSContext;->installCallSuccessful:Ljava/util/concurrent/atomic/AtomicBoolean;
return-void
.end method
.method public constructor <init>(Landroid/content/Context;)V
.locals 4
.line 104
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/helpshift/core/HSContext;->context:Landroid/content/Context;
.line 106
new-instance v0, Lcom/helpshift/storage/HSPersistentStorage;
new-instance v1, Lcom/helpshift/storage/SharedPreferencesStore;
const-string v2, "__hs_lite_sdk_store"
const/4 v3, 0x0
invoke-direct {v1, p1, v2, v3}, Lcom/helpshift/storage/SharedPreferencesStore;-><init>(Landroid/content/Context;Ljava/lang/String;I)V
invoke-direct {v0, v1}, Lcom/helpshift/storage/HSPersistentStorage;-><init>(Lcom/helpshift/storage/ISharedPreferencesStore;)V
iput-object v0, p0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
.line 109
new-instance v0, Lcom/helpshift/concurrency/HSWorkerThreader;
const/4 v1, 0x2
invoke-static {v1}, Ljava/util/concurrent/Executors;->newFixedThreadPool(I)Ljava/util/concurrent/ExecutorService;
move-result-object v1
invoke-direct {v0, v1}, Lcom/helpshift/concurrency/HSWorkerThreader;-><init>(Ljava/util/concurrent/ExecutorService;)V
.line 110
new-instance v1, Lcom/helpshift/concurrency/HSWorkerThreader;
invoke-static {}, Ljava/util/concurrent/Executors;->newSingleThreadExecutor()Ljava/util/concurrent/ExecutorService;
move-result-object v2
invoke-direct {v1, v2}, Lcom/helpshift/concurrency/HSWorkerThreader;-><init>(Ljava/util/concurrent/ExecutorService;)V
.line 111
new-instance v2, Lcom/helpshift/concurrency/HSUIThreader;
invoke-direct {v2}, Lcom/helpshift/concurrency/HSUIThreader;-><init>()V
.line 112
new-instance v3, Lcom/helpshift/concurrency/HSThreadingService;
invoke-direct {v3, v0, v1, v2}, Lcom/helpshift/concurrency/HSThreadingService;-><init>(Lcom/helpshift/concurrency/HSThreader;Lcom/helpshift/concurrency/HSThreader;Lcom/helpshift/concurrency/HSThreader;)V
iput-object v3, p0, Lcom/helpshift/core/HSContext;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
.line 116
new-instance v0, Lcom/helpshift/migrator/NativeToSdkxMigrator;
iget-object v1, p0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
invoke-direct {v0, p1, v1}, Lcom/helpshift/migrator/NativeToSdkxMigrator;-><init>(Landroid/content/Context;Lcom/helpshift/storage/HSPersistentStorage;)V
iput-object v0, p0, Lcom/helpshift/core/HSContext;->nativeToSdkxMigrator:Lcom/helpshift/migrator/NativeToSdkxMigrator;
return-void
.end method
.method public static getInstance()Lcom/helpshift/core/HSContext;
.locals 1
sget-object v0, Lcom/helpshift/core/HSContext;->instance:Lcom/helpshift/core/HSContext;
return-object v0
.end method
.method public static declared-synchronized initInstance(Landroid/content/Context;)V
.locals 2
const-class v0, Lcom/helpshift/core/HSContext;
monitor-enter v0
:try_start_0
sget-object v1, Lcom/helpshift/core/HSContext;->instance:Lcom/helpshift/core/HSContext;
if-nez v1, :cond_0
.line 96
new-instance v1, Lcom/helpshift/core/HSContext;
invoke-direct {v1, p0}, Lcom/helpshift/core/HSContext;-><init>(Landroid/content/Context;)V
sput-object v1, Lcom/helpshift/core/HSContext;->instance:Lcom/helpshift/core/HSContext;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
goto :goto_0
:catchall_0
move-exception p0
goto :goto_1
.line 98
:cond_0
:goto_0
monitor-exit v0
return-void
:goto_1
monitor-exit v0
throw p0
.end method
.method public static verifyInstall()Z
.locals 1
sget-object v0, Lcom/helpshift/core/HSContext;->installCallSuccessful:Ljava/util/concurrent/atomic/AtomicBoolean;
.line 349
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x1
return v0
:cond_0
const/4 v0, 0x0
return v0
.end method
# virtual methods
.method public getAnalyticsEventDM()Lcom/helpshift/analytics/HSAnalyticsEventDM;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->analyticsEventDM:Lcom/helpshift/analytics/HSAnalyticsEventDM;
return-object v0
.end method
.method public getChatResourceCacheManager()Lcom/helpshift/cache/HelpshiftResourceCacheManager;
.locals 7
iget-object v0, p0, Lcom/helpshift/core/HSContext;->chatResourceCacheManager:Lcom/helpshift/cache/HelpshiftResourceCacheManager;
if-nez v0, :cond_0
.line 225
new-instance v2, Lcom/helpshift/storage/SharedPreferencesStore;
iget-object v0, p0, Lcom/helpshift/core/HSContext;->context:Landroid/content/Context;
const-string v1, "__hs_chat_resource_cache"
const/4 v3, 0x0
invoke-direct {v2, v0, v1, v3}, Lcom/helpshift/storage/SharedPreferencesStore;-><init>(Landroid/content/Context;Ljava/lang/String;I)V
.line 228
new-instance v3, Lcom/helpshift/cache/ChatResourceEvictStrategy;
invoke-direct {v3}, Lcom/helpshift/cache/ChatResourceEvictStrategy;-><init>()V
sget-object v4, Lcom/helpshift/util/SdkURLs;->AWS_CACHE_URLS_CONFIG:Ljava/lang/String;
const-string v5, "chat_cacheURLs"
const-string v6, "webchat"
move-object v1, p0
invoke-virtual/range {v1 .. v6}, Lcom/helpshift/core/HSContext;->getHelpshiftResourceCacheManager(Lcom/helpshift/storage/SharedPreferencesStore;Lcom/helpshift/cache/ResourceCacheEvictStrategy;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/helpshift/cache/HelpshiftResourceCacheManager;
move-result-object v0
iput-object v0, p0, Lcom/helpshift/core/HSContext;->chatResourceCacheManager:Lcom/helpshift/cache/HelpshiftResourceCacheManager;
:cond_0
iget-object v0, p0, Lcom/helpshift/core/HSContext;->chatResourceCacheManager:Lcom/helpshift/cache/HelpshiftResourceCacheManager;
return-object v0
.end method
.method public getConfigManager()Lcom/helpshift/config/HSConfigManager;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->configManager:Lcom/helpshift/config/HSConfigManager;
return-object v0
.end method
.method public getConversationPoller()Lcom/helpshift/poller/ConversationPoller;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->conversationPoller:Lcom/helpshift/poller/ConversationPoller;
return-object v0
.end method
.method public getDevice()Lcom/helpshift/platform/Device;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->device:Lcom/helpshift/platform/Device;
return-object v0
.end method
.method public getGenericDataManager()Lcom/helpshift/storage/HSGenericDataManager;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
return-object v0
.end method
.method public getHelpcenterCacheEvictionManager()Lcom/helpshift/cache/HelpcenterCacheEvictionManager;
.locals 4
iget-object v0, p0, Lcom/helpshift/core/HSContext;->helpcenterCacheEvictionManager:Lcom/helpshift/cache/HelpcenterCacheEvictionManager;
if-nez v0, :cond_0
.line 253
new-instance v0, Lcom/helpshift/cache/HelpcenterCacheEvictionManager;
iget-object v1, p0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v2, p0, Lcom/helpshift/core/HSContext;->context:Landroid/content/Context;
.line 254
invoke-virtual {v2}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
move-result-object v2
invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object v2
const-string v3, "helpcenter"
invoke-direct {v0, v1, v2, v3}, Lcom/helpshift/cache/HelpcenterCacheEvictionManager;-><init>(Lcom/helpshift/storage/HSPersistentStorage;Ljava/lang/String;Ljava/lang/String;)V
iput-object v0, p0, Lcom/helpshift/core/HSContext;->helpcenterCacheEvictionManager:Lcom/helpshift/cache/HelpcenterCacheEvictionManager;
:cond_0
iget-object v0, p0, Lcom/helpshift/core/HSContext;->helpcenterCacheEvictionManager:Lcom/helpshift/cache/HelpcenterCacheEvictionManager;
return-object v0
.end method
.method public getHelpcenterResourceCacheManager()Lcom/helpshift/cache/HelpshiftResourceCacheManager;
.locals 7
iget-object v0, p0, Lcom/helpshift/core/HSContext;->helpcenterResourceCacheManager:Lcom/helpshift/cache/HelpshiftResourceCacheManager;
if-nez v0, :cond_0
.line 239
new-instance v2, Lcom/helpshift/storage/SharedPreferencesStore;
iget-object v0, p0, Lcom/helpshift/core/HSContext;->context:Landroid/content/Context;
const-string v1, "__hs_helpcenter_resource_cache"
const/4 v3, 0x0
invoke-direct {v2, v0, v1, v3}, Lcom/helpshift/storage/SharedPreferencesStore;-><init>(Landroid/content/Context;Ljava/lang/String;I)V
.line 242
new-instance v3, Lcom/helpshift/cache/HCResourceCacheEvictStrategy;
invoke-direct {v3}, Lcom/helpshift/cache/HCResourceCacheEvictStrategy;-><init>()V
sget-object v4, Lcom/helpshift/util/SdkURLs;->HC_CACHE_URLS_CONFIG:Ljava/lang/String;
const-string v5, "helpcenter_cacheURLs"
const-string v6, "helpcenter"
move-object v1, p0
invoke-virtual/range {v1 .. v6}, Lcom/helpshift/core/HSContext;->getHelpshiftResourceCacheManager(Lcom/helpshift/storage/SharedPreferencesStore;Lcom/helpshift/cache/ResourceCacheEvictStrategy;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/helpshift/cache/HelpshiftResourceCacheManager;
move-result-object v0
iput-object v0, p0, Lcom/helpshift/core/HSContext;->helpcenterResourceCacheManager:Lcom/helpshift/cache/HelpshiftResourceCacheManager;
:cond_0
iget-object v0, p0, Lcom/helpshift/core/HSContext;->helpcenterResourceCacheManager:Lcom/helpshift/cache/HelpshiftResourceCacheManager;
return-object v0
.end method
.method public final getHelpshiftResourceCacheManager(Lcom/helpshift/storage/SharedPreferencesStore;Lcom/helpshift/cache/ResourceCacheEvictStrategy;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/helpshift/cache/HelpshiftResourceCacheManager;
.locals 9
.line 265
new-instance v2, Lcom/helpshift/network/HSDownloaderNetwork;
new-instance v0, Lcom/helpshift/network/URLConnectionProvider;
invoke-direct {v0}, Lcom/helpshift/network/URLConnectionProvider;-><init>()V
invoke-direct {v2, v0}, Lcom/helpshift/network/HSDownloaderNetwork;-><init>(Lcom/helpshift/network/URLConnectionProvider;)V
.line 266
new-instance v8, Lcom/helpshift/cache/HelpshiftResourceCacheManager;
iget-object v0, p0, Lcom/helpshift/core/HSContext;->context:Landroid/content/Context;
.line 269
invoke-virtual {v0}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
move-result-object v0
invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object v4
move-object v0, v8
move-object v1, p1
move-object v3, p2
move-object v5, p3
move-object v6, p4
move-object v7, p5
invoke-direct/range {v0 .. v7}, Lcom/helpshift/cache/HelpshiftResourceCacheManager;-><init>(Lcom/helpshift/storage/ISharedPreferencesStore;Lcom/helpshift/network/HSDownloaderNetwork;Lcom/helpshift/cache/ResourceCacheEvictStrategy;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
return-object v8
.end method
.method public getHsEventProxy()Lcom/helpshift/chat/HSEventProxy;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->hsEventProxy:Lcom/helpshift/chat/HSEventProxy;
return-object v0
.end method
.method public getHsThreadingService()Lcom/helpshift/concurrency/HSThreadingService;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
return-object v0
.end method
.method public getJsGenerator()Lcom/helpshift/core/HSJSGenerator;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->jsGenerator:Lcom/helpshift/core/HSJSGenerator;
return-object v0
.end method
.method public getNativeToSdkxMigrator()Lcom/helpshift/migrator/NativeToSdkxMigrator;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->nativeToSdkxMigrator:Lcom/helpshift/migrator/NativeToSdkxMigrator;
return-object v0
.end method
.method public getNotificationManager()Lcom/helpshift/notification/CoreNotificationManager;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->notificationManager:Lcom/helpshift/notification/CoreNotificationManager;
return-object v0
.end method
.method public getPersistentStorage()Lcom/helpshift/storage/HSPersistentStorage;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
return-object v0
.end method
.method public getRequestUnreadMessageCountHandler()Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->requestUnreadMessageCountHandler:Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
return-object v0
.end method
.method public getUserManager()Lcom/helpshift/user/UserManager;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->userManager:Lcom/helpshift/user/UserManager;
return-object v0
.end method
.method public getWebchatAnalyticsManager()Lcom/helpshift/analytics/HSWebchatAnalyticsManager;
.locals 1
iget-object v0, p0, Lcom/helpshift/core/HSContext;->analyticsManager:Lcom/helpshift/analytics/HSWebchatAnalyticsManager;
return-object v0
.end method
.method public initialiseComponents(Landroid/content/Context;)V
.locals 17
move-object/from16 v0, p0
move-object/from16 v1, p1
.line 122
new-instance v2, Ljava/util/concurrent/ScheduledThreadPoolExecutor;
new-instance v3, Lcom/helpshift/core/HSContext$1;
invoke-direct {v3, v0}, Lcom/helpshift/core/HSContext$1;-><init>(Lcom/helpshift/core/HSContext;)V
const/4 v4, 0x1
invoke-direct {v2, v4, v3}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;-><init>(ILjava/util/concurrent/ThreadFactory;)V
iput-object v2, v0, Lcom/helpshift/core/HSContext;->scheduledThreadPoolExecutor:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
.line 129
new-instance v2, Lcom/helpshift/core/AndroidDevice;
iget-object v3, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
invoke-direct {v2, v1, v3}, Lcom/helpshift/core/AndroidDevice;-><init>(Landroid/content/Context;Lcom/helpshift/storage/HSPersistentStorage;)V
iput-object v2, v0, Lcom/helpshift/core/HSContext;->device:Lcom/helpshift/platform/Device;
.line 131
new-instance v3, Lcom/helpshift/notification/HSNotificationManager;
iget-object v4, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v5, v0, Lcom/helpshift/core/HSContext;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
invoke-direct {v3, v1, v2, v4, v5}, Lcom/helpshift/notification/HSNotificationManager;-><init>(Landroid/content/Context;Lcom/helpshift/platform/Device;Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/concurrency/HSThreadingService;)V
iput-object v3, v0, Lcom/helpshift/core/HSContext;->notificationManager:Lcom/helpshift/notification/CoreNotificationManager;
.line 133
new-instance v1, Lcom/helpshift/storage/HSGenericDataManager;
iget-object v2, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
invoke-direct {v1, v2}, Lcom/helpshift/storage/HSGenericDataManager;-><init>(Lcom/helpshift/storage/HSPersistentStorage;)V
iput-object v1, v0, Lcom/helpshift/core/HSContext;->genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
.line 135
new-instance v1, Lcom/helpshift/network/HSHttpTransport;
invoke-direct {v1}, Lcom/helpshift/network/HSHttpTransport;-><init>()V
iput-object v1, v0, Lcom/helpshift/core/HSContext;->httpTransport:Lcom/helpshift/network/HTTPTransport;
.line 137
new-instance v1, Lcom/helpshift/analytics/HSWebchatAnalyticsManager;
iget-object v2, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v3, v0, Lcom/helpshift/core/HSContext;->device:Lcom/helpshift/platform/Device;
invoke-direct {v1, v2, v3}, Lcom/helpshift/analytics/HSWebchatAnalyticsManager;-><init>(Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/platform/Device;)V
iput-object v1, v0, Lcom/helpshift/core/HSContext;->analyticsManager:Lcom/helpshift/analytics/HSWebchatAnalyticsManager;
.line 140
new-instance v8, Lcom/helpshift/chat/HSEventProxy;
iget-object v1, v0, Lcom/helpshift/core/HSContext;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
invoke-direct {v8, v1}, Lcom/helpshift/chat/HSEventProxy;-><init>(Lcom/helpshift/concurrency/HSThreadingService;)V
iput-object v8, v0, Lcom/helpshift/core/HSContext;->hsEventProxy:Lcom/helpshift/chat/HSEventProxy;
.line 142
new-instance v1, Lcom/helpshift/notification/HSPushTokenManager;
iget-object v5, v0, Lcom/helpshift/core/HSContext;->device:Lcom/helpshift/platform/Device;
iget-object v6, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v7, v0, Lcom/helpshift/core/HSContext;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
iget-object v9, v0, Lcom/helpshift/core/HSContext;->httpTransport:Lcom/helpshift/network/HTTPTransport;
iget-object v10, v0, Lcom/helpshift/core/HSContext;->genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
move-object v4, v1
invoke-direct/range {v4 .. v10}, Lcom/helpshift/notification/HSPushTokenManager;-><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
iput-object v1, v0, Lcom/helpshift/core/HSContext;->pushTokenManager:Lcom/helpshift/notification/HSPushTokenManager;
.line 149
new-instance v8, Lcom/helpshift/user/UserManager;
iget-object v3, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v5, v0, Lcom/helpshift/core/HSContext;->genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
iget-object v6, v0, Lcom/helpshift/core/HSContext;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
iget-object v7, v0, Lcom/helpshift/core/HSContext;->notificationManager:Lcom/helpshift/notification/CoreNotificationManager;
move-object v2, v8
invoke-direct/range {v2 .. v7}, Lcom/helpshift/user/UserManager;-><init>(Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/notification/HSPushTokenManager;Lcom/helpshift/storage/HSGenericDataManager;Lcom/helpshift/concurrency/HSThreadingService;Lcom/helpshift/notification/CoreNotificationManager;)V
iput-object v8, v0, Lcom/helpshift/core/HSContext;->userManager:Lcom/helpshift/user/UserManager;
.line 155
new-instance v1, Lcom/helpshift/config/HSConfigManager;
iget-object v2, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v3, v0, Lcom/helpshift/core/HSContext;->analyticsManager:Lcom/helpshift/analytics/HSWebchatAnalyticsManager;
iget-object v4, v0, Lcom/helpshift/core/HSContext;->device:Lcom/helpshift/platform/Device;
invoke-direct {v1, v2, v3, v4, v8}, Lcom/helpshift/config/HSConfigManager;-><init>(Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/analytics/HSWebchatAnalyticsManager;Lcom/helpshift/platform/Device;Lcom/helpshift/user/UserManager;)V
iput-object v1, v0, Lcom/helpshift/core/HSContext;->configManager:Lcom/helpshift/config/HSConfigManager;
.line 157
new-instance v1, Lcom/helpshift/poller/FetchNotificationUpdate;
iget-object v10, v0, Lcom/helpshift/core/HSContext;->device:Lcom/helpshift/platform/Device;
iget-object v11, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v12, v0, Lcom/helpshift/core/HSContext;->genericDataManager:Lcom/helpshift/storage/HSGenericDataManager;
iget-object v13, v0, Lcom/helpshift/core/HSContext;->userManager:Lcom/helpshift/user/UserManager;
iget-object v14, v0, Lcom/helpshift/core/HSContext;->notificationManager:Lcom/helpshift/notification/CoreNotificationManager;
iget-object v15, v0, Lcom/helpshift/core/HSContext;->httpTransport:Lcom/helpshift/network/HTTPTransport;
iget-object v2, v0, Lcom/helpshift/core/HSContext;->hsEventProxy:Lcom/helpshift/chat/HSEventProxy;
move-object v9, v1
move-object/from16 v16, v2
invoke-direct/range {v9 .. v16}, Lcom/helpshift/poller/FetchNotificationUpdate;-><init>(Lcom/helpshift/platform/Device;Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/storage/HSGenericDataManager;Lcom/helpshift/user/UserManager;Lcom/helpshift/notification/CoreNotificationManager;Lcom/helpshift/network/HTTPTransport;Lcom/helpshift/chat/HSEventProxy;)V
.line 165
new-instance v2, Lcom/helpshift/poller/ExponentialBackoff;
const/16 v3, 0x1388
const v4, 0xea60
invoke-direct {v2, v3, v4}, Lcom/helpshift/poller/ExponentialBackoff;-><init>(II)V
.line 168
new-instance v3, Lcom/helpshift/poller/PollerController;
iget-object v4, v0, Lcom/helpshift/core/HSContext;->userManager:Lcom/helpshift/user/UserManager;
iget-object v5, v0, Lcom/helpshift/core/HSContext;->scheduledThreadPoolExecutor:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
invoke-direct {v3, v1, v4, v2, v5}, Lcom/helpshift/poller/PollerController;-><init>(Lcom/helpshift/poller/FetchNotificationUpdate;Lcom/helpshift/user/UserManager;Lcom/helpshift/poller/ExponentialBackoff;Ljava/util/concurrent/ScheduledThreadPoolExecutor;)V
.line 173
new-instance v2, Lcom/helpshift/poller/ConversationPoller;
iget-object v4, v0, Lcom/helpshift/core/HSContext;->userManager:Lcom/helpshift/user/UserManager;
invoke-direct {v2, v3, v4}, Lcom/helpshift/poller/ConversationPoller;-><init>(Lcom/helpshift/poller/PollerController;Lcom/helpshift/user/UserManager;)V
iput-object v2, v0, Lcom/helpshift/core/HSContext;->conversationPoller:Lcom/helpshift/poller/ConversationPoller;
iget-object v3, v0, Lcom/helpshift/core/HSContext;->userManager:Lcom/helpshift/user/UserManager;
.line 175
invoke-virtual {v3, v2}, Lcom/helpshift/user/UserManager;->setConversationPoller(Lcom/helpshift/poller/ConversationPoller;)V
iget-object v2, v0, Lcom/helpshift/core/HSContext;->userManager:Lcom/helpshift/user/UserManager;
.line 176
invoke-virtual {v2, v1}, Lcom/helpshift/user/UserManager;->setFetchNotificationUpdateFunction(Lcom/helpshift/poller/FetchNotificationUpdate;)V
.line 178
new-instance v2, Lcom/helpshift/analytics/HSAnalyticsEventDM;
iget-object v4, v0, Lcom/helpshift/core/HSContext;->device:Lcom/helpshift/platform/Device;
iget-object v5, v0, Lcom/helpshift/core/HSContext;->userManager:Lcom/helpshift/user/UserManager;
iget-object v6, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v7, v0, Lcom/helpshift/core/HSContext;->analyticsManager:Lcom/helpshift/analytics/HSWebchatAnalyticsManager;
iget-object v8, v0, Lcom/helpshift/core/HSContext;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
iget-object v9, v0, Lcom/helpshift/core/HSContext;->httpTransport:Lcom/helpshift/network/HTTPTransport;
move-object v3, v2
invoke-direct/range {v3 .. v9}, Lcom/helpshift/analytics/HSAnalyticsEventDM;-><init>(Lcom/helpshift/platform/Device;Lcom/helpshift/user/UserManager;Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/analytics/HSWebchatAnalyticsManager;Lcom/helpshift/concurrency/HSThreadingService;Lcom/helpshift/network/HTTPTransport;)V
iput-object v2, v0, Lcom/helpshift/core/HSContext;->analyticsEventDM:Lcom/helpshift/analytics/HSAnalyticsEventDM;
.line 185
new-instance v2, Lcom/helpshift/core/HSJSGenerator;
iget-object v3, v0, Lcom/helpshift/core/HSContext;->configManager:Lcom/helpshift/config/HSConfigManager;
invoke-direct {v2, v3}, Lcom/helpshift/core/HSJSGenerator;-><init>(Lcom/helpshift/config/HSConfigManager;)V
iput-object v2, v0, Lcom/helpshift/core/HSContext;->jsGenerator:Lcom/helpshift/core/HSJSGenerator;
.line 187
new-instance v2, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
iget-object v10, v0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v12, v0, Lcom/helpshift/core/HSContext;->userManager:Lcom/helpshift/user/UserManager;
iget-object v13, v0, Lcom/helpshift/core/HSContext;->hsEventProxy:Lcom/helpshift/chat/HSEventProxy;
iget-object v14, v0, Lcom/helpshift/core/HSContext;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
move-object v9, v2
move-object v11, v1
invoke-direct/range {v9 .. v14}, Lcom/helpshift/notification/RequestUnreadMessageCountHandler;-><init>(Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/poller/FetchNotificationUpdate;Lcom/helpshift/user/UserManager;Lcom/helpshift/chat/HSEventProxy;Lcom/helpshift/concurrency/HSThreadingService;)V
iput-object v2, v0, Lcom/helpshift/core/HSContext;->requestUnreadMessageCountHandler:Lcom/helpshift/notification/RequestUnreadMessageCountHandler;
return-void
.end method
.method public isIsWebchatOpenedFromHelpcenter()Z
.locals 1
iget-boolean v0, p0, Lcom/helpshift/core/HSContext;->isWebchatOpenedFromHelpcenter:Z
return v0
.end method
.method public isSDKLoggingEnabled()Z
.locals 1
iget-boolean v0, p0, Lcom/helpshift/core/HSContext;->isSDKLoggingEnabled:Z
return v0
.end method
.method public isSdkOpen()Z
.locals 1
iget-boolean v0, p0, Lcom/helpshift/core/HSContext;->isSdkOpen:Z
return v0
.end method
.method public isWebchatUIOpen()Z
.locals 1
iget-boolean v0, p0, Lcom/helpshift/core/HSContext;->isWebchatOpen:Z
return v0
.end method
.method public sendMigrationFailureLogs()V
.locals 7
.line 276
new-instance v6, Lcom/helpshift/migrator/MigrationFailureLogProvider;
iget-object v1, p0, Lcom/helpshift/core/HSContext;->context:Landroid/content/Context;
iget-object v2, p0, Lcom/helpshift/core/HSContext;->httpTransport:Lcom/helpshift/network/HTTPTransport;
iget-object v3, p0, Lcom/helpshift/core/HSContext;->persistentStorage:Lcom/helpshift/storage/HSPersistentStorage;
iget-object v4, p0, Lcom/helpshift/core/HSContext;->device:Lcom/helpshift/platform/Device;
iget-object v5, p0, Lcom/helpshift/core/HSContext;->hsThreadingService:Lcom/helpshift/concurrency/HSThreadingService;
move-object v0, v6
invoke-direct/range {v0 .. v5}, Lcom/helpshift/migrator/MigrationFailureLogProvider;-><init>(Landroid/content/Context;Lcom/helpshift/network/HTTPTransport;Lcom/helpshift/storage/HSPersistentStorage;Lcom/helpshift/platform/Device;Lcom/helpshift/concurrency/HSThreadingService;)V
.line 280
invoke-virtual {v6}, Lcom/helpshift/migrator/MigrationFailureLogProvider;->sendMigrationFailureLogs()V
return-void
.end method
.method public setIsWebchatOpenedFromHelpcenter(Z)V
.locals 0
iput-boolean p1, p0, Lcom/helpshift/core/HSContext;->isWebchatOpenedFromHelpcenter:Z
return-void
.end method
.method public setSDKLoggingEnabled(Z)V
.locals 0
iput-boolean p1, p0, Lcom/helpshift/core/HSContext;->isSDKLoggingEnabled:Z
return-void
.end method
.method public setSdkIsOpen(Z)V
.locals 0
iput-boolean p1, p0, Lcom/helpshift/core/HSContext;->isSdkOpen:Z
return-void
.end method
.method public setWebchatUIIsOpen(Z)V
.locals 0
iput-boolean p1, p0, Lcom/helpshift/core/HSContext;->isWebchatOpen:Z
return-void
.end method

View File

@@ -0,0 +1,189 @@
.class public Lcom/helpshift/core/HSJSGenerator;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field public static backBtnClickJs:Ljava/lang/String; = "Helpcenter( JSON.stringify({ \"eventType\": \"backBtnClick\", \"config\": {} }));"
.field public static reloadIframeJS:Ljava/lang/String; = "Helpcenter( JSON.stringify({ \"eventType\": \"reloadHelpcenter\", \"config\": %helpshiftConfig }));"
.field public static sendForegroundEvent:Ljava/lang/String; = "Helpcenter( JSON.stringify({ \"eventType\": \"sdkxIsInForeground\", \"config\": %foreground }));"
.field public static sendWebchatData:Ljava/lang/String; = "Helpcenter( JSON.stringify({ \"eventType\": \"setWebchatData\", \"config\": %data }));"
.field public static showNotificationBadgeJS:Ljava/lang/String; = "Helpcenter(JSON.stringify({ \"eventType\": \"showNotifBadge\", \"config\": { \"notifCount\": %count } }));"
# instance fields
.field public configManager:Lcom/helpshift/config/HSConfigManager;
.field public helpcenterEmbeddedCodeString:Ljava/lang/String;
.field public webchatEmbeddedCodeString:Ljava/lang/String;
# direct methods
.method static constructor <clinit>()V
.locals 0
return-void
.end method
.method public constructor <init>(Lcom/helpshift/config/HSConfigManager;)V
.locals 0
.line 22
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/helpshift/core/HSJSGenerator;->configManager:Lcom/helpshift/config/HSConfigManager;
return-void
.end method
# virtual methods
.method public getHelpcenterEmbeddedCodeString(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
.locals 2
iget-object v0, p0, Lcom/helpshift/core/HSJSGenerator;->helpcenterEmbeddedCodeString:Ljava/lang/String;
.line 78
invoke-static {v0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_1
const-string v0, "helpshift/Helpcenter.js"
.line 79
invoke-static {p1, v0}, Lcom/helpshift/util/AssetsUtil;->readAssetFileContents(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
.line 80
invoke-static {p1}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
const-string p1, ""
return-object p1
:cond_0
const-string v0, "%cdn"
.line 83
sget-object v1, Lcom/helpshift/util/SdkURLs;->HELPCENTER_MIDDLEWARE_JS:Ljava/lang/String;
invoke-virtual {p1, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object p1
iput-object p1, p0, Lcom/helpshift/core/HSJSGenerator;->helpcenterEmbeddedCodeString:Ljava/lang/String;
:cond_1
iget-object p1, p0, Lcom/helpshift/core/HSJSGenerator;->helpcenterEmbeddedCodeString:Ljava/lang/String;
iget-object v0, p0, Lcom/helpshift/core/HSJSGenerator;->configManager:Lcom/helpshift/config/HSConfigManager;
.line 86
invoke-virtual {v0, p2, p3, p4}, Lcom/helpshift/config/HSConfigManager;->getHelpcenterConfigJs(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
move-result-object p2
const-string p3, "%config"
.line 87
invoke-virtual {p1, p3, p2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object p1
return-object p1
.end method
.method public getWebchatEmbeddedCodeString(Landroid/content/Context;)Ljava/lang/String;
.locals 2
iget-object v0, p0, Lcom/helpshift/core/HSJSGenerator;->webchatEmbeddedCodeString:Ljava/lang/String;
.line 62
invoke-static {v0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_1
const-string v0, "helpshift/Webchat.js"
.line 63
invoke-static {p1, v0}, Lcom/helpshift/util/AssetsUtil;->readAssetFileContents(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
.line 64
invoke-static {p1}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
const-string p1, ""
return-object p1
:cond_0
const-string v0, "%cdn"
.line 67
sget-object v1, Lcom/helpshift/util/SdkURLs;->AWS_WEBCHAT_JS:Ljava/lang/String;
invoke-virtual {p1, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object p1
iput-object p1, p0, Lcom/helpshift/core/HSJSGenerator;->webchatEmbeddedCodeString:Ljava/lang/String;
:cond_1
iget-object p1, p0, Lcom/helpshift/core/HSJSGenerator;->webchatEmbeddedCodeString:Ljava/lang/String;
iget-object v0, p0, Lcom/helpshift/core/HSJSGenerator;->configManager:Lcom/helpshift/config/HSConfigManager;
.line 70
invoke-static {}, Lcom/helpshift/core/HSContext;->getInstance()Lcom/helpshift/core/HSContext;
move-result-object v1
invoke-virtual {v1}, Lcom/helpshift/core/HSContext;->isIsWebchatOpenedFromHelpcenter()Z
move-result v1
invoke-virtual {v0, v1}, Lcom/helpshift/config/HSConfigManager;->getWebchatConfigJs(Z)Ljava/lang/String;
move-result-object v0
const-string v1, "%config"
.line 71
invoke-virtual {p1, v1, v0}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object p1
iget-object v0, p0, Lcom/helpshift/core/HSJSGenerator;->configManager:Lcom/helpshift/config/HSConfigManager;
.line 72
invoke-virtual {v0}, Lcom/helpshift/config/HSConfigManager;->getCif()Ljava/lang/String;
move-result-object v0
const-string v1, "%cifs"
invoke-virtual {p1, v1, v0}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object p1
return-object p1
.end method