jimu-decompiled/sources/com/google/android/gms/measurement/internal/zzq.java
2025-05-13 19:24:51 +02:00

257 lines
7.0 KiB
Java

package com.google.android.gms.measurement.internal;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.text.TextUtils;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.util.ProcessUtils;
import com.google.android.gms.common.wrappers.Wrappers;
import com.google.android.gms.measurement.internal.zzai;
import com.ubtrobot.jimu.robotapi.PeripheralType;
import java.lang.reflect.InvocationTargetException;
/* loaded from: classes.dex */
public final class zzq extends zzcr {
private Boolean b;
private zzs c;
private Boolean d;
zzq(zzbw zzbwVar) {
super(zzbwVar);
this.c = zzr.a;
zzai.a(zzbwVar);
}
static String t() {
return zzai.k.a();
}
public static long u() {
return zzai.N.a().longValue();
}
public static long v() {
return zzai.n.a().longValue();
}
public static boolean w() {
return zzai.j.a().booleanValue();
}
static boolean x() {
return zzai.e0.a().booleanValue();
}
final void a(zzs zzsVar) {
this.c = zzsVar;
}
public final int b(String str, zzai.zza<Integer> zzaVar) {
if (str == null) {
return zzaVar.a().intValue();
}
String a = this.c.a(str, zzaVar.b());
if (TextUtils.isEmpty(a)) {
return zzaVar.a().intValue();
}
try {
return zzaVar.a(Integer.valueOf(Integer.parseInt(a))).intValue();
} catch (NumberFormatException unused) {
return zzaVar.a().intValue();
}
}
public final boolean c(String str, zzai.zza<Boolean> zzaVar) {
if (str == null) {
return zzaVar.a().booleanValue();
}
String a = this.c.a(str, zzaVar.b());
return TextUtils.isEmpty(a) ? zzaVar.a().booleanValue() : zzaVar.a(Boolean.valueOf(Boolean.parseBoolean(a))).booleanValue();
}
public final boolean d(String str, zzai.zza<Boolean> zzaVar) {
return c(str, zzaVar);
}
final boolean e(String str) {
return c(str, zzai.S);
}
final boolean f(String str) {
return c(str, zzai.U);
}
final boolean g(String str) {
return c(str, zzai.V);
}
final boolean h(String str) {
return c(str, zzai.W);
}
final boolean i(String str) {
return c(str, zzai.X);
}
final boolean j(String str) {
return c(str, zzai.Z);
}
final boolean k(String str) {
return c(str, zzai.a0);
}
final boolean l(String str) {
return c(str, zzai.b0);
}
final boolean m(String str) {
return c(str, zzai.d0);
}
public final boolean n() {
if (this.d == null) {
synchronized (this) {
if (this.d == null) {
ApplicationInfo applicationInfo = b().getApplicationInfo();
String a = ProcessUtils.a();
if (applicationInfo != null) {
String str = applicationInfo.processName;
this.d = Boolean.valueOf(str != null && str.equals(a));
}
if (this.d == null) {
this.d = Boolean.TRUE;
e().t().a("My process not in the list of running processes");
}
}
}
}
return this.d.booleanValue();
}
public final long o() {
c();
return 14710L;
}
public final boolean p() {
c();
Boolean b = b("firebase_analytics_collection_deactivated");
return b != null && b.booleanValue();
}
public final Boolean q() {
c();
return b("firebase_analytics_collection_enabled");
}
public final String r() {
try {
return (String) Class.forName("android.os.SystemProperties").getMethod("get", String.class, String.class).invoke(null, "debug.firebase.analytics.app", "");
} catch (ClassNotFoundException e) {
e().t().a("Could not find SystemProperties class", e);
return "";
} catch (IllegalAccessException e2) {
e().t().a("Could not access SystemProperties.get()", e2);
return "";
} catch (NoSuchMethodException e3) {
e().t().a("Could not find SystemProperties.get() method", e3);
return "";
} catch (InvocationTargetException e4) {
e().t().a("SystemProperties.get() threw an exception", e4);
return "";
}
}
final boolean s() {
if (this.b == null) {
this.b = b("app_measurement_lite");
if (this.b == null) {
this.b = false;
}
}
return this.b.booleanValue() || !this.a.D();
}
public final int a(String str) {
return b(str, zzai.y);
}
public final boolean d(String str) {
return "1".equals(this.c.a(str, "measurement.event_sampling_enabled"));
}
final boolean o(String str) {
return c(str, zzai.f0);
}
public final long a(String str, zzai.zza<Long> zzaVar) {
if (str == null) {
return zzaVar.a().longValue();
}
String a = this.c.a(str, zzaVar.b());
if (TextUtils.isEmpty(a)) {
return zzaVar.a().longValue();
}
try {
return zzaVar.a(Long.valueOf(Long.parseLong(a))).longValue();
} catch (NumberFormatException unused) {
return zzaVar.a().longValue();
}
}
final boolean q(String str) {
return c(str, zzai.h0);
}
final boolean p(String str) {
return c(str, zzai.g0);
}
final boolean s(String str) {
return c(str, zzai.k0);
}
public final boolean c(String str) {
return "1".equals(this.c.a(str, "gaia_collection_enabled"));
}
final Boolean b(String str) {
Preconditions.b(str);
try {
if (b().getPackageManager() == null) {
e().t().a("Failed to load metadata: PackageManager is null");
return null;
}
ApplicationInfo a = Wrappers.a(b()).a(b().getPackageName(), PeripheralType.SERVO);
if (a == null) {
e().t().a("Failed to load metadata: ApplicationInfo is null");
return null;
}
if (a.metaData == null) {
e().t().a("Failed to load metadata: Metadata bundle is null");
return null;
}
if (a.metaData.containsKey(str)) {
return Boolean.valueOf(a.metaData.getBoolean(str));
}
return null;
} catch (PackageManager.NameNotFoundException e) {
e().t().a("Failed to load metadata: Package name not found", e);
return null;
}
}
final boolean r(String str) {
return c(str, zzai.i0);
}
public final boolean a(zzai.zza<Boolean> zzaVar) {
return c(null, zzaVar);
}
final boolean n(String str) {
return c(str, zzai.c0);
}
}