Files
rr3-apk/smali_classes3/com/google/firebase/crashlytics/internal/settings/CachedSettingsIo.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

275 lines
7.2 KiB
Smali

.class public Lcom/google/firebase/crashlytics/internal/settings/CachedSettingsIo;
.super Ljava/lang/Object;
.source "SourceFile"
# instance fields
.field public final cachedSettingsFile:Ljava/io/File;
# direct methods
.method public constructor <init>(Lcom/google/firebase/crashlytics/internal/persistence/FileStore;)V
.locals 1
.line 34
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const-string v0, "com.crashlytics.settings.json"
.line 35
invoke-virtual {p1, v0}, Lcom/google/firebase/crashlytics/internal/persistence/FileStore;->getCommonFile(Ljava/lang/String;)Ljava/io/File;
move-result-object p1
iput-object p1, p0, Lcom/google/firebase/crashlytics/internal/settings/CachedSettingsIo;->cachedSettingsFile:Ljava/io/File;
return-void
.end method
# virtual methods
.method public final getSettingsFile()Ljava/io/File;
.locals 1
iget-object v0, p0, Lcom/google/firebase/crashlytics/internal/settings/CachedSettingsIo;->cachedSettingsFile:Ljava/io/File;
return-object v0
.end method
.method public readCachedSettings()Lorg/json/JSONObject;
.locals 6
const-string v0, "Error while closing settings cache file."
.line 47
invoke-static {}, Lcom/google/firebase/crashlytics/internal/Logger;->getLogger()Lcom/google/firebase/crashlytics/internal/Logger;
move-result-object v1
const-string v2, "Checking for cached settings..."
invoke-virtual {v1, v2}, Lcom/google/firebase/crashlytics/internal/Logger;->d(Ljava/lang/String;)V
const/4 v1, 0x0
.line 53
:try_start_0
invoke-virtual {p0}, Lcom/google/firebase/crashlytics/internal/settings/CachedSettingsIo;->getSettingsFile()Ljava/io/File;
move-result-object v2
.line 55
invoke-virtual {v2}, Ljava/io/File;->exists()Z
move-result v3
if-eqz v3, :cond_0
.line 56
new-instance v3, Ljava/io/FileInputStream;
invoke-direct {v3, v2}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
.catchall {:try_start_0 .. :try_end_0} :catchall_1
.line 57
:try_start_1
invoke-static {v3}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->streamToString(Ljava/io/InputStream;)Ljava/lang/String;
move-result-object v2
.line 59
new-instance v4, Lorg/json/JSONObject;
invoke-direct {v4, v2}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
:try_end_1
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_0
move-object v1, v3
goto :goto_0
:catchall_0
move-exception v1
goto :goto_3
:catch_0
move-exception v2
goto :goto_1
:catchall_1
move-exception v2
move-object v3, v1
move-object v1, v2
goto :goto_3
:catch_1
move-exception v2
move-object v3, v1
goto :goto_1
.line 61
:cond_0
:try_start_2
invoke-static {}, Lcom/google/firebase/crashlytics/internal/Logger;->getLogger()Lcom/google/firebase/crashlytics/internal/Logger;
move-result-object v2
const-string v3, "Settings file does not exist."
invoke-virtual {v2, v3}, Lcom/google/firebase/crashlytics/internal/Logger;->v(Ljava/lang/String;)V
:try_end_2
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1
.catchall {:try_start_2 .. :try_end_2} :catchall_1
move-object v4, v1
.line 66
:goto_0
invoke-static {v1, v0}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeOrLog(Ljava/io/Closeable;Ljava/lang/String;)V
move-object v1, v4
goto :goto_2
.line 64
:goto_1
:try_start_3
invoke-static {}, Lcom/google/firebase/crashlytics/internal/Logger;->getLogger()Lcom/google/firebase/crashlytics/internal/Logger;
move-result-object v4
const-string v5, "Failed to fetch cached settings"
invoke-virtual {v4, v5, v2}, Lcom/google/firebase/crashlytics/internal/Logger;->e(Ljava/lang/String;Ljava/lang/Throwable;)V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
.line 66
invoke-static {v3, v0}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeOrLog(Ljava/io/Closeable;Ljava/lang/String;)V
:goto_2
return-object v1
:goto_3
invoke-static {v3, v0}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeOrLog(Ljava/io/Closeable;Ljava/lang/String;)V
.line 67
throw v1
.end method
.method public writeCachedSettings(JLorg/json/JSONObject;)V
.locals 3
const-string v0, "Failed to close settings writer."
.line 80
invoke-static {}, Lcom/google/firebase/crashlytics/internal/Logger;->getLogger()Lcom/google/firebase/crashlytics/internal/Logger;
move-result-object v1
const-string v2, "Writing settings to cache file..."
invoke-virtual {v1, v2}, Lcom/google/firebase/crashlytics/internal/Logger;->v(Ljava/lang/String;)V
if-eqz p3, :cond_0
const/4 v1, 0x0
:try_start_0
const-string v2, "expires_at"
.line 86
invoke-virtual {p3, v2, p1, p2}, Lorg/json/JSONObject;->put(Ljava/lang/String;J)Lorg/json/JSONObject;
.line 88
new-instance p1, Ljava/io/FileWriter;
invoke-virtual {p0}, Lcom/google/firebase/crashlytics/internal/settings/CachedSettingsIo;->getSettingsFile()Ljava/io/File;
move-result-object p2
invoke-direct {p1, p2}, Ljava/io/FileWriter;-><init>(Ljava/io/File;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
.catchall {:try_start_0 .. :try_end_0} :catchall_1
.line 89
:try_start_1
invoke-virtual {p3}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
move-result-object p2
invoke-virtual {p1, p2}, Ljava/io/Writer;->write(Ljava/lang/String;)V
.line 90
invoke-virtual {p1}, Ljava/io/Writer;->flush()V
:try_end_1
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 94
invoke-static {p1, v0}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeOrLog(Ljava/io/Closeable;Ljava/lang/String;)V
goto :goto_2
:catchall_0
move-exception p2
move-object v1, p1
goto :goto_1
:catch_0
move-exception p2
move-object v1, p1
goto :goto_0
:catchall_1
move-exception p2
goto :goto_1
:catch_1
move-exception p2
.line 92
:goto_0
:try_start_2
invoke-static {}, Lcom/google/firebase/crashlytics/internal/Logger;->getLogger()Lcom/google/firebase/crashlytics/internal/Logger;
move-result-object p1
const-string p3, "Failed to cache settings"
invoke-virtual {p1, p3, p2}, Lcom/google/firebase/crashlytics/internal/Logger;->e(Ljava/lang/String;Ljava/lang/Throwable;)V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
.line 94
invoke-static {v1, v0}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeOrLog(Ljava/io/Closeable;Ljava/lang/String;)V
goto :goto_2
:goto_1
invoke-static {v1, v0}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeOrLog(Ljava/io/Closeable;Ljava/lang/String;)V
.line 95
throw p2
:cond_0
:goto_2
return-void
.end method