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

408 lines
9.5 KiB
Smali

.class public Lcsdk/glucentralservices/devicetiers/DeviceUtil;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;
}
.end annotation
# static fields
.field private static sGlesData:Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;
.field private static sGlesDataEvaluated:Z
# direct methods
.method public constructor <init>()V
.locals 0
.line 24
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static addGpuData(Ljavax/microedition/khronos/egl/EGL10;Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;)V
.locals 1
.line 168
new-instance v0, Lcsdk/glucentralservices/devicetiers/DeviceUtil$1;
invoke-direct {v0, p0, p1, p2, p3}, Lcsdk/glucentralservices/devicetiers/DeviceUtil$1;-><init>(Ljavax/microedition/khronos/egl/EGL10;Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;)V
.line 214
invoke-virtual {v0}, Ljava/lang/Thread;->start()V
.line 216
:try_start_0
invoke-virtual {v0}, Ljava/lang/Thread;->join()V
:try_end_0
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
return-void
:catch_0
move-exception p0
.line 218
new-instance p1, Ljava/lang/RuntimeException;
invoke-direct {p1, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
throw p1
.end method
.method private static doGetGlesData()Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;
.locals 14
.line 111
invoke-static {}, Ljavax/microedition/khronos/egl/EGLContext;->getEGL()Ljavax/microedition/khronos/egl/EGL;
move-result-object v0
check-cast v0, Ljavax/microedition/khronos/egl/EGL10;
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_DEFAULT_DISPLAY:Ljava/lang/Object;
.line 112
invoke-interface {v0, v1}, Ljavax/microedition/khronos/egl/EGL10;->eglGetDisplay(Ljava/lang/Object;)Ljavax/microedition/khronos/egl/EGLDisplay;
move-result-object v1
const/4 v2, 0x1
new-array v3, v2, [I
const/4 v4, 0x0
.line 114
invoke-interface {v0, v1, v4}, Ljavax/microedition/khronos/egl/EGL10;->eglInitialize(Ljavax/microedition/khronos/egl/EGLDisplay;[I)Z
move-result v5
if-eqz v5, :cond_6
const/16 v5, 0x3055
.line 116
:try_start_0
invoke-interface {v0, v1, v5}, Ljavax/microedition/khronos/egl/EGL10;->eglQueryString(Ljavax/microedition/khronos/egl/EGLDisplay;I)Ljava/lang/String;
move-result-object v5
const-string v6, "EGL_KHR_create_context"
invoke-static {v5, v6}, Lcsdk/glucentralservices/devicetiers/DeviceUtil;->hasExtension(Ljava/lang/String;Ljava/lang/String;)Z
move-result v5
const/4 v6, 0x0
.line 118
invoke-interface {v0, v1, v4, v6, v3}, Ljavax/microedition/khronos/egl/EGL10;->eglGetConfigs(Ljavax/microedition/khronos/egl/EGLDisplay;[Ljavax/microedition/khronos/egl/EGLConfig;I[I)Z
move-result v7
if-eqz v7, :cond_5
aget v7, v3, v6
.line 119
new-array v8, v7, [Ljavax/microedition/khronos/egl/EGLConfig;
.line 120
invoke-interface {v0, v1, v8, v7, v3}, Ljavax/microedition/khronos/egl/EGL10;->eglGetConfigs(Ljavax/microedition/khronos/egl/EGLDisplay;[Ljavax/microedition/khronos/egl/EGLConfig;I[I)Z
move-result v7
if-eqz v7, :cond_4
new-array v7, v2, [I
move v9, v6
move v10, v9
:goto_0
aget v11, v3, v6
if-ge v9, v11, :cond_3
.line 125
aget-object v11, v8, v9
const/16 v12, 0x3040
invoke-interface {v0, v1, v11, v12, v7}, Ljavax/microedition/khronos/egl/EGL10;->eglGetConfigAttrib(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;I[I)Z
move-result v11
if-eqz v11, :cond_2
if-eqz v5, :cond_0
aget v11, v7, v6
const/16 v12, 0x40
and-int/2addr v11, v12
if-ne v11, v12, :cond_0
const/4 v11, 0x3
if-ge v10, v11, :cond_2
.line 131
aget-object v4, v8, v9
:goto_1
move v10, v11
goto :goto_2
:catchall_0
move-exception v2
goto :goto_3
:cond_0
aget v11, v7, v6
and-int/lit8 v12, v11, 0x4
const/4 v13, 0x4
if-ne v12, v13, :cond_1
const/4 v11, 0x2
if-ge v10, v11, :cond_2
.line 136
aget-object v4, v8, v9
goto :goto_1
:cond_1
and-int/lit8 v11, v11, 0x1
if-ne v11, v2, :cond_2
if-ge v10, v2, :cond_2
.line 141
aget-object v4, v8, v9
move v10, v2
:cond_2
:goto_2
add-int/lit8 v9, v9, 0x1
goto :goto_0
.line 147
:cond_3
new-instance v2, Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;
invoke-direct {v2}, Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;-><init>()V
iput v10, v2, Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;->highestEsVersion:I
.line 149
invoke-static {v0, v1, v4, v2}, Lcsdk/glucentralservices/devicetiers/DeviceUtil;->addGpuData(Ljavax/microedition/khronos/egl/EGL10;Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 158
invoke-interface {v0, v1}, Ljavax/microedition/khronos/egl/EGL10;->eglTerminate(Ljavax/microedition/khronos/egl/EGLDisplay;)Z
return-object v2
:cond_4
invoke-interface {v0, v1}, Ljavax/microedition/khronos/egl/EGL10;->eglTerminate(Ljavax/microedition/khronos/egl/EGLDisplay;)Z
return-object v4
:cond_5
invoke-interface {v0, v1}, Ljavax/microedition/khronos/egl/EGL10;->eglTerminate(Ljavax/microedition/khronos/egl/EGLDisplay;)Z
return-object v4
:goto_3
invoke-interface {v0, v1}, Ljavax/microedition/khronos/egl/EGL10;->eglTerminate(Ljavax/microedition/khronos/egl/EGLDisplay;)Z
.line 159
throw v2
:cond_6
return-object v4
.end method
.method public static getCpuCount()I
.locals 1
.line 38
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Runtime;->availableProcessors()I
move-result v0
return v0
.end method
.method public static getGlesData()Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;
.locals 3
const-class v0, Lcsdk/glucentralservices/devicetiers/DeviceUtil;
.line 90
monitor-enter v0
:try_start_0
sget-boolean v1, Lcsdk/glucentralservices/devicetiers/DeviceUtil;->sGlesDataEvaluated:Z
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-nez v1, :cond_0
const/4 v1, 0x1
.line 94
:try_start_1
invoke-static {}, Lcsdk/glucentralservices/devicetiers/DeviceUtil;->doGetGlesData()Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;
move-result-object v2
sput-object v2, Lcsdk/glucentralservices/devicetiers/DeviceUtil;->sGlesData:Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
:try_start_2
sput-boolean v1, Lcsdk/glucentralservices/devicetiers/DeviceUtil;->sGlesDataEvaluated:Z
goto :goto_0
:catchall_0
move-exception v1
goto :goto_1
:catchall_1
move-exception v2
sput-boolean v1, Lcsdk/glucentralservices/devicetiers/DeviceUtil;->sGlesDataEvaluated:Z
.line 97
throw v2
:cond_0
:goto_0
sget-object v1, Lcsdk/glucentralservices/devicetiers/DeviceUtil;->sGlesData:Lcsdk/glucentralservices/devicetiers/DeviceUtil$GlesData;
.line 99
monitor-exit v0
return-object v1
.line 100
:goto_1
monitor-exit v0
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
throw v1
.end method
.method public static getScreenSize(Landroid/content/Context;)Landroid/graphics/Point;
.locals 1
const-string v0, "window"
.line 72
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroid/view/WindowManager;
.line 73
invoke-interface {p0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object p0
.line 74
new-instance v0, Landroid/graphics/Point;
invoke-direct {v0}, Landroid/graphics/Point;-><init>()V
.line 77
invoke-virtual {p0, v0}, Landroid/view/Display;->getRealSize(Landroid/graphics/Point;)V
return-object v0
.end method
.method private static hasExtension(Ljava/lang/String;Ljava/lang/String;)Z
.locals 3
.line 229
invoke-virtual {p0, p1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v0
:goto_0
if-ltz v0, :cond_2
.line 232
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result v1
add-int/2addr v0, v1
.line 233
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v1
if-eq v0, v1, :cond_1
invoke-virtual {p0, v0}, Ljava/lang/String;->charAt(I)C
move-result v1
const/16 v2, 0x20
if-ne v1, v2, :cond_0
goto :goto_1
.line 236
:cond_0
invoke-virtual {p0, p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;I)I
move-result v0
goto :goto_0
:cond_1
:goto_1
const/4 p0, 0x1
return p0
:cond_2
const/4 p0, 0x0
return p0
.end method