Files
rr3-apk/smali_classes3/com/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager.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

225 lines
6.9 KiB
Smali

.class public Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;
.super Landroid/net/ConnectivityManager$NetworkCallback;
.source "SourceFile"
# interfaces
.implements Lcom/helpshift/util/network/connectivity/HSAndroidConnectivityManager;
# instance fields
.field public context:Landroid/content/Context;
.field public networkListener:Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 0
.line 25
invoke-direct {p0}, Landroid/net/ConnectivityManager$NetworkCallback;-><init>()V
iput-object p1, p0, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->context:Landroid/content/Context;
return-void
.end method
.method private getConnectivityManager()Landroid/net/ConnectivityManager;
.locals 3
:try_start_0
iget-object v0, p0, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->context:Landroid/content/Context;
const-string v1, "connectivity"
.line 143
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/net/ConnectivityManager;
: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, "AboveNConnectvtManager"
const-string v2, "Exception while getting connectivity manager"
.line 146
invoke-static {v1, v2, v0}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
const/4 v0, 0x0
:goto_0
return-object v0
.end method
# virtual methods
.method public getConnectivityStatus()Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;
.locals 2
.line 73
sget-object v0, Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;->UNKNOWN:Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;
.line 74
invoke-direct {p0}, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->getConnectivityManager()Landroid/net/ConnectivityManager;
move-result-object v1
if-eqz v1, :cond_1
.line 76
invoke-virtual {v1}, Landroid/net/ConnectivityManager;->getActiveNetwork()Landroid/net/Network;
move-result-object v0
if-eqz v0, :cond_0
.line 78
sget-object v0, Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;->CONNECTED:Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;
goto :goto_0
.line 81
:cond_0
sget-object v0, Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;->NOT_CONNECTED:Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;
:cond_1
:goto_0
return-object v0
.end method
.method public onAvailable(Landroid/net/Network;)V
.locals 0
iget-object p1, p0, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->networkListener:Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;
if-eqz p1, :cond_0
.line 122
invoke-interface {p1}, Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;->onNetworkAvailable()V
:cond_0
return-void
.end method
.method public onLost(Landroid/net/Network;)V
.locals 0
iget-object p1, p0, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->networkListener:Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;
if-eqz p1, :cond_0
.line 129
invoke-interface {p1}, Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;->onNetworkUnavailable()V
:cond_0
return-void
.end method
.method public onUnavailable()V
.locals 1
iget-object v0, p0, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->networkListener:Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;
if-eqz v0, :cond_0
.line 136
invoke-interface {v0}, Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;->onNetworkUnavailable()V
:cond_0
return-void
.end method
.method public startListeningConnectivityChange(Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;)V
.locals 3
iput-object p1, p0, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->networkListener:Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;
.line 33
invoke-direct {p0}, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->getConnectivityManager()Landroid/net/ConnectivityManager;
move-result-object v0
if-eqz v0, :cond_0
.line 36
:try_start_0
invoke-virtual {v0, p0}, Landroid/net/ConnectivityManager;->registerDefaultNetworkCallback(Landroid/net/ConnectivityManager$NetworkCallback;)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, "AboveNConnectvtManager"
const-string v2, "Exception while registering network callback"
.line 39
invoke-static {v1, v2, v0}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
.line 48
:cond_0
:goto_0
invoke-virtual {p0}, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->getConnectivityStatus()Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;
move-result-object v0
.line 49
sget-object v1, Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;->NOT_CONNECTED:Lcom/helpshift/util/network/connectivity/HSConnectivityStatus;
if-ne v0, v1, :cond_1
.line 50
invoke-interface {p1}, Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;->onNetworkUnavailable()V
:cond_1
return-void
.end method
.method public stopListeningConnectivityChange()V
.locals 3
.line 57
invoke-direct {p0}, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->getConnectivityManager()Landroid/net/ConnectivityManager;
move-result-object v0
if-eqz v0, :cond_0
.line 60
:try_start_0
invoke-virtual {v0, p0}, Landroid/net/ConnectivityManager;->unregisterNetworkCallback(Landroid/net/ConnectivityManager$NetworkCallback;)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, "AboveNConnectvtManager"
const-string v2, "Exception while unregistering network callback"
.line 63
invoke-static {v1, v2, v0}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_0
:goto_0
const/4 v0, 0x0
iput-object v0, p0, Lcom/helpshift/util/network/connectivity/HSOnAndAboveNConnectivityManager;->networkListener:Lcom/helpshift/util/network/connectivity/HSNetworkConnectivityCallback;
return-void
.end method