导航菜单

页面标题

页面副标题

Kredinesia v8.3.1 - i1.java 源代码

正在查看: Kredinesia v8.3.1 应用的 i1.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package S3;

import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
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.text.TextUtils;
import com.onecard.utils.Constants;
import java.io.ByteArrayInputStream;
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.Collections;
import java.util.Iterator;
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 p5.AbstractC1706e;
import y3.C2050b;

public final class i1 extends AbstractC0391j0 {

    public static final String[] f3442S = {"firebase_", "google_", "ga_"};

    public static final String[] f3443T = {"_err"};

    public final AtomicLong f3444P;

    public int f3445Q;

    public Integer f3446R;

    public SecureRandom f3447d;

    public i1(C0381e0 c0381e0) {
        super(c0381e0);
        this.f3446R = null;
        this.f3444P = new AtomicLong(0L);
    }

    public static ArrayList B(List list) {
        if (list == null) {
            return new ArrayList(0);
        }
        ArrayList arrayList = new ArrayList(list.size());
        Iterator it = list.iterator();
        while (it.hasNext()) {
            C0376c c0376c = (C0376c) it.next();
            Bundle bundle = new Bundle();
            bundle.putString("app_id", c0376c.a);
            bundle.putString("origin", c0376c.f3302b);
            bundle.putLong("creation_timestamp", c0376c.f3304d);
            bundle.putString("name", c0376c.f3303c.f3418b);
            Object A9 = c0376c.f3303c.A();
            r3.C.i(A9);
            AbstractC0397m0.h(bundle, A9);
            bundle.putBoolean("active", c0376c.f3295P);
            String str = c0376c.f3296Q;
            if (str != null) {
                bundle.putString("trigger_event_name", str);
            }
            r rVar = c0376c.f3297R;
            if (rVar != null) {
                bundle.putString("timed_out_event_name", rVar.a);
                C0404q c0404q = rVar.f3578b;
                if (c0404q != null) {
                    bundle.putBundle("timed_out_event_params", c0404q.A());
                }
            }
            bundle.putLong("trigger_timeout", c0376c.f3298S);
            r rVar2 = c0376c.f3299T;
            if (rVar2 != null) {
                bundle.putString("triggered_event_name", rVar2.a);
                C0404q c0404q2 = rVar2.f3578b;
                if (c0404q2 != null) {
                    bundle.putBundle("triggered_event_params", c0404q2.A());
                }
            }
            bundle.putLong("triggered_timestamp", c0376c.f3303c.f3419c);
            bundle.putLong("time_to_live", c0376c.f3300U);
            r rVar3 = c0376c.f3301V;
            if (rVar3 != null) {
                bundle.putString("expired_event_name", rVar3.a);
                C0404q c0404q3 = rVar3.f3578b;
                if (c0404q3 != null) {
                    bundle.putBundle("expired_event_params", c0404q3.A());
                }
            }
            arrayList.add(bundle);
        }
        return arrayList;
    }

    public static void E(F0 f02, Bundle bundle, boolean z9) {
        if (bundle != null && f02 != null) {
            if (!bundle.containsKey("_sc") || z9) {
                String str = f02.a;
                if (str != null) {
                    bundle.putString("_sn", str);
                } else {
                    bundle.remove("_sn");
                }
                String str2 = f02.f3131b;
                if (str2 != null) {
                    bundle.putString("_sc", str2);
                } else {
                    bundle.remove("_sc");
                }
                bundle.putLong("_si", f02.f3132c);
                return;
            }
            z9 = false;
        }
        if (bundle != null && f02 == null && z9) {
            bundle.remove("_sn");
            bundle.remove("_sc");
            bundle.remove("_si");
        }
    }

    public static void I(h1 h1Var, String str, int i4, String str2, String str3, int i10) {
        Bundle bundle = new Bundle();
        j0(i4, bundle);
        if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
            bundle.putString(str2, str3);
        }
        if (i4 == 6 || i4 == 7 || i4 == 2) {
            bundle.putLong("_el", i10);
        }
        h1Var.b(bundle, str);
    }

    public static boolean a0(Object obj) {
        return (obj instanceof Parcelable[]) || (obj instanceof ArrayList) || (obj instanceof Bundle);
    }

    public static boolean d0(String str) {
        return !TextUtils.isEmpty(str) && str.startsWith("_");
    }

    public static boolean e0(String str) {
        r3.C.e(str);
        return str.charAt(0) != '_' || str.equals("_ep");
    }

    public static boolean f0(Context context) {
        ActivityInfo receiverInfo;
        r3.C.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 g0(Context context) {
        r3.C.i(context);
        return Build.VERSION.SDK_INT >= 24 ? n0(context, "com.google.android.gms.measurement.AppMeasurementJobService") : n0(context, "com.google.android.gms.measurement.AppMeasurementService");
    }

    public static boolean h0(String str, String str2, String str3, String str4) {
        boolean isEmpty = TextUtils.isEmpty(str);
        boolean isEmpty2 = TextUtils.isEmpty(str2);
        if (!isEmpty && !isEmpty2) {
            r3.C.i(str);
            return !str.equals(str2);
        }
        if (isEmpty && isEmpty2) {
            return (TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4)) ? !TextUtils.isEmpty(str4) : !str3.equals(str4);
        }
        if (isEmpty) {
            return TextUtils.isEmpty(str3) || !str3.equals(str4);
        }
        if (TextUtils.isEmpty(str4)) {
            return false;
        }
        return TextUtils.isEmpty(str3) || !str3.equals(str4);
    }

    public static byte[] i0(Parcelable parcelable) {
        if (parcelable == null) {
            return null;
        }
        Parcel obtain = Parcel.obtain();
        try {
            parcelable.writeToParcel(obtain, 0);
            return obtain.marshall();
        } finally {
            obtain.recycle();
        }
    }

    public static final boolean j0(int i4, Bundle bundle) {
        if (bundle == null || bundle.getLong("_err") != 0) {
            return false;
        }
        bundle.putLong("_err", i4);
        return true;
    }

    public static boolean m0(String str, String[] strArr) {
        r3.C.i(strArr);
        for (Object obj : strArr) {
            if (str == obj) {
                return true;
            }
            if (str != null && str.equals(obj)) {
                return true;
            }
        }
        return false;
    }

    public static boolean n0(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 long u0(byte[] bArr) {
        r3.C.i(bArr);
        int length = bArr.length;
        int i4 = 0;
        r3.C.l(length > 0);
        long j10 = 0;
        for (int i10 = length - 1; i10 >= 0 && i10 >= bArr.length - 8; i10--) {
            j10 += (bArr[i10] & 255) << i4;
            i4 += 8;
        }
        return j10;
    }

    public static String y(int i4, String str, boolean z9) {
        if (str == null) {
            return null;
        }
        if (str.codePointCount(0, str.length()) <= i4) {
            return str;
        }
        if (z9) {
            return String.valueOf(str.substring(0, str.offsetByCodePoints(0, i4))).concat("...");
        }
        return null;
    }

    public static MessageDigest z() {
        MessageDigest messageDigest;
        for (int i4 = 0; i4 < 2; i4++) {
            try {
                messageDigest = MessageDigest.getInstance("MD5");
            } catch (NoSuchAlgorithmException unused) {
            }
            if (messageDigest != null) {
                return messageDigest;
            }
        }
        return null;
    }

    public final SecureRandom A() {
        r();
        if (this.f3447d == null) {
            this.f3447d = new SecureRandom();
        }
        return this.f3447d;
    }

    public final void C(Bundle bundle, long j10) {
        long j11 = bundle.getLong("_et");
        if (j11 != 0) {
            K k8 = ((C0381e0) this.f961b).f3352T;
            C0381e0.k(k8);
            k8.f3171U.c(Long.valueOf(j11), "Params already contained engagement");
        } else {
            j11 = 0;
        }
        bundle.putLong("_et", j10 + j11);
    }

    public final void D(Bundle bundle, int i4, String str, Object obj) {
        if (j0(i4, bundle)) {
            ((C0381e0) this.f961b).getClass();
            bundle.putString("_ev", y(40, str, true));
            if (obj != null) {
                if ((obj instanceof String) || (obj instanceof CharSequence)) {
                    bundle.putLong("_el", obj.toString().length());
                }
            }
        }
    }

    public final void F(Bundle bundle, Bundle bundle2) {
        if (bundle2 == null) {
            return;
        }
        for (String str : bundle2.keySet()) {
            if (!bundle.containsKey(str)) {
                i1 i1Var = ((C0381e0) this.f961b).f3355W;
                C0381e0.h(i1Var);
                i1Var.J(bundle, str, bundle2.get(str));
            }
        }
    }

    public final void G(Parcelable[] parcelableArr, int i4, boolean z9) {
        r3.C.i(parcelableArr);
        for (Parcelable parcelable : parcelableArr) {
            Bundle bundle = (Bundle) parcelable;
            Iterator it = new TreeSet(bundle.keySet()).iterator();
            int i10 = 0;
            while (it.hasNext()) {
                String str = (String) it.next();
                if (e0(str) && !m0(str, AbstractC0397m0.h) && (i10 = i10 + 1) > i4) {
                    C0381e0 c0381e0 = (C0381e0) this.f961b;
                    if (z9) {
                        K k8 = c0381e0.f3352T;
                        C0381e0.k(k8);
                        F f10 = c0381e0.f3356X;
                        k8.f3170T.d(f10.e(str), f10.b(bundle), "Param can't contain more than " + i4 + " item-scoped custom parameters");
                        j0(28, bundle);
                    } else {
                        K k10 = c0381e0.f3352T;
                        C0381e0.k(k10);
                        F f11 = c0381e0.f3356X;
                        k10.f3170T.d(f11.e(str), f11.b(bundle), "Param cannot contain item-scoped custom parameters");
                        j0(23, bundle);
                    }
                    bundle.remove(str);
                }
            }
        }
    }

    public final void H(L l10, int i4) {
        Bundle bundle = (Bundle) l10.f3185e;
        Iterator it = new TreeSet(bundle.keySet()).iterator();
        int i10 = 0;
        while (it.hasNext()) {
            String str = (String) it.next();
            if (e0(str) && (i10 = i10 + 1) > i4) {
                String f10 = AbstractC1706e.f("Event can't contain more than ", i4, " params");
                C0381e0 c0381e0 = (C0381e0) this.f961b;
                K k8 = c0381e0.f3352T;
                C0381e0.k(k8);
                String str2 = (String) l10.f3183c;
                F f11 = c0381e0.f3356X;
                k8.f3170T.d(f11.d(str2), f11.b(bundle), f10);
                j0(5, bundle);
                bundle.remove(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());
            return;
        }
        if (obj instanceof String) {
            bundle.putString(str, String.valueOf(obj));
            return;
        }
        if (obj instanceof Double) {
            bundle.putDouble(str, ((Double) obj).doubleValue());
            return;
        }
        if (obj instanceof Bundle[]) {
            bundle.putParcelableArray(str, (Bundle[]) obj);
            return;
        }
        if (str != null) {
            String simpleName = obj != null ? obj.getClass().getSimpleName() : null;
            C0381e0 c0381e0 = (C0381e0) this.f961b;
            K k8 = c0381e0.f3352T;
            C0381e0.k(k8);
            k8.f3173W.d(c0381e0.f3356X.e(str), simpleName, "Not putting event parameter. Invalid value type. name, type");
        }
    }

    public final void K(com.google.android.gms.internal.measurement.M m10, boolean z9) {
        Bundle bundle = new Bundle();
        bundle.putBoolean("r", z9);
        try {
            m10.E(bundle);
        } catch (RemoteException e10) {
            K k8 = ((C0381e0) this.f961b).f3352T;
            C0381e0.k(k8);
            k8.f3171U.c(e10, "Error returning boolean value to wrapper");
        }
    }

    public final void L(com.google.android.gms.internal.measurement.M m10, ArrayList arrayList) {
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList("r", arrayList);
        try {
            m10.E(bundle);
        } catch (RemoteException e10) {
            K k8 = ((C0381e0) this.f961b).f3352T;
            C0381e0.k(k8);
            k8.f3171U.c(e10, "Error returning bundle list to wrapper");
        }
    }

    public final void M(com.google.android.gms.internal.measurement.M m10, Bundle bundle) {
        try {
            m10.E(bundle);
        } catch (RemoteException e10) {
            K k8 = ((C0381e0) this.f961b).f3352T;
            C0381e0.k(k8);
            k8.f3171U.c(e10, "Error returning bundle value to wrapper");
        }
    }

    public final void N(com.google.android.gms.internal.measurement.M m10, byte[] bArr) {
        Bundle bundle = new Bundle();
        bundle.putByteArray("r", bArr);
        try {
            m10.E(bundle);
        } catch (RemoteException e10) {
            K k8 = ((C0381e0) this.f961b).f3352T;
            C0381e0.k(k8);
            k8.f3171U.c(e10, "Error returning byte array to wrapper");
        }
    }

    public final void O(com.google.android.gms.internal.measurement.M m10, int i4) {
        Bundle bundle = new Bundle();
        bundle.putInt("r", i4);
        try {
            m10.E(bundle);
        } catch (RemoteException e10) {
            K k8 = ((C0381e0) this.f961b).f3352T;
            C0381e0.k(k8);
            k8.f3171U.c(e10, "Error returning int value to wrapper");
        }
    }

    public final void P(com.google.android.gms.internal.measurement.M m10, long j10) {
        Bundle bundle = new Bundle();
        bundle.putLong("r", j10);
        try {
            m10.E(bundle);
        } catch (RemoteException e10) {
            K k8 = ((C0381e0) this.f961b).f3352T;
            C0381e0.k(k8);
            k8.f3171U.c(e10, "Error returning long value to wrapper");
        }
    }

    public final void Q(String str, com.google.android.gms.internal.measurement.M m10) {
        Bundle bundle = new Bundle();
        bundle.putString("r", str);
        try {
            m10.E(bundle);
        } catch (RemoteException e10) {
            K k8 = ((C0381e0) this.f961b).f3352T;
            C0381e0.k(k8);
            k8.f3171U.c(e10, "Error returning string value to wrapper");
        }
    }

    public final void R(java.lang.String r17, java.lang.String r18, android.os.Bundle r19, java.util.List r20, boolean r21) {
        throw new UnsupportedOperationException("Method not decompiled: S3.i1.R(java.lang.String, java.lang.String, android.os.Bundle, java.util.List, boolean):void");
    }

    public final boolean S(String str, String str2) {
        boolean isEmpty = TextUtils.isEmpty(str);
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        if (!isEmpty) {
            r3.C.i(str);
            if (str.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$")) {
                return true;
            }
            if (TextUtils.isEmpty(c0381e0.f3360b)) {
                K k8 = c0381e0.f3352T;
                C0381e0.k(k8);
                k8.f3170T.c(K.z(str), "Invalid google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI. provided id");
                return false;
            }
        } else {
            if (!TextUtils.isEmpty(str2)) {
                r3.C.i(str2);
                if (str2.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$")) {
                    return true;
                }
                K k10 = c0381e0.f3352T;
                C0381e0.k(k10);
                k10.f3170T.c(K.z(str2), "Invalid admob_app_id. Analytics disabled.");
                return false;
            }
            if (TextUtils.isEmpty(c0381e0.f3360b)) {
                K k11 = c0381e0.f3352T;
                C0381e0.k(k11);
                k11.f3170T.b("Missing google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI");
            }
        }
        return false;
    }

    public final boolean T(String str, int i4, String str2) {
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        if (str2 == null) {
            K k8 = c0381e0.f3352T;
            C0381e0.k(k8);
            k8.f3170T.c(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.codePointCount(0, str2.length()) <= i4) {
            return true;
        }
        K k10 = c0381e0.f3352T;
        C0381e0.k(k10);
        k10.f3170T.e("Name is too long. Type, maximum supported length, name", str, Integer.valueOf(i4), str2);
        return false;
    }

    public final int U(java.lang.String r13, java.lang.String r14, java.lang.Object r15, android.os.Bundle r16, java.util.List r17, boolean r18, boolean r19) {
        throw new UnsupportedOperationException("Method not decompiled: S3.i1.U(java.lang.String, java.lang.String, java.lang.Object, android.os.Bundle, java.util.List, boolean, boolean):int");
    }

    public final boolean V(String str, String[] strArr, String[] strArr2, String str2) {
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        if (str2 == null) {
            K k8 = c0381e0.f3352T;
            C0381e0.k(k8);
            k8.f3170T.c(str, "Name is required and can't be null. Type");
            return false;
        }
        String[] strArr3 = f3442S;
        for (int i4 = 0; i4 < 3; i4++) {
            if (str2.startsWith(strArr3[i4])) {
                K k10 = c0381e0.f3352T;
                C0381e0.k(k10);
                k10.f3170T.d(str, str2, "Name starts with reserved prefix. Type, name");
                return false;
            }
        }
        if (strArr == null || !m0(str2, strArr)) {
            return true;
        }
        if (strArr2 != null && m0(str2, strArr2)) {
            return true;
        }
        K k11 = c0381e0.f3352T;
        C0381e0.k(k11);
        k11.f3170T.d(str, str2, "Name is reserved. Type, name");
        return false;
    }

    public final boolean W(String str, String str2, int i4, 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)) {
            return true;
        }
        if (!(obj instanceof String) && !(obj instanceof Character) && !(obj instanceof CharSequence)) {
            return false;
        }
        String obj2 = obj.toString();
        if (obj2.codePointCount(0, obj2.length()) > i4) {
            K k8 = ((C0381e0) this.f961b).f3352T;
            C0381e0.k(k8);
            k8.f3173W.e("Value is too long; discarded. Value kind, name, value length", str, str2, Integer.valueOf(obj2.length()));
            return false;
        }
        return true;
    }

    public final boolean X(String str, String str2) {
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        if (str2 == null) {
            K k8 = c0381e0.f3352T;
            C0381e0.k(k8);
            k8.f3170T.c(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.length() == 0) {
            K k10 = c0381e0.f3352T;
            C0381e0.k(k10);
            k10.f3170T.c(str, "Name is required and can't be empty. Type");
            return false;
        }
        int codePointAt = str2.codePointAt(0);
        if (!Character.isLetter(codePointAt)) {
            if (codePointAt != 95) {
                K k11 = c0381e0.f3352T;
                C0381e0.k(k11);
                k11.f3170T.d(str, str2, "Name must start with a letter or _ (underscore). Type, name");
                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)) {
                K k12 = c0381e0.f3352T;
                C0381e0.k(k12);
                k12.f3170T.d(str, str2, "Name must consist of letters, digits or _ (underscores). Type, name");
                return false;
            }
            charCount += Character.charCount(codePointAt2);
        }
        return true;
    }

    public final boolean Y(String str, String str2) {
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        if (str2 == null) {
            K k8 = c0381e0.f3352T;
            C0381e0.k(k8);
            k8.f3170T.c(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.length() == 0) {
            K k10 = c0381e0.f3352T;
            C0381e0.k(k10);
            k10.f3170T.c(str, "Name is required and can't be empty. Type");
            return false;
        }
        int codePointAt = str2.codePointAt(0);
        if (!Character.isLetter(codePointAt)) {
            K k11 = c0381e0.f3352T;
            C0381e0.k(k11);
            k11.f3170T.d(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)) {
                K k12 = c0381e0.f3352T;
                C0381e0.k(k12);
                k12.f3170T.d(str, str2, "Name must consist of letters, digits or _ (underscores). Type, name");
                return false;
            }
            charCount += Character.charCount(codePointAt2);
        }
        return true;
    }

    public final boolean Z(String str) {
        r();
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        if (C2050b.a(c0381e0.a).f2026b.checkCallingOrSelfPermission(str) == 0) {
            return true;
        }
        K k8 = c0381e0.f3352T;
        C0381e0.k(k8);
        k8.f3175Y.c(str, "Permission not granted");
        return false;
    }

    public final boolean b0(Context context, String str) {
        Signature[] signatureArr;
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        X500Principal x500Principal = new X500Principal("CN=Android Debug,O=Android,C=US");
        try {
            PackageInfo b10 = C2050b.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) {
            K k8 = c0381e0.f3352T;
            C0381e0.k(k8);
            k8.f3168R.c(e10, "Package name not found");
            return true;
        } catch (CertificateException e11) {
            K k10 = c0381e0.f3352T;
            C0381e0.k(k10);
            k10.f3168R.c(e11, "Error obtaining certificate");
            return true;
        }
    }

    public final boolean c0(int i4) {
        Boolean bool = ((C0381e0) this.f961b).s().f3205Q;
        if (t0() < i4 / 1000) {
            return (bool == null || bool.booleanValue()) ? false : true;
        }
        return true;
    }

    public final int k0(String str) {
        boolean equals = "_ldl".equals(str);
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        if (equals) {
            c0381e0.getClass();
            return Constants.COMPRESS_IMAGE_LIMIT;
        }
        if ("_id".equals(str)) {
            c0381e0.getClass();
            return 256;
        }
        if ("_lgclid".equals(str)) {
            c0381e0.getClass();
            return 100;
        }
        c0381e0.getClass();
        return 36;
    }

    public final Object l0(int i4, Object obj, boolean z9, boolean z10) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Long) {
            return obj;
        }
        if (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);
        }
        if (obj instanceof Float) {
            return Double.valueOf(((Float) obj).doubleValue());
        }
        if ((obj instanceof String) || (obj instanceof Character) || (obj instanceof CharSequence)) {
            return y(i4, obj.toString(), z9);
        }
        if (!z10) {
            return null;
        }
        if (!(obj instanceof Bundle[]) && !(obj instanceof Parcelable[])) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (Parcelable parcelable : (Parcelable[]) obj) {
            if (parcelable instanceof Bundle) {
                Bundle x02 = x0((Bundle) parcelable);
                if (!x02.isEmpty()) {
                    arrayList.add(x02);
                }
            }
        }
        return arrayList.toArray(new Bundle[arrayList.size()]);
    }

    public final int o0(Object obj, String str) {
        return "_ldl".equals(str) ? W("user property referrer", str, k0(str), obj) : W("user property", str, k0(str), obj) ? 0 : 7;
    }

    public final int p0(String str) {
        if (!X("event", str)) {
            return 2;
        }
        if (!V("event", AbstractC0397m0.a, AbstractC0397m0.f3530b, str)) {
            return 13;
        }
        ((C0381e0) this.f961b).getClass();
        return !T("event", 40, str) ? 2 : 0;
    }

    public final int q0(String str) {
        if (!X("event param", str)) {
            return 3;
        }
        if (!V("event param", null, null, str)) {
            return 14;
        }
        ((C0381e0) this.f961b).getClass();
        return !T("event param", 40, str) ? 3 : 0;
    }

    public final int r0(String str) {
        if (!Y("event param", str)) {
            return 3;
        }
        if (!V("event param", null, null, str)) {
            return 14;
        }
        ((C0381e0) this.f961b).getClass();
        return !T("event param", 40, str) ? 3 : 0;
    }

    @Override
    public final boolean s() {
        return true;
    }

    public final int s0(String str) {
        if (!X("user property", str)) {
            return 6;
        }
        if (!V("user property", AbstractC0397m0.f3536i, null, str)) {
            return 15;
        }
        ((C0381e0) this.f961b).getClass();
        return !T("user property", 24, str) ? 6 : 0;
    }

    public final int t0() {
        if (this.f3446R == null) {
            o3.e eVar = o3.e.f13041b;
            Context context = ((C0381e0) this.f961b).a;
            eVar.getClass();
            this.f3446R = Integer.valueOf(o3.e.a(context) / 1000);
        }
        return this.f3446R.intValue();
    }

    public final long v0() {
        long andIncrement;
        long j10;
        if (this.f3444P.get() != 0) {
            synchronized (this.f3444P) {
                this.f3444P.compareAndSet(-1L, 1L);
                andIncrement = this.f3444P.getAndIncrement();
            }
            return andIncrement;
        }
        synchronized (this.f3444P) {
            long nanoTime = System.nanoTime();
            ((C0381e0) this.f961b).f3357Y.getClass();
            long nextLong = new Random(nanoTime ^ System.currentTimeMillis()).nextLong();
            int i4 = this.f3445Q + 1;
            this.f3445Q = i4;
            j10 = nextLong + i4;
        }
        return j10;
    }

    public final Object w(Object obj, String str) {
        boolean equals = "_ev".equals(str);
        int i4 = 256;
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        if (equals) {
            c0381e0.getClass();
            return l0(256, obj, true, true);
        }
        if (d0(str)) {
            c0381e0.getClass();
        } else {
            c0381e0.getClass();
            i4 = 100;
        }
        return l0(i4, obj, false, true);
    }

    public final Bundle w0(Uri uri, boolean z9) {
        String str;
        String str2;
        String str3;
        String str4;
        String str5;
        String str6;
        String str7;
        String str8;
        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");
                    str5 = uri.getQueryParameter("utm_id");
                    str6 = uri.getQueryParameter("dclid");
                    str7 = uri.getQueryParameter("srsltid");
                    str8 = z9 ? uri.getQueryParameter("sfmc_id") : null;
                } else {
                    str = null;
                    str2 = null;
                    str3 = null;
                    str4 = null;
                    str5 = null;
                    str6 = null;
                    str7 = null;
                    str8 = null;
                }
                if (TextUtils.isEmpty(str) && TextUtils.isEmpty(str2) && TextUtils.isEmpty(str3) && TextUtils.isEmpty(str4) && TextUtils.isEmpty(str5) && TextUtils.isEmpty(str6) && TextUtils.isEmpty(str7) && (!z9 || TextUtils.isEmpty(str8))) {
                    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(com.adjust.sdk.Constants.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);
                }
                if (!TextUtils.isEmpty(str5)) {
                    bundle.putString("campaign_id", str5);
                }
                if (!TextUtils.isEmpty(str6)) {
                    bundle.putString("dclid", str6);
                }
                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(str7)) {
                    bundle.putString("srsltid", str7);
                }
                if (z9 && !TextUtils.isEmpty(str8)) {
                    bundle.putString("sfmc_id", str8);
                }
                return bundle;
            } catch (UnsupportedOperationException e10) {
                K k8 = ((C0381e0) this.f961b).f3352T;
                C0381e0.k(k8);
                k8.f3171U.c(e10, "Install referrer url isn't a hierarchical URI");
            }
        }
        return null;
    }

    public final Object x(Object obj, String str) {
        return "_ldl".equals(str) ? l0(k0(str), obj, true, false) : l0(k0(str), obj, false, false);
    }

    public final Bundle x0(Bundle bundle) {
        Bundle bundle2 = new Bundle();
        if (bundle != null) {
            for (String str : bundle.keySet()) {
                Object w6 = w(bundle.get(str), str);
                if (w6 == null) {
                    C0381e0 c0381e0 = (C0381e0) this.f961b;
                    K k8 = c0381e0.f3352T;
                    C0381e0.k(k8);
                    k8.f3173W.c(c0381e0.f3356X.e(str), "Param value can't be null");
                } else {
                    J(bundle2, str, w6);
                }
            }
        }
        return bundle2;
    }

    public final Bundle y0(String str, Bundle bundle, List list, boolean z9) {
        int r02;
        List list2 = list;
        boolean m02 = m0(str, AbstractC0397m0.f3532d);
        if (bundle == null) {
            return null;
        }
        Bundle bundle2 = new Bundle(bundle);
        C0381e0 c0381e0 = (C0381e0) this.f961b;
        i1 i1Var = ((C0381e0) c0381e0.f3350R.f961b).f3355W;
        C0381e0.h(i1Var);
        int i4 = i1Var.c0(201500000) ? 100 : 25;
        Iterator it = new TreeSet(bundle.keySet()).iterator();
        int i10 = 0;
        while (it.hasNext()) {
            String str2 = (String) it.next();
            if (list2 == null || !list2.contains(str2)) {
                r02 = !z9 ? r0(str2) : 0;
                if (r02 == 0) {
                    r02 = q0(str2);
                }
            } else {
                r02 = 0;
            }
            if (r02 != 0) {
                D(bundle2, r02, str2, r02 == 3 ? str2 : null);
                bundle2.remove(str2);
            } else {
                int U4 = U(str, str2, bundle.get(str2), bundle2, list2, z9, m02);
                if (U4 == 17) {
                    D(bundle2, 17, str2, Boolean.FALSE);
                } else if (U4 != 0 && !"_ev".equals(str2)) {
                    D(bundle2, U4, U4 == 21 ? str : str2, bundle.get(str2));
                    bundle2.remove(str2);
                }
                if (e0(str2) && (i10 = i10 + 1) > i4) {
                    String f10 = AbstractC1706e.f("Event can't contain more than ", i4, " params");
                    K k8 = c0381e0.f3352T;
                    C0381e0.k(k8);
                    F f11 = c0381e0.f3356X;
                    k8.f3170T.d(f11.d(str), f11.b(bundle), f10);
                    j0(5, bundle2);
                    bundle2.remove(str2);
                }
            }
            list2 = list;
        }
        return bundle2;
    }

    public final r z0(String str, Bundle bundle, String str2, long j10, boolean z9) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        if (p0(str) != 0) {
            C0381e0 c0381e0 = (C0381e0) this.f961b;
            K k8 = c0381e0.f3352T;
            C0381e0.k(k8);
            k8.f3168R.c(c0381e0.f3356X.f(str), "Invalid conditional property event name");
            throw new IllegalArgumentException();
        }
        Bundle bundle2 = bundle != null ? new Bundle(bundle) : new Bundle();
        bundle2.putString("_o", str2);
        Bundle y02 = y0(str, bundle2, Collections.singletonList("_o"), true);
        if (z9) {
            y02 = x0(y02);
        }
        r3.C.i(y02);
        return new r(str, new C0404q(y02), str2, j10);
    }
}