Initial version -- added millennium read funcionality
This commit is contained in:
@@ -0,0 +1,164 @@
|
||||
package com.google.android.gms.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.RemoteException;
|
||||
import android.os.StrictMode;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.zzaf;
|
||||
import com.google.android.gms.common.internal.zzag;
|
||||
import com.google.android.gms.common.util.AndroidUtilsLight;
|
||||
import com.google.android.gms.common.util.Hex;
|
||||
import com.google.android.gms.dynamic.ObjectWrapper;
|
||||
import com.google.android.gms.dynamite.DynamiteModule;
|
||||
import com.google.errorprone.annotations.CheckReturnValue;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
@CheckReturnValue
|
||||
final class zzn {
|
||||
private static volatile zzag zze;
|
||||
private static Context zzg;
|
||||
static final zzl zza = new zzf(zzj.zze("0\u0082\u0005È0\u0082\u0003° \u0003\u0002\u0001\u0002\u0002\u0014\u0010\u008ae\bsù/\u008eQí"));
|
||||
static final zzl zzb = new zzg(zzj.zze("0\u0082\u0006\u00040\u0082\u0003ì \u0003\u0002\u0001\u0002\u0002\u0014\u0003£²\u00ad×árÊkì"));
|
||||
static final zzl zzc = new zzh(zzj.zze("0\u0082\u0004C0\u0082\u0003+ \u0003\u0002\u0001\u0002\u0002\t\u0000Âà\u0087FdJ0\u008d0"));
|
||||
static final zzl zzd = new zzi(zzj.zze("0\u0082\u0004¨0\u0082\u0003\u0090 \u0003\u0002\u0001\u0002\u0002\t\u0000Õ\u0085¸l}ÓNõ0"));
|
||||
private static final Object zzf = new Object();
|
||||
|
||||
static zzx zza(String str, zzj zzjVar, boolean z, boolean z2) {
|
||||
StrictMode.ThreadPolicy threadPolicyAllowThreadDiskReads = StrictMode.allowThreadDiskReads();
|
||||
try {
|
||||
return zzh(str, zzjVar, z, z2);
|
||||
} finally {
|
||||
StrictMode.setThreadPolicy(threadPolicyAllowThreadDiskReads);
|
||||
}
|
||||
}
|
||||
|
||||
static zzx zzb(String str, boolean z, boolean z2, boolean z3) {
|
||||
return zzi(str, z, false, false, true);
|
||||
}
|
||||
|
||||
static zzx zzc(String str, boolean z, boolean z2, boolean z3) {
|
||||
return zzi(str, z, false, false, false);
|
||||
}
|
||||
|
||||
static /* synthetic */ String zzd(boolean z, String str, zzj zzjVar) throws Exception {
|
||||
String str2 = (z || !zzh(str, zzjVar, true, false).zza) ? "not allowed" : "debug cert rejected";
|
||||
MessageDigest messageDigestZza = AndroidUtilsLight.zza("SHA-256");
|
||||
Preconditions.checkNotNull(messageDigestZza);
|
||||
return String.format("%s: pkg=%s, sha256=%s, atk=%s, ver=%s", str2, str, Hex.bytesToStringLowercase(messageDigestZza.digest(zzjVar.zzf())), Boolean.valueOf(z), "12451000.false");
|
||||
}
|
||||
|
||||
static synchronized void zze(Context context) {
|
||||
if (zzg != null) {
|
||||
Log.w("GoogleCertificates", "GoogleCertificates has been initialized already");
|
||||
} else if (context != null) {
|
||||
zzg = context.getApplicationContext();
|
||||
}
|
||||
}
|
||||
|
||||
static boolean zzf() {
|
||||
boolean zZzg;
|
||||
StrictMode.ThreadPolicy threadPolicyAllowThreadDiskReads = StrictMode.allowThreadDiskReads();
|
||||
try {
|
||||
try {
|
||||
zzj();
|
||||
zZzg = zze.zzg();
|
||||
} catch (RemoteException | DynamiteModule.LoadingException e) {
|
||||
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e);
|
||||
zZzg = false;
|
||||
}
|
||||
return zZzg;
|
||||
} finally {
|
||||
StrictMode.setThreadPolicy(threadPolicyAllowThreadDiskReads);
|
||||
}
|
||||
}
|
||||
|
||||
static boolean zzg() {
|
||||
boolean zZzi;
|
||||
StrictMode.ThreadPolicy threadPolicyAllowThreadDiskReads = StrictMode.allowThreadDiskReads();
|
||||
try {
|
||||
try {
|
||||
zzj();
|
||||
zZzi = zze.zzi();
|
||||
} catch (RemoteException | DynamiteModule.LoadingException e) {
|
||||
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e);
|
||||
zZzi = false;
|
||||
}
|
||||
return zZzi;
|
||||
} finally {
|
||||
StrictMode.setThreadPolicy(threadPolicyAllowThreadDiskReads);
|
||||
}
|
||||
}
|
||||
|
||||
private static zzx zzh(final String str, final zzj zzjVar, final boolean z, boolean z2) {
|
||||
try {
|
||||
zzj();
|
||||
Preconditions.checkNotNull(zzg);
|
||||
try {
|
||||
return zze.zzh(new zzs(str, zzjVar, z, z2), ObjectWrapper.wrap(zzg.getPackageManager())) ? zzx.zzb() : new zzv(new Callable() { // from class: com.google.android.gms.common.zze
|
||||
@Override // java.util.concurrent.Callable
|
||||
public final Object call() {
|
||||
return zzn.zzd(z, str, zzjVar);
|
||||
}
|
||||
}, null);
|
||||
} catch (RemoteException e) {
|
||||
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e);
|
||||
return zzx.zzd("module call", e);
|
||||
}
|
||||
} catch (DynamiteModule.LoadingException e2) {
|
||||
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e2);
|
||||
return zzx.zzd("module init: ".concat(String.valueOf(e2.getMessage())), e2);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Type inference failed for: r6v0, types: [android.os.IBinder, com.google.android.gms.dynamic.IObjectWrapper] */
|
||||
private static zzx zzi(String str, boolean z, boolean z2, boolean z3, boolean z4) {
|
||||
zzx zzxVarZzd;
|
||||
StrictMode.ThreadPolicy threadPolicyAllowThreadDiskReads = StrictMode.allowThreadDiskReads();
|
||||
try {
|
||||
Preconditions.checkNotNull(zzg);
|
||||
try {
|
||||
zzj();
|
||||
zzo zzoVar = new zzo(str, z, false, ObjectWrapper.wrap(zzg), false, true);
|
||||
try {
|
||||
zzq zzqVarZze = z4 ? zze.zze(zzoVar) : zze.zzf(zzoVar);
|
||||
if (zzqVarZze.zzb()) {
|
||||
zzxVarZzd = zzx.zzf(zzqVarZze.zzc());
|
||||
} else {
|
||||
String strZza = zzqVarZze.zza();
|
||||
PackageManager.NameNotFoundException nameNotFoundException = zzqVarZze.zzd() == 4 ? new PackageManager.NameNotFoundException() : null;
|
||||
if (strZza == null) {
|
||||
strZza = "error checking package certificate";
|
||||
}
|
||||
zzxVarZzd = zzx.zzg(zzqVarZze.zzc(), zzqVarZze.zzd(), strZza, nameNotFoundException);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e);
|
||||
zzxVarZzd = zzx.zzd("module call", e);
|
||||
}
|
||||
} catch (DynamiteModule.LoadingException e2) {
|
||||
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e2);
|
||||
zzxVarZzd = zzx.zzd("module init: ".concat(String.valueOf(e2.getMessage())), e2);
|
||||
}
|
||||
return zzxVarZzd;
|
||||
} finally {
|
||||
StrictMode.setThreadPolicy(threadPolicyAllowThreadDiskReads);
|
||||
}
|
||||
}
|
||||
|
||||
private static void zzj() throws DynamiteModule.LoadingException {
|
||||
if (zze != null) {
|
||||
return;
|
||||
}
|
||||
Preconditions.checkNotNull(zzg);
|
||||
synchronized (zzf) {
|
||||
if (zze == null) {
|
||||
zze = zzaf.zzb(DynamiteModule.load(zzg, DynamiteModule.PREFER_HIGHEST_OR_LOCAL_VERSION_NO_FORCE_STAGING, "com.google.android.gms.googlecertificates").instantiate("com.google.android.gms.common.GoogleCertificatesImpl"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user