CCIPTV PRO v3.0.9.1版本的 MD5 值为:e78d4d980447be4a9f823314f45bbf03
以下内容为反编译后的 ea.java 源代码,内容仅作参考
package f.f.a.d.k.b;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ServiceInfo;
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.text.TextUtils;
import f.f.a.d.j.j.lb;
import f.f.a.d.j.j.md;
import java.io.ByteArrayInputStream;
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.List;
import java.util.Random;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicLong;
import javax.security.auth.x500.X500Principal;
import org.achartengine.chart.TimeChart;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
public final class ea extends x5 {
public static final String[] f8611g = {"firebase_", "google_", "ga_"};
public static final String[] f8612h = {"_err"};
public static final int f8613i = 0;
public SecureRandom c;
public final AtomicLong f8614d;
public int f8615e;
public Integer f8616f;
public ea(c5 c5Var) {
super(c5Var);
this.f8616f = null;
this.f8614d = new AtomicLong(0L);
}
public static MessageDigest B() {
MessageDigest messageDigest;
for (int i2 = 0; i2 < 2; i2++) {
try {
messageDigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException unused) {
}
if (messageDigest != null) {
return messageDigest;
}
}
return null;
}
public static long C(byte[] bArr) {
f.f.a.d.f.o.s.k(bArr);
int length = bArr.length;
int i2 = 0;
f.f.a.d.f.o.s.n(length > 0);
long j2 = 0;
for (int i3 = length - 1; i3 >= 0 && i3 >= bArr.length - 8; i3--) {
j2 += (bArr[i3] & 255) << i2;
i2 += 8;
}
return j2;
}
public static boolean D(Context context, boolean z) {
f.f.a.d.f.o.s.k(context);
return e0(context, Build.VERSION.SDK_INT >= 24 ? "com.google.android.gms.measurement.AppMeasurementJobService" : "com.google.android.gms.measurement.AppMeasurementService");
}
public static boolean F(String str) {
return !TextUtils.isEmpty(str) && str.startsWith("_");
}
public static boolean G(String str, String str2) {
if (str == null && str2 == null) {
return true;
}
if (str == null) {
return false;
}
return str.equals(str2);
}
public static boolean M(String str) {
return !f8612h[0].equals(str);
}
public static ArrayList<Bundle> Y(List<b> list) {
if (list == null) {
return new ArrayList<>(0);
}
ArrayList<Bundle> arrayList = new ArrayList<>(list.size());
for (b bVar : list) {
Bundle bundle = new Bundle();
bundle.putString("app_id", bVar.b);
bundle.putString("origin", bVar.c);
bundle.putLong("creation_timestamp", bVar.f8559e);
bundle.putString("name", bVar.f8558d.c);
z5.a(bundle, bVar.f8558d.p());
bundle.putBoolean("active", bVar.f8560f);
String str = bVar.f8561g;
if (str != null) {
bundle.putString("trigger_event_name", str);
}
t tVar = bVar.f8562h;
if (tVar != null) {
bundle.putString("timed_out_event_name", tVar.b);
r rVar = bVar.f8562h.c;
if (rVar != null) {
bundle.putBundle("timed_out_event_params", rVar.C());
}
}
bundle.putLong("trigger_timeout", bVar.f8563i);
t tVar2 = bVar.f8564j;
if (tVar2 != null) {
bundle.putString("triggered_event_name", tVar2.b);
r rVar2 = bVar.f8564j.c;
if (rVar2 != null) {
bundle.putBundle("triggered_event_params", rVar2.C());
}
}
bundle.putLong("triggered_timestamp", bVar.f8558d.f8553d);
bundle.putLong("time_to_live", bVar.f8565k);
t tVar3 = bVar.f8566l;
if (tVar3 != null) {
bundle.putString("expired_event_name", tVar3.b);
r rVar3 = bVar.f8566l.c;
if (rVar3 != null) {
bundle.putBundle("expired_event_params", rVar3.C());
}
}
arrayList.add(bundle);
}
return arrayList;
}
public static final boolean a0(Bundle bundle, int i2) {
if (bundle.getLong("_err") == 0) {
bundle.putLong("_err", i2);
return true;
}
return false;
}
public static final boolean b0(String str) {
f.f.a.d.f.o.s.k(str);
return str.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$");
}
public static boolean e0(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 f0(String str, String[] strArr) {
f.f.a.d.f.o.s.k(strArr);
for (String str2 : strArr) {
if (G(str, str2)) {
return true;
}
}
return false;
}
public static boolean i0(String str) {
f.f.a.d.f.o.s.g(str);
return str.charAt(0) != '_' || str.equals("_ep");
}
public final void A(da daVar, String str, int i2, String str2, String str3, int i3) {
Bundle bundle = new Bundle();
a0(bundle, i2);
if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
bundle.putString(str2, str3);
}
if (i2 == 6 || i2 == 7 || i2 == 2) {
bundle.putLong("_el", i3);
}
f.f.a.d.j.j.o9.b();
if (this.a.z().w(null, m3.L0)) {
daVar.l(str, bundle);
return;
}
this.a.f();
this.a.F().X("auto", "_err", bundle);
}
public final boolean E(String str) {
h();
if (f.f.a.d.f.t.c.a(this.a.b()).a(str) == 0) {
return true;
}
this.a.c().v().b("Permission not granted", str);
return false;
}
public final boolean H(String str) {
if (TextUtils.isEmpty(str)) {
return false;
}
String D = this.a.z().D();
this.a.f();
return D.equals(str);
}
public final Bundle I(Bundle bundle) {
Bundle bundle2 = new Bundle();
if (bundle != null) {
for (String str : bundle.keySet()) {
Object s = s(str, bundle.get(str));
if (s == null) {
this.a.c().t().b("Param value can't be null", this.a.H().q(str));
} else {
z(bundle2, str, s);
}
}
}
return bundle2;
}
public final t J(String str, String str2, Bundle bundle, String str3, long j2, boolean z, boolean z2, boolean z3) {
if (TextUtils.isEmpty(str2)) {
return null;
}
if (o0(str2, z3) != 0) {
this.a.c().o().b("Invalid conditional property event name", this.a.H().r(str2));
throw new IllegalArgumentException();
}
Bundle bundle2 = bundle != null ? new Bundle(bundle) : new Bundle();
bundle2.putString("_o", str3);
Bundle t = t(str, str2, bundle2, f.f.a.d.f.s.f.b("_o"), false);
if (z) {
t = I(t);
}
f.f.a.d.f.o.s.k(t);
return new t(str2, new r(t), str3, j2);
}
public final boolean K(Context context, String str) {
w3 o2;
String str2;
X500Principal x500Principal = new X500Principal("CN=Android Debug,O=Android,C=US");
try {
PackageInfo e2 = f.f.a.d.f.t.c.a(context).e(str, 64);
if (e2 == null || e2.signatures == null || e2.signatures.length <= 0) {
return true;
}
return ((X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(new ByteArrayInputStream(e2.signatures[0].toByteArray()))).getSubjectX500Principal().equals(x500Principal);
} catch (PackageManager.NameNotFoundException e3) {
e = e3;
o2 = this.a.c().o();
str2 = "Package name not found";
o2.b(str2, e);
return true;
} catch (CertificateException e4) {
e = e4;
o2 = this.a.c().o();
str2 = "Error obtaining certificate";
o2.b(str2, e);
return true;
}
}
public final byte[] L(Parcelable parcelable) {
if (parcelable == null) {
return null;
}
Parcel obtain = Parcel.obtain();
try {
parcelable.writeToParcel(obtain, 0);
return obtain.marshall();
} finally {
obtain.recycle();
}
}
@EnsuresNonNull({"this.apkVersion"})
public final int N() {
if (this.f8616f == null) {
this.f8616f = Integer.valueOf(f.f.a.d.f.f.h().b(this.a.b()) / 1000);
}
return this.f8616f.intValue();
}
public final int O(int i2) {
return f.f.a.d.f.f.h().j(this.a.b(), f.f.a.d.f.i.a);
}
public final long P(long j2, long j3) {
return (j2 + (j3 * 60000)) / TimeChart.DAY;
}
public final void Q(Bundle bundle, long j2) {
long j3 = bundle.getLong("_et");
if (j3 != 0) {
this.a.c().r().b("Params already contained engagement", Long.valueOf(j3));
}
bundle.putLong("_et", j2 + j3);
}
public final void R(md mdVar, String str) {
Bundle bundle = new Bundle();
bundle.putString("r", str);
try {
mdVar.D1(bundle);
} catch (RemoteException e2) {
this.a.c().r().b("Error returning string value to wrapper", e2);
}
}
public final void S(md mdVar, long j2) {
Bundle bundle = new Bundle();
bundle.putLong("r", j2);
try {
mdVar.D1(bundle);
} catch (RemoteException e2) {
this.a.c().r().b("Error returning long value to wrapper", e2);
}
}
public final void T(md mdVar, int i2) {
Bundle bundle = new Bundle();
bundle.putInt("r", i2);
try {
mdVar.D1(bundle);
} catch (RemoteException e2) {
this.a.c().r().b("Error returning int value to wrapper", e2);
}
}
public final void U(md mdVar, byte[] bArr) {
Bundle bundle = new Bundle();
bundle.putByteArray("r", bArr);
try {
mdVar.D1(bundle);
} catch (RemoteException e2) {
this.a.c().r().b("Error returning byte array to wrapper", e2);
}
}
public final void V(md mdVar, boolean z) {
Bundle bundle = new Bundle();
bundle.putBoolean("r", z);
try {
mdVar.D1(bundle);
} catch (RemoteException e2) {
this.a.c().r().b("Error returning boolean value to wrapper", e2);
}
}
public final void W(md mdVar, Bundle bundle) {
try {
mdVar.D1(bundle);
} catch (RemoteException e2) {
this.a.c().r().b("Error returning bundle value to wrapper", e2);
}
}
public final void X(md mdVar, ArrayList<Bundle> arrayList) {
Bundle bundle = new Bundle();
bundle.putParcelableArrayList("r", arrayList);
try {
mdVar.D1(bundle);
} catch (RemoteException e2) {
this.a.c().r().b("Error returning bundle list to wrapper", e2);
}
}
public final URL Z(long j2, String str, String str2, long j3) {
try {
f.f.a.d.f.o.s.g(str2);
f.f.a.d.f.o.s.g(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", 37000L, Integer.valueOf(N())), str2, str, Long.valueOf(j3));
if (str.equals(this.a.z().E())) {
format = format.concat("&ddl_test=1");
}
return new URL(format);
} catch (IllegalArgumentException | MalformedURLException e2) {
this.a.c().o().b("Failed to create BOW URL for Deferred Deep Link. exception", e2.getMessage());
return null;
}
}
public final Object c0(int i2, Object obj, boolean z, boolean z2) {
Parcelable[] parcelableArr;
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(true != ((Boolean) obj).booleanValue() ? 0L : 1L);
} else if (obj instanceof Float) {
return Double.valueOf(((Float) obj).doubleValue());
} else {
if ((obj instanceof String) || (obj instanceof Character) || (obj instanceof CharSequence)) {
return q(String.valueOf(obj), i2, z);
}
if (z2 && ((obj instanceof Bundle[]) || (obj instanceof Parcelable[]))) {
ArrayList arrayList = new ArrayList();
for (Parcelable parcelable : (Parcelable[]) obj) {
if (parcelable instanceof Bundle) {
Bundle I = I((Bundle) parcelable);
if (!I.isEmpty()) {
arrayList.add(I);
}
}
}
return arrayList.toArray(new Bundle[arrayList.size()]);
}
return null;
}
}
public final int d0(String str) {
if ("_ldl".equals(str)) {
this.a.z();
return IjkMediaMeta.FF_PROFILE_H264_INTRA;
} else if ("_id".equals(str)) {
this.a.z();
return 256;
} else if (this.a.z().w(null, m3.g0) && "_lgclid".equals(str)) {
this.a.z();
return 100;
} else {
this.a.z();
return 36;
}
}
public final long g0() {
int i2 = (this.f8614d.get() > 0L ? 1 : (this.f8614d.get() == 0L ? 0 : -1));
synchronized (this.f8614d) {
if (i2 != 0) {
this.f8614d.compareAndSet(-1L, 1L);
return this.f8614d.getAndIncrement();
}
long nextLong = new Random(System.nanoTime() ^ this.a.a().a()).nextLong();
int i3 = this.f8615e + 1;
this.f8615e = i3;
return nextLong + i3;
}
}
@EnsuresNonNull({"this.secureRandom"})
public final SecureRandom h0() {
h();
if (this.c == null) {
this.c = new SecureRandom();
}
return this.c;
}
@Override
public final boolean i() {
return true;
}
@Override
public final void j() {
h();
SecureRandom secureRandom = new SecureRandom();
long nextLong = secureRandom.nextLong();
if (nextLong == 0) {
nextLong = secureRandom.nextLong();
if (nextLong == 0) {
this.a.c().r().a("Utils falling back to Random for random id");
}
}
this.f8614d.set(nextLong);
}
public final Bundle j0(Uri uri) {
String str;
String str2;
String str3;
String str4;
if (uri != null) {
try {
if (uri.isHierarchical()) {
str = uri.getQueryParameter("utm_campaign");
str2 = uri.getQueryParameter("utm_source");
str3 = uri.getQueryParameter("utm_medium");
str4 = uri.getQueryParameter("gclid");
} else {
str = null;
str2 = null;
str3 = null;
str4 = null;
}
if (TextUtils.isEmpty(str) && TextUtils.isEmpty(str2) && TextUtils.isEmpty(str3) && TextUtils.isEmpty(str4)) {
return null;
}
Bundle bundle = new Bundle();
if (!TextUtils.isEmpty(str)) {
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);
}
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);
}
return bundle;
} catch (UnsupportedOperationException e2) {
this.a.c().r().b("Install referrer url isn't a hierarchical URI", e2);
}
}
return null;
}
public final boolean k0(String str, String str2) {
if (str2 == null) {
this.a.c().q().b("Name is required and can't be null. Type", str);
return false;
} else if (str2.length() == 0) {
this.a.c().q().b("Name is required and can't be empty. Type", str);
return false;
} else {
int codePointAt = str2.codePointAt(0);
if (!Character.isLetter(codePointAt)) {
this.a.c().q().c("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)) {
this.a.c().q().c("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
return false;
}
charCount += Character.charCount(codePointAt2);
}
return true;
}
}
public final boolean l0(String str, String str2) {
if (str2 == null) {
this.a.c().q().b("Name is required and can't be null. Type", str);
return false;
} else if (str2.length() == 0) {
this.a.c().q().b("Name is required and can't be empty. Type", str);
return false;
} else {
int codePointAt = str2.codePointAt(0);
if (!Character.isLetter(codePointAt)) {
if (codePointAt != 95) {
this.a.c().q().c("Name must start with a letter or _ (underscore). Type, name", str, str2);
return false;
}
codePointAt = 95;
}
int length = str2.length();
int charCount = Character.charCount(codePointAt);
while (charCount < length) {
int codePointAt2 = str2.codePointAt(charCount);
if (codePointAt2 != 95 && !Character.isLetterOrDigit(codePointAt2)) {
this.a.c().q().c("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
return false;
}
charCount += Character.charCount(codePointAt2);
}
return true;
}
}
public final boolean m0(String str, String[] strArr, String[] strArr2, String str2) {
if (str2 == null) {
this.a.c().q().b("Name is required and can't be null. Type", str);
return false;
}
f.f.a.d.f.o.s.k(str2);
String[] strArr3 = f8611g;
for (int i2 = 0; i2 < 3; i2++) {
if (str2.startsWith(strArr3[i2])) {
this.a.c().q().c("Name starts with reserved prefix. Type, name", str, str2);
return false;
}
}
if (strArr == null || !f0(str2, strArr)) {
return true;
}
if (strArr2 == null || !f0(str2, strArr2)) {
this.a.c().q().c("Name is reserved. Type, name", str, str2);
return false;
}
return true;
}
public final boolean n0(String str, int i2, String str2) {
if (str2 == null) {
this.a.c().q().b("Name is required and can't be null. Type", str);
return false;
} else if (str2.codePointCount(0, str2.length()) > i2) {
this.a.c().q().d("Name is too long. Type, maximum supported length, name", str, Integer.valueOf(i2), str2);
return false;
} else {
return true;
}
}
public final boolean o(String str, String str2, String str3) {
if (!TextUtils.isEmpty(str)) {
if (b0(str)) {
return true;
}
if (this.a.K()) {
this.a.c().q().b("Invalid google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI. provided id", y3.x(str));
}
return false;
}
lb.b();
if (!this.a.z().w(null, m3.i0) || TextUtils.isEmpty(str3)) {
if (TextUtils.isEmpty(str2)) {
if (this.a.K()) {
this.a.c().q().a("Missing google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI");
}
return false;
} else if (b0(str2)) {
return true;
} else {
this.a.c().q().b("Invalid admob_app_id. Analytics disabled.", y3.x(str2));
return false;
}
}
return true;
}
public final int o0(String str, boolean z) {
if (l0("event", str)) {
if (z) {
if (!m0("event", a6.a, a6.b, str)) {
return 13;
}
} else if (!m0("event", a6.a, null, str)) {
return 13;
}
this.a.z();
return !n0("event", 40, str) ? 2 : 0;
}
return 2;
}
public final boolean p(String str, String str2, String str3, String str4) {
boolean isEmpty = TextUtils.isEmpty(str);
boolean isEmpty2 = TextUtils.isEmpty(str2);
if (!isEmpty && !isEmpty2) {
f.f.a.d.f.o.s.k(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) {
return TextUtils.isEmpty(str3) || !str3.equals(str4);
} else if (TextUtils.isEmpty(str4)) {
return false;
} else {
return TextUtils.isEmpty(str3) || !str3.equals(str4);
}
}
public final int p0(String str) {
if (l0("user property", str)) {
if (m0("user property", c6.a, null, str)) {
this.a.z();
return !n0("user property", 24, str) ? 6 : 0;
}
return 15;
}
return 6;
}
public final String q(String str, int i2, boolean z) {
if (str == null) {
return null;
}
if (str.codePointCount(0, str.length()) > i2) {
if (z) {
return String.valueOf(str.substring(0, str.offsetByCodePoints(0, i2))).concat("...");
}
return null;
}
return str;
}
public final int q0(String str) {
if (k0("event param", str)) {
if (m0("event param", null, null, str)) {
this.a.z();
return !n0("event param", 40, str) ? 3 : 0;
}
return 14;
}
return 3;
}
public final int r(String str, String str2, String str3, Object obj, Bundle bundle, List<String> list, boolean z, boolean z2) {
int i2;
int i3;
w3 t;
String str4;
String str5;
Parcelable[] parcelableArr;
int size;
h();
if (s0(obj)) {
if (!z2) {
return 21;
}
if (!f0(str3, b6.c)) {
return 20;
}
u8 R = this.a.R();
R.h();
R.j();
if (R.r() && R.a.G().N() < 200900) {
return 25;
}
this.a.z();
boolean z3 = obj instanceof Parcelable[];
if (z3) {
size = ((Parcelable[]) obj).length;
} else if (obj instanceof ArrayList) {
size = ((ArrayList) obj).size();
}
if (size > 200) {
this.a.c().t().d("Parameter array is too long; discarded. Value kind, name, array length", "param", str3, Integer.valueOf(size));
this.a.z();
if (z3) {
Parcelable[] parcelableArr2 = (Parcelable[]) obj;
if (parcelableArr2.length > 200) {
bundle.putParcelableArray(str3, (Parcelable[]) Arrays.copyOf(parcelableArr2, 200));
}
} else if (obj instanceof ArrayList) {
ArrayList arrayList = (ArrayList) obj;
if (arrayList.size() > 200) {
bundle.putParcelableArrayList(str3, new ArrayList<>(arrayList.subList(0, 200)));
}
}
i2 = 17;
if ((this.a.z().w(str, m3.R) || !F(str2)) && !F(str3)) {
this.a.z();
i3 = 100;
} else {
this.a.z();
i3 = 256;
}
if (t0("param", str3, i3, obj)) {
if (z2) {
if (obj instanceof Bundle) {
u0(str, str2, str3, (Bundle) obj, list, z);
} else if (obj instanceof Parcelable[]) {
for (Parcelable parcelable : (Parcelable[]) obj) {
if (!(parcelable instanceof Bundle)) {
t = this.a.c().t();
str4 = parcelable.getClass();
str5 = "All Parcelable[] elements must be of type Bundle. Value type, name";
t.c(str5, str4, str3);
return 4;
}
u0(str, str2, str3, (Bundle) parcelable, list, z);
}
} else if (!(obj instanceof ArrayList)) {
return 4;
} else {
ArrayList arrayList2 = (ArrayList) obj;
int size2 = arrayList2.size();
for (int i4 = 0; i4 < size2; i4++) {
Object obj2 = arrayList2.get(i4);
if (!(obj2 instanceof Bundle)) {
t = this.a.c().t();
str4 = obj2 != null ? obj2.getClass() : "null";
str5 = "All ArrayList elements must be of type Bundle. Value type, name";
t.c(str5, str4, str3);
return 4;
}
u0(str, str2, str3, (Bundle) obj2, list, z);
}
}
return i2;
}
return 4;
}
return i2;
}
}
i2 = 0;
if (this.a.z().w(str, m3.R)) {
}
this.a.z();
i3 = 100;
if (t0("param", str3, i3, obj)) {
}
}
public final int r0(String str) {
if (l0("event param", str)) {
if (m0("event param", null, null, str)) {
this.a.z();
return !n0("event param", 40, str) ? 3 : 0;
}
return 14;
}
return 3;
}
public final Object s(String str, Object obj) {
int i2 = 256;
if ("_ev".equals(str)) {
this.a.z();
return c0(256, obj, true, true);
}
if (F(str)) {
this.a.z();
} else {
this.a.z();
i2 = 100;
}
return c0(i2, obj, false, true);
}
public final boolean s0(Object obj) {
return (obj instanceof Parcelable[]) || (obj instanceof ArrayList) || (obj instanceof Bundle);
}
public final Bundle t(String str, String str2, Bundle bundle, List<String> list, boolean z) {
int i2;
String str3;
boolean f0 = f0(str2, a6.f8548d);
Bundle bundle2 = new Bundle(bundle);
int m2 = this.a.z().m();
int i3 = 0;
for (String str4 : this.a.z().w(str, m3.Y) ? new TreeSet<>(bundle.keySet()) : bundle.keySet()) {
if (list == null || !list.contains(str4)) {
int q0 = z ? q0(str4) : 0;
if (q0 == 0) {
q0 = r0(str4);
}
i2 = q0;
} else {
i2 = 0;
}
if (i2 != 0) {
w(bundle2, i2, str4, str4, i2 == 3 ? str4 : null);
bundle2.remove(str4);
} else {
int r = r(str, str2, str4, bundle.get(str4), bundle2, list, z, f0);
if (r == 17) {
w(bundle2, 17, str4, str4, Boolean.FALSE);
} else if (r != 0) {
str3 = str4;
if (!"_ev".equals(str3)) {
w(bundle2, r, r == 21 ? str2 : str3, str3, bundle.get(str3));
bundle2.remove(str3);
}
if (!i0(str3)) {
int i4 = i3 + 1;
if (i4 > m2) {
StringBuilder sb = new StringBuilder(48);
sb.append("Event can't contain more than ");
sb.append(m2);
sb.append(" params");
this.a.c().q().c(sb.toString(), this.a.H().p(str2), this.a.H().s(bundle));
a0(bundle2, 5);
bundle2.remove(str3);
}
i3 = i4;
}
}
str3 = str4;
if (!i0(str3)) {
}
}
}
return bundle2;
}
public final boolean t0(String str, String str2, int i2, 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()) > i2) {
this.a.c().t().d("Value is too long; discarded. Value kind, name, value length", str, str2, Integer.valueOf(valueOf.length()));
return false;
}
}
return true;
}
public final void u(z3 z3Var, int i2) {
int i3 = 0;
for (String str : new TreeSet(z3Var.f8914d.keySet())) {
if (i0(str) && (i3 = i3 + 1) > i2) {
StringBuilder sb = new StringBuilder(48);
sb.append("Event can't contain more than ");
sb.append(i2);
sb.append(" params");
this.a.c().q().c(sb.toString(), this.a.H().p(z3Var.a), this.a.H().s(z3Var.f8914d));
a0(z3Var.f8914d, 5);
z3Var.f8914d.remove(str);
}
}
}
public final void u0(String str, String str2, String str3, Bundle bundle, List<String> list, boolean z) {
int i2;
String str4;
int r;
if (bundle == null) {
return;
}
this.a.z();
int i3 = 0;
for (String str5 : new TreeSet(bundle.keySet())) {
if (list == null || !list.contains(str5)) {
int q0 = z ? q0(str5) : 0;
if (q0 == 0) {
q0 = r0(str5);
}
i2 = q0;
} else {
i2 = 0;
}
if (i2 != 0) {
w(bundle, i2, str5, str5, i2 == 3 ? str5 : null);
bundle.remove(str5);
} else {
if (s0(bundle.get(str5))) {
this.a.c().t().d("Nested Bundle parameters are not allowed; discarded. event name, param name, child param name", str2, str3, str5);
str4 = str5;
r = 22;
} else {
str4 = str5;
r = r(str, str2, str5, bundle.get(str5), bundle, list, z, false);
}
if (r != 0 && !"_ev".equals(str4)) {
w(bundle, r, str4, str4, bundle.get(str4));
} else if (i0(str4) && !f0(str4, b6.f8568d) && (i3 = i3 + 1) > 0) {
this.a.c().q().c("Item cannot contain custom parameters", this.a.H().p(str2), this.a.H().s(bundle));
a0(bundle, 23);
}
bundle.remove(str4);
}
}
}
public final void v(Bundle bundle, Bundle bundle2) {
if (bundle2 == null) {
return;
}
for (String str : bundle2.keySet()) {
if (!bundle.containsKey(str)) {
this.a.G().z(bundle, str, bundle2.get(str));
}
}
}
public final void w(Bundle bundle, int i2, String str, String str2, Object obj) {
if (a0(bundle, i2)) {
this.a.z();
bundle.putString("_ev", q(str, 40, true));
if (obj != null) {
f.f.a.d.f.o.s.k(bundle);
if ((obj instanceof String) || (obj instanceof CharSequence)) {
bundle.putLong("_el", String.valueOf(obj).length());
}
}
}
}
public final int x(String str, Object obj) {
int d0;
String str2;
if ("_ldl".equals(str)) {
d0 = d0(str);
str2 = "user property referrer";
} else {
d0 = d0(str);
str2 = "user property";
}
return t0(str2, str, d0, obj) ? 0 : 7;
}
public final Object y(String str, Object obj) {
boolean equals = "_ldl".equals(str);
int d0 = d0(str);
return equals ? c0(d0, obj, true, false) : c0(d0, obj, false, false);
}
public final void z(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) {
this.a.c().t().c("Not putting event parameter. Invalid value type. name, type", this.a.H().q(str), obj != null ? obj.getClass().getSimpleName() : null);
}
}
}