Files
rr3-apk/smali_classes3/com/helpshift/chat/HSChatToNativeBridge.smali
Daniel Elliott f3960ee359 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
2026-02-18 16:13:44 -08:00

535 lines
15 KiB
Smali

.class public Lcom/helpshift/chat/HSChatToNativeBridge;
.super Ljava/lang/Object;
.source "SourceFile"
# instance fields
.field public final delegate:Lcom/helpshift/chat/HSEventProxy;
.field public final eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.field public isWebSdkConfigLoaded:Z
# direct methods
.method public constructor <init>(Lcom/helpshift/chat/HSEventProxy;Lcom/helpshift/chat/HSChatEventsHandler;)V
.locals 0
.line 28
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->delegate:Lcom/helpshift/chat/HSEventProxy;
iput-object p2, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
return-void
.end method
# virtual methods
.method public getHelpcenterData()V
.locals 2
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
const-string v0, "ChatNativeBridge"
const-string v1, "Received event to get Aditional info of HC from WC from webview."
.line 142
invoke-static {v0, v1}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 143
invoke-virtual {v0}, Lcom/helpshift/chat/HSChatEventsHandler;->getHelpcenterData()V
return-void
.end method
.method public onRemoveAnonymousUser()V
.locals 1
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 224
invoke-virtual {v0}, Lcom/helpshift/chat/HSChatEventsHandler;->onRemoveAnonymousUser()V
return-void
.end method
.method public onUIConfigChange(Ljava/lang/String;)V
.locals 1
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 176
invoke-virtual {v0, p1}, Lcom/helpshift/chat/HSChatEventsHandler;->onUiConfigChange(Ljava/lang/String;)V
return-void
.end method
.method public onWebSdkConfigLoad()V
.locals 2
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
const-string v0, "ChatNativeBridge"
const-string v1, "Received event when web sdk config loaded"
.line 89
invoke-static {v0, v1}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
iget-boolean v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->isWebSdkConfigLoaded:Z
if-eqz v0, :cond_0
return-void
:cond_0
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->isWebSdkConfigLoaded:Z
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 96
invoke-virtual {v0}, Lcom/helpshift/chat/HSChatEventsHandler;->onWebchatLoaded()V
return-void
.end method
.method public onWebchatError()V
.locals 2
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
const-string v0, "ChatNativeBridge"
const-string v1, "Received error from webview."
.line 152
invoke-static {v0, v1}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 153
invoke-virtual {v0}, Lcom/helpshift/chat/HSChatEventsHandler;->onWebchatError()V
return-void
.end method
.method public removeLocalStorage(Ljava/lang/String;)V
.locals 2
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
const-string v0, "ChatNativeBridge"
const-string v1, "Received event to remove data from local store from webview."
.line 131
invoke-static {v0, v1}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 132
invoke-virtual {v0, p1}, Lcom/helpshift/chat/HSChatEventsHandler;->onRemoveLocalStorage(Ljava/lang/String;)V
return-void
.end method
.method public requestConversationMetadata(Ljava/lang/String;)V
.locals 1
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 259
invoke-virtual {v0, p1}, Lcom/helpshift/chat/HSChatEventsHandler;->requestConversationMetadata(Ljava/lang/String;)V
return-void
.end method
.method public sdkxMigrationLogSynced(Z)V
.locals 1
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 254
invoke-virtual {v0, p1}, Lcom/helpshift/chat/HSChatEventsHandler;->sdkxMigrationLogSynced(Z)V
return-void
.end method
.method public sendEvent(Ljava/lang/String;)V
.locals 5
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
const-string v0, "Received event from webview."
const-string v1, "ChatNativeBridge"
.line 40
invoke-static {v1, v0}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->delegate:Lcom/helpshift/chat/HSEventProxy;
if-eqz v0, :cond_1
.line 41
invoke-static {p1}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
goto :goto_1
.line 45
:cond_0
:try_start_0
new-instance v0, Lorg/json/JSONObject;
invoke-direct {v0, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
.line 46
invoke-virtual {v0}, Lorg/json/JSONObject;->keys()Ljava/util/Iterator;
move-result-object p1
.line 47
:goto_0
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_1
.line 48
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/lang/String;
const-string v3, ""
.line 49
invoke-virtual {v0, v2, v3}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
iget-object v4, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->delegate:Lcom/helpshift/chat/HSEventProxy;
.line 50
invoke-static {v3}, Lcom/helpshift/util/Utils;->jsonStringToMap(Ljava/lang/String;)Ljava/util/Map;
move-result-object v3
invoke-virtual {v4, v2, v3}, Lcom/helpshift/chat/HSEventProxy;->sendEvent(Ljava/lang/String;Ljava/util/Map;)V
:try_end_0
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception p1
const-string v0, "Error in sending public event"
.line 54
invoke-static {v1, v0, p1}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_1
:goto_1
return-void
.end method
.method public sendPushTokenSyncRequestData(Ljava/lang/String;)V
.locals 1
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 165
invoke-virtual {v0, p1}, Lcom/helpshift/chat/HSChatEventsHandler;->onReceivePushTokenSyncRequestData(Ljava/lang/String;)V
return-void
.end method
.method public sendUserAuthFailureEvent(Ljava/lang/String;)V
.locals 3
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
const-string v0, "message"
iget-object v1, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->delegate:Lcom/helpshift/chat/HSEventProxy;
if-eqz v1, :cond_3
.line 187
invoke-static {p1}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v1
if-eqz v1, :cond_0
goto :goto_1
:cond_0
const-string v1, "Authentication Failure"
.line 192
:try_start_0
new-instance v2, Lorg/json/JSONObject;
invoke-direct {v2, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
.line 193
invoke-virtual {v2, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result p1
if-eqz p1, :cond_2
.line 194
invoke-virtual {v2, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
.line 195
invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
if-eqz v0, :cond_1
goto :goto_0
:cond_1
move-object v1, p1
goto :goto_0
:catch_0
const-string p1, "ChatNativeBridge"
const-string v0, "Error in reading auth failure event "
.line 199
invoke-static {p1, v0}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;)V
:cond_2
:goto_0
iget-object p1, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 203
invoke-virtual {p1}, Lcom/helpshift/chat/HSChatEventsHandler;->onUserAuthenticationFailure()V
iget-object p1, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->delegate:Lcom/helpshift/chat/HSEventProxy;
.line 212
invoke-virtual {p1, v1}, Lcom/helpshift/chat/HSEventProxy;->sendAuthFailureEvent(Ljava/lang/String;)V
:cond_3
:goto_1
return-void
.end method
.method public setGenericSdkData(Ljava/lang/String;)V
.locals 1
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 244
invoke-virtual {v0, p1}, Lcom/helpshift/chat/HSChatEventsHandler;->setGenericSdkData(Ljava/lang/String;)V
return-void
.end method
.method public setIssueExistsFlag(Ljava/lang/String;)V
.locals 2
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
.line 108
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "Received event to set the issue exist as -"
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, "ChatNativeBridge"
invoke-static {v1, v0}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 109
invoke-virtual {v0, p1}, Lcom/helpshift/chat/HSChatEventsHandler;->setIssueExistsForUser(Ljava/lang/String;)V
return-void
.end method
.method public setLocalStorage(Ljava/lang/String;)V
.locals 2
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
const-string v0, "ChatNativeBridge"
const-string v1, "Received event to set data in local store from webview."
.line 119
invoke-static {v0, v1}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 120
invoke-virtual {v0, p1}, Lcom/helpshift/chat/HSChatEventsHandler;->onSetLocalStorage(Ljava/lang/String;)V
return-void
.end method
.method public setPollingStatus(Ljava/lang/String;)V
.locals 1
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 234
invoke-virtual {v0, p1}, Lcom/helpshift/chat/HSChatEventsHandler;->setPollingStatus(Ljava/lang/String;)V
return-void
.end method
.method public webchatJsFileLoaded()V
.locals 1
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
iget-object v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 264
invoke-virtual {v0}, Lcom/helpshift/chat/HSChatEventsHandler;->webchatJsFileLoaded()V
return-void
.end method
.method public widgetToggle(Ljava/lang/String;)V
.locals 3
.annotation runtime Landroid/webkit/JavascriptInterface;
.end annotation
.line 65
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "webchat widget toggle: "
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, "ChatNativeBridge"
invoke-static {v1, v0}, Lcom/helpshift/log/HSLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
.line 66
invoke-static {p1}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_2
iget-boolean v0, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->isWebSdkConfigLoaded:Z
if-nez v0, :cond_0
goto :goto_1
.line 70
:cond_0
:try_start_0
new-instance v0, Lorg/json/JSONObject;
invoke-direct {v0, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
const-string p1, "visible"
const/4 v2, 0x0
.line 71
invoke-virtual {v0, p1, v2}, Lorg/json/JSONObject;->optBoolean(Ljava/lang/String;Z)Z
move-result p1
if-eqz p1, :cond_1
iget-object p1, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 73
invoke-virtual {p1}, Lcom/helpshift/chat/HSChatEventsHandler;->onWebchatLoaded()V
goto :goto_1
:catch_0
move-exception p1
goto :goto_0
:cond_1
iget-object p1, p0, Lcom/helpshift/chat/HSChatToNativeBridge;->eventsHandler:Lcom/helpshift/chat/HSChatEventsHandler;
.line 76
invoke-virtual {p1}, Lcom/helpshift/chat/HSChatEventsHandler;->onWebchatClosed()V
:try_end_0
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_1
:goto_0
const-string v0, "Error in closing the webchat"
.line 80
invoke-static {v1, v0, p1}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_2
:goto_1
return-void
.end method