78 lines
3.0 KiB
Java
78 lines
3.0 KiB
Java
package com.google.android.gms.common;
|
|
|
|
import android.content.Context;
|
|
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.dynamic.ObjectWrapper;
|
|
import com.google.android.gms.dynamite.DynamiteModule;
|
|
import java.util.concurrent.Callable;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class zzc {
|
|
private static volatile com.google.android.gms.common.internal.zzm a;
|
|
private static final Object b = new Object();
|
|
private static Context c;
|
|
|
|
static synchronized void a(Context context) {
|
|
synchronized (zzc.class) {
|
|
if (c != null) {
|
|
Log.w("GoogleCertificates", "GoogleCertificates has been initialized already");
|
|
} else if (context != null) {
|
|
c = context.getApplicationContext();
|
|
}
|
|
}
|
|
}
|
|
|
|
private static zzm b(final String str, final zze zzeVar, final boolean z) {
|
|
try {
|
|
if (a == null) {
|
|
Preconditions.a(c);
|
|
synchronized (b) {
|
|
if (a == null) {
|
|
a = com.google.android.gms.common.internal.zzn.a(DynamiteModule.a(c, DynamiteModule.i, "com.google.android.gms.googlecertificates").a("com.google.android.gms.common.GoogleCertificatesImpl"));
|
|
}
|
|
}
|
|
}
|
|
Preconditions.a(c);
|
|
try {
|
|
return a.a(new zzk(str, zzeVar, z), ObjectWrapper.a(c.getPackageManager())) ? zzm.c() : zzm.a((Callable<String>) new Callable(z, str, zzeVar) { // from class: com.google.android.gms.common.zzd
|
|
private final boolean a;
|
|
private final String b;
|
|
private final zze c;
|
|
|
|
{
|
|
this.a = z;
|
|
this.b = str;
|
|
this.c = zzeVar;
|
|
}
|
|
|
|
@Override // java.util.concurrent.Callable
|
|
public final Object call() {
|
|
String a2;
|
|
a2 = zzm.a(this.b, this.c, this.a, !r2 && zzc.b(r3, r4, true).a);
|
|
return a2;
|
|
}
|
|
});
|
|
} catch (RemoteException e) {
|
|
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e);
|
|
return zzm.a("module call", e);
|
|
}
|
|
} catch (DynamiteModule.LoadingException e2) {
|
|
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e2);
|
|
String valueOf = String.valueOf(e2.getMessage());
|
|
return zzm.a(valueOf.length() != 0 ? "module init: ".concat(valueOf) : new String("module init: "), e2);
|
|
}
|
|
}
|
|
|
|
static zzm a(String str, zze zzeVar, boolean z) {
|
|
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
|
|
try {
|
|
return b(str, zzeVar, z);
|
|
} finally {
|
|
StrictMode.setThreadPolicy(allowThreadDiskReads);
|
|
}
|
|
}
|
|
}
|