573 lines
13 KiB
Smali
573 lines
13 KiB
Smali
.class public final Landroidx/browser/trusted/TokenContents;
|
|
.super Ljava/lang/Object;
|
|
.source "TokenContents.java"
|
|
|
|
|
|
# instance fields
|
|
.field public final mContents:[B
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public mFingerprints:Ljava/util/List;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"[B>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public mPackageName:Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>([B)V
|
|
.locals 0
|
|
.param p1 # [B
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Landroidx/browser/trusted/TokenContents;->mContents:[B
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>([BLjava/lang/String;Ljava/util/List;)V
|
|
.locals 1
|
|
.param p1 # [B
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Ljava/util/List;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"([B",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/List<",
|
|
"[B>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Landroidx/browser/trusted/TokenContents;->mContents:[B
|
|
|
|
iput-object p2, p0, Landroidx/browser/trusted/TokenContents;->mPackageName:Ljava/lang/String;
|
|
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-interface {p3}, Ljava/util/List;->size()I
|
|
|
|
move-result p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
iput-object p1, p0, Landroidx/browser/trusted/TokenContents;->mFingerprints:Ljava/util/List;
|
|
|
|
invoke-interface {p3}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, [B
|
|
|
|
iget-object p3, p0, Landroidx/browser/trusted/TokenContents;->mFingerprints:Ljava/util/List;
|
|
|
|
array-length v0, p2
|
|
|
|
invoke-static {p2, v0}, Ljava/util/Arrays;->copyOf([BI)[B
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p3, p2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static compareByteArrays([B[B)I
|
|
.locals 4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-ne p0, p1, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
if-nez p0, :cond_1
|
|
|
|
const/4 p0, -0x1
|
|
|
|
return p0
|
|
|
|
:cond_1
|
|
if-nez p1, :cond_2
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_2
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
array-length v2, p0
|
|
|
|
array-length v3, p1
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v2
|
|
|
|
if-ge v1, v2, :cond_4
|
|
|
|
aget-byte v2, p0, v1
|
|
|
|
aget-byte v3, p1, v1
|
|
|
|
if-eq v2, v3, :cond_3
|
|
|
|
aget-byte p0, p0, v1
|
|
|
|
aget-byte p1, p1, v1
|
|
|
|
:goto_1
|
|
sub-int/2addr p0, p1
|
|
|
|
return p0
|
|
|
|
:cond_3
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
array-length v1, p0
|
|
|
|
array-length v2, p1
|
|
|
|
if-eq v1, v2, :cond_5
|
|
|
|
array-length p0, p0
|
|
|
|
array-length p1, p1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
return v0
|
|
.end method
|
|
|
|
.method public static create(Ljava/lang/String;Ljava/util/List;)Landroidx/browser/trusted/TokenContents;
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/List<",
|
|
"[B>;)",
|
|
"Landroidx/browser/trusted/TokenContents;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Landroidx/browser/trusted/TokenContents;
|
|
|
|
invoke-static {p0, p1}, Landroidx/browser/trusted/TokenContents;->createToken(Ljava/lang/String;Ljava/util/List;)[B
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1, p0, p1}, Landroidx/browser/trusted/TokenContents;-><init>([BLjava/lang/String;Ljava/util/List;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static createToken(Ljava/lang/String;Ljava/util/List;)[B
|
|
.locals 3
|
|
.param p0 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Ljava/util/List;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/List<",
|
|
"[B>;)[B"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Lu/a/b/b;->d:Lu/a/b/b;
|
|
|
|
invoke-static {p1, v0}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V
|
|
|
|
new-instance v0, Ljava/io/ByteArrayOutputStream;
|
|
|
|
invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
|
|
|
|
new-instance v1, Ljava/io/DataOutputStream;
|
|
|
|
invoke-direct {v1, v0}, Ljava/io/DataOutputStream;-><init>(Ljava/io/OutputStream;)V
|
|
|
|
invoke-virtual {v1, p0}, Ljava/io/DataOutputStream;->writeUTF(Ljava/lang/String;)V
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->size()I
|
|
|
|
move-result p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/io/DataOutputStream;->writeInt(I)V
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, [B
|
|
|
|
array-length v2, p1
|
|
|
|
invoke-virtual {v1, v2}, Ljava/io/DataOutputStream;->writeInt(I)V
|
|
|
|
invoke-virtual {v1, p1}, Ljava/io/DataOutputStream;->write([B)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {v1}, Ljava/io/DataOutputStream;->flush()V
|
|
|
|
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static deserialize([B)Landroidx/browser/trusted/TokenContents;
|
|
.locals 1
|
|
.param p0 # [B
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
new-instance v0, Landroidx/browser/trusted/TokenContents;
|
|
|
|
invoke-direct {v0, p0}, Landroidx/browser/trusted/TokenContents;-><init>([B)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private parseIfNeeded()V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/browser/trusted/TokenContents;->mPackageName:Ljava/lang/String;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/io/DataInputStream;
|
|
|
|
new-instance v1, Ljava/io/ByteArrayInputStream;
|
|
|
|
iget-object v2, p0, Landroidx/browser/trusted/TokenContents;->mContents:[B
|
|
|
|
invoke-direct {v1, v2}, Ljava/io/ByteArrayInputStream;-><init>([B)V
|
|
|
|
invoke-direct {v0, v1}, Ljava/io/DataInputStream;-><init>(Ljava/io/InputStream;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/DataInputStream;->readUTF()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
iput-object v1, p0, Landroidx/browser/trusted/TokenContents;->mPackageName:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0}, Ljava/io/DataInputStream;->readInt()I
|
|
|
|
move-result v1
|
|
|
|
new-instance v2, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v2, v1}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
iput-object v2, p0, Landroidx/browser/trusted/TokenContents;->mFingerprints:Ljava/util/List;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_2
|
|
|
|
invoke-virtual {v0}, Ljava/io/DataInputStream;->readInt()I
|
|
|
|
move-result v3
|
|
|
|
new-array v4, v3, [B
|
|
|
|
invoke-virtual {v0, v4}, Ljava/io/DataInputStream;->read([B)I
|
|
|
|
move-result v5
|
|
|
|
if-ne v5, v3, :cond_1
|
|
|
|
iget-object v3, p0, Landroidx/browser/trusted/TokenContents;->mFingerprints:Ljava/util/List;
|
|
|
|
invoke-interface {v3, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "Could not read fingerprint"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public equals(Ljava/lang/Object;)Z
|
|
.locals 2
|
|
|
|
if-ne p0, p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
if-eqz p1, :cond_2
|
|
|
|
const-class v0, Landroidx/browser/trusted/TokenContents;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v1
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
check-cast p1, Landroidx/browser/trusted/TokenContents;
|
|
|
|
iget-object v0, p0, Landroidx/browser/trusted/TokenContents;->mContents:[B
|
|
|
|
iget-object p1, p1, Landroidx/browser/trusted/TokenContents;->mContents:[B
|
|
|
|
invoke-static {v0, p1}, Ljava/util/Arrays;->equals([B[B)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
|
|
:cond_2
|
|
:goto_0
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public getFingerprint(I)[B
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Landroidx/browser/trusted/TokenContents;->parseIfNeeded()V
|
|
|
|
iget-object v0, p0, Landroidx/browser/trusted/TokenContents;->mFingerprints:Ljava/util/List;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [B
|
|
|
|
iget-object v1, p0, Landroidx/browser/trusted/TokenContents;->mFingerprints:Ljava/util/List;
|
|
|
|
invoke-interface {v1, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, [B
|
|
|
|
array-length p1, p1
|
|
|
|
invoke-static {v0, p1}, Ljava/util/Arrays;->copyOf([BI)[B
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/IllegalStateException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public getFingerprintCount()I
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Landroidx/browser/trusted/TokenContents;->parseIfNeeded()V
|
|
|
|
iget-object v0, p0, Landroidx/browser/trusted/TokenContents;->mFingerprints:Ljava/util/List;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-direct {v0}, Ljava/lang/IllegalStateException;-><init>()V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public getPackageName()Ljava/lang/String;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Landroidx/browser/trusted/TokenContents;->parseIfNeeded()V
|
|
|
|
iget-object v0, p0, Landroidx/browser/trusted/TokenContents;->mPackageName:Ljava/lang/String;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-direct {v0}, Ljava/lang/IllegalStateException;-><init>()V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public hashCode()I
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/browser/trusted/TokenContents;->mContents:[B
|
|
|
|
invoke-static {v0}, Ljava/util/Arrays;->hashCode([B)I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public serialize()[B
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/browser/trusted/TokenContents;->mContents:[B
|
|
|
|
array-length v1, v0
|
|
|
|
invoke-static {v0, v1}, Ljava/util/Arrays;->copyOf([BI)[B
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|