what-the-bank/sources/com/google/firebase/analytics/connector/internal/zzc.java

210 lines
11 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.analytics.connector.internal;
import android.os.Bundle;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.util.ArrayUtils;
import com.google.android.gms.measurement.AppMeasurement;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.google.android.gms.measurement.internal.zzgr;
import com.google.android.gms.measurement.internal.zzgs;
import com.google.android.gms.measurement.internal.zzgu;
import com.google.android.gms.measurement.internal.zzig;
import com.google.firebase.analytics.connector.AnalyticsConnector;
import com.google.firebase.crashlytics.internal.analytics.AnalyticsConnectorReceiver;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
/* loaded from: classes2.dex */
public final class zzc {
private static final Set<String> zza = new HashSet(Arrays.asList("_in", "_xa", "_xu", "_aq", "_aa", "_ai", "_ac", "campaign_details", "_ug", "_iapx", "_exp_set", "_exp_clear", "_exp_activate", "_exp_timeout", "_exp_expire"));
private static final List<String> zzb = Arrays.asList("_e", "_f", "_iap", "_s", "_au", "_ui", "_cd");
private static final List<String> zzc = Arrays.asList("auto", "app", "am");
private static final List<String> zzd = Arrays.asList("_r", "_dbg");
private static final List<String> zze = Arrays.asList((String[]) ArrayUtils.concat(zzgu.zza, zzgu.zzb));
private static final List<String> zzf = Arrays.asList("^_ltv_[A-Z]{3}$", "^_cc[1-5]{1}$");
public static Bundle zza(AnalyticsConnector.ConditionalUserProperty conditionalUserProperty) {
Bundle bundle = new Bundle();
if (conditionalUserProperty.origin != null) {
bundle.putString("origin", conditionalUserProperty.origin);
}
if (conditionalUserProperty.name != null) {
bundle.putString("name", conditionalUserProperty.name);
}
if (conditionalUserProperty.value != null) {
zzgr.zzb(bundle, conditionalUserProperty.value);
}
if (conditionalUserProperty.triggerEventName != null) {
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.TRIGGER_EVENT_NAME, conditionalUserProperty.triggerEventName);
}
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.TRIGGER_TIMEOUT, conditionalUserProperty.triggerTimeout);
if (conditionalUserProperty.timedOutEventName != null) {
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_NAME, conditionalUserProperty.timedOutEventName);
}
if (conditionalUserProperty.timedOutEventParams != null) {
bundle.putBundle(AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_PARAMS, conditionalUserProperty.timedOutEventParams);
}
if (conditionalUserProperty.triggeredEventName != null) {
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_NAME, conditionalUserProperty.triggeredEventName);
}
if (conditionalUserProperty.triggeredEventParams != null) {
bundle.putBundle(AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_PARAMS, conditionalUserProperty.triggeredEventParams);
}
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.TIME_TO_LIVE, conditionalUserProperty.timeToLive);
if (conditionalUserProperty.expiredEventName != null) {
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_NAME, conditionalUserProperty.expiredEventName);
}
if (conditionalUserProperty.expiredEventParams != null) {
bundle.putBundle(AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_PARAMS, conditionalUserProperty.expiredEventParams);
}
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.CREATION_TIMESTAMP, conditionalUserProperty.creationTimestamp);
bundle.putBoolean(AppMeasurementSdk.ConditionalUserProperty.ACTIVE, conditionalUserProperty.active);
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_TIMESTAMP, conditionalUserProperty.triggeredTimestamp);
return bundle;
}
public static AnalyticsConnector.ConditionalUserProperty zzb(Bundle bundle) {
Preconditions.checkNotNull(bundle);
AnalyticsConnector.ConditionalUserProperty conditionalUserProperty = new AnalyticsConnector.ConditionalUserProperty();
conditionalUserProperty.origin = (String) Preconditions.checkNotNull((String) zzgr.zza(bundle, "origin", String.class, null));
conditionalUserProperty.name = (String) Preconditions.checkNotNull((String) zzgr.zza(bundle, "name", String.class, null));
conditionalUserProperty.value = zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.VALUE, Object.class, null);
conditionalUserProperty.triggerEventName = (String) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGER_EVENT_NAME, String.class, null);
conditionalUserProperty.triggerTimeout = ((Long) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGER_TIMEOUT, Long.class, 0L)).longValue();
conditionalUserProperty.timedOutEventName = (String) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_NAME, String.class, null);
conditionalUserProperty.timedOutEventParams = (Bundle) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_PARAMS, Bundle.class, null);
conditionalUserProperty.triggeredEventName = (String) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_NAME, String.class, null);
conditionalUserProperty.triggeredEventParams = (Bundle) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_PARAMS, Bundle.class, null);
conditionalUserProperty.timeToLive = ((Long) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TIME_TO_LIVE, Long.class, 0L)).longValue();
conditionalUserProperty.expiredEventName = (String) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_NAME, String.class, null);
conditionalUserProperty.expiredEventParams = (Bundle) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_PARAMS, Bundle.class, null);
conditionalUserProperty.active = ((Boolean) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.ACTIVE, Boolean.class, Boolean.FALSE)).booleanValue();
conditionalUserProperty.creationTimestamp = ((Long) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.CREATION_TIMESTAMP, Long.class, 0L)).longValue();
conditionalUserProperty.triggeredTimestamp = ((Long) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_TIMESTAMP, Long.class, 0L)).longValue();
return conditionalUserProperty;
}
public static String zzc(String str) {
String zza2 = zzgs.zza(str);
return zza2 != null ? zza2 : str;
}
public static void zze(String str, String str2, Bundle bundle) {
if ("clx".equals(str) && AnalyticsConnectorReceiver.APP_EXCEPTION_EVENT_NAME.equals(str2)) {
bundle.putLong("_r", 1L);
}
}
public static boolean zzh(String str, String str2, Bundle bundle) {
char c;
if (!"_cmp".equals(str2)) {
return true;
}
if (!zzl(str) || bundle == null) {
return false;
}
Iterator<String> it = zzd.iterator();
while (it.hasNext()) {
if (bundle.containsKey(it.next())) {
return false;
}
}
int hashCode = str.hashCode();
if (hashCode == 101200) {
if (str.equals(AppMeasurement.FCM_ORIGIN)) {
c = 0;
}
c = 65535;
} else if (hashCode != 101230) {
if (hashCode == 3142703 && str.equals(AppMeasurement.FIAM_ORIGIN)) {
c = 2;
}
c = 65535;
} else {
if (str.equals("fdl")) {
c = 1;
}
c = 65535;
}
if (c == 0) {
bundle.putString("_cis", "fcm_integration");
return true;
}
if (c == 1) {
bundle.putString("_cis", "fdl_integration");
return true;
}
if (c != 2) {
return false;
}
bundle.putString("_cis", "fiam_integration");
return true;
}
public static boolean zzi(AnalyticsConnector.ConditionalUserProperty conditionalUserProperty) {
String str;
if (conditionalUserProperty == null || (str = conditionalUserProperty.origin) == null || str.isEmpty()) {
return false;
}
if ((conditionalUserProperty.value != null && zzig.zza(conditionalUserProperty.value) == null) || !zzl(str) || !zzm(str, conditionalUserProperty.name)) {
return false;
}
if (conditionalUserProperty.expiredEventName != null && (!zzj(conditionalUserProperty.expiredEventName, conditionalUserProperty.expiredEventParams) || !zzh(str, conditionalUserProperty.expiredEventName, conditionalUserProperty.expiredEventParams))) {
return false;
}
if (conditionalUserProperty.triggeredEventName != null && (!zzj(conditionalUserProperty.triggeredEventName, conditionalUserProperty.triggeredEventParams) || !zzh(str, conditionalUserProperty.triggeredEventName, conditionalUserProperty.triggeredEventParams))) {
return false;
}
if (conditionalUserProperty.timedOutEventName != null) {
return zzj(conditionalUserProperty.timedOutEventName, conditionalUserProperty.timedOutEventParams) && zzh(str, conditionalUserProperty.timedOutEventName, conditionalUserProperty.timedOutEventParams);
}
return true;
}
public static boolean zzj(String str, Bundle bundle) {
if (zzb.contains(str)) {
return false;
}
if (bundle == null) {
return true;
}
Iterator<String> it = zzd.iterator();
while (it.hasNext()) {
if (bundle.containsKey(it.next())) {
return false;
}
}
return true;
}
public static boolean zzk(String str) {
return !zza.contains(str);
}
public static boolean zzl(String str) {
return !zzc.contains(str);
}
public static boolean zzm(String str, String str2) {
if ("_ce1".equals(str2) || "_ce2".equals(str2)) {
return str.equals(AppMeasurement.FCM_ORIGIN) || str.equals("frc");
}
if ("_ln".equals(str2)) {
return str.equals(AppMeasurement.FCM_ORIGIN) || str.equals(AppMeasurement.FIAM_ORIGIN);
}
if (zze.contains(str2)) {
return false;
}
Iterator<String> it = zzf.iterator();
while (it.hasNext()) {
if (str2.matches(it.next())) {
return false;
}
}
return true;
}
}