- 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
401 lines
10 KiB
Smali
401 lines
10 KiB
Smali
.class public Lcom/firemonkeys/cloudcellapi/HttpRequest;
|
|
.super Ljava/lang/Object;
|
|
.source "SourceFile"
|
|
|
|
|
|
# static fields
|
|
.field private static final CLASSNAME:Ljava/lang/String; = "HttpRequest"
|
|
|
|
.field private static s_sslContextInit:Z = false
|
|
|
|
.field public static s_userAgent:Ljava/lang/String;
|
|
|
|
|
|
# instance fields
|
|
.field private m_TimeoutMilliseconds:I
|
|
|
|
.field private m_bSSLCheck:Z
|
|
|
|
.field private m_serverTime:D
|
|
|
|
.field m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 2
|
|
|
|
.line 53
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
iput-wide v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_serverTime:D
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_bSSLCheck:Z
|
|
|
|
const v0, 0xea60
|
|
|
|
iput v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_TimeoutMilliseconds:I
|
|
|
|
const-string v0, "http.keepAlive"
|
|
|
|
const-string v1, "false"
|
|
|
|
.line 56
|
|
invoke-static {v0, v1}, Ljava/lang/System;->setProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private initSSLContext()V
|
|
.locals 4
|
|
|
|
:try_start_0
|
|
const-string v0, "TLS"
|
|
|
|
.line 158
|
|
invoke-static {v0}, Ljavax/net/ssl/SSLContext;->getInstance(Ljava/lang/String;)Ljavax/net/ssl/SSLContext;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
new-array v1, v1, [Ljavax/net/ssl/TrustManager;
|
|
|
|
.line 159
|
|
new-instance v2, Lcom/firemonkeys/cloudcellapi/CloudcellTrustManager;
|
|
|
|
invoke-direct {v2, p0}, Lcom/firemonkeys/cloudcellapi/CloudcellTrustManager;-><init>(Lcom/firemonkeys/cloudcellapi/HttpRequest;)V
|
|
|
|
const/4 v3, 0x0
|
|
|
|
aput-object v2, v1, v3
|
|
|
|
new-instance v2, Ljava/security/SecureRandom;
|
|
|
|
invoke-direct {v2}, Ljava/security/SecureRandom;-><init>()V
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-virtual {v0, v3, v1, v2}, Ljavax/net/ssl/SSLContext;->init([Ljavax/net/ssl/KeyManager;[Ljavax/net/ssl/TrustManager;Ljava/security/SecureRandom;)V
|
|
|
|
.line 162
|
|
new-instance v1, Lcom/firemonkeys/cloudcellapi/TLSSocketFactory;
|
|
|
|
invoke-virtual {v0}, Ljavax/net/ssl/SSLContext;->getSocketFactory()Ljavax/net/ssl/SSLSocketFactory;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v1, v0}, Lcom/firemonkeys/cloudcellapi/TLSSocketFactory;-><init>(Ljavax/net/ssl/SSLSocketFactory;)V
|
|
|
|
invoke-static {v1}, Ljavax/net/ssl/HttpsURLConnection;->setDefaultSSLSocketFactory(Ljavax/net/ssl/SSLSocketFactory;)V
|
|
|
|
.line 163
|
|
sget-object v0, Lorg/apache/http/conn/ssl/SSLSocketFactory;->ALLOW_ALL_HOSTNAME_VERIFIER:Lorg/apache/http/conn/ssl/X509HostnameVerifier;
|
|
|
|
invoke-static {v0}, Ljavax/net/ssl/HttpsURLConnection;->setDefaultHostnameVerifier(Ljavax/net/ssl/HostnameVerifier;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
const-string v0, "HttpRequest"
|
|
|
|
const-string v1, "Exception when trying to init SSLContext!"
|
|
|
|
.line 167
|
|
invoke-static {v0, v1}, Lcom/firemonkeys/cloudcellapi/Logging;->CC_ERROR(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private static initUserAgent(Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->s_userAgent:Ljava/lang/String;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 147
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p0, " "
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p0, "http.agent"
|
|
|
|
invoke-static {p0}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
sput-object p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->s_userAgent:Ljava/lang/String;
|
|
|
|
.line 148
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v0, "User Agent: "
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
sget-object v0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->s_userAgent:Ljava/lang/String;
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "HttpRequest"
|
|
|
|
invoke-static {v0, p0}, Lcom/firemonkeys/cloudcellapi/Logging;->CC_INFO(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public addHeader(Ljava/lang/String;Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
.line 104
|
|
invoke-virtual {v0, p1, p2}, Lcom/firemonkeys/cloudcellapi/HttpThread;->addHeader(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public close()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 128
|
|
invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public native completeCallback(JI)V
|
|
.end method
|
|
|
|
.method public native dataCallback(J[BI)V
|
|
.end method
|
|
|
|
.method public native errorCallback(JI)V
|
|
.end method
|
|
|
|
.method public getSSLCheck()Z
|
|
.locals 1
|
|
|
|
iget-boolean v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_bSSLCheck:Z
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getServerTime()D
|
|
.locals 2
|
|
|
|
iget-wide v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_serverTime:D
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public getTimeoutMilliseconds()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_TimeoutMilliseconds:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public native headerCallback(JILjava/util/Map;)V
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(JI",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/String;",
|
|
">;>;)V"
|
|
}
|
|
.end annotation
|
|
.end method
|
|
|
|
.method public init(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BIJZDZZI)V
|
|
.locals 12
|
|
|
|
move-object v10, p0
|
|
|
|
move-wide/from16 v0, p9
|
|
|
|
move/from16 v2, p13
|
|
|
|
iput-wide v0, v10, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_serverTime:D
|
|
|
|
move/from16 v0, p11
|
|
|
|
iput-boolean v0, v10, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_bSSLCheck:Z
|
|
|
|
if-lez v2, :cond_0
|
|
|
|
mul-int/lit16 v0, v2, 0x3e8
|
|
|
|
iput v0, v10, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_TimeoutMilliseconds:I
|
|
|
|
.line 68
|
|
:cond_0
|
|
invoke-direct {p0}, Lcom/firemonkeys/cloudcellapi/HttpRequest;->initSSLContext()V
|
|
|
|
.line 69
|
|
invoke-static {p1}, Lcom/firemonkeys/cloudcellapi/HttpRequest;->initUserAgent(Ljava/lang/String;)V
|
|
|
|
.line 71
|
|
new-instance v11, Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
move-object v0, v11
|
|
|
|
move-object v1, p0
|
|
|
|
move-object v2, p2
|
|
|
|
move-object v3, p3
|
|
|
|
move-object/from16 v4, p4
|
|
|
|
move/from16 v5, p5
|
|
|
|
move-wide/from16 v6, p6
|
|
|
|
move/from16 v8, p8
|
|
|
|
move/from16 v9, p12
|
|
|
|
invoke-direct/range {v0 .. v9}, Lcom/firemonkeys/cloudcellapi/HttpThread;-><init>(Lcom/firemonkeys/cloudcellapi/HttpRequest;Ljava/lang/String;Ljava/lang/String;[BIJZZ)V
|
|
|
|
iput-object v11, v10, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public isClosed()Z
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public post()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
const-string v1, "HttpRequest"
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const-string v0, "post() called but thread is already closed"
|
|
|
|
.line 111
|
|
invoke-static {v1, v0}, Lcom/firemonkeys/cloudcellapi/Logging;->CC_ERROR(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 115
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/lang/Thread;->isAlive()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
const-string v0, "post() called but thread is already running"
|
|
|
|
.line 117
|
|
invoke-static {v1, v0}, Lcom/firemonkeys/cloudcellapi/Logging;->CC_ERROR(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
iget-object v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
.line 121
|
|
invoke-virtual {v0}, Ljava/lang/Thread;->start()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setClosedBySSLCheck(Z)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
.line 91
|
|
invoke-virtual {v0, p1}, Lcom/firemonkeys/cloudcellapi/HttpThread;->setClosedBySSLCheck(Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public shutdown()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/firemonkeys/cloudcellapi/HttpRequest;->m_thread:Lcom/firemonkeys/cloudcellapi/HttpThread;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 98
|
|
invoke-virtual {v0}, Lcom/firemonkeys/cloudcellapi/HttpThread;->shutdown()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|