Files
rr3-apk/smali_classes5/kotlinx/coroutines/channels/ConflatedBufferedChannel.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

576 lines
16 KiB
Smali

.class public Lkotlinx/coroutines/channels/ConflatedBufferedChannel;
.super Lkotlinx/coroutines/channels/BufferedChannel;
.source "SourceFile"
# instance fields
.field public final capacity:I
.field public final onBufferOverflow:Lkotlinx/coroutines/channels/BufferOverflow;
# direct methods
.method public constructor <init>(ILkotlinx/coroutines/channels/BufferOverflow;Lkotlin/jvm/functions/Function1;)V
.locals 0
.line 26
invoke-direct {p0, p1, p3}, Lkotlinx/coroutines/channels/BufferedChannel;-><init>(ILkotlin/jvm/functions/Function1;)V
iput p1, p0, Lkotlinx/coroutines/channels/ConflatedBufferedChannel;->capacity:I
iput-object p2, p0, Lkotlinx/coroutines/channels/ConflatedBufferedChannel;->onBufferOverflow:Lkotlinx/coroutines/channels/BufferOverflow;
.line 28
sget-object p3, Lkotlinx/coroutines/channels/BufferOverflow;->SUSPEND:Lkotlinx/coroutines/channels/BufferOverflow;
if-eq p2, p3, :cond_1
const/4 p2, 0x1
if-lt p1, p2, :cond_0
return-void
.line 32
:cond_0
new-instance p2, Ljava/lang/StringBuilder;
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
const-string p3, "Buffered channel capacity must be at least 1, but "
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string p1, " was specified"
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
.line 31
new-instance p2, Ljava/lang/IllegalArgumentException;
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p2
.line 29
:cond_1
new-instance p1, Ljava/lang/StringBuilder;
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
const-string p2, "This implementation does not support suspension for senders, use "
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-class p2, Lkotlinx/coroutines/channels/BufferedChannel;
invoke-static {p2}, Lkotlin/jvm/internal/Reflection;->getOrCreateKotlinClass(Ljava/lang/Class;)Lkotlin/reflect/KClass;
move-result-object p2
invoke-interface {p2}, Lkotlin/reflect/KClass;->getSimpleName()Ljava/lang/String;
move-result-object p2
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p2, " instead"
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
.line 28
new-instance p2, Ljava/lang/IllegalArgumentException;
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p2
.end method
.method public static synthetic send$suspendImpl(Lkotlinx/coroutines/channels/ConflatedBufferedChannel;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
.locals 2
const/4 p2, 0x1
.line 41
invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/ConflatedBufferedChannel;->trySendImpl-Mj0NB7M(Ljava/lang/Object;Z)Ljava/lang/Object;
move-result-object p2
.line 551
instance-of v0, p2, Lkotlinx/coroutines/channels/ChannelResult$Closed;
if-eqz v0, :cond_1
invoke-static {p2}, Lkotlinx/coroutines/channels/ChannelResult;->exceptionOrNull-impl(Ljava/lang/Object;)Ljava/lang/Throwable;
.line 42
iget-object p2, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1;
if-eqz p2, :cond_0
const/4 v0, 0x2
const/4 v1, 0x0
invoke-static {p2, p1, v1, v0, v1}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->callUndeliveredElementCatchingException$default(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlinx/coroutines/internal/UndeliveredElementException;ILjava/lang/Object;)Lkotlinx/coroutines/internal/UndeliveredElementException;
move-result-object p1
if-eqz p1, :cond_0
.line 43
invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable;
move-result-object p0
invoke-static {p1, p0}, Lkotlin/ExceptionsKt;->addSuppressed(Ljava/lang/Throwable;Ljava/lang/Throwable;)V
.line 44
throw p1
.line 46
:cond_0
invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable;
move-result-object p0
throw p0
.line 48
:cond_1
sget-object p0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
return-object p0
.end method
# virtual methods
.method public isConflatedDropOldest()Z
.locals 2
iget-object v0, p0, Lkotlinx/coroutines/channels/ConflatedBufferedChannel;->onBufferOverflow:Lkotlinx/coroutines/channels/BufferOverflow;
.line 37
sget-object v1, Lkotlinx/coroutines/channels/BufferOverflow;->DROP_OLDEST:Lkotlinx/coroutines/channels/BufferOverflow;
if-ne v0, v1, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
.method public send(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
.locals 0
invoke-static {p0, p1, p2}, Lkotlinx/coroutines/channels/ConflatedBufferedChannel;->send$suspendImpl(Lkotlinx/coroutines/channels/ConflatedBufferedChannel;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
move-result-object p1
return-object p1
.end method
.method public trySend-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object;
.locals 1
const/4 v0, 0x0
.line 57
invoke-virtual {p0, p1, v0}, Lkotlinx/coroutines/channels/ConflatedBufferedChannel;->trySendImpl-Mj0NB7M(Ljava/lang/Object;Z)Ljava/lang/Object;
move-result-object p1
return-object p1
.end method
.method public final trySendDropLatest-Mj0NB7M(Ljava/lang/Object;Z)Ljava/lang/Object;
.locals 2
.line 65
invoke-super {p0, p1}, Lkotlinx/coroutines/channels/BufferedChannel;->trySend-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
.line 67
invoke-static {v0}, Lkotlinx/coroutines/channels/ChannelResult;->isSuccess-impl(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_3
invoke-static {v0}, Lkotlinx/coroutines/channels/ChannelResult;->isClosed-impl(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
goto :goto_1
:cond_0
if-eqz p2, :cond_2
iget-object p2, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1;
if-eqz p2, :cond_2
const/4 v0, 0x2
const/4 v1, 0x0
.line 72
invoke-static {p2, p1, v1, v0, v1}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->callUndeliveredElementCatchingException$default(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlinx/coroutines/internal/UndeliveredElementException;ILjava/lang/Object;)Lkotlinx/coroutines/internal/UndeliveredElementException;
move-result-object p1
if-nez p1, :cond_1
goto :goto_0
.line 73
:cond_1
throw p1
.line 76
:cond_2
:goto_0
sget-object p1, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion;
sget-object p2, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
return-object p1
:cond_3
:goto_1
return-object v0
.end method
.method public final trySendDropOldest-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object;
.locals 16
move-object/from16 v8, p0
.line 85
sget-object v9, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol;
.line 244
invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getSendSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;
move-result-object v0
.line 273
invoke-virtual {v0, v8}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lkotlinx/coroutines/channels/ChannelSegment;
.line 274
:cond_0
:goto_0
invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getSendersAndCloseStatus$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
move-result-object v1
.line 277
invoke-virtual {v1, v8}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J
move-result-wide v1
const-wide v3, 0xfffffffffffffffL
and-long v10, v1, v3
.line 280
invoke-static {v8, v1, v2}, Lkotlinx/coroutines/channels/BufferedChannel;->access$isClosedForSend0(Lkotlinx/coroutines/channels/BufferedChannel;J)Z
move-result v12
.line 282
sget v13, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I
int-to-long v1, v13
div-long v1, v10, v1
int-to-long v3, v13
.line 283
rem-long v3, v10, v3
long-to-int v14, v3
.line 286
iget-wide v3, v0, Lkotlinx/coroutines/internal/Segment;->id:J
cmp-long v3, v3, v1
if-eqz v3, :cond_2
.line 288
invoke-static {v8, v1, v2, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->access$findSegmentSend(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment;
move-result-object v1
if-nez v1, :cond_1
if-eqz v12, :cond_0
.line 97
sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion;
invoke-virtual/range {p0 .. p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable;
move-result-object v1
invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->closed-JP2dKIU(Ljava/lang/Throwable;)Ljava/lang/Object;
move-result-object v0
return-object v0
:cond_1
move-object v15, v1
goto :goto_1
:cond_2
move-object v15, v0
:goto_1
move-object/from16 v0, p0
move-object v1, v15
move v2, v14
move-object/from16 v3, p1
move-wide v4, v10
move-object v6, v9
move v7, v12
.line 304
invoke-static/range {v0 .. v7}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellSend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I
move-result v0
if-eqz v0, :cond_c
const/4 v1, 0x1
if-eq v0, v1, :cond_b
const/4 v1, 0x2
if-eq v0, v1, :cond_7
const/4 v1, 0x3
if-eq v0, v1, :cond_6
const/4 v1, 0x4
if-eq v0, v1, :cond_4
const/4 v1, 0x5
if-eq v0, v1, :cond_3
goto :goto_2
.line 341
:cond_3
invoke-virtual {v15}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V
:goto_2
move-object v0, v15
goto :goto_0
.line 334
:cond_4
invoke-virtual/range {p0 .. p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J
move-result-wide v0
cmp-long v0, v10, v0
if-gez v0, :cond_5
invoke-virtual {v15}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V
.line 97
:cond_5
sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion;
invoke-virtual/range {p0 .. p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable;
move-result-object v1
invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->closed-JP2dKIU(Ljava/lang/Throwable;)Ljava/lang/Object;
move-result-object v0
return-object v0
.line 347
:cond_6
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "unexpected"
.line 269
invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
:cond_7
if-eqz v12, :cond_8
.line 323
invoke-virtual {v15}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V
.line 97
sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion;
invoke-virtual/range {p0 .. p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable;
move-result-object v1
invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->closed-JP2dKIU(Ljava/lang/Throwable;)Ljava/lang/Object;
move-result-object v0
return-object v0
.line 326
:cond_8
instance-of v0, v9, Lkotlinx/coroutines/Waiter;
if-eqz v0, :cond_9
check-cast v9, Lkotlinx/coroutines/Waiter;
goto :goto_3
:cond_9
const/4 v9, 0x0
:goto_3
if-eqz v9, :cond_a
invoke-static {v8, v9, v15, v14}, Lkotlinx/coroutines/channels/BufferedChannel;->access$prepareSenderForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V
.line 93
:cond_a
iget-wide v0, v15, Lkotlinx/coroutines/internal/Segment;->id:J
int-to-long v2, v13
mul-long/2addr v0, v2
int-to-long v2, v14
add-long/2addr v0, v2
invoke-virtual {v8, v0, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->dropFirstElementUntilTheSpecifiedCellIsInTheBuffer(J)V
.line 94
sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion;
sget-object v1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
return-object v0
.line 88
:cond_b
sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion;
sget-object v1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
return-object v0
.line 310
:cond_c
invoke-virtual {v15}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V
.line 88
sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion;
sget-object v1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
return-object v0
.end method
.method public final trySendImpl-Mj0NB7M(Ljava/lang/Object;Z)Ljava/lang/Object;
.locals 2
iget-object v0, p0, Lkotlinx/coroutines/channels/ConflatedBufferedChannel;->onBufferOverflow:Lkotlinx/coroutines/channels/BufferOverflow;
.line 60
sget-object v1, Lkotlinx/coroutines/channels/BufferOverflow;->DROP_LATEST:Lkotlinx/coroutines/channels/BufferOverflow;
if-ne v0, v1, :cond_0
invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/ConflatedBufferedChannel;->trySendDropLatest-Mj0NB7M(Ljava/lang/Object;Z)Ljava/lang/Object;
move-result-object p1
goto :goto_0
.line 61
:cond_0
invoke-virtual {p0, p1}, Lkotlinx/coroutines/channels/ConflatedBufferedChannel;->trySendDropOldest-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
:goto_0
return-object p1
.end method