1217 lines
23 KiB
Smali
1217 lines
23 KiB
Smali
.class public Lokio/ByteString;
|
|
.super Ljava/lang/Object;
|
|
.source "ByteString.java"
|
|
|
|
# interfaces
|
|
.implements Ljava/io/Serializable;
|
|
.implements Ljava/lang/Comparable;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/Object;",
|
|
"Ljava/io/Serializable;",
|
|
"Ljava/lang/Comparable<",
|
|
"Lokio/ByteString;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field static final bni:[C
|
|
|
|
.field public static final buW:Lokio/ByteString;
|
|
|
|
.field private static final serialVersionUID:J = 0x1L
|
|
|
|
|
|
# instance fields
|
|
.field transient buX:Ljava/lang/String;
|
|
|
|
.field transient cU:I
|
|
|
|
.field final data:[B
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const/16 v0, 0x10
|
|
|
|
new-array v0, v0, [C
|
|
|
|
fill-array-data v0, :array_0
|
|
|
|
sput-object v0, Lokio/ByteString;->bni:[C
|
|
|
|
const/4 v0, 0x0
|
|
|
|
new-array v0, v0, [B
|
|
|
|
invoke-static {v0}, Lokio/ByteString;->B([B)Lokio/ByteString;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lokio/ByteString;->buW:Lokio/ByteString;
|
|
|
|
return-void
|
|
|
|
nop
|
|
|
|
:array_0
|
|
.array-data 2
|
|
0x30s
|
|
0x31s
|
|
0x32s
|
|
0x33s
|
|
0x34s
|
|
0x35s
|
|
0x36s
|
|
0x37s
|
|
0x38s
|
|
0x39s
|
|
0x61s
|
|
0x62s
|
|
0x63s
|
|
0x64s
|
|
0x65s
|
|
0x66s
|
|
.end array-data
|
|
.end method
|
|
|
|
.method constructor <init>([B)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lokio/ByteString;->data:[B
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static varargs B([B)Lokio/ByteString;
|
|
.locals 1
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
new-instance v0, Lokio/ByteString;
|
|
|
|
invoke-virtual {p0}, [B->clone()Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, [B
|
|
|
|
invoke-direct {v0, p0}, Lokio/ByteString;-><init>([B)V
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "data == null"
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static decodeHexDigit(C)I
|
|
.locals 2
|
|
|
|
const/16 v0, 0x30
|
|
|
|
if-lt p0, v0, :cond_0
|
|
|
|
const/16 v1, 0x39
|
|
|
|
if-gt p0, v1, :cond_0
|
|
|
|
sub-int/2addr p0, v0
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
const/16 v0, 0x61
|
|
|
|
if-lt p0, v0, :cond_1
|
|
|
|
const/16 v1, 0x66
|
|
|
|
if-gt p0, v1, :cond_1
|
|
|
|
sub-int/2addr p0, v0
|
|
|
|
add-int/lit8 p0, p0, 0xa
|
|
|
|
return p0
|
|
|
|
:cond_1
|
|
const/16 v0, 0x41
|
|
|
|
if-lt p0, v0, :cond_2
|
|
|
|
const/16 v1, 0x46
|
|
|
|
if-gt p0, v1, :cond_2
|
|
|
|
sub-int/2addr p0, v0
|
|
|
|
add-int/lit8 p0, p0, 0xa
|
|
|
|
return p0
|
|
|
|
:cond_2
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-static {p0}, Ljava/lang/String;->valueOf(C)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v1, "Unexpected hex digit: "
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static ef(Ljava/lang/String;)Lokio/ByteString;
|
|
.locals 2
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
new-instance v0, Lokio/ByteString;
|
|
|
|
sget-object v1, Lokio/s;->UTF_8:Ljava/nio/charset/Charset;
|
|
|
|
invoke-virtual {p0, v1}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Lokio/ByteString;-><init>([B)V
|
|
|
|
iput-object p0, v0, Lokio/ByteString;->buX:Ljava/lang/String;
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "s == null"
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private eg(Ljava/lang/String;)Lokio/ByteString;
|
|
.locals 1
|
|
|
|
:try_start_0
|
|
invoke-static {p1}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
invoke-virtual {p1, v0}, Ljava/security/MessageDigest;->digest([B)[B
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Lokio/ByteString;->B([B)Lokio/ByteString;
|
|
|
|
move-result-object p1
|
|
:try_end_0
|
|
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
new-instance v0, Ljava/lang/AssertionError;
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static eh(Ljava/lang/String;)Lokio/ByteString;
|
|
.locals 4
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
rem-int/lit8 v0, v0, 0x2
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
div-int/lit8 v0, v0, 0x2
|
|
|
|
new-array v0, v0, [B
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
array-length v2, v0
|
|
|
|
if-ge v1, v2, :cond_0
|
|
|
|
mul-int/lit8 v2, v1, 0x2
|
|
|
|
invoke-virtual {p0, v2}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v3}, Lokio/ByteString;->decodeHexDigit(C)I
|
|
|
|
move-result v3
|
|
|
|
shl-int/lit8 v3, v3, 0x4
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
invoke-virtual {p0, v2}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v2
|
|
|
|
invoke-static {v2}, Lokio/ByteString;->decodeHexDigit(C)I
|
|
|
|
move-result v2
|
|
|
|
add-int/2addr v3, v2
|
|
|
|
int-to-byte v2, v3
|
|
|
|
aput-byte v2, v0, v1
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-static {v0}, Lokio/ByteString;->B([B)Lokio/ByteString;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_1
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v1, "Unexpected hex string: "
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private readObject(Ljava/io/ObjectInputStream;)V
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Ljava/io/ObjectInputStream;->readInt()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
if-ltz v0, :cond_2
|
|
|
|
new-array v1, v0, [B
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v0, :cond_1
|
|
|
|
sub-int v3, v0, v2
|
|
|
|
invoke-virtual {p1, v1, v2, v3}, Ljava/io/InputStream;->read([BII)I
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, -0x1
|
|
|
|
if-eq v3, v4, :cond_0
|
|
|
|
add-int/2addr v2, v3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/io/EOFException;
|
|
|
|
invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
new-instance p1, Lokio/ByteString;
|
|
|
|
invoke-direct {p1, v1}, Lokio/ByteString;-><init>([B)V
|
|
|
|
:try_start_0
|
|
const-class v0, Lokio/ByteString;
|
|
|
|
const-string v1, "data"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/reflect/Field;->setAccessible(Z)V
|
|
|
|
iget-object p1, p1, Lokio/ByteString;->data:[B
|
|
|
|
invoke-virtual {v0, p0, p1}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
new-instance p1, Ljava/lang/AssertionError;
|
|
|
|
invoke-direct {p1}, Ljava/lang/AssertionError;-><init>()V
|
|
|
|
throw p1
|
|
|
|
:catch_1
|
|
new-instance p1, Ljava/lang/AssertionError;
|
|
|
|
invoke-direct {p1}, Ljava/lang/AssertionError;-><init>()V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "byteCount < 0: "
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "in == null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private writeObject(Ljava/io/ObjectOutputStream;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v0, v0
|
|
|
|
invoke-virtual {p1, v0}, Ljava/io/ObjectOutputStream;->writeInt(I)V
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
invoke-virtual {p1, v0}, Ljava/io/ObjectOutputStream;->write([B)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public Cg()Ljava/lang/String;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->buX:Ljava/lang/String;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/String;
|
|
|
|
iget-object v1, p0, Lokio/ByteString;->data:[B
|
|
|
|
sget-object v2, Lokio/s;->UTF_8:Ljava/nio/charset/Charset;
|
|
|
|
invoke-direct {v0, v1, v2}, Ljava/lang/String;-><init>([BLjava/nio/charset/Charset;)V
|
|
|
|
iput-object v0, p0, Lokio/ByteString;->buX:Ljava/lang/String;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public Ch()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
invoke-static {v0}, Lokio/b;->y([B)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public Ci()Lokio/ByteString;
|
|
.locals 1
|
|
|
|
const-string v0, "SHA-1"
|
|
|
|
invoke-direct {p0, v0}, Lokio/ByteString;->eg(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public Cj()Lokio/ByteString;
|
|
.locals 1
|
|
|
|
const-string v0, "SHA-256"
|
|
|
|
invoke-direct {p0, v0}, Lokio/ByteString;->eg(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public Ck()Ljava/lang/String;
|
|
.locals 9
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v1, v0
|
|
|
|
mul-int/lit8 v1, v1, 0x2
|
|
|
|
new-array v1, v1, [C
|
|
|
|
array-length v2, v0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_0
|
|
if-ge v3, v2, :cond_0
|
|
|
|
aget-byte v5, v0, v3
|
|
|
|
add-int/lit8 v6, v4, 0x1
|
|
|
|
sget-object v7, Lokio/ByteString;->bni:[C
|
|
|
|
shr-int/lit8 v8, v5, 0x4
|
|
|
|
and-int/lit8 v8, v8, 0xf
|
|
|
|
aget-char v8, v7, v8
|
|
|
|
aput-char v8, v1, v4
|
|
|
|
add-int/lit8 v4, v6, 0x1
|
|
|
|
and-int/lit8 v5, v5, 0xf
|
|
|
|
aget-char v5, v7, v5
|
|
|
|
aput-char v5, v1, v6
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/String;
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/String;-><init>([C)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public Cl()Lokio/ByteString;
|
|
.locals 6
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iget-object v1, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v2, v1
|
|
|
|
if-ge v0, v2, :cond_3
|
|
|
|
aget-byte v2, v1, v0
|
|
|
|
const/16 v3, 0x41
|
|
|
|
if-lt v2, v3, :cond_2
|
|
|
|
const/16 v4, 0x5a
|
|
|
|
if-gt v2, v4, :cond_2
|
|
|
|
invoke-virtual {v1}, [B->clone()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, [B
|
|
|
|
add-int/lit8 v5, v0, 0x1
|
|
|
|
add-int/lit8 v2, v2, 0x20
|
|
|
|
int-to-byte v2, v2
|
|
|
|
aput-byte v2, v1, v0
|
|
|
|
:goto_1
|
|
array-length v0, v1
|
|
|
|
if-ge v5, v0, :cond_1
|
|
|
|
aget-byte v0, v1, v5
|
|
|
|
if-lt v0, v3, :cond_0
|
|
|
|
if-gt v0, v4, :cond_0
|
|
|
|
add-int/lit8 v0, v0, 0x20
|
|
|
|
int-to-byte v0, v0
|
|
|
|
aput-byte v0, v1, v5
|
|
|
|
:cond_0
|
|
add-int/lit8 v5, v5, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
new-instance v0, Lokio/ByteString;
|
|
|
|
invoke-direct {v0, v1}, Lokio/ByteString;-><init>([B)V
|
|
|
|
return-object v0
|
|
|
|
:cond_2
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public a(ILokio/ByteString;II)Z
|
|
.locals 0
|
|
|
|
iget-object p1, p0, Lokio/ByteString;->data:[B
|
|
|
|
const/4 p3, 0x0
|
|
|
|
invoke-virtual {p2, p3, p1, p3, p4}, Lokio/ByteString;->f(I[BII)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public ad(II)Lokio/ByteString;
|
|
.locals 3
|
|
|
|
if-ltz p1, :cond_3
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v1, v0
|
|
|
|
if-gt p2, v1, :cond_2
|
|
|
|
sub-int v1, p2, p1
|
|
|
|
if-ltz v1, :cond_1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
array-length v0, v0
|
|
|
|
if-ne p2, v0, :cond_0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
new-array p2, v1, [B
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {v0, p1, p2, v2, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
new-instance p1, Lokio/ByteString;
|
|
|
|
invoke-direct {p1, p2}, Lokio/ByteString;-><init>([B)V
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "endIndex < beginIndex"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "endIndex > length("
|
|
|
|
invoke-direct {p2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v0, v0
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, ")"
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, 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
|
|
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "beginIndex < 0"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method b(Lokio/c;)V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {p1, v0, v2, v1}, Lokio/c;->m([BII)Lokio/c;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic compareTo(Ljava/lang/Object;)I
|
|
.locals 9
|
|
|
|
check-cast p1, Lokio/ByteString;
|
|
|
|
invoke-virtual {p0}, Lokio/ByteString;->size()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p1}, Lokio/ByteString;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_0
|
|
const/4 v5, -0x1
|
|
|
|
const/4 v6, 0x1
|
|
|
|
if-ge v4, v2, :cond_2
|
|
|
|
invoke-virtual {p0, v4}, Lokio/ByteString;->getByte(I)B
|
|
|
|
move-result v7
|
|
|
|
and-int/lit16 v7, v7, 0xff
|
|
|
|
invoke-virtual {p1, v4}, Lokio/ByteString;->getByte(I)B
|
|
|
|
move-result v8
|
|
|
|
and-int/lit16 v8, v8, 0xff
|
|
|
|
if-eq v7, v8, :cond_1
|
|
|
|
if-ge v7, v8, :cond_0
|
|
|
|
return v5
|
|
|
|
:cond_0
|
|
return v6
|
|
|
|
:cond_1
|
|
add-int/lit8 v4, v4, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
if-ne v0, v1, :cond_3
|
|
|
|
return v3
|
|
|
|
:cond_3
|
|
if-ge v0, v1, :cond_4
|
|
|
|
return v5
|
|
|
|
:cond_4
|
|
return v6
|
|
.end method
|
|
|
|
.method public equals(Ljava/lang/Object;)Z
|
|
.locals 5
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-ne p1, p0, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
instance-of v1, p1, Lokio/ByteString;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
check-cast p1, Lokio/ByteString;
|
|
|
|
invoke-virtual {p1}, Lokio/ByteString;->size()I
|
|
|
|
move-result v1
|
|
|
|
iget-object v3, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v4, v3
|
|
|
|
if-ne v1, v4, :cond_1
|
|
|
|
array-length v1, v3
|
|
|
|
invoke-virtual {p1, v2, v3, v2, v1}, Lokio/ByteString;->f(I[BII)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
return v0
|
|
|
|
:cond_1
|
|
return v2
|
|
.end method
|
|
|
|
.method public f(I[BII)Z
|
|
.locals 2
|
|
|
|
if-ltz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v1, v0
|
|
|
|
sub-int/2addr v1, p4
|
|
|
|
if-gt p1, v1, :cond_0
|
|
|
|
if-ltz p3, :cond_0
|
|
|
|
array-length v1, p2
|
|
|
|
sub-int/2addr v1, p4
|
|
|
|
if-gt p3, v1, :cond_0
|
|
|
|
invoke-static {v0, p1, p2, p3, p4}, Lokio/s;->a([BI[BII)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public getByte(I)B
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
aget-byte p1, v0, p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public hashCode()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Lokio/ByteString;->cU:I
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
invoke-static {v0}, Ljava/util/Arrays;->hashCode([B)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lokio/ByteString;->cU:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public size()I
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v0, v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public toByteArray()[B
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
invoke-virtual {v0}, [B->clone()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [B
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public toString()Ljava/lang/String;
|
|
.locals 9
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v0, v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const-string v0, "[size=0]"
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lokio/ByteString;->Cg()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_0
|
|
const/4 v5, -0x1
|
|
|
|
const/16 v6, 0x40
|
|
|
|
if-ge v3, v1, :cond_5
|
|
|
|
if-ne v4, v6, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-virtual {v0, v3}, Ljava/lang/String;->codePointAt(I)I
|
|
|
|
move-result v7
|
|
|
|
invoke-static {v7}, Ljava/lang/Character;->isISOControl(I)Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_2
|
|
|
|
const/16 v8, 0xa
|
|
|
|
if-eq v7, v8, :cond_2
|
|
|
|
const/16 v8, 0xd
|
|
|
|
if-ne v7, v8, :cond_3
|
|
|
|
:cond_2
|
|
const v8, 0xfffd
|
|
|
|
if-ne v7, v8, :cond_4
|
|
|
|
:cond_3
|
|
const/4 v3, -0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
add-int/lit8 v4, v4, 0x1
|
|
|
|
invoke-static {v7}, Ljava/lang/Character;->charCount(I)I
|
|
|
|
move-result v5
|
|
|
|
add-int/2addr v3, v5
|
|
|
|
goto :goto_0
|
|
|
|
:cond_5
|
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v3
|
|
|
|
:goto_1
|
|
if-ne v3, v5, :cond_7
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v0, v0
|
|
|
|
if-gt v0, v6, :cond_6
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "[hex="
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Lokio/ByteString;->Ck()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "]"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
|
|
:cond_6
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "[size="
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object v1, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v1, v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, " hex="
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0, v2, v6}, Lokio/ByteString;->ad(II)Lokio/ByteString;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lokio/ByteString;->Ck()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "\u2026]"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
|
|
:cond_7
|
|
invoke-virtual {v0, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "\\"
|
|
|
|
const-string v4, "\\\\"
|
|
|
|
invoke-virtual {v1, v2, v4}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "\n"
|
|
|
|
const-string v4, "\\n"
|
|
|
|
invoke-virtual {v1, v2, v4}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "\r"
|
|
|
|
const-string v4, "\\r"
|
|
|
|
invoke-virtual {v1, v2, v4}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
if-ge v3, v0, :cond_8
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "[size="
|
|
|
|
invoke-direct {v0, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object v2, p0, Lokio/ByteString;->data:[B
|
|
|
|
array-length v2, v2
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, " text="
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "\u2026]"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
|
|
:cond_8
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "[text="
|
|
|
|
invoke-direct {v0, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "]"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public write(Ljava/io/OutputStream;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lokio/ByteString;->data:[B
|
|
|
|
invoke-virtual {p1, v0}, Ljava/io/OutputStream;->write([B)V
|
|
|
|
return-void
|
|
.end method
|