Files
rr3-apk/smali_classes2/com/ea/nimble/ByteBufferIOStream$ByteBufferInputStream.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

490 lines
12 KiB
Smali

.class public Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;
.super Ljava/io/InputStream;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/ea/nimble/ByteBufferIOStream;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = "ByteBufferInputStream"
.end annotation
# instance fields
.field final synthetic this$0:Lcom/ea/nimble/ByteBufferIOStream;
# direct methods
.method public constructor <init>(Lcom/ea/nimble/ByteBufferIOStream;)V
.locals 0
iput-object p1, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 141
invoke-direct {p0}, Ljava/io/InputStream;-><init>()V
return-void
.end method
# virtual methods
.method public available()I
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
iget-object v0, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 146
iget-boolean v1, v0, Lcom/ea/nimble/ByteBufferIOStream;->m_closed:Z
if-nez v1, :cond_0
.line 150
iget v1, v0, Lcom/ea/nimble/ByteBufferIOStream;->m_availableSegment:I
mul-int/lit16 v1, v1, 0x1000
iget v2, v0, Lcom/ea/nimble/ByteBufferIOStream;->m_writePosition:I
add-int/2addr v1, v2
iget v0, v0, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
sub-int/2addr v1, v0
return v1
.line 148
:cond_0
new-instance v0, Ljava/io/IOException;
const-string v1, "ByteBufferIOStream is closed"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public close()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
iget-object v0, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 157
invoke-virtual {v0}, Lcom/ea/nimble/ByteBufferIOStream;->closeIOStream()V
return-void
.end method
.method public markSupported()Z
.locals 1
const/4 v0, 0x0
return v0
.end method
.method public read()I
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 175
invoke-virtual {p0}, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->available()I
move-result v0
if-lez v0, :cond_1
iget-object v0, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 181
iget-object v0, v0, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->getFirst()Ljava/lang/Object;
move-result-object v0
check-cast v0, [B
iget-object v1, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
iget v2, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
aget-byte v0, v0, v2
add-int/lit8 v2, v2, 0x1
.line 182
iput v2, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
const/16 v3, 0x1000
if-lt v2, v3, :cond_0
.line 185
iget-object v1, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v1}, Ljava/util/LinkedList;->poll()Ljava/lang/Object;
move-result-object v2
check-cast v2, [B
invoke-virtual {v1, v2}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
iget-object v1, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
const/4 v2, 0x0
.line 186
iput v2, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
.line 187
iget v2, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_availableSegment:I
add-int/lit8 v2, v2, -0x1
iput v2, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_availableSegment:I
:cond_0
return v0
.line 178
:cond_1
new-instance v0, Ljava/io/IOException;
const-string v1, "Nothing to read in ByteBufferIOStream"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public read([B)I
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 169
array-length v0, p1
const/4 v1, 0x0
invoke-virtual {p0, p1, v1, v0}, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->read([BII)I
move-result p1
return p1
.end method
.method public read([BII)I
.locals 7
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
if-ltz p2, :cond_4
if-ltz p3, :cond_4
add-int v0, p2, p3
.line 195
array-length v1, p1
if-gt v0, v1, :cond_4
.line 199
invoke-virtual {p0}, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->available()I
move-result v0
if-gtz v0, :cond_0
const/4 p1, -0x1
return p1
:cond_0
if-le p3, v0, :cond_1
move p3, v0
:cond_1
iget-object v0, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 210
iget v1, v0, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
const/16 v2, 0x1000
rsub-int v1, v1, 0x1000
if-ge p3, v1, :cond_2
.line 214
iget-object v0, v0, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->getFirst()Ljava/lang/Object;
move-result-object v0
iget-object v1, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
iget v1, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
invoke-static {v0, v1, p1, p2, p3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object p1, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 215
iget p2, p1, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
add-int/2addr p2, p3
iput p2, p1, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
goto :goto_1
.line 220
:cond_2
iget-object v0, v0, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->getFirst()Ljava/lang/Object;
move-result-object v0
iget-object v3, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
iget v3, v3, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
invoke-static {v0, v3, p1, p2, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object v0, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 221
iget-object v0, v0, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->poll()Ljava/lang/Object;
move-result-object v3
check-cast v3, [B
invoke-virtual {v0, v3}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
sub-int v0, p3, v1
add-int/2addr p2, v1
.line 224
div-int/lit16 v1, v0, 0x1000
const/4 v3, 0x0
move v4, v3
:goto_0
if-ge v4, v1, :cond_3
iget-object v5, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 227
iget-object v5, v5, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v5}, Ljava/util/LinkedList;->getFirst()Ljava/lang/Object;
move-result-object v5
invoke-static {v5, v3, p1, p2, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object v5, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 228
iget-object v5, v5, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v5}, Ljava/util/LinkedList;->poll()Ljava/lang/Object;
move-result-object v6
check-cast v6, [B
invoke-virtual {v5, v6}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
add-int/lit16 v0, v0, -0x1000
add-int/lit16 p2, p2, 0x1000
add-int/lit8 v4, v4, 0x1
goto :goto_0
:cond_3
iget-object v2, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 232
iget-object v2, v2, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v2}, Ljava/util/LinkedList;->getFirst()Ljava/lang/Object;
move-result-object v2
invoke-static {v2, v3, p1, p2, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object p1, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 233
iput v0, p1, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
.line 234
iget p2, p1, Lcom/ea/nimble/ByteBufferIOStream;->m_availableSegment:I
add-int/lit8 v1, v1, 0x1
sub-int/2addr p2, v1
iput p2, p1, Lcom/ea/nimble/ByteBufferIOStream;->m_availableSegment:I
:goto_1
return p3
.line 197
:cond_4
new-instance p1, Ljava/lang/IndexOutOfBoundsException;
const-string p2, "The reading range of out of buffer boundary."
invoke-direct {p1, p2}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public skip(J)J
.locals 5
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 244
invoke-virtual {p0}, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->available()I
move-result v0
if-gtz v0, :cond_0
const-wide/16 p1, 0x0
return-wide p1
:cond_0
int-to-long v0, v0
cmp-long v2, p1, v0
if-lez v2, :cond_1
move-wide p1, v0
:cond_1
long-to-int v0, p1
iget-object v1, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 255
iget v2, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
rsub-int v3, v2, 0x1000
if-ge v0, v3, :cond_2
add-int/2addr v2, v0
.line 259
iput v2, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
goto :goto_1
.line 264
:cond_2
iget-object v1, v1, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v1}, Ljava/util/LinkedList;->poll()Ljava/lang/Object;
move-result-object v2
check-cast v2, [B
invoke-virtual {v1, v2}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
sub-int/2addr v0, v3
.line 266
div-int/lit16 v1, v0, 0x1000
const/4 v2, 0x0
:goto_0
if-ge v2, v1, :cond_3
iget-object v3, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 269
iget-object v3, v3, Lcom/ea/nimble/ByteBufferIOStream;->m_buffer:Ljava/util/LinkedList;
invoke-virtual {v3}, Ljava/util/LinkedList;->poll()Ljava/lang/Object;
move-result-object v4
check-cast v4, [B
invoke-virtual {v3, v4}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
add-int/lit16 v0, v0, -0x1000
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_3
iget-object v2, p0, Lcom/ea/nimble/ByteBufferIOStream$ByteBufferInputStream;->this$0:Lcom/ea/nimble/ByteBufferIOStream;
.line 272
iput v0, v2, Lcom/ea/nimble/ByteBufferIOStream;->m_readPosition:I
.line 273
iget v0, v2, Lcom/ea/nimble/ByteBufferIOStream;->m_availableSegment:I
add-int/lit8 v1, v1, 0x1
sub-int/2addr v0, v1
iput v0, v2, Lcom/ea/nimble/ByteBufferIOStream;->m_availableSegment:I
:goto_1
return-wide p1
.end method