what-the-bank/sources/com/google/android/gms/measurement/AppMeasurement.java

300 lines
13 KiB
Java

package com.google.android.gms.measurement;
import android.content.Context;
import android.os.Bundle;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.internal.measurement.zzcl;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.google.android.gms.measurement.internal.zzfv;
import com.google.android.gms.measurement.internal.zzgr;
import com.google.android.gms.measurement.internal.zzgv;
import com.google.android.gms.measurement.internal.zzgw;
import com.google.android.gms.measurement.internal.zzib;
import com.google.android.gms.measurement.internal.zzig;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@Deprecated
/* loaded from: classes.dex */
public class AppMeasurement {
public static final String CRASH_ORIGIN = "crash";
public static final String FCM_ORIGIN = "fcm";
public static final String FIAM_ORIGIN = "fiam";
private static volatile AppMeasurement zza;
private final zzd zzb;
/* loaded from: classes.dex */
public interface EventInterceptor extends zzgv {
@Override // com.google.android.gms.measurement.internal.zzgv
void interceptEvent(String str, String str2, Bundle bundle, long j);
}
/* loaded from: classes.dex */
public interface OnEventListener extends zzgw {
@Override // com.google.android.gms.measurement.internal.zzgw
void onEvent(String str, String str2, Bundle bundle, long j);
}
public AppMeasurement(zzfv zzfvVar) {
this.zzb = new zza(zzfvVar);
}
@Deprecated
public static AppMeasurement getInstance(Context context) {
zzib zzibVar;
if (zza == null) {
synchronized (AppMeasurement.class) {
if (zza == null) {
try {
zzibVar = (zzib) Class.forName("com.google.firebase.analytics.FirebaseAnalytics").getDeclaredMethod("getScionFrontendApiImplementation", Context.class, Bundle.class).invoke(null, context, null);
} catch (ClassNotFoundException | Exception unused) {
zzibVar = null;
}
if (zzibVar == null) {
zza = new AppMeasurement(zzfv.zzp(context, new zzcl(0L, 0L, true, null, null, null, null, null), null));
} else {
zza = new AppMeasurement(zzibVar);
}
}
}
}
return zza;
}
public void beginAdUnitExposure(String str) {
this.zzb.zzp(str);
}
public void clearConditionalUserProperty(String str, String str2, Bundle bundle) {
this.zzb.zzq(str, str2, bundle);
}
public void endAdUnitExposure(String str) {
this.zzb.zzr(str);
}
public long generateEventId() {
return this.zzb.zzb();
}
public String getAppInstanceId() {
return this.zzb.zzh();
}
public Boolean getBoolean() {
return this.zzb.zzc();
}
public List<ConditionalUserProperty> getConditionalUserProperties(String str, String str2) {
List<Bundle> zzm = this.zzb.zzm(str, str2);
ArrayList arrayList = new ArrayList(zzm == null ? 0 : zzm.size());
Iterator<Bundle> it = zzm.iterator();
while (it.hasNext()) {
arrayList.add(new ConditionalUserProperty(it.next()));
}
return arrayList;
}
public String getCurrentScreenClass() {
return this.zzb.zzi();
}
public String getCurrentScreenName() {
return this.zzb.zzj();
}
public Double getDouble() {
return this.zzb.zzd();
}
public String getGmpAppId() {
return this.zzb.zzk();
}
public Integer getInteger() {
return this.zzb.zze();
}
public Long getLong() {
return this.zzb.zzf();
}
public int getMaxUserProperties(String str) {
return this.zzb.zza(str);
}
public String getString() {
return this.zzb.zzl();
}
protected Map<String, Object> getUserProperties(String str, String str2, boolean z) {
return this.zzb.zzo(str, str2, z);
}
public void logEventInternal(String str, String str2, Bundle bundle) {
this.zzb.zzs(str, str2, bundle);
}
public void logEventInternalNoInterceptor(String str, String str2, Bundle bundle, long j) {
this.zzb.zzt(str, str2, bundle, j);
}
public void registerOnMeasurementEventListener(OnEventListener onEventListener) {
this.zzb.zzu(onEventListener);
}
public void setConditionalUserProperty(ConditionalUserProperty conditionalUserProperty) {
Preconditions.checkNotNull(conditionalUserProperty);
zzd zzdVar = this.zzb;
Bundle bundle = new Bundle();
String str = conditionalUserProperty.mAppId;
if (str != null) {
bundle.putString(HiAnalyticsConstant.BI_KEY_APP_ID, str);
}
String str2 = conditionalUserProperty.mOrigin;
if (str2 != null) {
bundle.putString("origin", str2);
}
String str3 = conditionalUserProperty.mName;
if (str3 != null) {
bundle.putString("name", str3);
}
Object obj = conditionalUserProperty.mValue;
if (obj != null) {
zzgr.zzb(bundle, obj);
}
String str4 = conditionalUserProperty.mTriggerEventName;
if (str4 != null) {
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.TRIGGER_EVENT_NAME, str4);
}
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.TRIGGER_TIMEOUT, conditionalUserProperty.mTriggerTimeout);
String str5 = conditionalUserProperty.mTimedOutEventName;
if (str5 != null) {
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_NAME, str5);
}
Bundle bundle2 = conditionalUserProperty.mTimedOutEventParams;
if (bundle2 != null) {
bundle.putBundle(AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_PARAMS, bundle2);
}
String str6 = conditionalUserProperty.mTriggeredEventName;
if (str6 != null) {
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_NAME, str6);
}
Bundle bundle3 = conditionalUserProperty.mTriggeredEventParams;
if (bundle3 != null) {
bundle.putBundle(AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_PARAMS, bundle3);
}
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.TIME_TO_LIVE, conditionalUserProperty.mTimeToLive);
String str7 = conditionalUserProperty.mExpiredEventName;
if (str7 != null) {
bundle.putString(AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_NAME, str7);
}
Bundle bundle4 = conditionalUserProperty.mExpiredEventParams;
if (bundle4 != null) {
bundle.putBundle(AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_PARAMS, bundle4);
}
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.CREATION_TIMESTAMP, conditionalUserProperty.mCreationTimestamp);
bundle.putBoolean(AppMeasurementSdk.ConditionalUserProperty.ACTIVE, conditionalUserProperty.mActive);
bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_TIMESTAMP, conditionalUserProperty.mTriggeredTimestamp);
zzdVar.zzv(bundle);
}
public void setEventInterceptor(EventInterceptor eventInterceptor) {
this.zzb.zzw(eventInterceptor);
}
public void unregisterOnMeasurementEventListener(OnEventListener onEventListener) {
this.zzb.zzx(onEventListener);
}
public AppMeasurement(zzib zzibVar) {
this.zzb = new zzb(zzibVar);
}
public Map<String, Object> getUserProperties(boolean z) {
return this.zzb.zzn(z);
}
/* loaded from: classes2.dex */
public static class ConditionalUserProperty {
public boolean mActive;
public String mAppId;
public long mCreationTimestamp;
public String mExpiredEventName;
public Bundle mExpiredEventParams;
public String mName;
public String mOrigin;
public long mTimeToLive;
public String mTimedOutEventName;
public Bundle mTimedOutEventParams;
public String mTriggerEventName;
public long mTriggerTimeout;
public String mTriggeredEventName;
public Bundle mTriggeredEventParams;
public long mTriggeredTimestamp;
public Object mValue;
ConditionalUserProperty(Bundle bundle) {
Preconditions.checkNotNull(bundle);
this.mAppId = (String) zzgr.zza(bundle, HiAnalyticsConstant.BI_KEY_APP_ID, String.class, null);
this.mOrigin = (String) zzgr.zza(bundle, "origin", String.class, null);
this.mName = (String) zzgr.zza(bundle, "name", String.class, null);
this.mValue = zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.VALUE, Object.class, null);
this.mTriggerEventName = (String) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGER_EVENT_NAME, String.class, null);
this.mTriggerTimeout = ((Long) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGER_TIMEOUT, Long.class, 0L)).longValue();
this.mTimedOutEventName = (String) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_NAME, String.class, null);
this.mTimedOutEventParams = (Bundle) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TIMED_OUT_EVENT_PARAMS, Bundle.class, null);
this.mTriggeredEventName = (String) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_NAME, String.class, null);
this.mTriggeredEventParams = (Bundle) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_EVENT_PARAMS, Bundle.class, null);
this.mTimeToLive = ((Long) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TIME_TO_LIVE, Long.class, 0L)).longValue();
this.mExpiredEventName = (String) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_NAME, String.class, null);
this.mExpiredEventParams = (Bundle) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.EXPIRED_EVENT_PARAMS, Bundle.class, null);
this.mActive = ((Boolean) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.ACTIVE, Boolean.class, Boolean.FALSE)).booleanValue();
this.mCreationTimestamp = ((Long) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.CREATION_TIMESTAMP, Long.class, 0L)).longValue();
this.mTriggeredTimestamp = ((Long) zzgr.zza(bundle, AppMeasurementSdk.ConditionalUserProperty.TRIGGERED_TIMESTAMP, Long.class, 0L)).longValue();
}
public ConditionalUserProperty(ConditionalUserProperty conditionalUserProperty) {
Preconditions.checkNotNull(conditionalUserProperty);
this.mAppId = conditionalUserProperty.mAppId;
this.mOrigin = conditionalUserProperty.mOrigin;
this.mCreationTimestamp = conditionalUserProperty.mCreationTimestamp;
this.mName = conditionalUserProperty.mName;
Object obj = conditionalUserProperty.mValue;
if (obj != null) {
Object zza = zzig.zza(obj);
this.mValue = zza;
if (zza == null) {
this.mValue = conditionalUserProperty.mValue;
}
}
this.mActive = conditionalUserProperty.mActive;
this.mTriggerEventName = conditionalUserProperty.mTriggerEventName;
this.mTriggerTimeout = conditionalUserProperty.mTriggerTimeout;
this.mTimedOutEventName = conditionalUserProperty.mTimedOutEventName;
Bundle bundle = conditionalUserProperty.mTimedOutEventParams;
if (bundle != null) {
this.mTimedOutEventParams = new Bundle(bundle);
}
this.mTriggeredEventName = conditionalUserProperty.mTriggeredEventName;
Bundle bundle2 = conditionalUserProperty.mTriggeredEventParams;
if (bundle2 != null) {
this.mTriggeredEventParams = new Bundle(bundle2);
}
this.mTriggeredTimestamp = conditionalUserProperty.mTriggeredTimestamp;
this.mTimeToLive = conditionalUserProperty.mTimeToLive;
this.mExpiredEventName = conditionalUserProperty.mExpiredEventName;
Bundle bundle3 = conditionalUserProperty.mExpiredEventParams;
if (bundle3 != null) {
this.mExpiredEventParams = new Bundle(bundle3);
}
}
public ConditionalUserProperty() {
}
}
}