Files
rr3-apk/smali_classes4/csdk/glucentralservices/network/NetworkUtils.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

775 lines
19 KiB
Smali

.class public Lcsdk/glucentralservices/network/NetworkUtils;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field private static final REQUEST_TIME_OUT_MS:I = 0xbb8
# direct methods
.method public constructor <init>()V
.locals 0
.line 22
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static close(Ljava/io/Closeable;)V
.locals 0
.param p0 # Ljava/io/Closeable;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
if-nez p0, :cond_0
return-void
.line 139
:cond_0
:try_start_0
invoke-interface {p0}, Ljava/io/Closeable;->close()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
:catch_0
return-void
.end method
.method public static copyData(Ljava/io/InputStream;Ljava/io/OutputStream;)V
.locals 3
.param p0 # Ljava/io/InputStream;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/io/OutputStream;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const/16 v0, 0x4000
new-array v0, v0, [B
.line 79
:goto_0
invoke-virtual {p0, v0}, Ljava/io/InputStream;->read([B)I
move-result v1
if-gez v1, :cond_0
return-void
:cond_0
const/4 v2, 0x0
.line 82
invoke-virtual {p1, v0, v2, v1}, Ljava/io/OutputStream;->write([BII)V
goto :goto_0
.end method
.method public static copyIntoFile(Ljava/io/InputStream;Ljava/io/File;)V
.locals 1
.param p0 # Ljava/io/InputStream;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/io/File;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 87
new-instance v0, Ljava/io/FileOutputStream;
invoke-direct {v0, p1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
.line 89
:try_start_0
invoke-static {p0, v0}, Lcsdk/glucentralservices/network/NetworkUtils;->copyData(Ljava/io/InputStream;Ljava/io/OutputStream;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 91
invoke-virtual {v0}, Ljava/io/OutputStream;->close()V
return-void
:catchall_0
move-exception p0
invoke-virtual {v0}, Ljava/io/OutputStream;->close()V
.line 92
throw p0
.end method
.method public static downloadIntoFile(Ljava/net/URL;Ljava/io/File;J)Lcsdk/glucentralservices/network/NetworkResponse;
.locals 7
const/4 v0, 0x0
:try_start_0
const-string v1, "GET"
.line 60
invoke-static {}, Ljava/util/Collections;->emptyMap()Ljava/util/Map;
move-result-object v3
const/4 v4, 0x0
move-object v2, p0
move-wide v5, p2
invoke-static/range {v1 .. v6}, Lcsdk/glucentralservices/network/NetworkUtils;->openConnection(Ljava/lang/String;Ljava/net/URL;Ljava/util/Map;Ljava/lang/String;J)Ljavax/net/ssl/HttpsURLConnection;
move-result-object p0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2
.catchall {:try_start_0 .. :try_end_0} :catchall_2
.line 61
:try_start_1
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->getResponseCode()I
move-result p2
const/16 p3, 0xc8
if-lt p2, p3, :cond_1
const/16 p3, 0x12c
if-lt p2, p3, :cond_0
goto :goto_0
.line 64
:cond_0
invoke-virtual {p0}, Ljava/net/URLConnection;->getInputStream()Ljava/io/InputStream;
move-result-object p3
:try_end_1
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
.line 65
:try_start_2
invoke-static {p3, p1}, Lcsdk/glucentralservices/network/NetworkUtils;->copyIntoFile(Ljava/io/InputStream;Ljava/io/File;)V
.line 66
new-instance p1, Lcsdk/glucentralservices/network/NetworkResponse;
invoke-direct {p1, p2, v0, v0, v0}, Lcsdk/glucentralservices/network/NetworkResponse;-><init>(I[BLjava/util/Map;Ljava/lang/Exception;)V
:try_end_2
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 70
invoke-static {p3}, Lcsdk/glucentralservices/network/NetworkUtils;->close(Ljava/io/Closeable;)V
.line 72
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->disconnect()V
return-object p1
:catchall_0
move-exception p1
move-object v0, p3
goto :goto_2
:catch_0
move-exception p1
goto :goto_1
:catchall_1
move-exception p1
goto :goto_2
:catch_1
move-exception p1
move-object p3, v0
goto :goto_1
.line 63
:cond_1
:goto_0
:try_start_3
new-instance p1, Lcsdk/glucentralservices/network/NetworkResponse;
invoke-direct {p1, p2, v0, v0, v0}, Lcsdk/glucentralservices/network/NetworkResponse;-><init>(I[BLjava/util/Map;Ljava/lang/Exception;)V
:try_end_3
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1
.catchall {:try_start_3 .. :try_end_3} :catchall_1
.line 70
invoke-static {v0}, Lcsdk/glucentralservices/network/NetworkUtils;->close(Ljava/io/Closeable;)V
.line 72
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->disconnect()V
return-object p1
:catchall_2
move-exception p1
move-object p0, v0
goto :goto_2
:catch_2
move-exception p1
move-object p0, v0
move-object p3, p0
.line 68
:goto_1
:try_start_4
new-instance p2, Lcsdk/glucentralservices/network/NetworkResponse;
const/4 v1, -0x1
invoke-direct {p2, v1, v0, v0, p1}, Lcsdk/glucentralservices/network/NetworkResponse;-><init>(I[BLjava/util/Map;Ljava/lang/Exception;)V
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_0
.line 70
invoke-static {p3}, Lcsdk/glucentralservices/network/NetworkUtils;->close(Ljava/io/Closeable;)V
if-eqz p0, :cond_2
.line 72
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->disconnect()V
:cond_2
return-object p2
.line 70
:goto_2
invoke-static {v0}, Lcsdk/glucentralservices/network/NetworkUtils;->close(Ljava/io/Closeable;)V
if-eqz p0, :cond_3
.line 72
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->disconnect()V
.line 73
:cond_3
throw p1
.end method
.method private static openConnection(Ljava/lang/String;Ljava/net/URL;Ljava/util/Map;Ljava/lang/String;J)Ljavax/net/ssl/HttpsURLConnection;
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/String;",
"Ljava/net/URL;",
"Ljava/util/Map<",
"Ljava/lang/String;",
"Ljava/lang/String;",
">;",
"Ljava/lang/String;",
"J)",
"Ljavax/net/ssl/HttpsURLConnection;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-string v0, "POST"
.line 96
invoke-static {p0, v0}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
move-result v0
const/4 v1, 0x1
const/4 v2, 0x0
if-nez v0, :cond_1
const-string v0, "PUT"
invoke-static {p0, v0}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_0
goto :goto_0
:cond_0
move v0, v2
goto :goto_1
:cond_1
:goto_0
move v0, v1
.line 97
:goto_1
invoke-virtual {p1}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;
move-result-object p1
invoke-static {p1}, Lcom/google/firebase/perf/network/FirebasePerfUrlConnection;->instrument(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
check-cast p1, Ljava/net/URLConnection;
check-cast p1, Ljavax/net/ssl/HttpsURLConnection;
.line 98
invoke-static {p1}, Lcsdk/glucentralservices/network/GluTLS12SocketFactory;->fixTLSPre21(Ljavax/net/ssl/HttpsURLConnection;)V
.line 99
invoke-virtual {p1, p0}, Ljava/net/HttpURLConnection;->setRequestMethod(Ljava/lang/String;)V
.line 101
invoke-interface {p2}, Ljava/util/Map;->entrySet()Ljava/util/Set;
move-result-object p0
invoke-interface {p0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object p0
:goto_2
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result p2
if-eqz p2, :cond_2
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object p2
check-cast p2, Ljava/util/Map$Entry;
.line 102
invoke-interface {p2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/String;
invoke-interface {p2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object p2
check-cast p2, Ljava/lang/String;
invoke-virtual {p1, v3, p2}, Ljava/net/URLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
goto :goto_2
.line 104
:cond_2
invoke-virtual {p1, v2}, Ljava/net/URLConnection;->setAllowUserInteraction(Z)V
const/16 p0, 0xbb8
.line 105
invoke-virtual {p1, p0}, Ljava/net/URLConnection;->setConnectTimeout(I)V
long-to-int p0, p4
.line 106
invoke-virtual {p1, p0}, Ljava/net/URLConnection;->setReadTimeout(I)V
.line 108
invoke-virtual {p1, v2}, Ljava/net/URLConnection;->setUseCaches(Z)V
if-eqz v0, :cond_3
.line 111
invoke-virtual {p1, v1}, Ljava/net/URLConnection;->setDoOutput(Z)V
.line 112
invoke-virtual {p1}, Ljava/net/URLConnection;->connect()V
.line 113
invoke-virtual {p1}, Ljava/net/URLConnection;->getOutputStream()Ljava/io/OutputStream;
move-result-object p0
:try_start_0
const-string p2, "UTF-8"
.line 115
invoke-virtual {p3, p2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
move-result-object p2
invoke-virtual {p0, p2}, Ljava/io/OutputStream;->write([B)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 117
invoke-virtual {p0}, Ljava/io/OutputStream;->close()V
goto :goto_3
:catchall_0
move-exception p1
invoke-virtual {p0}, Ljava/io/OutputStream;->close()V
.line 118
throw p1
.line 120
:cond_3
invoke-virtual {p1}, Ljava/net/URLConnection;->connect()V
:goto_3
return-object p1
.end method
.method private static readAsByteArrayAndClose(Ljava/io/InputStream;)[B
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 126
new-instance v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
.line 128
:try_start_0
invoke-static {p0, v0}, Lcsdk/glucentralservices/network/NetworkUtils;->copyData(Ljava/io/InputStream;Ljava/io/OutputStream;)V
.line 129
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
move-result-object p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 131
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V
return-object p0
:catchall_0
move-exception p0
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V
.line 132
throw p0
.end method
.method public static sendRequest(Ljava/lang/String;Ljava/net/URL;Ljava/util/Map;Ljava/lang/String;J)Lcsdk/glucentralservices/network/NetworkResponse;
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/String;",
"Ljava/net/URL;",
"Ljava/util/Map<",
"Ljava/lang/String;",
"Ljava/lang/String;",
">;",
"Ljava/lang/String;",
"J)",
"Lcsdk/glucentralservices/network/NetworkResponse;"
}
.end annotation
const/4 v0, -0x1
const/4 v1, 0x0
.line 30
:try_start_0
invoke-static/range {p0 .. p5}, Lcsdk/glucentralservices/network/NetworkUtils;->openConnection(Ljava/lang/String;Ljava/net/URL;Ljava/util/Map;Ljava/lang/String;J)Ljavax/net/ssl/HttpsURLConnection;
move-result-object p0
:try_end_0
.catch Ljavax/net/ssl/SSLHandshakeException; {:try_start_0 .. :try_end_0} :catch_5
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_4
.catchall {:try_start_0 .. :try_end_0} :catchall_2
.line 31
:try_start_1
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->getResponseCode()I
move-result p1
const/16 p2, 0x190
if-lt p1, p2, :cond_0
.line 33
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->getErrorStream()Ljava/io/InputStream;
move-result-object p2
goto :goto_0
:catchall_0
move-exception p1
goto/16 :goto_3
:catch_0
move-exception p1
move-object p2, v1
goto :goto_1
:catch_1
move-exception p1
move-object p2, v1
goto :goto_2
:cond_0
invoke-virtual {p0}, Ljava/net/URLConnection;->getInputStream()Ljava/io/InputStream;
move-result-object p2
:try_end_1
.catch Ljavax/net/ssl/SSLHandshakeException; {:try_start_1 .. :try_end_1} :catch_1
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 34
:goto_0
:try_start_2
invoke-static {p2}, Lcsdk/glucentralservices/network/NetworkUtils;->readAsByteArrayAndClose(Ljava/io/InputStream;)[B
move-result-object p3
.line 35
invoke-virtual {p0}, Ljava/net/URLConnection;->getHeaderFields()Ljava/util/Map;
move-result-object p4
.line 36
new-instance p5, Lcsdk/glucentralservices/network/NetworkResponse;
invoke-direct {p5, p1, p3, p4, v1}, Lcsdk/glucentralservices/network/NetworkResponse;-><init>(I[BLjava/util/Map;Ljava/lang/Exception;)V
:try_end_2
.catch Ljavax/net/ssl/SSLHandshakeException; {:try_start_2 .. :try_end_2} :catch_3
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
.line 49
invoke-static {p2}, Lcsdk/glucentralservices/network/NetworkUtils;->close(Ljava/io/Closeable;)V
.line 51
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->disconnect()V
return-object p5
:catchall_1
move-exception p1
move-object v1, p2
goto/16 :goto_3
:catch_2
move-exception p1
goto :goto_1
:catch_3
move-exception p1
goto :goto_2
:catchall_2
move-exception p1
move-object p0, v1
goto/16 :goto_3
:catch_4
move-exception p1
move-object p0, v1
move-object p2, p0
:goto_1
:try_start_3
sget-object p3, Ljava/lang/System;->out:Ljava/io/PrintStream;
.line 46
new-instance p4, Ljava/lang/StringBuilder;
invoke-direct {p4}, Ljava/lang/StringBuilder;-><init>()V
const-string p5, "Exception type: "
invoke-virtual {p4, p5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object p5
invoke-virtual {p4, p5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {p4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p4
invoke-virtual {p3, p4}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
.line 47
new-instance p3, Lcsdk/glucentralservices/network/NetworkResponse;
invoke-direct {p3, v0, v1, v1, p1}, Lcsdk/glucentralservices/network/NetworkResponse;-><init>(I[BLjava/util/Map;Ljava/lang/Exception;)V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
.line 49
invoke-static {p2}, Lcsdk/glucentralservices/network/NetworkUtils;->close(Ljava/io/Closeable;)V
if-eqz p0, :cond_1
.line 51
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->disconnect()V
:cond_1
return-object p3
:catch_5
move-exception p1
move-object p0, v1
move-object p2, p0
:goto_2
:try_start_4
sget-object p3, Ljava/lang/System;->out:Ljava/io/PrintStream;
.line 38
new-instance p4, Ljava/lang/StringBuilder;
invoke-direct {p4}, Ljava/lang/StringBuilder;-><init>()V
const-string p5, "SSLHandshakeException occurred: "
invoke-virtual {p4, p5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
move-result-object p5
invoke-virtual {p4, p5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p4
invoke-virtual {p3, p4}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
.line 39
invoke-virtual {p1}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;
move-result-object p4
if-eqz p4, :cond_2
.line 41
new-instance p5, Ljava/lang/StringBuilder;
invoke-direct {p5}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Cause: "
invoke-virtual {p5, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p4}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
move-result-object p4
invoke-virtual {p5, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p4
invoke-virtual {p3, p4}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
.line 43
:cond_2
invoke-virtual {p1}, Ljava/lang/Throwable;->printStackTrace()V
.line 44
new-instance p3, Lcsdk/glucentralservices/network/NetworkResponse;
invoke-direct {p3, v0, v1, v1, p1}, Lcsdk/glucentralservices/network/NetworkResponse;-><init>(I[BLjava/util/Map;Ljava/lang/Exception;)V
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_1
.line 49
invoke-static {p2}, Lcsdk/glucentralservices/network/NetworkUtils;->close(Ljava/io/Closeable;)V
if-eqz p0, :cond_3
.line 51
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->disconnect()V
:cond_3
return-object p3
.line 49
:goto_3
invoke-static {v1}, Lcsdk/glucentralservices/network/NetworkUtils;->close(Ljava/io/Closeable;)V
if-eqz p0, :cond_4
.line 51
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->disconnect()V
.line 53
:cond_4
throw p1
.end method