granularity level: instruction
.class public Lcom/google/android/gms/common/GoogleSignatureVerifier;
.super Ljava/lang/Object;
.source "com.google.android.gms:play-services-basement@@18.1.0"
.annotation runtime Lcom/google/errorprone/annotations/CheckReturnValue;
.end annotation
.annotation runtime Lcom/google/errorprone/annotations/RestrictedInheritance;
allowedOnPath = ".*java.*/com/google/android/gms/common/testing/.*"
explanation = "Sub classing of GMS Core\'s APIs are restricted to testing fakes."
link = "go/gmscore-restrictedinheritance"
.end annotation
.field private static zza:Lcom/google/android/gms/common/GoogleSignatureVerifier;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
.field private static volatile zzb:Ljava/util/Set;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
.field private final zzc:Landroid/content/Context;
.field private volatile zzd:Ljava/lang/String;
.method public constructor <init>(Landroid/content/Context;)V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object p1
iput-object p1, p0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzc:Landroid/content/Context;
return-void
.end method
.method public static getInstance(Landroid/content/Context;)Lcom/google/android/gms/common/GoogleSignatureVerifier;
.locals 2
invoke-static {p0}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
const-class v0, Lcom/google/android/gms/common/GoogleSignatureVerifier;
monitor-enter v0
:try_start_0
sget-object v1, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza:Lcom/google/android/gms/common/GoogleSignatureVerifier;
if-nez v1, :cond_0
invoke-static {p0}, Lcom/google/android/gms/common/zzn;->zze(Landroid/content/Context;)V
new-instance v1, Lcom/google/android/gms/common/GoogleSignatureVerifier;
invoke-direct {v1, p0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;-><init>(Landroid/content/Context;)V
sput-object v1, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza:Lcom/google/android/gms/common/GoogleSignatureVerifier;
:cond_0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
sget-object p0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza:Lcom/google/android/gms/common/GoogleSignatureVerifier;
return-object p0
:catchall_0
move-exception p0
:try_start_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw p0
.end method
.method static final varargs zza(Landroid/content/pm/PackageInfo;[Lcom/google/android/gms/common/zzj;)Lcom/google/android/gms/common/zzj;
.locals 3
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
const/4 v1, 0x0
if-nez v0, :cond_0
return-object v1
:cond_0
iget-object v0, p0, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
array-length v0, v0
const/4 v2, 0x1
if-eq v0, v2, :cond_1
const-string p0, "GoogleSignatureVerifier"
const-string p1, "Package has more than one signature."
invoke-static {p0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
return-object v1
:cond_1
new-instance v0, Lcom/google/android/gms/common/zzk;
iget-object p0, p0, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
const/4 v2, 0x0
aget-object p0, p0, v2
invoke-virtual {p0}, Landroid/content/pm/Signature;->toByteArray()[B
move-result-object p0
invoke-direct {v0, p0}, Lcom/google/android/gms/common/zzk;-><init>([B)V
:goto_0
array-length p0, p1
if-ge v2, p0, :cond_3
aget-object p0, p1, v2
invoke-virtual {p0, v0}, Lcom/google/android/gms/common/zzj;->equals(Ljava/lang/Object;)Z
move-result p0
if-eqz p0, :cond_2
aget-object p0, p1, v2
return-object p0
:cond_2
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_3
return-object v1
.end method
.method public static final zzb(Landroid/content/pm/PackageInfo;Z)Z
.locals 4
const/4 v0, 0x1
const/4 v1, 0x0
if-eqz p1, :cond_3
if-eqz p0, :cond_3
iget-object v2, p0, Landroid/content/pm/PackageInfo;->packageName:Ljava/lang/String;
const-string v3, "com.android.vending"
invoke-virtual {v3, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-nez v2, :cond_0
iget-object v2, p0, Landroid/content/pm/PackageInfo;->packageName:Ljava/lang/String;
const-string v3, "com.google.android.gms"
invoke-virtual {v3, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_3
:cond_0
iget-object p1, p0, Landroid/content/pm/PackageInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;
if-nez p1, :cond_2
:cond_1
const/4 p1, 0x0
goto :goto_0
:cond_2
iget p1, p1, Landroid/content/pm/ApplicationInfo;->flags:I
and-int/lit16 p1, p1, 0x81
if-eqz p1, :cond_1
const/4 p1, 0x1
:goto_0
:cond_3
if-eqz p0, :cond_5
iget-object v2, p0, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
if-eqz v2, :cond_5
if-eqz p1, :cond_4
sget-object p1, Lcom/google/android/gms/common/zzm;->zza:[Lcom/google/android/gms/common/zzj;
invoke-static {p0, p1}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;[Lcom/google/android/gms/common/zzj;)Lcom/google/android/gms/common/zzj;
move-result-object p0
goto :goto_1
:cond_4
new-array p1, v0, [Lcom/google/android/gms/common/zzj;
sget-object v2, Lcom/google/android/gms/common/zzm;->zza:[Lcom/google/android/gms/common/zzj;
aget-object v2, v2, v1
aput-object v2, p1, v1
invoke-static {p0, p1}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;[Lcom/google/android/gms/common/zzj;)Lcom/google/android/gms/common/zzj;
move-result-object p0
:goto_1
if-eqz p0, :cond_5
return v0
:cond_5
return v1
.end method
.method private final zzc(Ljava/lang/String;ZZ)Lcom/google/android/gms/common/zzx;
.locals 5
const-string p2, "null pkg"
if-nez p1, :cond_0
invoke-static {p2}, Lcom/google/android/gms/common/zzx;->zzc(Ljava/lang/String;)Lcom/google/android/gms/common/zzx;
move-result-object p1
return-object p1
:cond_0
iget-object p3, p0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzd:Ljava/lang/String;
invoke-virtual {p1, p3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result p3
if-nez p3, :cond_7
invoke-static {}, Lcom/google/android/gms/common/zzn;->zzg()Z
move-result p3
const/4 v0, 0x0
if-eqz p3, :cond_1
iget-object p2, p0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzc:Landroid/content/Context;
invoke-static {p2}, Lcom/google/android/gms/common/GooglePlayServicesUtilLight;->honorsDebugCertificates(Landroid/content/Context;)Z
move-result p2
invoke-static {p1, p2, v0, v0}, Lcom/google/android/gms/common/zzn;->zzb(Ljava/lang/String;ZZZ)Lcom/google/android/gms/common/zzx;
move-result-object p2
goto :goto_1
:try_start_0
:cond_1
iget-object p3, p0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzc:Landroid/content/Context;
invoke-virtual {p3}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object p3
const/16 v1, 0x40
invoke-virtual {p3, p1, v1}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
move-result-object p3
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
iget-object v1, p0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzc:Landroid/content/Context;
invoke-static {v1}, Lcom/google/android/gms/common/GooglePlayServicesUtilLight;->honorsDebugCertificates(Landroid/content/Context;)Z
move-result v1
if-nez p3, :cond_2
invoke-static {p2}, Lcom/google/android/gms/common/zzx;->zzc(Ljava/lang/String;)Lcom/google/android/gms/common/zzx;
move-result-object p2
goto :goto_1
:cond_2
iget-object p2, p3, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
if-eqz p2, :cond_5
iget-object p2, p3, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
array-length p2, p2
const/4 v2, 0x1
if-eq p2, v2, :cond_3
goto :goto_0
:cond_3
new-instance p2, Lcom/google/android/gms/common/zzk;
iget-object v3, p3, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
aget-object v3, v3, v0
invoke-virtual {v3}, Landroid/content/pm/Signature;->toByteArray()[B
move-result-object v3
invoke-direct {p2, v3}, Lcom/google/android/gms/common/zzk;-><init>([B)V
iget-object v3, p3, Landroid/content/pm/PackageInfo;->packageName:Ljava/lang/String;
invoke-static {v3, p2, v1, v0}, Lcom/google/android/gms/common/zzn;->zza(Ljava/lang/String;Lcom/google/android/gms/common/zzj;ZZ)Lcom/google/android/gms/common/zzx;
move-result-object v1
iget-boolean v4, v1, Lcom/google/android/gms/common/zzx;->zza:Z
if-eqz v4, :cond_4
iget-object v4, p3, Landroid/content/pm/PackageInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;
if-eqz v4, :cond_4
iget-object p3, p3, Landroid/content/pm/PackageInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;
iget p3, p3, Landroid/content/pm/ApplicationInfo;->flags:I
and-int/lit8 p3, p3, 0x2
if-eqz p3, :cond_4
invoke-static {v3, p2, v0, v2}, Lcom/google/android/gms/common/zzn;->zza(Ljava/lang/String;Lcom/google/android/gms/common/zzj;ZZ)Lcom/google/android/gms/common/zzx;
move-result-object p2
iget-boolean p2, p2, Lcom/google/android/gms/common/zzx;->zza:Z
if-eqz p2, :cond_4
const-string p2, "debuggable release cert app rejected"
invoke-static {p2}, Lcom/google/android/gms/common/zzx;->zzc(Ljava/lang/String;)Lcom/google/android/gms/common/zzx;
move-result-object p2
goto :goto_1
:cond_4
move-object p2, v1
goto :goto_1
:goto_0
:cond_5
const-string p2, "single cert required"
invoke-static {p2}, Lcom/google/android/gms/common/zzx;->zzc(Ljava/lang/String;)Lcom/google/android/gms/common/zzx;
move-result-object p2
:goto_1
iget-boolean p3, p2, Lcom/google/android/gms/common/zzx;->zza:Z
if-eqz p3, :cond_6
iput-object p1, p0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzd:Ljava/lang/String;
:cond_6
return-object p2
:catch_0
move-exception p2
const-string p3, "no pkg "
invoke-virtual {p3, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-static {p1, p2}, Lcom/google/android/gms/common/zzx;->zzd(Ljava/lang/String;Ljava/lang/Throwable;)Lcom/google/android/gms/common/zzx;
move-result-object p1
return-object p1
:cond_7
invoke-static {}, Lcom/google/android/gms/common/zzx;->zzb()Lcom/google/android/gms/common/zzx;
move-result-object p1
return-object p1
.end method
.method public isGooglePublicSignedPackage(Landroid/content/pm/PackageInfo;)Z
.locals 3
const/4 v0, 0x0
if-nez p1, :cond_0
return v0
:cond_0
invoke-static {p1, v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzb(Landroid/content/pm/PackageInfo;Z)Z
move-result v1
const/4 v2, 0x1
if-eqz v1, :cond_1
return v2
:cond_1
invoke-static {p1, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzb(Landroid/content/pm/PackageInfo;Z)Z
move-result p1
if-eqz p1, :cond_3
iget-object p1, p0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzc:Landroid/content/Context;
invoke-static {p1}, Lcom/google/android/gms/common/GooglePlayServicesUtilLight;->honorsDebugCertificates(Landroid/content/Context;)Z
move-result p1
if-eqz p1, :cond_2
return v2
:cond_2
const-string p1, "GoogleSignatureVerifier"
const-string v1, "Test-keys aren\'t accepted on this build."
invoke-static {p1, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:cond_3
return v0
.end method
.method public isPackageGoogleSigned(Ljava/lang/String;)Z
.locals 1
const/4 v0, 0x0
invoke-direct {p0, p1, v0, v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzc(Ljava/lang/String;ZZ)Lcom/google/android/gms/common/zzx;
move-result-object p1
invoke-virtual {p1}, Lcom/google/android/gms/common/zzx;->zze()V
iget-boolean p1, p1, Lcom/google/android/gms/common/zzx;->zza:Z
return p1
.end method
.method public isUidGoogleSigned(I)Z
.locals 5
iget-object v0, p0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzc:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
invoke-virtual {v0, p1}, Landroid/content/pm/PackageManager;->getPackagesForUid(I)[Ljava/lang/String;
move-result-object p1
if-eqz p1, :cond_3
array-length v0, p1
if-nez v0, :cond_0
goto :goto_1
:cond_0
const/4 v1, 0x0
const/4 v2, 0x0
const/4 v3, 0x0
:goto_0
if-ge v3, v0, :cond_2
aget-object v1, p1, v3
invoke-direct {p0, v1, v2, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzc(Ljava/lang/String;ZZ)Lcom/google/android/gms/common/zzx;
move-result-object v1
iget-boolean v4, v1, Lcom/google/android/gms/common/zzx;->zza:Z
if-eqz v4, :cond_1
goto :goto_2
:cond_1
add-int/lit8 v3, v3, 0x1
goto :goto_0
:cond_2
invoke-static {v1}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
goto :goto_2
:goto_1
:cond_3
const-string p1, "no pkgs"
invoke-static {p1}, Lcom/google/android/gms/common/zzx;->zzc(Ljava/lang/String;)Lcom/google/android/gms/common/zzx;
move-result-object v1
:goto_2
invoke-virtual {v1}, Lcom/google/android/gms/common/zzx;->zze()V
iget-boolean p1, v1, Lcom/google/android/gms/common/zzx;->zza:Z
return p1
.end method