Rabbit-R1/android (non root)/smali/smali_classes2/androidx/emoji2/text/flatbuffer/Utf8$DecodeUtil.smali
2024-05-21 17:08:36 -04:00

370 lines
6.5 KiB
Smali

.class Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;
.super Ljava/lang/Object;
.source "Utf8.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/emoji2/text/flatbuffer/Utf8;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x8
name = "DecodeUtil"
.end annotation
# direct methods
.method constructor <init>()V
.locals 0
.line 81
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method static handleFourBytes(BBBB[CI)V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/IllegalArgumentException;
}
.end annotation
.line 140
invoke-static {p1}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->isNotTrailingByte(B)Z
move-result v0
if-nez v0, :cond_0
shl-int/lit8 v0, p0, 0x1c
add-int/lit8 v1, p1, 0x70
add-int/2addr v0, v1
shr-int/lit8 v0, v0, 0x1e
if-nez v0, :cond_0
.line 149
invoke-static {p2}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->isNotTrailingByte(B)Z
move-result v0
if-nez v0, :cond_0
.line 150
invoke-static {p3}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->isNotTrailingByte(B)Z
move-result v0
if-nez v0, :cond_0
and-int/lit8 p0, p0, 0x7
shl-int/lit8 p0, p0, 0x12
.line 154
invoke-static {p1}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->trailingByteValue(B)I
move-result p1
shl-int/lit8 p1, p1, 0xc
or-int/2addr p0, p1
.line 155
invoke-static {p2}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->trailingByteValue(B)I
move-result p1
shl-int/lit8 p1, p1, 0x6
or-int/2addr p0, p1
.line 156
invoke-static {p3}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->trailingByteValue(B)I
move-result p1
or-int/2addr p0, p1
.line 157
invoke-static {p0}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->highSurrogate(I)C
move-result p1
aput-char p1, p4, p5
add-int/lit8 p5, p5, 0x1
.line 158
invoke-static {p0}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->lowSurrogate(I)C
move-result p0
aput-char p0, p4, p5
return-void
.line 151
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "Invalid UTF-8"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method static handleOneByte(B[CI)V
.locals 0
int-to-char p0, p0
.line 105
aput-char p0, p1, p2
return-void
.end method
.method static handleThreeBytes(BBB[CI)V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/IllegalArgumentException;
}
.end annotation
.line 125
invoke-static {p1}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->isNotTrailingByte(B)Z
move-result v0
if-nez v0, :cond_2
const/16 v0, -0x20
const/16 v1, -0x60
if-ne p0, v0, :cond_0
if-lt p1, v1, :cond_2
:cond_0
const/16 v0, -0x13
if-ne p0, v0, :cond_1
if-ge p1, v1, :cond_2
.line 130
:cond_1
invoke-static {p2}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->isNotTrailingByte(B)Z
move-result v0
if-nez v0, :cond_2
and-int/lit8 p0, p0, 0xf
shl-int/lit8 p0, p0, 0xc
.line 134
invoke-static {p1}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->trailingByteValue(B)I
move-result p1
shl-int/lit8 p1, p1, 0x6
or-int/2addr p0, p1
invoke-static {p2}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->trailingByteValue(B)I
move-result p1
or-int/2addr p0, p1
int-to-char p0, p0
aput-char p0, p3, p4
return-void
.line 131
:cond_2
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "Invalid UTF-8"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method static handleTwoBytes(BB[CI)V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/IllegalArgumentException;
}
.end annotation
const/16 v0, -0x3e
if-lt p0, v0, :cond_1
.line 116
invoke-static {p1}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->isNotTrailingByte(B)Z
move-result v0
if-nez v0, :cond_0
and-int/lit8 p0, p0, 0x1f
shl-int/lit8 p0, p0, 0x6
.line 119
invoke-static {p1}, Landroidx/emoji2/text/flatbuffer/Utf8$DecodeUtil;->trailingByteValue(B)I
move-result p1
or-int/2addr p0, p1
int-to-char p0, p0
aput-char p0, p2, p3
return-void
.line 117
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "Invalid UTF-8: Illegal trailing byte in 2 bytes utf"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.line 114
:cond_1
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "Invalid UTF-8: Illegal leading byte in 2 bytes utf"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method private static highSurrogate(I)C
.locals 1
ushr-int/lit8 p0, p0, 0xa
const v0, 0xd7c0
add-int/2addr p0, v0
int-to-char p0, p0
return p0
.end method
.method private static isNotTrailingByte(B)Z
.locals 1
const/16 v0, -0x41
if-le p0, v0, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
.method static isOneByte(B)Z
.locals 0
if-ltz p0, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
.method static isThreeBytes(B)Z
.locals 1
const/16 v0, -0x10
if-ge p0, v0, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
.method static isTwoBytes(B)Z
.locals 1
const/16 v0, -0x20
if-ge p0, v0, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
.method private static lowSurrogate(I)C
.locals 1
and-int/lit16 p0, p0, 0x3ff
const v0, 0xdc00
add-int/2addr p0, v0
int-to-char p0, p0
return p0
.end method
.method private static trailingByteValue(B)I
.locals 0
and-int/lit8 p0, p0, 0x3f
return p0
.end method