导航菜单

页面标题

页面副标题

Simple Préstamo v2.1.4 - W2.java 源代码

正在查看: Simple Préstamo v2.1.4 应用的 W2.java JAVA 源代码文件

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


package J1;

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 android.util.Log;
import com.adjust.sdk.Constants;
import com.google.android.gms.measurement.internal.zzac;
import com.google.android.gms.measurement.internal.zzas;
import com.google.android.gms.measurement.internal.zzau;
import g.AbstractC0889a;
import j1.C0935e;
import j1.C0939i;
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.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import javax.security.auth.x500.X500Principal;
import m1.C1005l;

public final class W2 extends Q1 {

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

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

    public SecureRandom f1170d;

    public final AtomicLong f1171e;

    public int f1172f;

    public Integer f1173g;

    public W2(I1 i12) {
        super(i12);
        this.f1173g = null;
        this.f1171e = new AtomicLong(0L);
    }

    public static void B(C0135p2 c0135p2, Bundle bundle, boolean z3) {
        if (bundle != null && c0135p2 != null) {
            if (!bundle.containsKey("_sc") || z3) {
                String str = c0135p2.f1496a;
                if (str != null) {
                    bundle.putString("_sn", str);
                } else {
                    bundle.remove("_sn");
                }
                String str2 = c0135p2.f1497b;
                if (str2 != null) {
                    bundle.putString("_sc", str2);
                } else {
                    bundle.remove("_sc");
                }
                bundle.putLong("_si", c0135p2.f1498c);
                return;
            }
            z3 = false;
        }
        if (bundle != null && c0135p2 == null && z3) {
            bundle.remove("_sn");
            bundle.remove("_sc");
            bundle.remove("_si");
        }
    }

    public static void F(V2 v22, String str, int i4, String str2, String str3, int i5) {
        Bundle bundle = new Bundle();
        h0(i4, bundle);
        if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
            bundle.putString(str2, str3);
        }
        if (i4 == 6 || i4 == 7 || i4 == 2) {
            bundle.putLong("_el", i5);
        }
        v22.j(str, bundle);
    }

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

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

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

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

    public static boolean f0(String str, String str2, String str3, String str4) {
        boolean isEmpty = TextUtils.isEmpty(str);
        boolean isEmpty2 = TextUtils.isEmpty(str2);
        if (!isEmpty && !isEmpty2) {
            C1005l.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[] g0(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 h0(int i4, Bundle bundle) {
        if (bundle == null || bundle.getLong("_err") != 0) {
            return false;
        }
        bundle.putLong("_err", i4);
        return true;
    }

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

    public static boolean l0(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 s0(byte[] bArr) {
        C1005l.i(bArr);
        int length = bArr.length;
        if (length <= 0) {
            throw new IllegalStateException();
        }
        int i4 = 0;
        long j4 = 0;
        for (int i5 = length - 1; i5 >= 0 && i5 >= bArr.length - 8; i5--) {
            j4 += (bArr[i5] & 255) << i4;
            i4 += 8;
        }
        return j4;
    }

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

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

    public static ArrayList y(List list) {
        if (list == null) {
            return new ArrayList(0);
        }
        ArrayList arrayList = new ArrayList(list.size());
        Iterator it = list.iterator();
        while (it.hasNext()) {
            zzac zzacVar = (zzac) it.next();
            Bundle bundle = new Bundle();
            bundle.putString("app_id", zzacVar.f7752a);
            bundle.putString("origin", zzacVar.f7753b);
            bundle.putLong("creation_timestamp", zzacVar.f7755d);
            bundle.putString("name", zzacVar.f7754c.f7769b);
            Object X3 = zzacVar.f7754c.X();
            C1005l.i(X3);
            V1.h(bundle, X3);
            bundle.putBoolean("active", zzacVar.f7756e);
            String str = zzacVar.f7757f;
            if (str != null) {
                bundle.putString("trigger_event_name", str);
            }
            zzau zzauVar = zzacVar.f7758g;
            if (zzauVar != null) {
                bundle.putString("timed_out_event_name", zzauVar.f7764a);
                zzas zzasVar = zzauVar.f7765b;
                if (zzasVar != null) {
                    bundle.putBundle("timed_out_event_params", zzasVar.X());
                }
            }
            bundle.putLong("trigger_timeout", zzacVar.f7759h);
            zzau zzauVar2 = zzacVar.f7760i;
            if (zzauVar2 != null) {
                bundle.putString("triggered_event_name", zzauVar2.f7764a);
                zzas zzasVar2 = zzauVar2.f7765b;
                if (zzasVar2 != null) {
                    bundle.putBundle("triggered_event_params", zzasVar2.X());
                }
            }
            bundle.putLong("triggered_timestamp", zzacVar.f7754c.f7770c);
            bundle.putLong("time_to_live", zzacVar.f7761j);
            zzau zzauVar3 = zzacVar.f7762k;
            if (zzauVar3 != null) {
                bundle.putString("expired_event_name", zzauVar3.f7764a);
                zzas zzasVar3 = zzauVar3.f7765b;
                if (zzasVar3 != null) {
                    bundle.putBundle("expired_event_params", zzasVar3.X());
                }
            }
            arrayList.add(bundle);
        }
        return arrayList;
    }

    public final void A(Bundle bundle, int i4, String str, Object obj) {
        if (h0(i4, bundle)) {
            ((I1) this.f1061b).getClass();
            bundle.putString("_ev", v(str, 40, true));
            if (obj != null) {
                if ((obj instanceof String) || (obj instanceof CharSequence)) {
                    bundle.putLong("_el", obj.toString().length());
                }
            }
        }
    }

    public final void C(Bundle bundle, Bundle bundle2) {
        if (bundle2 == null) {
            return;
        }
        for (String str : bundle2.keySet()) {
            if (!bundle.containsKey(str)) {
                W2 w22 = ((I1) this.f1061b).f991m;
                I1.g(w22);
                w22.G(bundle, str, bundle2.get(str));
            }
        }
    }

    public final void D(Parcelable[] parcelableArr, int i4, boolean z3) {
        C1005l.i(parcelableArr);
        for (Parcelable parcelable : parcelableArr) {
            Bundle bundle = (Bundle) parcelable;
            Iterator it = new TreeSet(bundle.keySet()).iterator();
            int i5 = 0;
            while (it.hasNext()) {
                String str = (String) it.next();
                if (c0(str) && !k0(str, V1.f1162h) && (i5 = i5 + 1) > i4) {
                    I1 i12 = (I1) this.f1061b;
                    if (z3) {
                        C0126n1 c0126n1 = i12.f988j;
                        I1.j(c0126n1);
                        C0106i1 c0106i1 = i12.f992n;
                        c0126n1.f1469i.c("Param can't contain more than " + i4 + " item-scoped custom parameters", c0106i1.e(str), c0106i1.b(bundle));
                        h0(28, bundle);
                    } else {
                        C0126n1 c0126n12 = i12.f988j;
                        I1.j(c0126n12);
                        C0106i1 c0106i12 = i12.f992n;
                        c0126n12.f1469i.c("Param cannot contain item-scoped custom parameters", c0106i12.e(str), c0106i12.b(bundle));
                        h0(23, bundle);
                    }
                    bundle.remove(str);
                }
            }
        }
    }

    public final void E(C0130o1 c0130o1, int i4) {
        Bundle bundle = (Bundle) c0130o1.f1488e;
        Iterator it = new TreeSet(bundle.keySet()).iterator();
        int i5 = 0;
        while (it.hasNext()) {
            String str = (String) it.next();
            if (c0(str) && (i5 = i5 + 1) > i4) {
                String d4 = AbstractC0889a.d("Event can't contain more than ", i4, " params");
                I1 i12 = (I1) this.f1061b;
                C0126n1 c0126n1 = i12.f988j;
                I1.j(c0126n1);
                String str2 = (String) c0130o1.f1486c;
                C0106i1 c0106i1 = i12.f992n;
                c0126n1.f1469i.c(d4, c0106i1.d(str2), c0106i1.b(bundle));
                h0(5, bundle);
                bundle.remove(str);
            }
        }
    }

    public final void G(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;
            I1 i12 = (I1) this.f1061b;
            C0126n1 c0126n1 = i12.f988j;
            I1.j(c0126n1);
            c0126n1.f1472l.c("Not putting event parameter. Invalid value type. name, type", i12.f992n.e(str), simpleName);
        }
    }

    public final void H(com.google.android.gms.internal.measurement.V v4, boolean z3) {
        Bundle bundle = new Bundle();
        bundle.putBoolean("r", z3);
        try {
            v4.s(bundle);
        } catch (RemoteException e4) {
            C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
            I1.j(c0126n1);
            c0126n1.f1470j.b(e4, "Error returning boolean value to wrapper");
        }
    }

    public final void I(com.google.android.gms.internal.measurement.V v4, ArrayList arrayList) {
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList("r", arrayList);
        try {
            v4.s(bundle);
        } catch (RemoteException e4) {
            C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
            I1.j(c0126n1);
            c0126n1.f1470j.b(e4, "Error returning bundle list to wrapper");
        }
    }

    public final void J(com.google.android.gms.internal.measurement.V v4, Bundle bundle) {
        try {
            v4.s(bundle);
        } catch (RemoteException e4) {
            C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
            I1.j(c0126n1);
            c0126n1.f1470j.b(e4, "Error returning bundle value to wrapper");
        }
    }

    public final void K(com.google.android.gms.internal.measurement.V v4, byte[] bArr) {
        Bundle bundle = new Bundle();
        bundle.putByteArray("r", bArr);
        try {
            v4.s(bundle);
        } catch (RemoteException e4) {
            C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
            I1.j(c0126n1);
            c0126n1.f1470j.b(e4, "Error returning byte array to wrapper");
        }
    }

    public final void L(com.google.android.gms.internal.measurement.V v4, int i4) {
        Bundle bundle = new Bundle();
        bundle.putInt("r", i4);
        try {
            v4.s(bundle);
        } catch (RemoteException e4) {
            C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
            I1.j(c0126n1);
            c0126n1.f1470j.b(e4, "Error returning int value to wrapper");
        }
    }

    public final void M(com.google.android.gms.internal.measurement.V v4, long j4) {
        Bundle bundle = new Bundle();
        bundle.putLong("r", j4);
        try {
            v4.s(bundle);
        } catch (RemoteException e4) {
            C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
            I1.j(c0126n1);
            c0126n1.f1470j.b(e4, "Error returning long value to wrapper");
        }
    }

    public final void N(String str, com.google.android.gms.internal.measurement.V v4) {
        Bundle bundle = new Bundle();
        bundle.putString("r", str);
        try {
            v4.s(bundle);
        } catch (RemoteException e4) {
            C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
            I1.j(c0126n1);
            c0126n1.f1470j.b(e4, "Error returning string value to wrapper");
        }
    }

    public final void O(java.lang.String r21, java.lang.String r22, android.os.Bundle r23, java.util.List r24, boolean r25) {
        throw new UnsupportedOperationException("Method not decompiled: J1.W2.O(java.lang.String, java.lang.String, android.os.Bundle, java.util.List, boolean):void");
    }

    public final boolean P(String str, String str2) {
        boolean isEmpty = TextUtils.isEmpty(str);
        I1 i12 = (I1) this.f1061b;
        if (!isEmpty) {
            C1005l.i(str);
            if (str.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$")) {
                return true;
            }
            if (TextUtils.isEmpty(i12.f981c)) {
                C0126n1 c0126n1 = i12.f988j;
                I1.j(c0126n1);
                c0126n1.f1469i.b(C0126n1.w(str), "Invalid google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI. provided id");
            }
            return false;
        }
        if (TextUtils.isEmpty(str2)) {
            if (TextUtils.isEmpty(i12.f981c)) {
                C0126n1 c0126n12 = i12.f988j;
                I1.j(c0126n12);
                c0126n12.f1469i.a("Missing google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI");
            }
            return false;
        }
        C1005l.i(str2);
        if (str2.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$")) {
            return true;
        }
        C0126n1 c0126n13 = i12.f988j;
        I1.j(c0126n13);
        c0126n13.f1469i.b(C0126n1.w(str2), "Invalid admob_app_id. Analytics disabled.");
        return false;
    }

    public final boolean Q(String str, int i4, String str2) {
        I1 i12 = (I1) this.f1061b;
        if (str2 == null) {
            C0126n1 c0126n1 = i12.f988j;
            I1.j(c0126n1);
            c0126n1.f1469i.b(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.codePointCount(0, str2.length()) <= i4) {
            return true;
        }
        C0126n1 c0126n12 = i12.f988j;
        I1.j(c0126n12);
        c0126n12.f1469i.d("Name is too long. Type, maximum supported length, name", str, Integer.valueOf(i4), str2);
        return false;
    }

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

    public final void S() {
        p();
        SecureRandom secureRandom = new SecureRandom();
        long nextLong = secureRandom.nextLong();
        if (nextLong == 0) {
            nextLong = secureRandom.nextLong();
            if (nextLong == 0) {
                C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
                I1.j(c0126n1);
                c0126n1.f1470j.a("Utils falling back to Random for random id");
            }
        }
        this.f1171e.set(nextLong);
    }

    public final boolean T(String str, String[] strArr, String[] strArr2, String str2) {
        I1 i12 = (I1) this.f1061b;
        if (str2 == null) {
            C0126n1 c0126n1 = i12.f988j;
            I1.j(c0126n1);
            c0126n1.f1469i.b(str, "Name is required and can't be null. Type");
            return false;
        }
        String[] strArr3 = f1168h;
        for (int i4 = 0; i4 < 3; i4++) {
            if (str2.startsWith(strArr3[i4])) {
                C0126n1 c0126n12 = i12.f988j;
                I1.j(c0126n12);
                c0126n12.f1469i.c("Name starts with reserved prefix. Type, name", str, str2);
                return false;
            }
        }
        if (strArr == null || !k0(str2, strArr)) {
            return true;
        }
        if (strArr2 != null && k0(str2, strArr2)) {
            return true;
        }
        C0126n1 c0126n13 = i12.f988j;
        I1.j(c0126n13);
        c0126n13.f1469i.c("Name is reserved. Type, name", str, str2);
        return false;
    }

    public final boolean U(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)) {
            if (!(obj instanceof String) && !(obj instanceof Character) && !(obj instanceof CharSequence)) {
                return false;
            }
            String obj2 = obj.toString();
            if (obj2.codePointCount(0, obj2.length()) > i4) {
                C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
                I1.j(c0126n1);
                c0126n1.f1472l.d("Value is too long; discarded. Value kind, name, value length", str, str2, Integer.valueOf(obj2.length()));
                return false;
            }
        }
        return true;
    }

    public final boolean V(String str, String str2) {
        I1 i12 = (I1) this.f1061b;
        if (str2 == null) {
            C0126n1 c0126n1 = i12.f988j;
            I1.j(c0126n1);
            c0126n1.f1469i.b(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.length() == 0) {
            C0126n1 c0126n12 = i12.f988j;
            I1.j(c0126n12);
            c0126n12.f1469i.b(str, "Name is required and can't be empty. Type");
            return false;
        }
        int codePointAt = str2.codePointAt(0);
        if (!Character.isLetter(codePointAt)) {
            if (codePointAt != 95) {
                C0126n1 c0126n13 = i12.f988j;
                I1.j(c0126n13);
                c0126n13.f1469i.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)) {
                C0126n1 c0126n14 = i12.f988j;
                I1.j(c0126n14);
                c0126n14.f1469i.c("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
                return false;
            }
            charCount += Character.charCount(codePointAt2);
        }
        return true;
    }

    public final boolean W(String str, String str2) {
        I1 i12 = (I1) this.f1061b;
        if (str2 == null) {
            C0126n1 c0126n1 = i12.f988j;
            I1.j(c0126n1);
            c0126n1.f1469i.b(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.length() == 0) {
            C0126n1 c0126n12 = i12.f988j;
            I1.j(c0126n12);
            c0126n12.f1469i.b(str, "Name is required and can't be empty. Type");
            return false;
        }
        int codePointAt = str2.codePointAt(0);
        if (!Character.isLetter(codePointAt)) {
            C0126n1 c0126n13 = i12.f988j;
            I1.j(c0126n13);
            c0126n13.f1469i.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)) {
                C0126n1 c0126n14 = i12.f988j;
                I1.j(c0126n14);
                c0126n14.f1469i.c("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
                return false;
            }
            charCount += Character.charCount(codePointAt2);
        }
        return true;
    }

    public final boolean X(String str) {
        p();
        I1 i12 = (I1) this.f1061b;
        if (x1.b.a(i12.f980b).f945a.checkCallingOrSelfPermission(str) == 0) {
            return true;
        }
        C0126n1 c0126n1 = i12.f988j;
        I1.j(c0126n1);
        c0126n1.f1474n.b(str, "Permission not granted");
        return false;
    }

    public final boolean Z(Context context, String str) {
        Signature[] signatureArr;
        I1 i12 = (I1) this.f1061b;
        X500Principal x500Principal = new X500Principal("CN=Android Debug,O=Android,C=US");
        try {
            PackageInfo g4 = x1.b.a(context).g(64, str);
            if (g4 == null || (signatureArr = g4.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 e4) {
            C0126n1 c0126n1 = i12.f988j;
            I1.j(c0126n1);
            c0126n1.f1467g.b(e4, "Package name not found");
            return true;
        } catch (CertificateException e5) {
            C0126n1 c0126n12 = i12.f988j;
            I1.j(c0126n12);
            c0126n12.f1467g.b(e5, "Error obtaining certificate");
            return true;
        }
    }

    public final boolean a0(int i4) {
        Boolean bool = ((I1) this.f1061b).s().f895f;
        if (r0() < i4 / 1000) {
            return (bool == null || bool.booleanValue()) ? false : true;
        }
        return true;
    }

    public final int i0(String str) {
        boolean equals = "_ldl".equals(str);
        I1 i12 = (I1) this.f1061b;
        if (equals) {
            i12.getClass();
            return 2048;
        }
        if ("_id".equals(str)) {
            i12.getClass();
            return 256;
        }
        if ("_lgclid".equals(str)) {
            i12.getClass();
            return 100;
        }
        i12.getClass();
        return 36;
    }

    public final Object j0(int i4, Object obj, boolean z3, boolean z4) {
        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);
        }
        if (obj instanceof Float) {
            return Double.valueOf(((Float) obj).doubleValue());
        }
        if ((obj instanceof String) || (obj instanceof Character) || (obj instanceof CharSequence)) {
            return v(obj.toString(), i4, z3);
        }
        if (!z4 || (!(obj instanceof Bundle[]) && !(obj instanceof Parcelable[]))) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (Parcelable parcelable : (Parcelable[]) obj) {
            if (parcelable instanceof Bundle) {
                Bundle v02 = v0((Bundle) parcelable);
                if (!v02.isEmpty()) {
                    arrayList.add(v02);
                }
            }
        }
        return arrayList.toArray(new Bundle[arrayList.size()]);
    }

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

    public final int n0(String str) {
        if (!V("event", str)) {
            return 2;
        }
        if (!T("event", V1.f1155a, V1.f1156b, str)) {
            return 13;
        }
        ((I1) this.f1061b).getClass();
        return !Q("event", 40, str) ? 2 : 0;
    }

    public final int o0(String str) {
        if (!V("event param", str)) {
            return 3;
        }
        if (!T("event param", null, null, str)) {
            return 14;
        }
        ((I1) this.f1061b).getClass();
        return !Q("event param", 40, str) ? 3 : 0;
    }

    public final int p0(String str) {
        if (!W("event param", str)) {
            return 3;
        }
        if (!T("event param", null, null, str)) {
            return 14;
        }
        ((I1) this.f1061b).getClass();
        return !Q("event param", 40, str) ? 3 : 0;
    }

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

    public final int q0(String str) {
        if (!V("user property", str)) {
            return 6;
        }
        if (!T("user property", V1.f1163i, null, str)) {
            return 15;
        }
        ((I1) this.f1061b).getClass();
        return !Q("user property", 24, str) ? 6 : 0;
    }

    public final int r0() {
        if (this.f1173g == null) {
            C0935e c0935e = C0935e.f10087b;
            Context context = ((I1) this.f1061b).f980b;
            c0935e.getClass();
            AtomicBoolean atomicBoolean = C0939i.f10089a;
            int i4 = 0;
            try {
                i4 = context.getPackageManager().getPackageInfo("com.google.android.gms", 0).versionCode;
            } catch (PackageManager.NameNotFoundException unused) {
                Log.w("GooglePlayServicesUtil", "Google Play services is missing.");
            }
            this.f1173g = Integer.valueOf(i4 / 1000);
        }
        return this.f1173g.intValue();
    }

    public final Object t(Object obj, String str) {
        boolean equals = "_ev".equals(str);
        int i4 = 256;
        I1 i12 = (I1) this.f1061b;
        if (equals) {
            i12.getClass();
            return j0(256, obj, true, true);
        }
        if (b0(str)) {
            i12.getClass();
        } else {
            i12.getClass();
            i4 = 100;
        }
        return j0(i4, obj, false, true);
    }

    public final long t0() {
        long andIncrement;
        long j4;
        if (this.f1171e.get() != 0) {
            synchronized (this.f1171e) {
                this.f1171e.compareAndSet(-1L, 1L);
                andIncrement = this.f1171e.getAndIncrement();
            }
            return andIncrement;
        }
        synchronized (this.f1171e) {
            long nanoTime = System.nanoTime();
            ((I1) this.f1061b).f993o.getClass();
            long nextLong = new Random(nanoTime ^ System.currentTimeMillis()).nextLong();
            int i4 = this.f1172f + 1;
            this.f1172f = i4;
            j4 = nextLong + i4;
        }
        return j4;
    }

    public final Object u(Object obj, String str) {
        return "_ldl".equals(str) ? j0(i0(str), obj, true, false) : j0(i0(str), obj, false, false);
    }

    public final Bundle u0(Uri uri, boolean z3) {
        String str;
        String str2;
        String str3;
        String str4;
        String str5;
        String str6;
        String str7;
        String str8;
        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 = uri.getQueryParameter("utm_id");
                str6 = uri.getQueryParameter("dclid");
                str7 = uri.getQueryParameter("srsltid");
                str8 = z3 ? 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) && (!z3 || 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(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 (z3 && !TextUtils.isEmpty(str8)) {
                bundle.putString("sfmc_id", str8);
            }
            return bundle;
        } catch (UnsupportedOperationException e4) {
            C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
            I1.j(c0126n1);
            c0126n1.f1470j.b(e4, "Install referrer url isn't a hierarchical URI");
            return null;
        }
    }

    public final Bundle v0(Bundle bundle) {
        Bundle bundle2 = new Bundle();
        if (bundle != null) {
            for (String str : bundle.keySet()) {
                Object t4 = t(bundle.get(str), str);
                if (t4 == null) {
                    I1 i12 = (I1) this.f1061b;
                    C0126n1 c0126n1 = i12.f988j;
                    I1.j(c0126n1);
                    c0126n1.f1472l.b(i12.f992n.e(str), "Param value can't be null");
                } else {
                    G(bundle2, str, t4);
                }
            }
        }
        return bundle2;
    }

    public final Bundle w0(String str, Bundle bundle, List list, boolean z3) {
        int p02;
        int i4;
        List list2 = list;
        boolean k02 = k0(str, V1.f1158d);
        if (bundle == null) {
            return null;
        }
        Bundle bundle2 = new Bundle(bundle);
        I1 i12 = (I1) this.f1061b;
        W2 w22 = ((I1) i12.f986h.f1061b).f991m;
        I1.g(w22);
        int i5 = w22.a0(201500000) ? 100 : 25;
        Iterator it = new TreeSet(bundle.keySet()).iterator();
        int i6 = 0;
        while (it.hasNext()) {
            String str2 = (String) it.next();
            if (list2 == null || !list2.contains(str2)) {
                p02 = !z3 ? p0(str2) : 0;
                if (p02 == 0) {
                    p02 = o0(str2);
                }
            } else {
                p02 = 0;
            }
            if (p02 != 0) {
                A(bundle2, p02, str2, p02 == 3 ? str2 : null);
                bundle2.remove(str2);
                i4 = i5;
            } else {
                i4 = i5;
                int R3 = R(str, str2, bundle.get(str2), bundle2, list, z3, k02);
                if (R3 == 17) {
                    A(bundle2, 17, str2, Boolean.FALSE);
                } else if (R3 != 0 && !"_ev".equals(str2)) {
                    A(bundle2, R3, R3 == 21 ? str : str2, bundle.get(str2));
                    bundle2.remove(str2);
                }
                if (c0(str2)) {
                    int i7 = i6 + 1;
                    if (i7 > i4) {
                        String d4 = AbstractC0889a.d("Event can't contain more than ", i4, " params");
                        C0126n1 c0126n1 = i12.f988j;
                        I1.j(c0126n1);
                        C0106i1 c0106i1 = i12.f992n;
                        c0126n1.f1469i.c(d4, c0106i1.d(str), c0106i1.b(bundle));
                        h0(5, bundle2);
                        bundle2.remove(str2);
                    }
                    i6 = i7;
                }
            }
            i5 = i4;
            list2 = list;
        }
        return bundle2;
    }

    public final SecureRandom x() {
        p();
        if (this.f1170d == null) {
            this.f1170d = new SecureRandom();
        }
        return this.f1170d;
    }

    public final zzau x0(String str, Bundle bundle, String str2, long j4, boolean z3) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        if (n0(str) != 0) {
            I1 i12 = (I1) this.f1061b;
            C0126n1 c0126n1 = i12.f988j;
            I1.j(c0126n1);
            c0126n1.f1467g.b(i12.f992n.f(str), "Invalid conditional property event name");
            throw new IllegalArgumentException();
        }
        Bundle bundle2 = bundle != null ? new Bundle(bundle) : new Bundle();
        bundle2.putString("_o", str2);
        Bundle w02 = w0(str, bundle2, Collections.singletonList("_o"), true);
        if (z3) {
            w02 = v0(w02);
        }
        C1005l.i(w02);
        return new zzau(str, new zzas(w02), str2, j4);
    }

    public final void z(Bundle bundle, long j4) {
        long j5 = bundle.getLong("_et");
        if (j5 != 0) {
            C0126n1 c0126n1 = ((I1) this.f1061b).f988j;
            I1.j(c0126n1);
            c0126n1.f1470j.b(Long.valueOf(j5), "Params already contained engagement");
        } else {
            j5 = 0;
        }
        bundle.putLong("_et", j4 + j5);
    }
}