177 lines
4.5 KiB
Smali
177 lines
4.5 KiB
Smali
|
.class public Landroidx/browser/trusted/PackageIdentityUtils$Api28Implementation;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "PackageIdentityUtils.java"
|
||
|
|
||
|
# interfaces
|
||
|
.implements Landroidx/browser/trusted/PackageIdentityUtils$SignaturesCompat;
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation build Landroidx/annotation/RequiresApi;
|
||
|
value = 0x1c
|
||
|
.end annotation
|
||
|
|
||
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
||
|
value = Landroidx/browser/trusted/PackageIdentityUtils;
|
||
|
.end annotation
|
||
|
|
||
|
.annotation system Ldalvik/annotation/InnerClass;
|
||
|
accessFlags = 0x9
|
||
|
name = "Api28Implementation"
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>()V
|
||
|
.locals 0
|
||
|
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public getFingerprintsForPackage(Ljava/lang/String;Landroid/content/pm/PackageManager;)Ljava/util/List;
|
||
|
.locals 3
|
||
|
.annotation build Landroidx/annotation/Nullable;
|
||
|
.end annotation
|
||
|
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(",
|
||
|
"Ljava/lang/String;",
|
||
|
"Landroid/content/pm/PackageManager;",
|
||
|
")",
|
||
|
"Ljava/util/List<",
|
||
|
"[B>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.annotation system Ldalvik/annotation/Throws;
|
||
|
value = {
|
||
|
Landroid/content/pm/PackageManager$NameNotFoundException;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
const/high16 v0, 0x8000000
|
||
|
|
||
|
invoke-virtual {p2, p1, v0}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
new-instance p2, Ljava/util/ArrayList;
|
||
|
|
||
|
invoke-direct {p2}, Ljava/util/ArrayList;-><init>()V
|
||
|
|
||
|
iget-object p1, p1, Landroid/content/pm/PackageInfo;->signingInfo:Landroid/content/pm/SigningInfo;
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/content/pm/SigningInfo;->hasMultipleSigners()Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/content/pm/SigningInfo;->getApkContentsSigners()[Landroid/content/pm/Signature;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
array-length v0, p1
|
||
|
|
||
|
:goto_0
|
||
|
if-ge v1, v0, :cond_1
|
||
|
|
||
|
aget-object v2, p1, v1
|
||
|
|
||
|
invoke-static {v2}, Landroidx/browser/trusted/PackageIdentityUtils;->getCertificateSHA256Fingerprint(Landroid/content/pm/Signature;)[B
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-virtual {p2, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
add-int/lit8 v1, v1, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
invoke-virtual {p1}, Landroid/content/pm/SigningInfo;->getSigningCertificateHistory()[Landroid/content/pm/Signature;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
aget-object p1, p1, v1
|
||
|
|
||
|
invoke-static {p1}, Landroidx/browser/trusted/PackageIdentityUtils;->getCertificateSHA256Fingerprint(Landroid/content/pm/Signature;)[B
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p2, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
:cond_1
|
||
|
return-object p2
|
||
|
.end method
|
||
|
|
||
|
.method public packageMatchesToken(Ljava/lang/String;Landroid/content/pm/PackageManager;Landroidx/browser/trusted/TokenContents;)Z
|
||
|
.locals 4
|
||
|
.annotation system Ldalvik/annotation/Throws;
|
||
|
value = {
|
||
|
Landroid/content/pm/PackageManager$NameNotFoundException;,
|
||
|
Ljava/io/IOException;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
invoke-virtual {p0, p1, p2}, Landroidx/browser/trusted/PackageIdentityUtils$Api28Implementation;->getFingerprintsForPackage(Ljava/lang/String;Landroid/content/pm/PackageManager;)Ljava/util/List;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
if-nez v0, :cond_0
|
||
|
|
||
|
return v1
|
||
|
|
||
|
:cond_0
|
||
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
const/4 v3, 0x1
|
||
|
|
||
|
if-ne v2, v3, :cond_2
|
||
|
|
||
|
invoke-virtual {p3}, Landroidx/browser/trusted/TokenContents;->getPackageName()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-nez v0, :cond_1
|
||
|
|
||
|
return v1
|
||
|
|
||
|
:cond_1
|
||
|
invoke-virtual {p3, v1}, Landroidx/browser/trusted/TokenContents;->getFingerprint(I)[B
|
||
|
|
||
|
move-result-object p3
|
||
|
|
||
|
invoke-virtual {p2, p1, p3, v3}, Landroid/content/pm/PackageManager;->hasSigningCertificate(Ljava/lang/String;[BI)Z
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
return p1
|
||
|
|
||
|
:cond_2
|
||
|
invoke-static {p1, v0}, Landroidx/browser/trusted/TokenContents;->create(Ljava/lang/String;Ljava/util/List;)Landroidx/browser/trusted/TokenContents;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p3, p1}, Landroidx/browser/trusted/TokenContents;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
return p1
|
||
|
.end method
|