- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
1521 lines
56 KiB
Java
1521 lines
56 KiB
Java
package com.google.android.gms.measurement.internal;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.annotation.TargetApi;
|
|
import android.content.ComponentName;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.SharedPreferences;
|
|
import android.content.pm.ActivityInfo;
|
|
import android.content.pm.ApplicationInfo;
|
|
import android.content.pm.PackageInfo;
|
|
import android.content.pm.PackageManager;
|
|
import android.content.pm.ResolveInfo;
|
|
import android.content.pm.ServiceInfo;
|
|
import android.content.pm.Signature;
|
|
import android.net.Uri;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import android.os.RemoteException;
|
|
import android.os.ext.SdkExtensions;
|
|
import android.text.TextUtils;
|
|
import androidx.annotation.VisibleForTesting;
|
|
import androidx.annotation.WorkerThread;
|
|
import androidx.core.app.NotificationCompat;
|
|
import androidx.privacysandbox.ads.adservices.java.measurement.MeasurementManagerFutures;
|
|
import androidx.webkit.ProxyConfig;
|
|
import androidx.work.WorkRequest;
|
|
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
|
|
import com.facebook.share.internal.ShareConstants;
|
|
import com.google.android.gms.common.GoogleApiAvailabilityLight;
|
|
import com.google.android.gms.common.GooglePlayServicesUtilLight;
|
|
import com.google.android.gms.common.internal.Preconditions;
|
|
import com.google.android.gms.common.util.Clock;
|
|
import com.google.android.gms.common.util.CollectionUtils;
|
|
import com.google.android.gms.common.wrappers.Wrappers;
|
|
import com.google.android.gms.internal.measurement.zzor;
|
|
import com.google.android.gms.internal.measurement.zzpo;
|
|
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
|
import com.ironsource.v8;
|
|
import com.mbridge.msdk.foundation.tools.SameMD5;
|
|
import com.mbridge.msdk.interstitial.view.MBInterstitialActivity;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.source.chunk.ChunkedTrackBlacklistUtil;
|
|
import com.unity3d.ads.core.data.datasource.AndroidStaticDeviceInfoDataSource;
|
|
import com.vungle.ads.internal.signals.SignalManager;
|
|
import java.io.ByteArrayInputStream;
|
|
import java.math.BigInteger;
|
|
import java.net.MalformedURLException;
|
|
import java.net.URL;
|
|
import java.security.MessageDigest;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.SecureRandom;
|
|
import java.security.cert.CertificateException;
|
|
import java.security.cert.CertificateFactory;
|
|
import java.security.cert.X509Certificate;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Locale;
|
|
import java.util.Objects;
|
|
import java.util.Random;
|
|
import java.util.TreeSet;
|
|
import java.util.concurrent.CancellationException;
|
|
import java.util.concurrent.ExecutionException;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeoutException;
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
import javax.security.auth.x500.X500Principal;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public final class zznt extends zzim {
|
|
private static final String[] zza = {"firebase_", "google_", "ga_"};
|
|
private static final String[] zzb = {"_err"};
|
|
private SecureRandom zzc;
|
|
private final AtomicLong zzd;
|
|
private int zze;
|
|
private MeasurementManagerFutures zzf;
|
|
private Boolean zzg;
|
|
private Integer zzh;
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:29:0x00b0 A[RETURN] */
|
|
/* JADX WARN: Removed duplicated region for block: B:30:0x00b1 */
|
|
@androidx.annotation.WorkerThread
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private final int zza(java.lang.String r14, java.lang.String r15, java.lang.String r16, java.lang.Object r17, android.os.Bundle r18, java.util.List<java.lang.String> r19, boolean r20, boolean r21) {
|
|
/*
|
|
Method dump skipped, instructions count: 319
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.measurement.internal.zznt.zza(java.lang.String, java.lang.String, java.lang.String, java.lang.Object, android.os.Bundle, java.util.List, boolean, boolean):int");
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzim
|
|
public final boolean zzo() {
|
|
return true;
|
|
}
|
|
|
|
public final int zza(String str, Object obj) {
|
|
boolean zza2;
|
|
if ("_ldl".equals(str)) {
|
|
zza2 = zza("user property referrer", str, zzm(str), obj);
|
|
} else {
|
|
zza2 = zza("user property", str, zzm(str), obj);
|
|
}
|
|
return zza2 ? 0 : 7;
|
|
}
|
|
|
|
public final int zza(String str) {
|
|
if (!zzb(NotificationCompat.CATEGORY_EVENT, str)) {
|
|
return 2;
|
|
}
|
|
if (zza(NotificationCompat.CATEGORY_EVENT, zzir.zza, zzir.zzb, str)) {
|
|
return !zza(NotificationCompat.CATEGORY_EVENT, 40, str) ? 2 : 0;
|
|
}
|
|
return 13;
|
|
}
|
|
|
|
private final int zzk(String str) {
|
|
if (!zzb("event param", str)) {
|
|
return 3;
|
|
}
|
|
if (zza("event param", (String[]) null, str)) {
|
|
return !zza("event param", 40, str) ? 3 : 0;
|
|
}
|
|
return 14;
|
|
}
|
|
|
|
private final int zzl(String str) {
|
|
if (!zzc("event param", str)) {
|
|
return 3;
|
|
}
|
|
if (zza("event param", (String[]) null, str)) {
|
|
return !zza("event param", 40, str) ? 3 : 0;
|
|
}
|
|
return 14;
|
|
}
|
|
|
|
public final int zzb(String str) {
|
|
if (!zzb("user property", str)) {
|
|
return 6;
|
|
}
|
|
if (zza("user property", zzis.zza, str)) {
|
|
return !zza("user property", 24, str) ? 6 : 0;
|
|
}
|
|
return 15;
|
|
}
|
|
|
|
public static int zzc() {
|
|
int extensionVersion;
|
|
int extensionVersion2;
|
|
if (Build.VERSION.SDK_INT < 30) {
|
|
return 0;
|
|
}
|
|
extensionVersion = SdkExtensions.getExtensionVersion(30);
|
|
if (extensionVersion <= 3) {
|
|
return 0;
|
|
}
|
|
extensionVersion2 = SdkExtensions.getExtensionVersion(1000000);
|
|
return extensionVersion2;
|
|
}
|
|
|
|
public final int zzg() {
|
|
if (this.zzh == null) {
|
|
this.zzh = Integer.valueOf(GoogleApiAvailabilityLight.getInstance().getApkVersion(zza()) / 1000);
|
|
}
|
|
return this.zzh.intValue();
|
|
}
|
|
|
|
private static int zzm(String str) {
|
|
if ("_ldl".equals(str)) {
|
|
return 2048;
|
|
}
|
|
if ("_id".equals(str)) {
|
|
return 256;
|
|
}
|
|
return ("_lgclid".equals(str) || "_gbraid".equals(str) || "_dl_gbraid".equals(str) || "_mr_gbraid".equals(str)) ? 100 : 36;
|
|
}
|
|
|
|
public final int zza(int i) {
|
|
return GoogleApiAvailabilityLight.getInstance().isGooglePlayServicesAvailable(zza(), GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE);
|
|
}
|
|
|
|
@WorkerThread
|
|
public final long zzc(String str) {
|
|
if (zza().getPackageManager() == null) {
|
|
return 0L;
|
|
}
|
|
int i = 0;
|
|
try {
|
|
ApplicationInfo applicationInfo = Wrappers.packageManager(zza()).getApplicationInfo(str, 0);
|
|
if (applicationInfo != null) {
|
|
i = applicationInfo.targetSdkVersion;
|
|
}
|
|
} catch (PackageManager.NameNotFoundException unused) {
|
|
zzj().zzn().zza("PackageManager failed to find running app: app_id", str);
|
|
}
|
|
return i;
|
|
}
|
|
|
|
@WorkerThread
|
|
public final long zzh() {
|
|
int extensionVersion;
|
|
long j;
|
|
zzt();
|
|
if (!zzd(this.zzu.zzh().zzad())) {
|
|
return 0L;
|
|
}
|
|
if (Build.VERSION.SDK_INT < 30) {
|
|
j = 4;
|
|
} else {
|
|
extensionVersion = SdkExtensions.getExtensionVersion(30);
|
|
if (extensionVersion < 4) {
|
|
j = 8;
|
|
} else {
|
|
j = zzc() < zzbh.zzav.zza(null).intValue() ? 16L : 0L;
|
|
}
|
|
}
|
|
if (!zze("android.permission.ACCESS_ADSERVICES_ATTRIBUTION")) {
|
|
j |= 2;
|
|
}
|
|
if (j == 0 && !zzy()) {
|
|
j |= 64;
|
|
}
|
|
if (j == 0) {
|
|
return 1L;
|
|
}
|
|
return j;
|
|
}
|
|
|
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:13:0x0066 -> B:8:0x0073). Please report as a decompilation issue!!! */
|
|
@WorkerThread
|
|
public final long zza(Context context, String str) {
|
|
zzt();
|
|
Preconditions.checkNotNull(context);
|
|
Preconditions.checkNotEmpty(str);
|
|
PackageManager packageManager = context.getPackageManager();
|
|
MessageDigest zzu = zzu();
|
|
long j = -1;
|
|
if (zzu == null) {
|
|
zzj().zzg().zza("Could not get MD5 instance");
|
|
} else {
|
|
if (packageManager != null) {
|
|
try {
|
|
} catch (PackageManager.NameNotFoundException e) {
|
|
zzj().zzg().zza("Package name not found", e);
|
|
}
|
|
if (!zzb(context, str)) {
|
|
Signature[] signatureArr = Wrappers.packageManager(context).getPackageInfo(zza().getPackageName(), 64).signatures;
|
|
if (signatureArr != null && signatureArr.length > 0) {
|
|
j = zza(zzu.digest(signatureArr[0].toByteArray()));
|
|
} else {
|
|
zzj().zzu().zza("Could not get signatures");
|
|
}
|
|
}
|
|
}
|
|
j = 0;
|
|
}
|
|
return j;
|
|
}
|
|
|
|
@VisibleForTesting
|
|
public static long zza(byte[] bArr) {
|
|
Preconditions.checkNotNull(bArr);
|
|
int i = 0;
|
|
Preconditions.checkState(bArr.length > 0);
|
|
long j = 0;
|
|
for (int length = bArr.length - 1; length >= 0 && length >= bArr.length - 8; length--) {
|
|
j += (bArr[length] & 255) << i;
|
|
i += 8;
|
|
}
|
|
return j;
|
|
}
|
|
|
|
public static long zza(zzba zzbaVar) {
|
|
long j = 0;
|
|
if (zzbaVar == null) {
|
|
return 0L;
|
|
}
|
|
Iterator<String> it = zzbaVar.iterator();
|
|
while (it.hasNext()) {
|
|
if (zzbaVar.zzc(it.next()) instanceof Parcelable[]) {
|
|
j += ((Parcelable[]) r3).length;
|
|
}
|
|
}
|
|
return j;
|
|
}
|
|
|
|
public final long zzm() {
|
|
long andIncrement;
|
|
long j;
|
|
if (this.zzd.get() == 0) {
|
|
synchronized (this.zzd) {
|
|
long nextLong = new Random(System.nanoTime() ^ zzb().currentTimeMillis()).nextLong();
|
|
int i = this.zze + 1;
|
|
this.zze = i;
|
|
j = nextLong + i;
|
|
}
|
|
return j;
|
|
}
|
|
synchronized (this.zzd) {
|
|
this.zzd.compareAndSet(-1L, 1L);
|
|
andIncrement = this.zzd.getAndIncrement();
|
|
}
|
|
return andIncrement;
|
|
}
|
|
|
|
public static long zza(long j, long j2) {
|
|
return (j + (j2 * ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS)) / SignalManager.TWENTY_FOUR_HOURS_MILLIS;
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij, com.google.android.gms.measurement.internal.zzil
|
|
public final /* bridge */ /* synthetic */ Context zza() {
|
|
return super.zza();
|
|
}
|
|
|
|
public static Bundle zza(List<zzno> list) {
|
|
Bundle bundle = new Bundle();
|
|
if (list == null) {
|
|
return bundle;
|
|
}
|
|
for (zzno zznoVar : list) {
|
|
String str = zznoVar.zzd;
|
|
if (str != null) {
|
|
bundle.putString(zznoVar.zza, str);
|
|
} else {
|
|
Long l = zznoVar.zzc;
|
|
if (l != null) {
|
|
bundle.putLong(zznoVar.zza, l.longValue());
|
|
} else {
|
|
Double d = zznoVar.zzf;
|
|
if (d != null) {
|
|
bundle.putDouble(zznoVar.zza, d.doubleValue());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return bundle;
|
|
}
|
|
|
|
public final Bundle zza(Uri uri, boolean z) {
|
|
String str;
|
|
String str2;
|
|
String str3;
|
|
String str4;
|
|
String str5;
|
|
String str6;
|
|
String str7;
|
|
String str8;
|
|
String str9;
|
|
String str10;
|
|
if (uri == null) {
|
|
return null;
|
|
}
|
|
try {
|
|
if (uri.isHierarchical()) {
|
|
str = uri.getQueryParameter("utm_campaign");
|
|
str2 = uri.getQueryParameter("utm_source");
|
|
str3 = uri.getQueryParameter("utm_medium");
|
|
str4 = uri.getQueryParameter("gclid");
|
|
str5 = z ? uri.getQueryParameter("gbraid") : null;
|
|
str6 = uri.getQueryParameter("utm_id");
|
|
str7 = uri.getQueryParameter("dclid");
|
|
str8 = uri.getQueryParameter("srsltid");
|
|
str9 = uri.getQueryParameter("sfmc_id");
|
|
} else {
|
|
str = null;
|
|
str2 = null;
|
|
str3 = null;
|
|
str4 = null;
|
|
str5 = null;
|
|
str6 = null;
|
|
str7 = null;
|
|
str8 = null;
|
|
str9 = null;
|
|
}
|
|
if (TextUtils.isEmpty(str) && TextUtils.isEmpty(str2) && TextUtils.isEmpty(str3) && TextUtils.isEmpty(str4) && ((!z || TextUtils.isEmpty(str5)) && TextUtils.isEmpty(str6) && TextUtils.isEmpty(str7) && TextUtils.isEmpty(str8) && TextUtils.isEmpty(str9))) {
|
|
return null;
|
|
}
|
|
Bundle bundle = new Bundle();
|
|
if (TextUtils.isEmpty(str)) {
|
|
str10 = "sfmc_id";
|
|
} else {
|
|
str10 = "sfmc_id";
|
|
bundle.putString(MBInterstitialActivity.INTENT_CAMAPIGN, str);
|
|
}
|
|
if (!TextUtils.isEmpty(str2)) {
|
|
bundle.putString(ShareConstants.FEED_SOURCE_PARAM, str2);
|
|
}
|
|
if (!TextUtils.isEmpty(str3)) {
|
|
bundle.putString("medium", str3);
|
|
}
|
|
if (!TextUtils.isEmpty(str4)) {
|
|
bundle.putString("gclid", str4);
|
|
}
|
|
if (z && !TextUtils.isEmpty(str5)) {
|
|
bundle.putString("gbraid", str5);
|
|
}
|
|
String queryParameter = uri.getQueryParameter("gad_source");
|
|
if (z && !TextUtils.isEmpty(queryParameter)) {
|
|
bundle.putString("gad_source", queryParameter);
|
|
}
|
|
String queryParameter2 = uri.getQueryParameter("utm_term");
|
|
if (!TextUtils.isEmpty(queryParameter2)) {
|
|
bundle.putString("term", queryParameter2);
|
|
}
|
|
String queryParameter3 = uri.getQueryParameter("utm_content");
|
|
if (!TextUtils.isEmpty(queryParameter3)) {
|
|
bundle.putString("content", queryParameter3);
|
|
}
|
|
String queryParameter4 = uri.getQueryParameter("aclid");
|
|
if (!TextUtils.isEmpty(queryParameter4)) {
|
|
bundle.putString("aclid", queryParameter4);
|
|
}
|
|
String queryParameter5 = uri.getQueryParameter("cp1");
|
|
if (!TextUtils.isEmpty(queryParameter5)) {
|
|
bundle.putString("cp1", queryParameter5);
|
|
}
|
|
String queryParameter6 = uri.getQueryParameter("anid");
|
|
if (!TextUtils.isEmpty(queryParameter6)) {
|
|
bundle.putString("anid", queryParameter6);
|
|
}
|
|
if (!TextUtils.isEmpty(str6)) {
|
|
bundle.putString("campaign_id", str6);
|
|
}
|
|
if (!TextUtils.isEmpty(str7)) {
|
|
bundle.putString("dclid", str7);
|
|
}
|
|
String queryParameter7 = uri.getQueryParameter("utm_source_platform");
|
|
if (!TextUtils.isEmpty(queryParameter7)) {
|
|
bundle.putString("source_platform", queryParameter7);
|
|
}
|
|
String queryParameter8 = uri.getQueryParameter("utm_creative_format");
|
|
if (!TextUtils.isEmpty(queryParameter8)) {
|
|
bundle.putString("creative_format", queryParameter8);
|
|
}
|
|
String queryParameter9 = uri.getQueryParameter("utm_marketing_tactic");
|
|
if (!TextUtils.isEmpty(queryParameter9)) {
|
|
bundle.putString("marketing_tactic", queryParameter9);
|
|
}
|
|
if (!TextUtils.isEmpty(str8)) {
|
|
bundle.putString("srsltid", str8);
|
|
}
|
|
if (!TextUtils.isEmpty(str9)) {
|
|
bundle.putString(str10, str9);
|
|
}
|
|
return bundle;
|
|
} catch (UnsupportedOperationException e) {
|
|
zzj().zzu().zza("Install referrer url isn't a hierarchical URI", e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static Bundle zza(Bundle bundle) {
|
|
if (bundle == null) {
|
|
return new Bundle();
|
|
}
|
|
Bundle bundle2 = new Bundle(bundle);
|
|
for (String str : bundle2.keySet()) {
|
|
Object obj = bundle2.get(str);
|
|
if (obj instanceof Bundle) {
|
|
bundle2.putBundle(str, new Bundle((Bundle) obj));
|
|
} else {
|
|
int i = 0;
|
|
if (obj instanceof Parcelable[]) {
|
|
Parcelable[] parcelableArr = (Parcelable[]) obj;
|
|
while (i < parcelableArr.length) {
|
|
if (parcelableArr[i] instanceof Bundle) {
|
|
parcelableArr[i] = new Bundle((Bundle) parcelableArr[i]);
|
|
}
|
|
i++;
|
|
}
|
|
} else if (obj instanceof List) {
|
|
List list = (List) obj;
|
|
while (i < list.size()) {
|
|
Object obj2 = list.get(i);
|
|
if (obj2 instanceof Bundle) {
|
|
list.set(i, new Bundle((Bundle) obj2));
|
|
}
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return bundle2;
|
|
}
|
|
|
|
public final Bundle zza(Bundle bundle, String str) {
|
|
Bundle bundle2 = new Bundle();
|
|
if (bundle != null) {
|
|
for (String str2 : bundle.keySet()) {
|
|
Object zzb2 = zzb(str2, bundle.get(str2));
|
|
if (zzb2 == null) {
|
|
zzj().zzv().zza("Param value can't be null", zzi().zzb(str2));
|
|
} else {
|
|
zza(bundle2, str2, zzb2);
|
|
}
|
|
}
|
|
}
|
|
return bundle2;
|
|
}
|
|
|
|
public final Bundle zza(String str, String str2, Bundle bundle, List<String> list, boolean z) {
|
|
int zzl;
|
|
int i;
|
|
zznt zzntVar = this;
|
|
boolean zza2 = zza(str2, zzir.zzd);
|
|
if (bundle == null) {
|
|
return null;
|
|
}
|
|
Bundle bundle2 = new Bundle(bundle);
|
|
int zzg = zze().zzg();
|
|
int i2 = 0;
|
|
for (String str3 : new TreeSet(bundle.keySet())) {
|
|
if (list == null || !list.contains(str3)) {
|
|
zzl = !z ? zzntVar.zzl(str3) : 0;
|
|
if (zzl == 0) {
|
|
zzl = zzntVar.zzk(str3);
|
|
}
|
|
} else {
|
|
zzl = 0;
|
|
}
|
|
if (zzl != 0) {
|
|
zza(bundle2, zzl, str3, zzl == 3 ? str3 : null);
|
|
bundle2.remove(str3);
|
|
i = zzg;
|
|
} else {
|
|
i = zzg;
|
|
int zza3 = zza(str, str2, str3, bundle.get(str3), bundle2, list, z, zza2);
|
|
if (zza3 == 17) {
|
|
zza(bundle2, zza3, str3, Boolean.FALSE);
|
|
} else if (zza3 != 0 && !"_ev".equals(str3)) {
|
|
zza(bundle2, zza3, zza3 == 21 ? str2 : str3, bundle.get(str3));
|
|
bundle2.remove(str3);
|
|
}
|
|
if (zzh(str3)) {
|
|
int i3 = i2 + 1;
|
|
if (i3 > i) {
|
|
zzj().zzh().zza("Event can't contain more than " + i + " params", zzi().zza(str2), zzi().zza(bundle));
|
|
zzb(bundle2, 5);
|
|
bundle2.remove(str3);
|
|
}
|
|
i2 = i3;
|
|
}
|
|
}
|
|
zzg = i;
|
|
zzntVar = this;
|
|
}
|
|
return bundle2;
|
|
}
|
|
|
|
public final MeasurementManagerFutures zzn() {
|
|
if (this.zzf == null) {
|
|
this.zzf = MeasurementManagerFutures.from(zza());
|
|
}
|
|
return this.zzf;
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij, com.google.android.gms.measurement.internal.zzil
|
|
public final /* bridge */ /* synthetic */ Clock zzb() {
|
|
return super.zzb();
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij, com.google.android.gms.measurement.internal.zzil
|
|
public final /* bridge */ /* synthetic */ zzad zzd() {
|
|
return super.zzd();
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij
|
|
public final /* bridge */ /* synthetic */ zzae zze() {
|
|
return super.zze();
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij
|
|
public final /* bridge */ /* synthetic */ zzaz zzf() {
|
|
return super.zzf();
|
|
}
|
|
|
|
public final zzbf zza(String str, String str2, Bundle bundle, String str3, long j, boolean z, boolean z2) {
|
|
if (TextUtils.isEmpty(str2)) {
|
|
return null;
|
|
}
|
|
if (zza(str2) != 0) {
|
|
zzj().zzg().zza("Invalid conditional property event name", zzi().zzc(str2));
|
|
throw new IllegalArgumentException();
|
|
}
|
|
Bundle bundle2 = bundle != null ? new Bundle(bundle) : new Bundle();
|
|
bundle2.putString("_o", str3);
|
|
Bundle zza2 = zza(str, str2, bundle2, CollectionUtils.listOf("_o"), true);
|
|
if (z) {
|
|
zza2 = zza(zza2, str);
|
|
}
|
|
Preconditions.checkNotNull(zza2);
|
|
return new zzbf(str2, new zzba(zza2), str3, j);
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij
|
|
public final /* bridge */ /* synthetic */ zzfv zzi() {
|
|
return super.zzi();
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij, com.google.android.gms.measurement.internal.zzil
|
|
public final /* bridge */ /* synthetic */ zzfw zzj() {
|
|
return super.zzj();
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij
|
|
public final /* bridge */ /* synthetic */ zzgl zzk() {
|
|
return super.zzk();
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij, com.google.android.gms.measurement.internal.zzil
|
|
public final /* bridge */ /* synthetic */ zzhg zzl() {
|
|
return super.zzl();
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij
|
|
public final /* bridge */ /* synthetic */ zznt zzq() {
|
|
return super.zzq();
|
|
}
|
|
|
|
public final Object zzb(String str, Object obj) {
|
|
int zza2;
|
|
if ("_ev".equals(str)) {
|
|
return zza(zze().zzb((String) null, false), obj, true, true, (String) null);
|
|
}
|
|
if (zzg(str)) {
|
|
zza2 = zze().zzb((String) null, false);
|
|
} else {
|
|
zza2 = zze().zza((String) null, false);
|
|
}
|
|
return zza(zza2, obj, false, true, (String) null);
|
|
}
|
|
|
|
public final Object zzc(String str, Object obj) {
|
|
if ("_ldl".equals(str)) {
|
|
return zza(zzm(str), obj, true, false, (String) null);
|
|
}
|
|
return zza(zzm(str), obj, false, false, (String) null);
|
|
}
|
|
|
|
private final Object zza(int i, Object obj, boolean z, boolean z2, String str) {
|
|
Bundle zza2;
|
|
if (obj == null) {
|
|
return null;
|
|
}
|
|
if ((obj instanceof Long) || (obj instanceof Double)) {
|
|
return obj;
|
|
}
|
|
if (obj instanceof Integer) {
|
|
return Long.valueOf(((Integer) obj).intValue());
|
|
}
|
|
if (obj instanceof Byte) {
|
|
return Long.valueOf(((Byte) obj).byteValue());
|
|
}
|
|
if (obj instanceof Short) {
|
|
return Long.valueOf(((Short) obj).shortValue());
|
|
}
|
|
if (obj instanceof Boolean) {
|
|
return Long.valueOf(((Boolean) obj).booleanValue() ? 1L : 0L);
|
|
}
|
|
if (obj instanceof Float) {
|
|
return Double.valueOf(((Float) obj).doubleValue());
|
|
}
|
|
if ((obj instanceof String) || (obj instanceof Character) || (obj instanceof CharSequence)) {
|
|
return zza(String.valueOf(obj), i, z);
|
|
}
|
|
if (!z2 || (!(obj instanceof Bundle[]) && !(obj instanceof Parcelable[]))) {
|
|
return null;
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
for (Parcelable parcelable : (Parcelable[]) obj) {
|
|
if ((parcelable instanceof Bundle) && (zza2 = zza((Bundle) parcelable, (String) null)) != null && !zza2.isEmpty()) {
|
|
arrayList.add(zza2);
|
|
}
|
|
}
|
|
return arrayList.toArray(new Bundle[arrayList.size()]);
|
|
}
|
|
|
|
public final String zzp() {
|
|
byte[] bArr = new byte[16];
|
|
zzv().nextBytes(bArr);
|
|
return String.format(Locale.US, "%032x", new BigInteger(1, bArr));
|
|
}
|
|
|
|
public static String zza(String str, int i, boolean z) {
|
|
if (str == null) {
|
|
return null;
|
|
}
|
|
if (str.codePointCount(0, str.length()) <= i) {
|
|
return str;
|
|
}
|
|
if (!z) {
|
|
return null;
|
|
}
|
|
return str.substring(0, str.offsetByCodePoints(0, i)) + "...";
|
|
}
|
|
|
|
public final URL zza(long j, String str, String str2, long j2, String str3) {
|
|
try {
|
|
Preconditions.checkNotEmpty(str2);
|
|
Preconditions.checkNotEmpty(str);
|
|
String format = String.format("https://www.googleadservices.com/pagead/conversion/app/deeplink?id_type=adid&sdk_version=%s&rdid=%s&bundleid=%s&retry=%s", String.format("v%s.%s", Long.valueOf(j), Integer.valueOf(zzg())), str2, str, Long.valueOf(j2));
|
|
if (str.equals(zze().zzo())) {
|
|
format = format.concat("&ddl_test=1");
|
|
}
|
|
if (!str3.isEmpty()) {
|
|
if (str3.charAt(0) != '&') {
|
|
format = format.concat(v8.i.c);
|
|
}
|
|
format = format.concat(str3);
|
|
}
|
|
return new URL(format);
|
|
} catch (IllegalArgumentException e) {
|
|
e = e;
|
|
zzj().zzg().zza("Failed to create BOW URL for Deferred Deep Link. exception", e.getMessage());
|
|
return null;
|
|
} catch (MalformedURLException e2) {
|
|
e = e2;
|
|
zzj().zzg().zza("Failed to create BOW URL for Deferred Deep Link. exception", e.getMessage());
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static MessageDigest zzu() {
|
|
MessageDigest messageDigest;
|
|
for (int i = 0; i < 2; i++) {
|
|
try {
|
|
messageDigest = MessageDigest.getInstance(SameMD5.TAG);
|
|
} catch (NoSuchAlgorithmException unused) {
|
|
}
|
|
if (messageDigest != null) {
|
|
return messageDigest;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@WorkerThread
|
|
public final SecureRandom zzv() {
|
|
zzt();
|
|
if (this.zzc == null) {
|
|
this.zzc = new SecureRandom();
|
|
}
|
|
return this.zzc;
|
|
}
|
|
|
|
public static ArrayList<Bundle> zzb(List<zzac> list) {
|
|
if (list == null) {
|
|
return new ArrayList<>(0);
|
|
}
|
|
ArrayList<Bundle> arrayList = new ArrayList<>(list.size());
|
|
for (zzac zzacVar : list) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putString("app_id", zzacVar.zza);
|
|
bundle.putString("origin", zzacVar.zzb);
|
|
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.CREATION_TIMESTAMP, zzacVar.zzd);
|
|
bundle.putString("name", zzacVar.zzc.zza);
|
|
zzio.zza(bundle, Preconditions.checkNotNull(zzacVar.zzc.zza()));
|
|
bundle.putBoolean(AppMeasurementSdk.ConditionalUserProperty.ACTIVE, zzacVar.zze);
|
|
String str = zzacVar.zzf;
|
|
if (str != null) {
|
|
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.TRIGGER_EVENT_NAME, str);
|
|
}
|
|
zzbf zzbfVar = zzacVar.zzg;
|
|
if (zzbfVar != null) {
|
|
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_NAME, zzbfVar.zza);
|
|
zzba zzbaVar = zzbfVar.zzb;
|
|
if (zzbaVar != null) {
|
|
bundle.putBundle(AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_PARAMS, zzbaVar.zzb());
|
|
}
|
|
}
|
|
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.TRIGGER_TIMEOUT, zzacVar.zzh);
|
|
zzbf zzbfVar2 = zzacVar.zzi;
|
|
if (zzbfVar2 != null) {
|
|
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_NAME, zzbfVar2.zza);
|
|
zzba zzbaVar2 = zzbfVar2.zzb;
|
|
if (zzbaVar2 != null) {
|
|
bundle.putBundle(AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_PARAMS, zzbaVar2.zzb());
|
|
}
|
|
}
|
|
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_TIMESTAMP, zzacVar.zzc.zzb);
|
|
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.TIME_TO_LIVE, zzacVar.zzj);
|
|
zzbf zzbfVar3 = zzacVar.zzk;
|
|
if (zzbfVar3 != null) {
|
|
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_NAME, zzbfVar3.zza);
|
|
zzba zzbaVar3 = zzbfVar3.zzb;
|
|
if (zzbaVar3 != null) {
|
|
bundle.putBundle(AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_PARAMS, zzbaVar3.zzb());
|
|
}
|
|
}
|
|
arrayList.add(bundle);
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
public zznt(zzhj zzhjVar) {
|
|
super(zzhjVar);
|
|
this.zzh = null;
|
|
this.zzd = new AtomicLong(0L);
|
|
}
|
|
|
|
@WorkerThread
|
|
public final void zza(Bundle bundle, long j) {
|
|
long j2 = bundle.getLong("_et");
|
|
if (j2 != 0) {
|
|
zzj().zzu().zza("Params already contained engagement", Long.valueOf(j2));
|
|
}
|
|
bundle.putLong("_et", j + j2);
|
|
}
|
|
|
|
private static void zza(Bundle bundle, int i, String str, Object obj) {
|
|
if (zzb(bundle, i)) {
|
|
bundle.putString("_ev", zza(str, 40, true));
|
|
if (obj != null) {
|
|
Preconditions.checkNotNull(bundle);
|
|
if ((obj instanceof String) || (obj instanceof CharSequence)) {
|
|
bundle.putLong("_el", String.valueOf(obj).length());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@WorkerThread
|
|
public static void zza(zzkt zzktVar, Bundle bundle, boolean z) {
|
|
if (bundle == null || zzktVar == null || (bundle.containsKey("_sc") && !z)) {
|
|
if (bundle != null && zzktVar == null && z) {
|
|
bundle.remove("_sn");
|
|
bundle.remove("_sc");
|
|
bundle.remove("_si");
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
String str = zzktVar.zza;
|
|
if (str != null) {
|
|
bundle.putString("_sn", str);
|
|
} else {
|
|
bundle.remove("_sn");
|
|
}
|
|
String str2 = zzktVar.zzb;
|
|
if (str2 != null) {
|
|
bundle.putString("_sc", str2);
|
|
} else {
|
|
bundle.remove("_sc");
|
|
}
|
|
bundle.putLong("_si", zzktVar.zzc);
|
|
}
|
|
|
|
public final void zza(Bundle bundle, Bundle bundle2) {
|
|
if (bundle2 == null) {
|
|
return;
|
|
}
|
|
for (String str : bundle2.keySet()) {
|
|
if (!bundle.containsKey(str)) {
|
|
zzq().zza(bundle, str, bundle2.get(str));
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij
|
|
public final /* bridge */ /* synthetic */ void zzr() {
|
|
super.zzr();
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij
|
|
public final /* bridge */ /* synthetic */ void zzs() {
|
|
super.zzs();
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzij
|
|
public final /* bridge */ /* synthetic */ void zzt() {
|
|
super.zzt();
|
|
}
|
|
|
|
public final void zza(Parcelable[] parcelableArr, int i, boolean z) {
|
|
Preconditions.checkNotNull(parcelableArr);
|
|
for (Parcelable parcelable : parcelableArr) {
|
|
Bundle bundle = (Bundle) parcelable;
|
|
int i2 = 0;
|
|
for (String str : new TreeSet(bundle.keySet())) {
|
|
if (zzh(str) && !zza(str, zzit.zzd) && (i2 = i2 + 1) > i) {
|
|
if (z) {
|
|
zzj().zzh().zza("Param can't contain more than " + i + " item-scoped custom parameters", zzi().zzb(str), zzi().zza(bundle));
|
|
zzb(bundle, 28);
|
|
} else {
|
|
zzj().zzh().zza("Param cannot contain item-scoped custom parameters", zzi().zzb(str), zzi().zza(bundle));
|
|
zzb(bundle, 23);
|
|
}
|
|
bundle.remove(str);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void zza(zzga zzgaVar, int i) {
|
|
int i2 = 0;
|
|
for (String str : new TreeSet(zzgaVar.zzb.keySet())) {
|
|
if (zzh(str) && (i2 = i2 + 1) > i) {
|
|
zzj().zzh().zza("Event can't contain more than " + i + " params", zzi().zza(zzgaVar.zza), zzi().zza(zzgaVar.zzb));
|
|
zzb(zzgaVar.zzb, 5);
|
|
zzgaVar.zzb.remove(str);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void zza(zzns zznsVar, int i, String str, String str2, int i2) {
|
|
zza(zznsVar, (String) null, i, str, str2, i2);
|
|
}
|
|
|
|
public static void zza(zzns zznsVar, String str, int i, String str2, String str3, int i2) {
|
|
Bundle bundle = new Bundle();
|
|
zzb(bundle, i);
|
|
if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
|
|
bundle.putString(str2, str3);
|
|
}
|
|
if (i == 6 || i == 7 || i == 2) {
|
|
bundle.putLong("_el", i2);
|
|
}
|
|
zznsVar.zza(str, "_err", bundle);
|
|
}
|
|
|
|
@Override // com.google.android.gms.measurement.internal.zzim
|
|
@WorkerThread
|
|
public final void zzaa() {
|
|
zzt();
|
|
SecureRandom secureRandom = new SecureRandom();
|
|
long nextLong = secureRandom.nextLong();
|
|
if (nextLong == 0) {
|
|
nextLong = secureRandom.nextLong();
|
|
if (nextLong == 0) {
|
|
zzj().zzu().zza("Utils falling back to Random for random id");
|
|
}
|
|
}
|
|
this.zzd.set(nextLong);
|
|
}
|
|
|
|
public final void zza(Bundle bundle, String str, Object obj) {
|
|
if (bundle == null) {
|
|
return;
|
|
}
|
|
if (obj instanceof Long) {
|
|
bundle.putLong(str, ((Long) obj).longValue());
|
|
return;
|
|
}
|
|
if (obj instanceof String) {
|
|
bundle.putString(str, String.valueOf(obj));
|
|
return;
|
|
}
|
|
if (obj instanceof Double) {
|
|
bundle.putDouble(str, ((Double) obj).doubleValue());
|
|
} else if (obj instanceof Bundle[]) {
|
|
bundle.putParcelableArray(str, (Bundle[]) obj);
|
|
} else if (str != null) {
|
|
zzj().zzv().zza("Not putting event parameter. Invalid value type. name, type", zzi().zzb(str), obj != null ? obj.getClass().getSimpleName() : null);
|
|
}
|
|
}
|
|
|
|
public final void zza(com.google.android.gms.internal.measurement.zzdd zzddVar, boolean z) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putBoolean("r", z);
|
|
try {
|
|
zzddVar.zza(bundle);
|
|
} catch (RemoteException e) {
|
|
this.zzu.zzj().zzu().zza("Error returning boolean value to wrapper", e);
|
|
}
|
|
}
|
|
|
|
public final void zza(com.google.android.gms.internal.measurement.zzdd zzddVar, ArrayList<Bundle> arrayList) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putParcelableArrayList("r", arrayList);
|
|
try {
|
|
zzddVar.zza(bundle);
|
|
} catch (RemoteException e) {
|
|
this.zzu.zzj().zzu().zza("Error returning bundle list to wrapper", e);
|
|
}
|
|
}
|
|
|
|
public final void zza(com.google.android.gms.internal.measurement.zzdd zzddVar, Bundle bundle) {
|
|
try {
|
|
zzddVar.zza(bundle);
|
|
} catch (RemoteException e) {
|
|
this.zzu.zzj().zzu().zza("Error returning bundle value to wrapper", e);
|
|
}
|
|
}
|
|
|
|
public final void zza(com.google.android.gms.internal.measurement.zzdd zzddVar, byte[] bArr) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putByteArray("r", bArr);
|
|
try {
|
|
zzddVar.zza(bundle);
|
|
} catch (RemoteException e) {
|
|
this.zzu.zzj().zzu().zza("Error returning byte array to wrapper", e);
|
|
}
|
|
}
|
|
|
|
public final void zza(com.google.android.gms.internal.measurement.zzdd zzddVar, int i) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putInt("r", i);
|
|
try {
|
|
zzddVar.zza(bundle);
|
|
} catch (RemoteException e) {
|
|
this.zzu.zzj().zzu().zza("Error returning int value to wrapper", e);
|
|
}
|
|
}
|
|
|
|
public final void zza(com.google.android.gms.internal.measurement.zzdd zzddVar, long j) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putLong("r", j);
|
|
try {
|
|
zzddVar.zza(bundle);
|
|
} catch (RemoteException e) {
|
|
this.zzu.zzj().zzu().zza("Error returning long value to wrapper", e);
|
|
}
|
|
}
|
|
|
|
public final void zza(com.google.android.gms.internal.measurement.zzdd zzddVar, String str) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putString("r", str);
|
|
try {
|
|
zzddVar.zza(bundle);
|
|
} catch (RemoteException e) {
|
|
this.zzu.zzj().zzu().zza("Error returning string value to wrapper", e);
|
|
}
|
|
}
|
|
|
|
private final void zza(String str, String str2, String str3, Bundle bundle, List<String> list, boolean z) {
|
|
int zzl;
|
|
String str4;
|
|
int zza2;
|
|
if (bundle == null) {
|
|
return;
|
|
}
|
|
int zzc = zze().zzc();
|
|
int i = 0;
|
|
for (String str5 : new TreeSet(bundle.keySet())) {
|
|
if (list == null || !list.contains(str5)) {
|
|
zzl = !z ? zzl(str5) : 0;
|
|
if (zzl == 0) {
|
|
zzl = zzk(str5);
|
|
}
|
|
} else {
|
|
zzl = 0;
|
|
}
|
|
if (zzl != 0) {
|
|
zza(bundle, zzl, str5, zzl == 3 ? str5 : null);
|
|
bundle.remove(str5);
|
|
} else {
|
|
if (zza(bundle.get(str5))) {
|
|
zzj().zzv().zza("Nested Bundle parameters are not allowed; discarded. event name, param name, child param name", str2, str3, str5);
|
|
zza2 = 22;
|
|
str4 = str5;
|
|
} else {
|
|
str4 = str5;
|
|
zza2 = zza(str, str2, str5, bundle.get(str5), bundle, list, z, false);
|
|
}
|
|
if (zza2 != 0 && !"_ev".equals(str4)) {
|
|
zza(bundle, zza2, str4, bundle.get(str4));
|
|
bundle.remove(str4);
|
|
} else if (zzh(str4) && !zza(str4, zzit.zzd)) {
|
|
int i2 = i + 1;
|
|
if (!zza(231100000, true)) {
|
|
zzj().zzh().zza("Item array not supported on client's version of Google Play Services (Android Only)", zzi().zza(str2), zzi().zza(bundle));
|
|
zzb(bundle, 23);
|
|
bundle.remove(str4);
|
|
} else if (i2 > zzc) {
|
|
if (zzor.zza() && zze().zza(zzbh.zzbz)) {
|
|
zzj().zzh().zza("Item can't contain more than " + zzc + " item-scoped custom params", zzi().zza(str2), zzi().zza(bundle));
|
|
zzb(bundle, 28);
|
|
bundle.remove(str4);
|
|
} else {
|
|
zzj().zzh().zza("Item cannot contain custom parameters", zzi().zza(str2), zzi().zza(bundle));
|
|
zzb(bundle, 23);
|
|
bundle.remove(str4);
|
|
}
|
|
}
|
|
i = i2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private static boolean zzb(Bundle bundle, int i) {
|
|
if (bundle == null || bundle.getLong("_err") != 0) {
|
|
return false;
|
|
}
|
|
bundle.putLong("_err", i);
|
|
return true;
|
|
}
|
|
|
|
public static boolean zzd(String str) {
|
|
return zze(zzbh.zzbb.zza(null), str);
|
|
}
|
|
|
|
private static boolean zza(String str, String[] strArr) {
|
|
Preconditions.checkNotNull(strArr);
|
|
for (String str2 : strArr) {
|
|
if (Objects.equals(str, str2)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final boolean zza(String str, String str2) {
|
|
if (!TextUtils.isEmpty(str)) {
|
|
if (zzn(str)) {
|
|
return true;
|
|
}
|
|
if (this.zzu.zzae()) {
|
|
zzj().zzh().zza("Invalid google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI. provided id", zzfw.zza(str));
|
|
}
|
|
return false;
|
|
}
|
|
if (!TextUtils.isEmpty(str2)) {
|
|
if (zzn(str2)) {
|
|
return true;
|
|
}
|
|
zzj().zzh().zza("Invalid admob_app_id. Analytics disabled.", zzfw.zza(str2));
|
|
return false;
|
|
}
|
|
if (this.zzu.zzae()) {
|
|
zzj().zzh().zza("Missing google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI");
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final boolean zza(String str, int i, String str2) {
|
|
if (str2 == null) {
|
|
zzj().zzh().zza("Name is required and can't be null. Type", str);
|
|
return false;
|
|
}
|
|
if (str2.codePointCount(0, str2.length()) <= i) {
|
|
return true;
|
|
}
|
|
zzj().zzh().zza("Name is too long. Type, maximum supported length, name", str, Integer.valueOf(i), str2);
|
|
return false;
|
|
}
|
|
|
|
public final boolean zza(String str, String[] strArr, String str2) {
|
|
return zza(str, strArr, (String[]) null, str2);
|
|
}
|
|
|
|
public final boolean zza(String str, String[] strArr, String[] strArr2, String str2) {
|
|
if (str2 == null) {
|
|
zzj().zzh().zza("Name is required and can't be null. Type", str);
|
|
return false;
|
|
}
|
|
Preconditions.checkNotNull(str2);
|
|
for (String str3 : zza) {
|
|
if (str2.startsWith(str3)) {
|
|
zzj().zzh().zza("Name starts with reserved prefix. Type, name", str, str2);
|
|
return false;
|
|
}
|
|
}
|
|
if (strArr == null || !zza(str2, strArr)) {
|
|
return true;
|
|
}
|
|
if (strArr2 != null && zza(str2, strArr2)) {
|
|
return true;
|
|
}
|
|
zzj().zzh().zza("Name is reserved. Type, name", str, str2);
|
|
return false;
|
|
}
|
|
|
|
public final boolean zza(String str, String str2, int i, Object obj) {
|
|
if (obj != null && !(obj instanceof Long) && !(obj instanceof Float) && !(obj instanceof Integer) && !(obj instanceof Byte) && !(obj instanceof Short) && !(obj instanceof Boolean) && !(obj instanceof Double)) {
|
|
if (!(obj instanceof String) && !(obj instanceof Character) && !(obj instanceof CharSequence)) {
|
|
return false;
|
|
}
|
|
String valueOf = String.valueOf(obj);
|
|
if (valueOf.codePointCount(0, valueOf.length()) > i) {
|
|
zzj().zzv().zza("Value is too long; discarded. Value kind, name, value length", str, str2, Integer.valueOf(valueOf.length()));
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final boolean zzb(String str, String str2) {
|
|
if (str2 == null) {
|
|
zzj().zzh().zza("Name is required and can't be null. Type", str);
|
|
return false;
|
|
}
|
|
if (str2.length() == 0) {
|
|
zzj().zzh().zza("Name is required and can't be empty. Type", str);
|
|
return false;
|
|
}
|
|
int codePointAt = str2.codePointAt(0);
|
|
if (!Character.isLetter(codePointAt) && codePointAt != 95) {
|
|
zzj().zzh().zza("Name must start with a letter or _ (underscore). Type, name", str, str2);
|
|
return false;
|
|
}
|
|
int length = str2.length();
|
|
int charCount = Character.charCount(codePointAt);
|
|
while (charCount < length) {
|
|
int codePointAt2 = str2.codePointAt(charCount);
|
|
if (codePointAt2 != 95 && !Character.isLetterOrDigit(codePointAt2)) {
|
|
zzj().zzh().zza("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
|
|
return false;
|
|
}
|
|
charCount += Character.charCount(codePointAt2);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final boolean zzc(String str, String str2) {
|
|
if (str2 == null) {
|
|
zzj().zzh().zza("Name is required and can't be null. Type", str);
|
|
return false;
|
|
}
|
|
if (str2.length() == 0) {
|
|
zzj().zzh().zza("Name is required and can't be empty. Type", str);
|
|
return false;
|
|
}
|
|
int codePointAt = str2.codePointAt(0);
|
|
if (!Character.isLetter(codePointAt)) {
|
|
zzj().zzh().zza("Name must start with a letter. Type, name", str, str2);
|
|
return false;
|
|
}
|
|
int length = str2.length();
|
|
int charCount = Character.charCount(codePointAt);
|
|
while (charCount < length) {
|
|
int codePointAt2 = str2.codePointAt(charCount);
|
|
if (codePointAt2 != 95 && !Character.isLetterOrDigit(codePointAt2)) {
|
|
zzj().zzh().zza("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
|
|
return false;
|
|
}
|
|
charCount += Character.charCount(codePointAt2);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static boolean zza(Bundle bundle, int i) {
|
|
int i2 = 0;
|
|
if (bundle.size() <= i) {
|
|
return false;
|
|
}
|
|
for (String str : new TreeSet(bundle.keySet())) {
|
|
i2++;
|
|
if (i2 > i) {
|
|
bundle.remove(str);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@TargetApi(30)
|
|
@WorkerThread
|
|
private final boolean zzy() {
|
|
Integer num;
|
|
if (this.zzg == null) {
|
|
MeasurementManagerFutures zzn = zzn();
|
|
boolean z = false;
|
|
if (zzn == null) {
|
|
return false;
|
|
}
|
|
Integer num2 = null;
|
|
try {
|
|
num = (Integer) zzn.getMeasurementApiStatusAsync().get(WorkRequest.MIN_BACKOFF_MILLIS, TimeUnit.MILLISECONDS);
|
|
if (num != null) {
|
|
try {
|
|
if (num.intValue() == 1) {
|
|
z = true;
|
|
}
|
|
} catch (InterruptedException e) {
|
|
e = e;
|
|
num2 = num;
|
|
zzj().zzu().zza("Measurement manager api exception", e);
|
|
this.zzg = Boolean.FALSE;
|
|
num = num2;
|
|
zzj().zzp().zza("Measurement manager api status result", num);
|
|
return this.zzg.booleanValue();
|
|
} catch (CancellationException e2) {
|
|
e = e2;
|
|
num2 = num;
|
|
zzj().zzu().zza("Measurement manager api exception", e);
|
|
this.zzg = Boolean.FALSE;
|
|
num = num2;
|
|
zzj().zzp().zza("Measurement manager api status result", num);
|
|
return this.zzg.booleanValue();
|
|
} catch (ExecutionException e3) {
|
|
e = e3;
|
|
num2 = num;
|
|
zzj().zzu().zza("Measurement manager api exception", e);
|
|
this.zzg = Boolean.FALSE;
|
|
num = num2;
|
|
zzj().zzp().zza("Measurement manager api status result", num);
|
|
return this.zzg.booleanValue();
|
|
} catch (TimeoutException e4) {
|
|
e = e4;
|
|
num2 = num;
|
|
zzj().zzu().zza("Measurement manager api exception", e);
|
|
this.zzg = Boolean.FALSE;
|
|
num = num2;
|
|
zzj().zzp().zza("Measurement manager api status result", num);
|
|
return this.zzg.booleanValue();
|
|
}
|
|
}
|
|
this.zzg = Boolean.valueOf(z);
|
|
} catch (InterruptedException e5) {
|
|
e = e5;
|
|
} catch (CancellationException e6) {
|
|
e = e6;
|
|
} catch (ExecutionException e7) {
|
|
e = e7;
|
|
} catch (TimeoutException e8) {
|
|
e = e8;
|
|
}
|
|
zzj().zzp().zza("Measurement manager api status result", num);
|
|
}
|
|
return this.zzg.booleanValue();
|
|
}
|
|
|
|
@WorkerThread
|
|
public final boolean zze(String str) {
|
|
zzt();
|
|
if (Wrappers.packageManager(zza()).checkCallingOrSelfPermission(str) == 0) {
|
|
return true;
|
|
}
|
|
zzj().zzc().zza("Permission not granted", str);
|
|
return false;
|
|
}
|
|
|
|
public static boolean zzf(String str) {
|
|
return zze(zzbh.zzbw.zza(null), str);
|
|
}
|
|
|
|
public final boolean zzd(String str, String str2) {
|
|
if (zzpo.zza() && zze().zza(zzbh.zzbv) && !TextUtils.isEmpty(str2)) {
|
|
return true;
|
|
}
|
|
if (TextUtils.isEmpty(str)) {
|
|
return false;
|
|
}
|
|
return zze().zzn().equals(str);
|
|
}
|
|
|
|
public static boolean zza(Object obj) {
|
|
return (obj instanceof Parcelable[]) || (obj instanceof ArrayList) || (obj instanceof Bundle);
|
|
}
|
|
|
|
@VisibleForTesting
|
|
private final boolean zzb(Context context, String str) {
|
|
Signature[] signatureArr;
|
|
X500Principal x500Principal = new X500Principal("CN=Android Debug,O=Android,C=US");
|
|
try {
|
|
PackageInfo packageInfo = Wrappers.packageManager(context).getPackageInfo(str, 64);
|
|
if (packageInfo == null || (signatureArr = packageInfo.signatures) == null || signatureArr.length <= 0) {
|
|
return true;
|
|
}
|
|
return ((X509Certificate) CertificateFactory.getInstance(AndroidStaticDeviceInfoDataSource.CERTIFICATE_TYPE_X509).generateCertificate(new ByteArrayInputStream(signatureArr[0].toByteArray()))).getSubjectX500Principal().equals(x500Principal);
|
|
} catch (PackageManager.NameNotFoundException e) {
|
|
zzj().zzg().zza("Package name not found", e);
|
|
return true;
|
|
} catch (CertificateException e2) {
|
|
zzj().zzg().zza("Error obtaining certificate", e2);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
@WorkerThread
|
|
public final boolean zzw() {
|
|
zzt();
|
|
return zzh() == 1;
|
|
}
|
|
|
|
public final boolean zzx() {
|
|
try {
|
|
zza().getClassLoader().loadClass("com.google.firebase.remoteconfig.FirebaseRemoteConfig");
|
|
return true;
|
|
} catch (ClassNotFoundException unused) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public final boolean zza(int i, boolean z) {
|
|
Boolean zzab = this.zzu.zzr().zzab();
|
|
if (zzg() < i / 1000) {
|
|
return (zzab == null || zzab.booleanValue()) ? false : true;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static boolean zzg(String str) {
|
|
return !TextUtils.isEmpty(str) && str.startsWith("_");
|
|
}
|
|
|
|
public static boolean zzh(String str) {
|
|
Preconditions.checkNotEmpty(str);
|
|
return str.charAt(0) != '_' || str.equals("_ep");
|
|
}
|
|
|
|
public static boolean zza(Context context) {
|
|
ActivityInfo receiverInfo;
|
|
Preconditions.checkNotNull(context);
|
|
try {
|
|
PackageManager packageManager = context.getPackageManager();
|
|
if (packageManager != null && (receiverInfo = packageManager.getReceiverInfo(new ComponentName(context, "com.google.android.gms.measurement.AppMeasurementReceiver"), 0)) != null) {
|
|
if (receiverInfo.enabled) {
|
|
return true;
|
|
}
|
|
}
|
|
} catch (PackageManager.NameNotFoundException unused) {
|
|
}
|
|
return false;
|
|
}
|
|
|
|
private static boolean zzc(Context context, String str) {
|
|
ServiceInfo serviceInfo;
|
|
try {
|
|
PackageManager packageManager = context.getPackageManager();
|
|
if (packageManager != null && (serviceInfo = packageManager.getServiceInfo(new ComponentName(context, str), 0)) != null) {
|
|
if (serviceInfo.enabled) {
|
|
return true;
|
|
}
|
|
}
|
|
} catch (PackageManager.NameNotFoundException unused) {
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static boolean zza(Context context, boolean z) {
|
|
Preconditions.checkNotNull(context);
|
|
return zzc(context, "com.google.android.gms.measurement.AppMeasurementJobService");
|
|
}
|
|
|
|
public final boolean zzi(String str) {
|
|
List<ResolveInfo> queryIntentActivities;
|
|
return (TextUtils.isEmpty(str) || (queryIntentActivities = zza().getPackageManager().queryIntentActivities(new Intent("android.intent.action.VIEW", Uri.parse(str)), 0)) == null || queryIntentActivities.isEmpty()) ? false : true;
|
|
}
|
|
|
|
private static boolean zze(String str, String str2) {
|
|
return str.equals(ProxyConfig.MATCH_ALL_SCHEMES) || Arrays.asList(str.split(",")).contains(str2);
|
|
}
|
|
|
|
@SuppressLint({"ApplySharedPref"})
|
|
public final boolean zza(String str, double d) {
|
|
try {
|
|
SharedPreferences.Editor edit = zza().getSharedPreferences("google.analytics.deferred.deeplink.prefs", 0).edit();
|
|
edit.putString(SDKConstants.PARAM_TOURNAMENTS_DEEPLINK, str);
|
|
edit.putLong("timestamp", Double.doubleToRawLongBits(d));
|
|
return edit.commit();
|
|
} catch (RuntimeException e) {
|
|
zzj().zzg().zza("Failed to persist Deferred Deep Link. exception", e);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static boolean zza(Intent intent) {
|
|
String stringExtra = intent.getStringExtra("android.intent.extra.REFERRER_NAME");
|
|
return "android-app://com.google.android.googlequicksearchbox/https/www.google.com".equals(stringExtra) || "https://www.google.com".equals(stringExtra) || "android-app://com.google.appcrawler".equals(stringExtra);
|
|
}
|
|
|
|
public static boolean zzj(String str) {
|
|
for (String str2 : zzb) {
|
|
if (str2.equals(str)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static boolean zza(String str, String str2, String str3, String str4) {
|
|
boolean isEmpty = TextUtils.isEmpty(str);
|
|
boolean isEmpty2 = TextUtils.isEmpty(str2);
|
|
if (!isEmpty && !isEmpty2) {
|
|
Preconditions.checkNotNull(str);
|
|
return !str.equals(str2);
|
|
}
|
|
if (isEmpty && isEmpty2) {
|
|
return (TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4)) ? !TextUtils.isEmpty(str4) : !str3.equals(str4);
|
|
}
|
|
if (isEmpty || !isEmpty2) {
|
|
return TextUtils.isEmpty(str3) || !str3.equals(str4);
|
|
}
|
|
if (TextUtils.isEmpty(str4)) {
|
|
return false;
|
|
}
|
|
return TextUtils.isEmpty(str3) || !str3.equals(str4);
|
|
}
|
|
|
|
@VisibleForTesting
|
|
private static boolean zzn(String str) {
|
|
Preconditions.checkNotNull(str);
|
|
return str.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$");
|
|
}
|
|
|
|
public static byte[] zza(Parcelable parcelable) {
|
|
if (parcelable == null) {
|
|
return null;
|
|
}
|
|
Parcel obtain = Parcel.obtain();
|
|
try {
|
|
parcelable.writeToParcel(obtain, 0);
|
|
return obtain.marshall();
|
|
} finally {
|
|
obtain.recycle();
|
|
}
|
|
}
|
|
|
|
public static Bundle[] zzb(Object obj) {
|
|
if (obj instanceof Bundle) {
|
|
return new Bundle[]{(Bundle) obj};
|
|
}
|
|
if (obj instanceof Parcelable[]) {
|
|
Parcelable[] parcelableArr = (Parcelable[]) obj;
|
|
return (Bundle[]) Arrays.copyOf(parcelableArr, parcelableArr.length, Bundle[].class);
|
|
}
|
|
if (!(obj instanceof ArrayList)) {
|
|
return null;
|
|
}
|
|
ArrayList arrayList = (ArrayList) obj;
|
|
return (Bundle[]) arrayList.toArray(new Bundle[arrayList.size()]);
|
|
}
|
|
}
|