CONECTA PRO v4.2.8版本的 MD5 值为:ad88cf9e66d8cdaae8c40233e50eb389
以下内容为反编译后的 m7.java 源代码,内容仅作参考
package i5;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
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 android.util.Log;
import com.google.android.gms.internal.measurement.fa;
import java.io.ByteArrayInputStream;
import java.math.BigInteger;
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.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
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.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import javax.security.auth.x500.X500Principal;
public final class m7 extends j5 {
public SecureRandom f5513t;
public final AtomicLong f5514u;
public int f5515v;
public a1.d f5516w;
public Boolean f5517x;
public Integer f5518y;
public static final String[] f5512z = {"firebase_", "google_", "ga_"};
public static final String[] A = {"_err"};
public m7(x4 x4Var) {
super(x4Var);
this.f5518y = null;
this.f5514u = new AtomicLong(0L);
}
public static int A0(String str) {
if ("_ldl".equals(str)) {
return 2048;
}
if ("_id".equals(str)) {
return 256;
}
return ("_lgclid".equals(str) || "_gbraid".equals(str)) ? 100 : 36;
}
public static Bundle C(List list) {
Bundle bundle = new Bundle();
if (list == null) {
return bundle;
}
Iterator it = list.iterator();
while (it.hasNext()) {
j7 j7Var = (j7) it.next();
String str = j7Var.f5441v;
String str2 = j7Var.f5438s;
if (str != null) {
bundle.putString(str2, str);
} else {
Long l10 = j7Var.f5440u;
if (l10 != null) {
bundle.putLong(str2, l10.longValue());
} else {
Double d10 = j7Var.f5443x;
if (d10 != null) {
bundle.putDouble(str2, d10.doubleValue());
}
}
}
}
return bundle;
}
public static MessageDigest E0() {
MessageDigest messageDigest;
for (int i10 = 0; i10 < 2; i10++) {
try {
messageDigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException unused) {
}
if (messageDigest != null) {
return messageDigest;
}
}
return null;
}
public static String F(int i10, String str, boolean z10) {
if (str == null) {
return null;
}
if (str.codePointCount(0, str.length()) > i10) {
if (!z10) {
return null;
}
return a.d.j(str.substring(0, str.offsetByCodePoints(0, i10)), "...");
}
return str;
}
public static void G(Bundle bundle, int i10, String str, Object obj) {
if (l0(i10, bundle)) {
bundle.putString("_ev", F(40, str, true));
if (obj != null) {
if ((obj instanceof String) || (obj instanceof CharSequence)) {
bundle.putLong("_el", String.valueOf(obj).length());
}
}
}
}
public static void Q(z4 z4Var, String str, int i10, String str2, String str3, int i11) {
Bundle bundle = new Bundle();
l0(i10, bundle);
if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
bundle.putString(str2, str3);
}
if (i10 == 6 || i10 == 7 || i10 == 2) {
bundle.putLong("_el", i11);
}
z4Var.u(str, "_err", bundle);
}
public static void R(i6 i6Var, Bundle bundle, boolean z10) {
if (bundle == null || i6Var == null || (bundle.containsKey("_sc") && !z10)) {
if (bundle != null && i6Var == null && z10) {
bundle.remove("_sn");
bundle.remove("_sc");
bundle.remove("_si");
return;
}
return;
}
String str = i6Var.f5412a;
if (str != null) {
bundle.putString("_sn", str);
} else {
bundle.remove("_sn");
}
String str2 = i6Var.f5413b;
if (str2 != null) {
bundle.putString("_sc", str2);
} else {
bundle.remove("_sc");
}
bundle.putLong("_si", i6Var.f5414c);
}
public static boolean V(Context context) {
ActivityInfo receiverInfo;
p1.b.i(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;
}
public static boolean W(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 X(Object obj) {
return (obj instanceof Parcelable[]) || (obj instanceof ArrayList) || (obj instanceof Bundle);
}
public static boolean b0(String str, String str2, String str3, String str4) {
boolean isEmpty = TextUtils.isEmpty(str);
boolean isEmpty2 = TextUtils.isEmpty(str2);
if (!isEmpty && !isEmpty2) {
p1.b.i(str);
return !str.equals(str2);
} else if (isEmpty && isEmpty2) {
return (TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4)) ? !TextUtils.isEmpty(str4) : !str3.equals(str4);
} else if (isEmpty || !isEmpty2) {
return TextUtils.isEmpty(str3) || !str3.equals(str4);
} else if (TextUtils.isEmpty(str4)) {
return false;
} else {
return TextUtils.isEmpty(str3) || !str3.equals(str4);
}
}
public static boolean c0(String str, String[] strArr) {
boolean z10;
p1.b.i(strArr);
for (String str2 : strArr) {
if (str != str2 && (str == null || !str.equals(str2))) {
z10 = false;
} else {
z10 = true;
}
if (z10) {
return true;
}
}
return false;
}
public static byte[] e0(Parcelable parcelable) {
if (parcelable == null) {
return null;
}
Parcel obtain = Parcel.obtain();
try {
parcelable.writeToParcel(obtain, 0);
return obtain.marshall();
} finally {
obtain.recycle();
}
}
public static boolean g0(Context context) {
p1.b.i(context);
return p0(context, Build.VERSION.SDK_INT >= 24 ? "com.google.android.gms.measurement.AppMeasurementJobService" : "com.google.android.gms.measurement.AppMeasurementService");
}
public static ArrayList k0(List list) {
if (list == null) {
return new ArrayList(0);
}
ArrayList arrayList = new ArrayList(list.size());
Iterator it = list.iterator();
while (it.hasNext()) {
e eVar = (e) it.next();
Bundle bundle = new Bundle();
bundle.putString("app_id", eVar.f5319r);
bundle.putString("origin", eVar.f5320s);
bundle.putLong("creation_timestamp", eVar.f5322u);
bundle.putString("name", eVar.f5321t.f5438s);
Object c10 = eVar.f5321t.c();
p1.b.i(c10);
com.bumptech.glide.e.F(bundle, c10);
bundle.putBoolean("active", eVar.f5323v);
String str = eVar.f5324w;
if (str != null) {
bundle.putString("trigger_event_name", str);
}
v vVar = eVar.f5325x;
if (vVar != null) {
bundle.putString("timed_out_event_name", vVar.f5718r);
t tVar = vVar.f5719s;
if (tVar != null) {
bundle.putBundle("timed_out_event_params", tVar.e());
}
}
bundle.putLong("trigger_timeout", eVar.f5326y);
v vVar2 = eVar.f5327z;
if (vVar2 != null) {
bundle.putString("triggered_event_name", vVar2.f5718r);
t tVar2 = vVar2.f5719s;
if (tVar2 != null) {
bundle.putBundle("triggered_event_params", tVar2.e());
}
}
bundle.putLong("triggered_timestamp", eVar.f5321t.f5439t);
bundle.putLong("time_to_live", eVar.A);
v vVar3 = eVar.B;
if (vVar3 != null) {
bundle.putString("expired_event_name", vVar3.f5718r);
t tVar3 = vVar3.f5719s;
if (tVar3 != null) {
bundle.putBundle("expired_event_params", tVar3.e());
}
}
arrayList.add(bundle);
}
return arrayList;
}
public static boolean l0(int i10, Bundle bundle) {
if (bundle != null && bundle.getLong("_err") == 0) {
bundle.putLong("_err", i10);
return true;
}
return false;
}
public static boolean p0(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 r0(String str) {
String str2 = (String) x.Z.a(null);
return str2.equals("*") || Arrays.asList(str2.split(",")).contains(str);
}
public static boolean u0(String str) {
return !TextUtils.isEmpty(str) && str.startsWith("_");
}
public static boolean w0(String str) {
p1.b.f(str);
return str.charAt(0) != '_' || str.equals("_ep");
}
public static long y(t tVar) {
long j10 = 0;
if (tVar == null) {
return 0L;
}
androidx.datastore.preferences.protobuf.v1 v1Var = new androidx.datastore.preferences.protobuf.v1(tVar);
while (v1Var.hasNext()) {
Object obj = tVar.f5650r.get((String) v1Var.next());
if (obj instanceof Parcelable[]) {
j10 += ((Parcelable[]) obj).length;
}
}
return j10;
}
public static long z(byte[] bArr) {
boolean z10;
p1.b.i(bArr);
int i10 = 0;
if (bArr.length > 0) {
z10 = true;
} else {
z10 = false;
}
if (z10) {
long j10 = 0;
for (int length = bArr.length - 1; length >= 0 && length >= bArr.length - 8; length--) {
j10 += (bArr[length] & 255) << i10;
i10 += 8;
}
return j10;
}
throw new IllegalStateException();
}
public final Bundle A(Uri uri, boolean z10, boolean z11) {
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 = z11 ? uri.getQueryParameter("gbraid") : null;
str6 = uri.getQueryParameter("utm_id");
str7 = uri.getQueryParameter("dclid");
str8 = uri.getQueryParameter("srsltid");
str9 = z10 ? uri.getQueryParameter("sfmc_id") : null;
} 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) && ((!z11 || TextUtils.isEmpty(str5)) && TextUtils.isEmpty(str6) && TextUtils.isEmpty(str7) && TextUtils.isEmpty(str8) && (!z10 || TextUtils.isEmpty(str9)))) {
return null;
}
Bundle bundle = new Bundle();
if (TextUtils.isEmpty(str)) {
str10 = "sfmc_id";
} else {
str10 = "sfmc_id";
bundle.putString("campaign", str);
}
if (!TextUtils.isEmpty(str2)) {
bundle.putString("source", str2);
}
if (!TextUtils.isEmpty(str3)) {
bundle.putString("medium", str3);
}
if (!TextUtils.isEmpty(str4)) {
bundle.putString("gclid", str4);
}
if (z11 && !TextUtils.isEmpty(str5)) {
bundle.putString("gbraid", str5);
}
String queryParameter = uri.getQueryParameter("utm_term");
if (!TextUtils.isEmpty(queryParameter)) {
bundle.putString("term", queryParameter);
}
String queryParameter2 = uri.getQueryParameter("utm_content");
if (!TextUtils.isEmpty(queryParameter2)) {
bundle.putString("content", queryParameter2);
}
String queryParameter3 = uri.getQueryParameter("aclid");
if (!TextUtils.isEmpty(queryParameter3)) {
bundle.putString("aclid", queryParameter3);
}
String queryParameter4 = uri.getQueryParameter("cp1");
if (!TextUtils.isEmpty(queryParameter4)) {
bundle.putString("cp1", queryParameter4);
}
String queryParameter5 = uri.getQueryParameter("anid");
if (!TextUtils.isEmpty(queryParameter5)) {
bundle.putString("anid", queryParameter5);
}
if (!TextUtils.isEmpty(str6)) {
bundle.putString("campaign_id", str6);
}
if (!TextUtils.isEmpty(str7)) {
bundle.putString("dclid", str7);
}
String queryParameter6 = uri.getQueryParameter("utm_source_platform");
if (!TextUtils.isEmpty(queryParameter6)) {
bundle.putString("source_platform", queryParameter6);
}
String queryParameter7 = uri.getQueryParameter("utm_creative_format");
if (!TextUtils.isEmpty(queryParameter7)) {
bundle.putString("creative_format", queryParameter7);
}
String queryParameter8 = uri.getQueryParameter("utm_marketing_tactic");
if (!TextUtils.isEmpty(queryParameter8)) {
bundle.putString("marketing_tactic", queryParameter8);
}
if (!TextUtils.isEmpty(str8)) {
bundle.putString("srsltid", str8);
}
if (z10 && !TextUtils.isEmpty(str9)) {
bundle.putString(str10, str9);
}
return bundle;
} catch (UnsupportedOperationException e10) {
c().f5290z.c("Install referrer url isn't a hierarchical URI", e10);
return null;
}
}
public final Bundle B(String str, Bundle bundle, List list, boolean z10) {
int i10;
int i11;
String str2;
String str3;
m7 m7Var = this;
boolean c02 = c0(str, com.bumptech.glide.f.f2015i);
if (bundle != null) {
Bundle bundle2 = new Bundle(bundle);
if (m().p().f0(201500000)) {
i10 = 100;
} else {
i10 = 25;
}
Iterator it = new TreeSet(bundle.keySet()).iterator();
int i12 = 0;
while (it.hasNext()) {
String str4 = (String) it.next();
if (list != null && list.contains(str4)) {
i11 = 0;
} else {
if (!z10) {
i11 = m7Var.z0(str4);
} else {
i11 = 0;
}
if (i11 == 0) {
i11 = m7Var.y0(str4);
}
}
if (i11 != 0) {
if (i11 == 3) {
str2 = str4;
} else {
str2 = null;
}
G(bundle2, i11, str4, str2);
bundle2.remove(str4);
} else {
int w10 = w(str, str4, bundle.get(str4), bundle2, list, z10, c02);
if (w10 == 17) {
G(bundle2, w10, str4, Boolean.FALSE);
} else if (w10 != 0 && !"_ev".equals(str4)) {
if (w10 == 21) {
str3 = str;
} else {
str3 = str4;
}
G(bundle2, w10, str3, bundle.get(str4));
bundle2.remove(str4);
}
if (w0(str4)) {
int i13 = i12 + 1;
if (i13 > i10) {
String o10 = j.i0.o("Event can't contain more than ", i10, " params");
c4 c10 = c();
c10.f5289y.a(n().c(str), n().a(bundle), o10);
l0(5, bundle2);
bundle2.remove(str4);
}
m7Var = this;
i12 = i13;
}
}
m7Var = this;
}
return bundle2;
}
return null;
}
public final long B0() {
int i10 = (this.f5514u.get() > 0L ? 1 : (this.f5514u.get() == 0L ? 0 : -1));
synchronized (this.f5514u) {
if (i10 == 0) {
long nanoTime = System.nanoTime();
((u4.l) e()).getClass();
long nextLong = new Random(nanoTime ^ System.currentTimeMillis()).nextLong();
int i11 = this.f5515v + 1;
this.f5515v = i11;
return nextLong + i11;
}
this.f5514u.compareAndSet(-1L, 1L);
return this.f5514u.getAndIncrement();
}
}
public final a1.d C0() {
int i10;
b1.c cVar;
if (this.f5516w == null) {
Context a10 = a();
z8.b1.o("context", a10);
StringBuilder sb2 = new StringBuilder("AdServicesInfo.version=");
int i11 = Build.VERSION.SDK_INT;
y0.a aVar = y0.a.f10572a;
int i12 = 0;
if (i11 >= 30) {
i10 = aVar.a();
} else {
i10 = 0;
}
sb2.append(i10);
Log.d("MeasurementManager", sb2.toString());
if (i11 >= 30) {
i12 = aVar.a();
}
a1.d dVar = null;
if (i12 >= 5) {
cVar = new b1.c(a10);
} else {
cVar = null;
}
if (cVar != null) {
dVar = new a1.d(cVar);
}
this.f5516w = dVar;
}
return this.f5516w;
}
public final v D(String str, Bundle bundle, String str2, long j10, boolean z10) {
Bundle bundle2;
if (TextUtils.isEmpty(str)) {
return null;
}
if (u(str) == 0) {
if (bundle != null) {
bundle2 = new Bundle(bundle);
} else {
bundle2 = new Bundle();
}
bundle2.putString("_o", str2);
Bundle B = B(str, bundle2, Collections.singletonList("_o"), true);
if (z10) {
B = i0(B);
}
p1.b.i(B);
return new v(str, new t(B), str2, j10);
}
c4 c10 = c();
c10.f5287w.c("Invalid conditional property event name", n().g(str));
throw new IllegalArgumentException();
}
public final String D0() {
byte[] bArr = new byte[16];
F0().nextBytes(bArr);
return String.format(Locale.US, "%032x", new BigInteger(1, bArr));
}
public final Object E(int i10, Object obj, boolean z10, boolean z11) {
Parcelable[] parcelableArr;
Bundle i02;
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);
} else if (obj instanceof Float) {
return Double.valueOf(((Float) obj).doubleValue());
} else {
if ((obj instanceof String) || (obj instanceof Character) || (obj instanceof CharSequence)) {
return F(i10, String.valueOf(obj), z10);
}
if (z11 && ((obj instanceof Bundle[]) || (obj instanceof Parcelable[]))) {
ArrayList arrayList = new ArrayList();
for (Parcelable parcelable : (Parcelable[]) obj) {
if ((parcelable instanceof Bundle) && (i02 = i0((Bundle) parcelable)) != null && !i02.isEmpty()) {
arrayList.add(i02);
}
}
return arrayList.toArray(new Bundle[arrayList.size()]);
}
return null;
}
}
public final SecureRandom F0() {
q();
if (this.f5513t == null) {
this.f5513t = new SecureRandom();
}
return this.f5513t;
}
public final boolean G0() {
q();
return v0() == 1;
}
public final void H(Bundle bundle, long j10) {
long j11 = bundle.getLong("_et");
if (j11 != 0) {
c4 c10 = c();
c10.f5290z.c("Params already contained engagement", Long.valueOf(j11));
}
bundle.putLong("_et", j10 + j11);
}
public final void H0() {
q();
SecureRandom secureRandom = new SecureRandom();
long nextLong = secureRandom.nextLong();
if (nextLong == 0) {
nextLong = secureRandom.nextLong();
if (nextLong == 0) {
c().f5290z.b("Utils falling back to Random for random id");
}
}
this.f5514u.set(nextLong);
}
public final void I(Bundle bundle, Bundle bundle2) {
if (bundle2 == null) {
return;
}
for (String str : bundle2.keySet()) {
if (!bundle.containsKey(str)) {
p().J(bundle, str, bundle2.get(str));
}
}
}
public final void J(Bundle bundle, String str, Object obj) {
if (bundle == null) {
return;
}
if (obj instanceof Long) {
bundle.putLong(str, ((Long) obj).longValue());
} else if (obj instanceof String) {
bundle.putString(str, String.valueOf(obj));
} else if (obj instanceof Double) {
bundle.putDouble(str, ((Double) obj).doubleValue());
} else if (obj instanceof Bundle[]) {
bundle.putParcelableArray(str, (Bundle[]) obj);
} else if (str != null) {
String simpleName = obj != null ? obj.getClass().getSimpleName() : null;
c().B.a(n().f(str), simpleName, "Not putting event parameter. Invalid value type. name, type");
}
}
public final void K(com.google.android.gms.internal.measurement.t0 t0Var, int i10) {
Bundle bundle = new Bundle();
bundle.putInt("r", i10);
try {
t0Var.d(bundle);
} catch (RemoteException e10) {
c4 c4Var = ((x4) this.f10345r).f5820z;
x4.i(c4Var);
c4Var.f5290z.c("Error returning int value to wrapper", e10);
}
}
public final void L(com.google.android.gms.internal.measurement.t0 t0Var, long j10) {
Bundle bundle = new Bundle();
bundle.putLong("r", j10);
try {
t0Var.d(bundle);
} catch (RemoteException e10) {
c4 c4Var = ((x4) this.f10345r).f5820z;
x4.i(c4Var);
c4Var.f5290z.c("Error returning long value to wrapper", e10);
}
}
public final void M(com.google.android.gms.internal.measurement.t0 t0Var, ArrayList arrayList) {
Bundle bundle = new Bundle();
bundle.putParcelableArrayList("r", arrayList);
try {
t0Var.d(bundle);
} catch (RemoteException e10) {
c4 c4Var = ((x4) this.f10345r).f5820z;
x4.i(c4Var);
c4Var.f5290z.c("Error returning bundle list to wrapper", e10);
}
}
public final void N(com.google.android.gms.internal.measurement.t0 t0Var, boolean z10) {
Bundle bundle = new Bundle();
bundle.putBoolean("r", z10);
try {
t0Var.d(bundle);
} catch (RemoteException e10) {
c4 c4Var = ((x4) this.f10345r).f5820z;
x4.i(c4Var);
c4Var.f5290z.c("Error returning boolean value to wrapper", e10);
}
}
public final void O(com.google.android.gms.internal.measurement.t0 t0Var, byte[] bArr) {
Bundle bundle = new Bundle();
bundle.putByteArray("r", bArr);
try {
t0Var.d(bundle);
} catch (RemoteException e10) {
c4 c4Var = ((x4) this.f10345r).f5820z;
x4.i(c4Var);
c4Var.f5290z.c("Error returning byte array to wrapper", e10);
}
}
public final void P(g4 g4Var, int i10) {
Object obj = g4Var.f5369e;
Iterator it = new TreeSet(((Bundle) obj).keySet()).iterator();
int i11 = 0;
while (it.hasNext()) {
String str = (String) it.next();
if (w0(str) && (i11 = i11 + 1) > i10) {
Bundle bundle = (Bundle) obj;
c().f5289y.a(n().c((String) g4Var.f5367c), n().a(bundle), j.i0.o("Event can't contain more than ", i10, " params"));
l0(5, bundle);
bundle.remove(str);
}
}
}
public final void S(String str, com.google.android.gms.internal.measurement.t0 t0Var) {
Bundle bundle = new Bundle();
bundle.putString("r", str);
try {
t0Var.d(bundle);
} catch (RemoteException e10) {
c4 c4Var = ((x4) this.f10345r).f5820z;
x4.i(c4Var);
c4Var.f5290z.c("Error returning string value to wrapper", e10);
}
}
public final void T(String str, String str2, Bundle bundle, List list, boolean z10) {
int i10;
int i11;
String str3;
int w10;
String str4;
String c10;
String a10;
e4 e4Var;
String str5;
String str6;
if (bundle == null) {
return;
}
f m10 = m();
m10.getClass();
fa.b();
String str7 = null;
if (m10.m().z(null, x.A0) && m10.p().f0(231100000)) {
i10 = 35;
} else {
i10 = 0;
}
Iterator it = new TreeSet(bundle.keySet()).iterator();
int i12 = 0;
while (it.hasNext()) {
String str8 = (String) it.next();
if (list != null && list.contains(str8)) {
i11 = 0;
} else {
if (!z10) {
i11 = z0(str8);
} else {
i11 = 0;
}
if (i11 == 0) {
i11 = y0(str8);
}
}
if (i11 != 0) {
if (i11 == 3) {
str6 = str8;
} else {
str6 = str7;
}
G(bundle, i11, str8, str6);
bundle.remove(str8);
str4 = str7;
} else {
if (X(bundle.get(str8))) {
c().B.d("Nested Bundle parameters are not allowed; discarded. event name, param name, child param name", str, str2, str8);
w10 = 22;
str3 = str8;
} else {
str3 = str8;
w10 = w(str, str8, bundle.get(str8), bundle, list, z10, false);
}
if (w10 != 0 && !"_ev".equals(str3)) {
G(bundle, w10, str3, bundle.get(str3));
bundle.remove(str3);
} else if (w0(str3) && !c0(str3, com.bumptech.glide.e.f2004i)) {
int i13 = i12 + 1;
int i14 = 23;
if (!f0(231100000)) {
c4 c11 = c();
c10 = n().c(str);
String a11 = n().a(bundle);
e4Var = c11.f5289y;
str5 = "Item array not supported on client's version of Google Play Services (Android Only)";
a10 = a11;
str4 = null;
} else if (i13 > i10) {
fa.b();
str4 = null;
if (m().z(null, x.A0)) {
c4 c12 = c();
String o10 = j.i0.o("Item can't contain more than ", i10, " item-scoped custom params");
c12.f5289y.a(n().c(str), n().a(bundle), o10);
i14 = 28;
l0(i14, bundle);
bundle.remove(str3);
i12 = i13;
} else {
c4 c13 = c();
c10 = n().c(str);
a10 = n().a(bundle);
e4Var = c13.f5289y;
str5 = "Item cannot contain custom parameters";
}
} else {
str4 = null;
i12 = i13;
}
e4Var.a(c10, a10, str5);
l0(i14, bundle);
bundle.remove(str3);
i12 = i13;
}
str4 = null;
}
str7 = str4;
}
}
public final void U(Parcelable[] parcelableArr, int i10, boolean z10) {
int i11;
p1.b.i(parcelableArr);
for (Parcelable parcelable : parcelableArr) {
Bundle bundle = (Bundle) parcelable;
Iterator it = new TreeSet(bundle.keySet()).iterator();
int i12 = 0;
while (it.hasNext()) {
String str = (String) it.next();
if (w0(str) && !c0(str, com.bumptech.glide.e.f2004i) && (i12 = i12 + 1) > i10) {
e4 e4Var = c().f5289y;
if (z10) {
e4Var.a(n().f(str), n().a(bundle), j.i0.o("Param can't contain more than ", i10, " item-scoped custom parameters"));
i11 = 28;
} else {
e4Var.a(n().f(str), n().a(bundle), "Param cannot contain item-scoped custom parameters");
i11 = 23;
}
l0(i11, bundle);
bundle.remove(str);
}
}
}
}
public final boolean Y(String str, String str2) {
boolean isEmpty = TextUtils.isEmpty(str);
Object obj = this.f10345r;
if (!isEmpty) {
p1.b.i(str);
if (!str.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$")) {
if (TextUtils.isEmpty(((x4) obj).f5813s)) {
c4 c10 = c();
c10.f5289y.c("Invalid google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI. provided id", c4.u(str));
}
return false;
}
return true;
} else if (!TextUtils.isEmpty(str2)) {
p1.b.i(str2);
if (!str2.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$")) {
c4 c11 = c();
c11.f5289y.c("Invalid admob_app_id. Analytics disabled.", c4.u(str2));
return false;
}
return true;
} else {
if (TextUtils.isEmpty(((x4) obj).f5813s)) {
c().f5289y.b("Missing google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI");
}
return false;
}
}
public final boolean Z(String str, String str2, int i10) {
if (str2 == null) {
c().f5289y.c("Name is required and can't be null. Type", str);
return false;
} else if (str2.codePointCount(0, str2.length()) > i10) {
c4 c10 = c();
c10.f5289y.d("Name is too long. Type, maximum supported length, name", str, Integer.valueOf(i10), str2);
return false;
} else {
return true;
}
}
public final boolean a0(String str, String str2, int i10, 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()) > i10) {
c4 c10 = c();
c10.B.d("Value is too long; discarded. Value kind, name, value length", str, str2, Integer.valueOf(valueOf.length()));
return false;
}
}
return true;
}
public final boolean d0(String str, String[] strArr, String[] strArr2, String str2) {
boolean z10;
if (str2 == null) {
c().f5289y.c("Name is required and can't be null. Type", str);
return false;
}
String[] strArr3 = f5512z;
int i10 = 0;
while (true) {
if (i10 >= 3) {
z10 = false;
break;
} else if (str2.startsWith(strArr3[i10])) {
z10 = true;
break;
} else {
i10++;
}
}
if (z10) {
c().f5289y.a(str, str2, "Name starts with reserved prefix. Type, name");
return false;
} else if (strArr == null || !c0(str2, strArr) || (strArr2 != null && c0(str2, strArr2))) {
return true;
} else {
c().f5289y.a(str, str2, "Name is reserved. Type, name");
return false;
}
}
public final boolean f0(int i10) {
Boolean bool = ((x4) this.f10345r).r().f5507v;
if (t0() < i10 / 1000) {
if (bool == null || bool.booleanValue()) {
return false;
}
return true;
}
return true;
}
public final int h0(String str) {
if (!n0("user property", str)) {
return 6;
}
if (!d0("user property", com.google.android.gms.internal.measurement.m4.f2430d, null, str)) {
return 15;
}
if (!Z("user property", str, 24)) {
return 6;
}
return 0;
}
public final Bundle i0(Bundle bundle) {
Bundle bundle2 = new Bundle();
if (bundle != null) {
for (String str : bundle.keySet()) {
Object j02 = j0(str, bundle.get(str));
if (j02 == null) {
c4 c10 = c();
c10.B.c("Param value can't be null", n().f(str));
} else {
J(bundle2, str, j02);
}
}
}
return bundle2;
}
public final Object j0(String str, Object obj) {
int t3;
boolean equals = "_ev".equals(str);
Object obj2 = this.f10345r;
if (equals) {
return E(Math.max(m().t(((x4) obj2).p().B()), 256), obj, true, true);
}
if (u0(str)) {
t3 = Math.max(m().t(((x4) obj2).p().B()), 256);
} else {
t3 = m().t(((x4) obj2).p().B());
}
return E(t3, obj, false, true);
}
public final boolean m0(Context context, String str) {
c4 c10;
String str2;
Signature[] signatureArr;
X500Principal x500Principal = new X500Principal("CN=Android Debug,O=Android,C=US");
try {
PackageInfo b10 = z4.b.a(context).b(64, str);
if (b10 == null || (signatureArr = b10.signatures) == null || signatureArr.length <= 0) {
return true;
}
return ((X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(new ByteArrayInputStream(signatureArr[0].toByteArray()))).getSubjectX500Principal().equals(x500Principal);
} catch (PackageManager.NameNotFoundException e10) {
e = e10;
c10 = c();
str2 = "Package name not found";
c10.f5287w.c(str2, e);
return true;
} catch (CertificateException e11) {
e = e11;
c10 = c();
str2 = "Error obtaining certificate";
c10.f5287w.c(str2, e);
return true;
}
}
public final boolean n0(String str, String str2) {
if (str2 == null) {
c().f5289y.c("Name is required and can't be null. Type", str);
return false;
} else if (str2.length() == 0) {
c().f5289y.c("Name is required and can't be empty. Type", str);
return false;
} else {
int codePointAt = str2.codePointAt(0);
if (!Character.isLetter(codePointAt) && codePointAt != 95) {
c().f5289y.a(str, str2, "Name must start with a letter or _ (underscore). Type, name");
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)) {
c().f5289y.a(str, str2, "Name must consist of letters, digits or _ (underscores). Type, name");
return false;
}
charCount += Character.charCount(codePointAt2);
}
return true;
}
}
public final Object o0(String str, Object obj) {
boolean equals = "_ldl".equals(str);
int A0 = A0(str);
return equals ? E(A0, obj, true, false) : E(A0, obj, false, false);
}
public final boolean q0(String str, String str2) {
if (str2 == null) {
c().f5289y.c("Name is required and can't be null. Type", str);
return false;
} else if (str2.length() == 0) {
c().f5289y.c("Name is required and can't be empty. Type", str);
return false;
} else {
int codePointAt = str2.codePointAt(0);
if (!Character.isLetter(codePointAt)) {
c().f5289y.a(str, str2, "Name must start with a letter. Type, name");
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)) {
c().f5289y.a(str, str2, "Name must consist of letters, digits or _ (underscores). Type, name");
return false;
}
charCount += Character.charCount(codePointAt2);
}
return true;
}
}
public final boolean s0(String str) {
q();
if (z4.b.a(a()).f5087s.checkCallingOrSelfPermission(str) == 0) {
return true;
}
c().D.c("Permission not granted", str);
return false;
}
@Override
public final boolean t() {
return true;
}
public final int t0() {
if (this.f5518y == null) {
r4.g gVar = r4.g.f8743b;
Context a10 = a();
gVar.getClass();
AtomicBoolean atomicBoolean = r4.j.f8745a;
int i10 = 0;
try {
i10 = a10.getPackageManager().getPackageInfo("com.google.android.gms", 0).versionCode;
} catch (PackageManager.NameNotFoundException unused) {
Log.w("GooglePlayServicesUtil", "Google Play services is missing.");
}
this.f5518y = Integer.valueOf(i10 / 1000);
}
return this.f5518y.intValue();
}
public final int u(String str) {
if (n0("event", str)) {
if (d0("event", com.bumptech.glide.f.f2012f, com.bumptech.glide.f.f2013g, str)) {
return !Z("event", str, 40) ? 2 : 0;
}
return 13;
}
return 2;
}
public final int v(String str, Object obj) {
return a0("_ldl".equals(str) ? "user property referrer" : "user property", str, A0(str), obj) ? 0 : 7;
}
public final long v0() {
int extensionVersion;
int i10;
long j10;
int extensionVersion2;
Object e10;
Integer num;
q();
if (!r0(((x4) this.f10345r).p().B())) {
return 0L;
}
int i11 = Build.VERSION.SDK_INT;
boolean z10 = false;
Integer num2 = null;
if (i11 >= 30) {
extensionVersion = SdkExtensions.getExtensionVersion(30);
if (extensionVersion < 4) {
j10 = 8;
} else {
if (i11 >= 30) {
extensionVersion2 = SdkExtensions.getExtensionVersion(30);
if (extensionVersion2 > 3) {
i10 = SdkExtensions.getExtensionVersion(1000000);
if (i10 >= ((Integer) x.V.a(null)).intValue()) {
j10 = 16;
} else {
j10 = 0;
}
}
}
i10 = 0;
if (i10 >= ((Integer) x.V.a(null)).intValue()) {
}
}
} else {
j10 = 4;
}
if (!s0("android.permission.ACCESS_ADSERVICES_ATTRIBUTION")) {
j10 |= 2;
}
if (j10 == 0) {
if (this.f5517x == null) {
a1.d C0 = C0();
if (C0 != null) {
try {
num = (Integer) C0.b().get(10000L, TimeUnit.MILLISECONDS);
if (num != null) {
try {
if (num.intValue() == 1) {
z10 = true;
}
} catch (InterruptedException | CancellationException | ExecutionException | TimeoutException e11) {
e10 = e11;
num2 = num;
c().f5290z.c("Measurement manager api exception", e10);
this.f5517x = Boolean.FALSE;
num = num2;
c().E.c("Measurement manager api status result", num);
z10 = this.f5517x.booleanValue();
if (!z10) {
}
if (j10 != 0) {
}
}
}
this.f5517x = Boolean.valueOf(z10);
} catch (InterruptedException | CancellationException | ExecutionException | TimeoutException e12) {
e10 = e12;
}
c().E.c("Measurement manager api status result", num);
}
if (!z10) {
j10 |= 64;
}
}
z10 = this.f5517x.booleanValue();
if (!z10) {
}
}
if (j10 != 0) {
return 1L;
}
return j10;
}
public final int w(String str, String str2, Object obj, Bundle bundle, List list, boolean z10, boolean z11) {
int i10;
Parcelable[] parcelableArr;
int size;
boolean z12;
q();
boolean X = X(obj);
Object obj2 = this.f10345r;
boolean z13 = true;
if (X) {
if (!z11) {
return 21;
}
if (!c0(str2, com.bumptech.glide.e.f2003h)) {
return 20;
}
m6 r10 = ((x4) obj2).r();
r10.q();
r10.y();
if (!(!r10.M() || r10.p().t0() >= 200900)) {
return 25;
}
boolean z14 = obj instanceof Parcelable[];
if (z14) {
size = ((Parcelable[]) obj).length;
} else {
if (obj instanceof ArrayList) {
size = ((ArrayList) obj).size();
}
z12 = true;
if (!z12) {
if (z14) {
Parcelable[] parcelableArr2 = (Parcelable[]) obj;
if (parcelableArr2.length > 200) {
bundle.putParcelableArray(str2, (Parcelable[]) Arrays.copyOf(parcelableArr2, 200));
}
} else if (obj instanceof ArrayList) {
ArrayList arrayList = (ArrayList) obj;
if (arrayList.size() > 200) {
bundle.putParcelableArrayList(str2, new ArrayList<>(arrayList.subList(0, 200)));
}
}
i10 = 17;
if (a0("param", str2, (!u0(str) || u0(str2)) ? Math.max(m().t(((x4) obj2).p().B()), 256) : m().t(((x4) obj2).p().B()), obj)) {
if (z11) {
if (!(obj instanceof Bundle)) {
if (!(obj instanceof Parcelable[])) {
if (obj instanceof ArrayList) {
ArrayList arrayList2 = (ArrayList) obj;
int size2 = arrayList2.size();
int i11 = 0;
while (i11 < size2) {
Object obj3 = arrayList2.get(i11);
int i12 = i11 + 1;
if (obj3 instanceof Bundle) {
T(str, str2, (Bundle) obj3, list, z10);
i11 = i12;
} else {
c().B.a(obj3 != null ? obj3.getClass() : "null", str2, "All ArrayList elements must be of type Bundle. Value type, name");
}
}
}
z13 = false;
break;
}
for (Parcelable parcelable : (Parcelable[]) obj) {
if (!(parcelable instanceof Bundle)) {
c().B.a(parcelable.getClass(), str2, "All Parcelable[] elements must be of type Bundle. Value type, name");
z13 = false;
break;
}
T(str, str2, (Bundle) parcelable, list, z10);
}
} else {
T(str, str2, (Bundle) obj, list, z10);
}
if (z13) {
return i10;
}
return 4;
}
return 4;
}
return i10;
}
}
if (size > 200) {
c().B.d("Parameter array is too long; discarded. Value kind, name, array length", "param", str2, Integer.valueOf(size));
z12 = false;
if (!z12) {
}
}
z12 = true;
if (!z12) {
}
}
i10 = 0;
if (a0("param", str2, (!u0(str) || u0(str2)) ? Math.max(m().t(((x4) obj2).p().B()), 256) : m().t(((x4) obj2).p().B()), obj)) {
}
}
public final boolean x0(String str) {
List<ResolveInfo> queryIntentActivities;
return (TextUtils.isEmpty(str) || (queryIntentActivities = a().getPackageManager().queryIntentActivities(new Intent("android.intent.action.VIEW", Uri.parse(str)), 0)) == null || queryIntentActivities.isEmpty()) ? false : true;
}
public final int y0(String str) {
if (!n0("event param", str)) {
return 3;
}
if (!d0("event param", null, null, str)) {
return 14;
}
if (!Z("event param", str, 40)) {
return 3;
}
return 0;
}
public final int z0(String str) {
if (!q0("event param", str)) {
return 3;
}
if (!d0("event param", null, null, str)) {
return 14;
}
if (!Z("event param", str, 40)) {
return 3;
}
return 0;
}
}