- 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
646 lines
15 KiB
Smali
646 lines
15 KiB
Smali
.class public final Lokhttp3/internal/connection/RealConnectionPool;
|
|
.super Ljava/lang/Object;
|
|
.source "SourceFile"
|
|
|
|
|
|
# static fields
|
|
.field public static final executor:Ljava/util/concurrent/Executor;
|
|
|
|
|
|
# instance fields
|
|
.field public final cleanupRunnable:Ljava/lang/Runnable;
|
|
|
|
.field public cleanupRunning:Z
|
|
|
|
.field public final connections:Ljava/util/Deque;
|
|
|
|
.field public final keepAliveDurationNs:J
|
|
|
|
.field public final maxIdleConnections:I
|
|
|
|
.field public final routeDatabase:Lokhttp3/internal/connection/RouteDatabase;
|
|
|
|
|
|
# direct methods
|
|
.method public static synthetic $r8$lambda$IlX_zHTDM1o4DMNAF0yuZyL86PI(Lokhttp3/internal/connection/RealConnectionPool;)V
|
|
.locals 0
|
|
|
|
.line 0
|
|
invoke-virtual {p0}, Lokhttp3/internal/connection/RealConnectionPool;->lambda$new$0()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static constructor <clinit>()V
|
|
.locals 9
|
|
|
|
.line 46
|
|
new-instance v8, Ljava/util/concurrent/ThreadPoolExecutor;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const v2, 0x7fffffff
|
|
|
|
const-wide/16 v3, 0x3c
|
|
|
|
sget-object v5, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
new-instance v6, Ljava/util/concurrent/SynchronousQueue;
|
|
|
|
invoke-direct {v6}, Ljava/util/concurrent/SynchronousQueue;-><init>()V
|
|
|
|
const-string v0, "OkHttp ConnectionPool"
|
|
|
|
const/4 v7, 0x1
|
|
|
|
.line 48
|
|
invoke-static {v0, v7}, Lokhttp3/internal/Util;->threadFactory(Ljava/lang/String;Z)Ljava/util/concurrent/ThreadFactory;
|
|
|
|
move-result-object v7
|
|
|
|
move-object v0, v8
|
|
|
|
invoke-direct/range {v0 .. v7}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
|
|
|
|
sput-object v8, Lokhttp3/internal/connection/RealConnectionPool;->executor:Ljava/util/concurrent/Executor;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(IJLjava/util/concurrent/TimeUnit;)V
|
|
.locals 2
|
|
|
|
.line 74
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 53
|
|
new-instance v0, Lokhttp3/internal/connection/RealConnectionPool$$ExternalSyntheticLambda0;
|
|
|
|
invoke-direct {v0, p0}, Lokhttp3/internal/connection/RealConnectionPool$$ExternalSyntheticLambda0;-><init>(Lokhttp3/internal/connection/RealConnectionPool;)V
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->cleanupRunnable:Ljava/lang/Runnable;
|
|
|
|
.line 70
|
|
new-instance v0, Ljava/util/ArrayDeque;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->connections:Ljava/util/Deque;
|
|
|
|
.line 71
|
|
new-instance v0, Lokhttp3/internal/connection/RouteDatabase;
|
|
|
|
invoke-direct {v0}, Lokhttp3/internal/connection/RouteDatabase;-><init>()V
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->routeDatabase:Lokhttp3/internal/connection/RouteDatabase;
|
|
|
|
iput p1, p0, Lokhttp3/internal/connection/RealConnectionPool;->maxIdleConnections:I
|
|
|
|
.line 76
|
|
invoke-virtual {p4, p2, p3}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
|
|
|
|
move-result-wide v0
|
|
|
|
iput-wide v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->keepAliveDurationNs:J
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
cmp-long p1, p2, v0
|
|
|
|
if-lez p1, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 80
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance p4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v0, "keepAliveDuration <= 0: "
|
|
|
|
invoke-virtual {p4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p4, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public cleanup(J)J
|
|
.locals 11
|
|
|
|
.line 172
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->connections:Ljava/util/Deque;
|
|
|
|
.line 173
|
|
invoke-interface {v0}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const-wide/high16 v3, -0x8000000000000000L
|
|
|
|
move v5, v1
|
|
|
|
move v6, v5
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_2
|
|
|
|
.line 174
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v7
|
|
|
|
check-cast v7, Lokhttp3/internal/connection/RealConnection;
|
|
|
|
.line 177
|
|
invoke-virtual {p0, v7, p1, p2}, Lokhttp3/internal/connection/RealConnectionPool;->pruneAndGetAllocationCount(Lokhttp3/internal/connection/RealConnection;J)I
|
|
|
|
move-result v8
|
|
|
|
if-lez v8, :cond_1
|
|
|
|
add-int/lit8 v6, v6, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
add-int/lit8 v5, v5, 0x1
|
|
|
|
.line 185
|
|
iget-wide v8, v7, Lokhttp3/internal/connection/RealConnection;->idleAtNanos:J
|
|
|
|
sub-long v8, p1, v8
|
|
|
|
cmp-long v10, v8, v3
|
|
|
|
if-lez v10, :cond_0
|
|
|
|
move-object v2, v7
|
|
|
|
move-wide v3, v8
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
iget-wide p1, p0, Lokhttp3/internal/connection/RealConnectionPool;->keepAliveDurationNs:J
|
|
|
|
cmp-long v0, v3, p1
|
|
|
|
if-gez v0, :cond_6
|
|
|
|
iget v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->maxIdleConnections:I
|
|
|
|
if-le v5, v0, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
if-lez v5, :cond_4
|
|
|
|
sub-long/2addr p1, v3
|
|
|
|
.line 199
|
|
monitor-exit p0
|
|
|
|
return-wide p1
|
|
|
|
:cond_4
|
|
if-lez v6, :cond_5
|
|
|
|
.line 202
|
|
monitor-exit p0
|
|
|
|
return-wide p1
|
|
|
|
:cond_5
|
|
iput-boolean v1, p0, Lokhttp3/internal/connection/RealConnectionPool;->cleanupRunning:Z
|
|
|
|
.line 206
|
|
monitor-exit p0
|
|
|
|
const-wide/16 p1, -0x1
|
|
|
|
return-wide p1
|
|
|
|
:cond_6
|
|
:goto_1
|
|
iget-object p1, p0, Lokhttp3/internal/connection/RealConnectionPool;->connections:Ljava/util/Deque;
|
|
|
|
.line 196
|
|
invoke-interface {p1, v2}, Ljava/util/Deque;->remove(Ljava/lang/Object;)Z
|
|
|
|
.line 208
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 210
|
|
invoke-virtual {v2}, Lokhttp3/internal/connection/RealConnection;->socket()Ljava/net/Socket;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V
|
|
|
|
const-wide/16 p1, 0x0
|
|
|
|
return-wide p1
|
|
|
|
.line 208
|
|
:goto_2
|
|
:try_start_1
|
|
monitor-exit p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public connectFailed(Lokhttp3/Route;Ljava/io/IOException;)V
|
|
.locals 3
|
|
|
|
.line 254
|
|
invoke-virtual {p1}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Ljava/net/Proxy$Type;->DIRECT:Ljava/net/Proxy$Type;
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
.line 255
|
|
invoke-virtual {p1}, Lokhttp3/Route;->address()Lokhttp3/Address;
|
|
|
|
move-result-object v0
|
|
|
|
.line 256
|
|
invoke-virtual {v0}, Lokhttp3/Address;->proxySelector()Ljava/net/ProxySelector;
|
|
|
|
move-result-object v1
|
|
|
|
.line 257
|
|
invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lokhttp3/HttpUrl;->uri()Ljava/net/URI;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Ljava/net/Proxy;->address()Ljava/net/SocketAddress;
|
|
|
|
move-result-object v2
|
|
|
|
.line 256
|
|
invoke-virtual {v1, v0, v2, p2}, Ljava/net/ProxySelector;->connectFailed(Ljava/net/URI;Ljava/net/SocketAddress;Ljava/io/IOException;)V
|
|
|
|
:cond_0
|
|
iget-object p2, p0, Lokhttp3/internal/connection/RealConnectionPool;->routeDatabase:Lokhttp3/internal/connection/RouteDatabase;
|
|
|
|
.line 260
|
|
invoke-virtual {p2, p1}, Lokhttp3/internal/connection/RouteDatabase;->failed(Lokhttp3/Route;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public connectionBecameIdle(Lokhttp3/internal/connection/RealConnection;)Z
|
|
.locals 1
|
|
|
|
.line 131
|
|
iget-boolean v0, p1, Lokhttp3/internal/connection/RealConnection;->noNewExchanges:Z
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
iget v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->maxIdleConnections:I
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 135
|
|
:cond_0
|
|
invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
iget-object v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->connections:Ljava/util/Deque;
|
|
|
|
.line 132
|
|
invoke-interface {v0, p1}, Ljava/util/Deque;->remove(Ljava/lang/Object;)Z
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final synthetic lambda$new$0()V
|
|
.locals 6
|
|
|
|
.line 55
|
|
:cond_0
|
|
:goto_0
|
|
invoke-static {}, Ljava/lang/System;->nanoTime()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-virtual {p0, v0, v1}, Lokhttp3/internal/connection/RealConnectionPool;->cleanup(J)J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, -0x1
|
|
|
|
cmp-long v2, v0, v2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v2, v0, v2
|
|
|
|
if-lez v2, :cond_0
|
|
|
|
const-wide/32 v2, 0xf4240
|
|
|
|
.line 58
|
|
div-long v4, v0, v2
|
|
|
|
mul-long/2addr v2, v4
|
|
|
|
sub-long/2addr v0, v2
|
|
|
|
.line 60
|
|
monitor-enter p0
|
|
|
|
long-to-int v0, v0
|
|
|
|
.line 62
|
|
:try_start_0
|
|
invoke-virtual {p0, v4, v5, v0}, Ljava/lang/Object;->wait(JI)V
|
|
:try_end_0
|
|
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto :goto_2
|
|
|
|
.line 65
|
|
:catch_0
|
|
:goto_1
|
|
:try_start_1
|
|
monitor-exit p0
|
|
|
|
goto :goto_0
|
|
|
|
:goto_2
|
|
monitor-exit p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final pruneAndGetAllocationCount(Lokhttp3/internal/connection/RealConnection;J)I
|
|
.locals 6
|
|
|
|
.line 223
|
|
iget-object v0, p1, Lokhttp3/internal/connection/RealConnection;->transmitters:Ljava/util/List;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move v2, v1
|
|
|
|
.line 224
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v3
|
|
|
|
if-ge v2, v3, :cond_2
|
|
|
|
.line 225
|
|
invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/lang/ref/Reference;
|
|
|
|
.line 227
|
|
invoke-virtual {v3}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 233
|
|
:cond_1
|
|
check-cast v3, Lokhttp3/internal/connection/Transmitter$TransmitterReference;
|
|
|
|
.line 234
|
|
new-instance v4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v5, "A connection to "
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Lokhttp3/internal/connection/RealConnection;->route()Lokhttp3/Route;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v5}, Lokhttp3/Route;->address()Lokhttp3/Address;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v5}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v5, " was leaked. Did you forget to close a response body?"
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
.line 236
|
|
invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
|
|
|
|
move-result-object v5
|
|
|
|
iget-object v3, v3, Lokhttp3/internal/connection/Transmitter$TransmitterReference;->callStackTrace:Ljava/lang/Object;
|
|
|
|
invoke-virtual {v5, v4, v3}, Lokhttp3/internal/platform/Platform;->logCloseableLeak(Ljava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 238
|
|
invoke-interface {v0, v2}, Ljava/util/List;->remove(I)Ljava/lang/Object;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
.line 239
|
|
iput-boolean v3, p1, Lokhttp3/internal/connection/RealConnection;->noNewExchanges:Z
|
|
|
|
.line 242
|
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
iget-wide v2, p0, Lokhttp3/internal/connection/RealConnectionPool;->keepAliveDurationNs:J
|
|
|
|
sub-long/2addr p2, v2
|
|
|
|
.line 243
|
|
iput-wide p2, p1, Lokhttp3/internal/connection/RealConnection;->idleAtNanos:J
|
|
|
|
return v1
|
|
|
|
.line 248
|
|
:cond_2
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public put(Lokhttp3/internal/connection/RealConnection;)V
|
|
.locals 2
|
|
|
|
iget-boolean v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->cleanupRunning:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->cleanupRunning:Z
|
|
|
|
sget-object v0, Lokhttp3/internal/connection/RealConnectionPool;->executor:Ljava/util/concurrent/Executor;
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/connection/RealConnectionPool;->cleanupRunnable:Ljava/lang/Runnable;
|
|
|
|
.line 120
|
|
invoke-interface {v0, v1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->connections:Ljava/util/Deque;
|
|
|
|
.line 122
|
|
invoke-interface {v0, p1}, Ljava/util/Deque;->add(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public transmitterAcquirePooledConnection(Lokhttp3/Address;Lokhttp3/internal/connection/Transmitter;Ljava/util/List;Z)Z
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/connection/RealConnectionPool;->connections:Ljava/util/Deque;
|
|
|
|
.line 107
|
|
invoke-interface {v0}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lokhttp3/internal/connection/RealConnection;
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
.line 108
|
|
invoke-virtual {v1}, Lokhttp3/internal/connection/RealConnection;->isMultiplexed()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 109
|
|
:cond_0
|
|
invoke-virtual {v1, p1, p3}, Lokhttp3/internal/connection/RealConnection;->isEligible(Lokhttp3/Address;Ljava/util/List;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
.line 110
|
|
:cond_1
|
|
invoke-virtual {p2, v1}, Lokhttp3/internal/connection/Transmitter;->acquireConnectionNoEvents(Lokhttp3/internal/connection/RealConnection;)V
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_2
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|