Files
rr3-apk/smali_classes4/com/singular/sdk/internal/ApiManager.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

304 lines
8.7 KiB
Smali

.class public Lcom/singular/sdk/internal/ApiManager;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field public static final logger:Lcom/singular/sdk/internal/SingularLog;
# instance fields
.field public final context:Landroid/content/Context;
.field public final migrateEventsFromFileQueue:Ljava/lang/Runnable;
.field public queue:Lcom/singular/sdk/internal/Queue;
.field public final runnable:Ljava/lang/Runnable;
.field public worker:Lcom/singular/sdk/internal/SingularWorkerThread;
# direct methods
.method static constructor <clinit>()V
.locals 1
const-class v0, Lcom/singular/sdk/internal/ApiManager;
.line 27
invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lcom/singular/sdk/internal/SingularLog;->getLogger(Ljava/lang/String;)Lcom/singular/sdk/internal/SingularLog;
move-result-object v0
sput-object v0, Lcom/singular/sdk/internal/ApiManager;->logger:Lcom/singular/sdk/internal/SingularLog;
return-void
.end method
.method public constructor <init>(Lcom/singular/sdk/internal/SingularWorkerThread;Landroid/content/Context;Lcom/singular/sdk/internal/Queue;)V
.locals 1
.line 36
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 116
new-instance v0, Lcom/singular/sdk/internal/ApiManager$2;
invoke-direct {v0, p0}, Lcom/singular/sdk/internal/ApiManager$2;-><init>(Lcom/singular/sdk/internal/ApiManager;)V
iput-object v0, p0, Lcom/singular/sdk/internal/ApiManager;->runnable:Ljava/lang/Runnable;
.line 156
new-instance v0, Lcom/singular/sdk/internal/ApiManager$3;
invoke-direct {v0, p0}, Lcom/singular/sdk/internal/ApiManager$3;-><init>(Lcom/singular/sdk/internal/ApiManager;)V
iput-object v0, p0, Lcom/singular/sdk/internal/ApiManager;->migrateEventsFromFileQueue:Ljava/lang/Runnable;
iput-object p2, p0, Lcom/singular/sdk/internal/ApiManager;->context:Landroid/content/Context;
iput-object p3, p0, Lcom/singular/sdk/internal/ApiManager;->queue:Lcom/singular/sdk/internal/Queue;
if-nez p3, :cond_0
return-void
:cond_0
sget-object p2, Lcom/singular/sdk/internal/ApiManager;->logger:Lcom/singular/sdk/internal/SingularLog;
.line 45
invoke-virtual {p3}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object p3
invoke-virtual {p3}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
move-result-object p3
filled-new-array {p3}, [Ljava/lang/Object;
move-result-object p3
const-string v0, "Queue: %s"
invoke-virtual {p2, v0, p3}, Lcom/singular/sdk/internal/SingularLog;->debug(Ljava/lang/String;[Ljava/lang/Object;)I
if-nez p1, :cond_1
return-void
:cond_1
iput-object p1, p0, Lcom/singular/sdk/internal/ApiManager;->worker:Lcom/singular/sdk/internal/SingularWorkerThread;
.line 52
invoke-virtual {p1}, Ljava/lang/Thread;->start()V
return-void
.end method
.method public static synthetic access$000()Lcom/singular/sdk/internal/SingularLog;
.locals 1
sget-object v0, Lcom/singular/sdk/internal/ApiManager;->logger:Lcom/singular/sdk/internal/SingularLog;
return-object v0
.end method
.method public static synthetic access$100(Lcom/singular/sdk/internal/ApiManager;)Lcom/singular/sdk/internal/Queue;
.locals 0
.line 25
iget-object p0, p0, Lcom/singular/sdk/internal/ApiManager;->queue:Lcom/singular/sdk/internal/Queue;
return-object p0
.end method
# virtual methods
.method public enqueue(Lcom/singular/sdk/internal/BaseApi;)V
.locals 3
if-eqz p1, :cond_3
:try_start_0
iget-object v0, p0, Lcom/singular/sdk/internal/ApiManager;->queue:Lcom/singular/sdk/internal/Queue;
if-nez v0, :cond_0
goto :goto_2
.line 94
:cond_0
instance-of v0, p1, Lcom/singular/sdk/internal/ApiGDPRConsent;
if-nez v0, :cond_1
instance-of v0, p1, Lcom/singular/sdk/internal/ApiGDPRUnder13;
if-nez v0, :cond_1
const-string v0, "event_index"
iget-object v1, p0, Lcom/singular/sdk/internal/ApiManager;->context:Landroid/content/Context;
.line 95
invoke-static {v1}, Lcom/singular/sdk/internal/Utils;->getEventIndex(Landroid/content/Context;)J
move-result-wide v1
invoke-static {v1, v2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v1
invoke-virtual {p1, v0, v1}, Lcom/singular/sdk/internal/SingularMap;->put(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
goto :goto_0
:catch_0
move-exception p1
goto :goto_1
:cond_1
:goto_0
const-string v0, "singular_install_id"
iget-object v1, p0, Lcom/singular/sdk/internal/ApiManager;->context:Landroid/content/Context;
.line 98
invoke-static {v1}, Lcom/singular/sdk/internal/Utils;->getSingularId(Landroid/content/Context;)Ljava/util/UUID;
move-result-object v1
invoke-virtual {v1}, Ljava/util/UUID;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {p1, v0, v1}, Lcom/singular/sdk/internal/SingularMap;->put(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
.line 100
invoke-static {}, Lcom/singular/sdk/internal/SingularInstance;->getInstance()Lcom/singular/sdk/internal/SingularInstance;
move-result-object v0
invoke-virtual {v0}, Lcom/singular/sdk/internal/SingularInstance;->getGlobalPropertiesJSON()Lorg/json/JSONObject;
move-result-object v0
.line 101
invoke-virtual {v0}, Lorg/json/JSONObject;->length()I
move-result v1
if-eqz v1, :cond_2
const-string v1, "global_properties"
.line 102
invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {p1, v1, v0}, Lcom/singular/sdk/internal/SingularMap;->put(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
:cond_2
iget-object v0, p0, Lcom/singular/sdk/internal/ApiManager;->queue:Lcom/singular/sdk/internal/Queue;
.line 106
invoke-virtual {p1}, Lcom/singular/sdk/internal/BaseApi;->toJsonAsString()Ljava/lang/String;
move-result-object p1
invoke-interface {v0, p1}, Lcom/singular/sdk/internal/Queue;->add(Ljava/lang/String;)V
.line 108
invoke-virtual {p0}, Lcom/singular/sdk/internal/ApiManager;->wakeUp()V
:try_end_0
.catch Ljava/lang/IndexOutOfBoundsException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_2
:goto_1
sget-object v0, Lcom/singular/sdk/internal/ApiManager;->logger:Lcom/singular/sdk/internal/SingularLog;
const-string v1, "error in enqueue()"
.line 112
invoke-virtual {v0, v1, p1}, Lcom/singular/sdk/internal/SingularLog;->error(Ljava/lang/String;Ljava/lang/Throwable;)I
:catch_1
:cond_3
:goto_2
return-void
.end method
.method public tryMigrateEventsFromFileQueue()V
.locals 2
iget-object v0, p0, Lcom/singular/sdk/internal/ApiManager;->queue:Lcom/singular/sdk/internal/Queue;
.line 66
instance-of v0, v0, Lcom/singular/sdk/internal/SQLitePersistentQueue;
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/singular/sdk/internal/ApiManager;->worker:Lcom/singular/sdk/internal/SingularWorkerThread;
iget-object v1, p0, Lcom/singular/sdk/internal/ApiManager;->migrateEventsFromFileQueue:Ljava/lang/Runnable;
.line 67
invoke-virtual {v0, v1}, Lcom/singular/sdk/internal/SingularWorkerThread;->post(Ljava/lang/Runnable;)V
:cond_0
return-void
.end method
.method public tryMigrateEventsFromOldSQLiteQueue()V
.locals 2
iget-object v0, p0, Lcom/singular/sdk/internal/ApiManager;->worker:Lcom/singular/sdk/internal/SingularWorkerThread;
.line 72
new-instance v1, Lcom/singular/sdk/internal/ApiManager$1;
invoke-direct {v1, p0}, Lcom/singular/sdk/internal/ApiManager$1;-><init>(Lcom/singular/sdk/internal/ApiManager;)V
invoke-virtual {v0, v1}, Lcom/singular/sdk/internal/SingularWorkerThread;->post(Ljava/lang/Runnable;)V
return-void
.end method
.method public wakeUp()V
.locals 2
iget-object v0, p0, Lcom/singular/sdk/internal/ApiManager;->worker:Lcom/singular/sdk/internal/SingularWorkerThread;
if-nez v0, :cond_0
return-void
.line 60
:cond_0
invoke-virtual {v0}, Lcom/singular/sdk/internal/SingularWorkerThread;->getHandler()Landroid/os/Handler;
move-result-object v0
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacksAndMessages(Ljava/lang/Object;)V
iget-object v0, p0, Lcom/singular/sdk/internal/ApiManager;->worker:Lcom/singular/sdk/internal/SingularWorkerThread;
iget-object v1, p0, Lcom/singular/sdk/internal/ApiManager;->runnable:Ljava/lang/Runnable;
.line 61
invoke-virtual {v0, v1}, Lcom/singular/sdk/internal/SingularWorkerThread;->post(Ljava/lang/Runnable;)V
return-void
.end method