329 lines
6.1 KiB
Smali
329 lines
6.1 KiB
Smali
.class public Lcom/google/android/gms/common/util/Hex;
|
|
.super Ljava/lang/Object;
|
|
.source "com.google.android.gms:play-services-basement@@18.0.0"
|
|
|
|
|
|
# annotations
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/android/gms/common/internal/ShowFirstParty;
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final zza:[C
|
|
|
|
.field private static final zzb:[C
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
const/16 v0, 0x10
|
|
|
|
new-array v1, v0, [C
|
|
|
|
fill-array-data v1, :array_0
|
|
|
|
sput-object v1, Lcom/google/android/gms/common/util/Hex;->zza:[C
|
|
|
|
new-array v0, v0, [C
|
|
|
|
fill-array-data v0, :array_1
|
|
|
|
sput-object v0, Lcom/google/android/gms/common/util/Hex;->zzb:[C
|
|
|
|
return-void
|
|
|
|
nop
|
|
|
|
:array_0
|
|
.array-data 2
|
|
0x30s
|
|
0x31s
|
|
0x32s
|
|
0x33s
|
|
0x34s
|
|
0x35s
|
|
0x36s
|
|
0x37s
|
|
0x38s
|
|
0x39s
|
|
0x41s
|
|
0x42s
|
|
0x43s
|
|
0x44s
|
|
0x45s
|
|
0x46s
|
|
.end array-data
|
|
|
|
:array_1
|
|
.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 public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static bytesToStringLowercase([B)Ljava/lang/String;
|
|
.locals 7
|
|
.param p0 # [B
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.line 1
|
|
array-length v0, p0
|
|
|
|
add-int/2addr v0, v0
|
|
|
|
new-array v0, v0, [C
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move v2, v1
|
|
|
|
.line 2
|
|
:goto_0
|
|
array-length v3, p0
|
|
|
|
if-ge v1, v3, :cond_0
|
|
|
|
.line 3
|
|
aget-byte v3, p0, v1
|
|
|
|
and-int/lit16 v3, v3, 0xff
|
|
|
|
add-int/lit8 v4, v2, 0x1
|
|
|
|
sget-object v5, Lcom/google/android/gms/common/util/Hex;->zzb:[C
|
|
|
|
ushr-int/lit8 v6, v3, 0x4
|
|
|
|
aget-char v6, v5, v6
|
|
|
|
.line 4
|
|
aput-char v6, v0, v2
|
|
|
|
add-int/lit8 v2, v4, 0x1
|
|
|
|
and-int/lit8 v3, v3, 0xf
|
|
|
|
aget-char v3, v5, v3
|
|
|
|
.line 5
|
|
aput-char v3, v0, v4
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/String;
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/String;-><init>([C)V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static bytesToStringUppercase([B)Ljava/lang/String;
|
|
.locals 1
|
|
.param p0 # [B
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
invoke-static {p0, v0}, Lcom/google/android/gms/common/util/Hex;->bytesToStringUppercase([BZ)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static bytesToStringUppercase([BZ)Ljava/lang/String;
|
|
.locals 5
|
|
.param p0 # [B
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.line 2
|
|
array-length v0, p0
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
add-int v2, v0, v0
|
|
|
|
.line 3
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(I)V
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v0, :cond_1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
add-int/lit8 v3, v0, -0x1
|
|
|
|
if-ne v2, v3, :cond_0
|
|
|
|
.line 4
|
|
aget-byte v3, p0, v2
|
|
|
|
and-int/lit16 v3, v3, 0xff
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
:cond_0
|
|
sget-object v3, Lcom/google/android/gms/common/util/Hex;->zza:[C
|
|
|
|
.line 5
|
|
aget-byte v4, p0, v2
|
|
|
|
and-int/lit16 v4, v4, 0xf0
|
|
|
|
ushr-int/lit8 v4, v4, 0x4
|
|
|
|
aget-char v4, v3, v4
|
|
|
|
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
.line 6
|
|
aget-byte v4, p0, v2
|
|
|
|
and-int/lit8 v4, v4, 0xf
|
|
|
|
aget-char v3, v3, v4
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static stringToBytes(Ljava/lang/String;)[B
|
|
.locals 6
|
|
.param p0 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/IllegalArgumentException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
rem-int/lit8 v1, v0, 0x2
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
.line 2
|
|
div-int/lit8 v1, v0, 0x2
|
|
|
|
.line 3
|
|
new-array v1, v1, [B
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v0, :cond_0
|
|
|
|
add-int/lit8 v3, v2, 0x2
|
|
|
|
div-int/lit8 v4, v2, 0x2
|
|
|
|
.line 4
|
|
invoke-virtual {p0, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
const/16 v5, 0x10
|
|
|
|
invoke-static {v2, v5}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;I)I
|
|
|
|
move-result v2
|
|
|
|
int-to-byte v2, v2
|
|
|
|
aput-byte v2, v1, v4
|
|
|
|
move v2, v3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-object v1
|
|
|
|
.line 5
|
|
:cond_1
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Hex string has odd number of characters"
|
|
|
|
.line 6
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|