导航菜单

页面标题

页面副标题

Moneyman v2.316.0.0 - k4.java 源代码

正在查看: Moneyman v2.316.0.0 应用的 k4.java JAVA 源代码文件

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


package W6;

import B.AbstractC0151g;
import a3.AbstractC0590d;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.pm.Signature;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import android.text.TextUtils;
import android.util.Log;
import androidx.privacysandbox.ads.adservices.java.measurement.MeasurementManagerFutures;
import com.freshchat.consumer.sdk.beans.config.DefaultUserEventsConfig;
import com.google.android.gms.internal.measurement.InterfaceC1002k0;
import com.google.android.gms.internal.measurement.R4;
import com.google.android.gms.measurement.internal.zzae;
import com.google.android.gms.measurement.internal.zzbe;
import com.google.android.gms.measurement.internal.zzbf;
import com.google.android.gms.measurement.internal.zzon;
import java.io.ByteArrayInputStream;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
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 k6.AbstractC1470e;
import k6.C1469d;

public final class k4 extends S2 {

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

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

    public SecureRandom f4928c;

    public final AtomicLong f4929d;

    public int f4930e;

    public MeasurementManagerFutures.Api33Ext5JavaImpl f4931f;

    public Boolean f4932g;

    public Integer f4933h;

    public k4(D2 d22) {
        super(d22);
        this.f4933h = null;
        this.f4929d = new AtomicLong(0L);
    }

    public static Bundle D(List list) {
        Bundle bundle = new Bundle();
        if (list != null) {
            Iterator it = list.iterator();
            while (it.hasNext()) {
                zzon zzonVar = (zzon) it.next();
                String str = zzonVar.f21048e;
                String str2 = zzonVar.f21045b;
                if (str != null) {
                    bundle.putString(str2, str);
                } else {
                    Long l7 = zzonVar.f21047d;
                    if (l7 != null) {
                        bundle.putLong(str2, l7.longValue());
                    } else {
                        Double d7 = zzonVar.f21050g;
                        if (d7 != null) {
                            bundle.putDouble(str2, d7.doubleValue());
                        }
                    }
                }
            }
        }
        return bundle;
    }

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

    public static String G(String str, int i5, boolean z7) {
        if (str != null) {
            if (str.codePointCount(0, str.length()) <= i5) {
                return str;
            }
            if (z7) {
                return AbstractC0151g.D(str.substring(0, str.offsetByCodePoints(0, i5)), "...");
            }
        }
        return null;
    }

    public static void I(C0498v3 c0498v3, Bundle bundle, boolean z7) {
        if (bundle == null || c0498v3 == null || (bundle.containsKey("_sc") && !z7)) {
            if (bundle != null && c0498v3 == null && z7) {
                bundle.remove("_sn");
                bundle.remove("_sc");
                bundle.remove("_si");
                return;
            }
            return;
        }
        String str = c0498v3.f5182a;
        if (str != null) {
            bundle.putString("_sn", str);
        } else {
            bundle.remove("_sn");
        }
        String str2 = c0498v3.f5183b;
        if (str2 != null) {
            bundle.putString("_sc", str2);
        } else {
            bundle.remove("_sc");
        }
        bundle.putLong("_si", c0498v3.f5184c);
    }

    public static void J(j4 j4Var, String str, int i5, String str2, String str3, int i7) {
        Bundle bundle = new Bundle();
        m0(i5, bundle);
        if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
            bundle.putString(str2, str3);
        }
        if (i5 == 6 || i5 == 7 || i5 == 2) {
            bundle.putLong("_el", i7);
        }
        j4Var.l(str, "_err", bundle);
    }

    public static void K(Bundle bundle, int i5, String str, Object obj) {
        if (m0(i5, bundle)) {
            bundle.putString("_ev", G(str, 40, true));
            if (obj != null) {
                if ((obj instanceof String) || (obj instanceof CharSequence)) {
                    bundle.putLong("_el", String.valueOf(obj).length());
                }
            }
        }
    }

    public static boolean Y(Context context) {
        ActivityInfo receiverInfo;
        o6.J.j(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 Z(Intent intent) {
        String stringExtra = intent.getStringExtra("android.intent.extra.REFERRER_NAME");
        return "android-app://com.google.android.googlequicksearchbox/https/www.google.com".equals(stringExtra) || "https://www.google.com".equals(stringExtra) || "android-app://com.google.appcrawler".equals(stringExtra);
    }

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

    public static boolean e0(String str, String str2, String str3, String str4) {
        boolean isEmpty = TextUtils.isEmpty(str);
        boolean isEmpty2 = TextUtils.isEmpty(str2);
        if (!isEmpty && !isEmpty2) {
            o6.J.j(str);
            return !str.equals(str2);
        }
        if (isEmpty && isEmpty2) {
            return (TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4)) ? !TextUtils.isEmpty(str4) : !str3.equals(str4);
        }
        if (isEmpty || !isEmpty2) {
            return TextUtils.isEmpty(str3) || !str3.equals(str4);
        }
        if (TextUtils.isEmpty(str4)) {
            return false;
        }
        return TextUtils.isEmpty(str3) || !str3.equals(str4);
    }

    public static boolean f0(String str, String[] strArr) {
        o6.J.j(strArr);
        for (String str2 : strArr) {
            if (Objects.equals(str, str2)) {
                return true;
            }
        }
        return false;
    }

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

    public static ArrayList l0(List list) {
        if (list == null) {
            return new ArrayList(0);
        }
        ArrayList arrayList = new ArrayList(list.size());
        Iterator it = list.iterator();
        while (it.hasNext()) {
            zzae zzaeVar = (zzae) it.next();
            Bundle bundle = new Bundle();
            bundle.putString("app_id", zzaeVar.f20960a);
            bundle.putString("origin", zzaeVar.f20961b);
            bundle.putLong("creation_timestamp", zzaeVar.f20963d);
            bundle.putString("name", zzaeVar.f20962c.f21045b);
            Object c7 = zzaeVar.f20962c.c();
            o6.J.j(c7);
            T2.f(bundle, c7);
            bundle.putBoolean("active", zzaeVar.f20964e);
            String str = zzaeVar.f20965f;
            if (str != null) {
                bundle.putString("trigger_event_name", str);
            }
            zzbf zzbfVar = zzaeVar.f20966g;
            if (zzbfVar != null) {
                bundle.putString("timed_out_event_name", zzbfVar.f20982a);
                zzbe zzbeVar = zzbfVar.f20983b;
                if (zzbeVar != null) {
                    bundle.putBundle("timed_out_event_params", zzbeVar.w());
                }
            }
            bundle.putLong("trigger_timeout", zzaeVar.f20967h);
            zzbf zzbfVar2 = zzaeVar.f20968i;
            if (zzbfVar2 != null) {
                bundle.putString("triggered_event_name", zzbfVar2.f20982a);
                zzbe zzbeVar2 = zzbfVar2.f20983b;
                if (zzbeVar2 != null) {
                    bundle.putBundle("triggered_event_params", zzbeVar2.w());
                }
            }
            bundle.putLong("triggered_timestamp", zzaeVar.f20962c.f21046c);
            bundle.putLong("time_to_live", zzaeVar.f20969j);
            zzbf zzbfVar3 = zzaeVar.k;
            if (zzbfVar3 != null) {
                bundle.putString("expired_event_name", zzbfVar3.f20982a);
                zzbe zzbeVar3 = zzbfVar3.f20983b;
                if (zzbeVar3 != null) {
                    bundle.putBundle("expired_event_params", zzbeVar3.w());
                }
            }
            arrayList.add(bundle);
        }
        return arrayList;
    }

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

    public static boolean q0(Context context) {
        ServiceInfo serviceInfo;
        try {
            PackageManager packageManager = context.getPackageManager();
            if (packageManager != null && (serviceInfo = packageManager.getServiceInfo(new ComponentName(context, "com.google.android.gms.measurement.AppMeasurementJobService"), 0)) != null) {
                if (serviceInfo.enabled) {
                    return true;
                }
            }
        } catch (PackageManager.NameNotFoundException unused) {
        }
        return false;
    }

    public static boolean u0(String str) {
        String str2 = (String) AbstractC0494v.f5179z0.a(null);
        return str2.equals("*") || Arrays.asList(str2.split(",")).contains(str);
    }

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

    public static boolean x0(String str) {
        o6.J.f(str);
        return str.charAt(0) != '_' || str.equals("_ep");
    }

    public static long y(zzbe zzbeVar) {
        long j2 = 0;
        if (zzbeVar == null) {
            return 0L;
        }
        Bundle bundle = zzbeVar.f20981a;
        Iterator<String> it = bundle.keySet().iterator();
        while (it.hasNext()) {
            if (bundle.get(it.next()) instanceof Parcelable[]) {
                j2 += ((Parcelable[]) r3).length;
            }
        }
        return j2;
    }

    public static long z(byte[] bArr) {
        o6.J.j(bArr);
        if (bArr.length <= 0) {
            throw new IllegalStateException();
        }
        int i5 = 0;
        long j2 = 0;
        for (int length = bArr.length - 1; length >= 0 && length >= bArr.length - 8; length--) {
            j2 += (bArr[length] & 255) << i5;
            i5 += 8;
        }
        return j2;
    }

    public static int z0(String str) {
        if ("_ldl".equals(str)) {
            return 2048;
        }
        return "_id".equals(str) ? DefaultUserEventsConfig.MAX_CHARACTERS_PER_EVENT_PROPERTY_VALUE : "_lgclid".equals(str) ? 100 : 36;
    }

    public final Bundle A(Uri uri, boolean z7) {
        String str;
        String str2;
        String str3;
        String str4;
        String str5;
        String str6;
        String str7;
        String str8;
        String str9;
        String str10;
        if (uri == null) {
            return null;
        }
        try {
            if (uri.isHierarchical()) {
                str = uri.getQueryParameter("utm_campaign");
                str2 = uri.getQueryParameter("utm_source");
                str3 = uri.getQueryParameter("utm_medium");
                str4 = uri.getQueryParameter("gclid");
                str5 = z7 ? uri.getQueryParameter("gbraid") : null;
                str6 = uri.getQueryParameter("utm_id");
                str7 = uri.getQueryParameter("dclid");
                str8 = uri.getQueryParameter("srsltid");
                str9 = uri.getQueryParameter("sfmc_id");
            } else {
                str = null;
                str2 = null;
                str3 = null;
                str4 = null;
                str5 = null;
                str6 = null;
                str7 = null;
                str8 = null;
                str9 = null;
            }
            if (TextUtils.isEmpty(str) && TextUtils.isEmpty(str2) && TextUtils.isEmpty(str3) && TextUtils.isEmpty(str4) && ((!z7 || TextUtils.isEmpty(str5)) && TextUtils.isEmpty(str6) && TextUtils.isEmpty(str7) && TextUtils.isEmpty(str8) && TextUtils.isEmpty(str9))) {
                return null;
            }
            Bundle bundle = new Bundle();
            if (TextUtils.isEmpty(str)) {
                str10 = "sfmc_id";
            } else {
                str10 = "sfmc_id";
                bundle.putString("campaign", str);
            }
            if (!TextUtils.isEmpty(str2)) {
                bundle.putString("source", str2);
            }
            if (!TextUtils.isEmpty(str3)) {
                bundle.putString("medium", str3);
            }
            if (!TextUtils.isEmpty(str4)) {
                bundle.putString("gclid", str4);
            }
            if (z7 && !TextUtils.isEmpty(str5)) {
                bundle.putString("gbraid", str5);
            }
            String queryParameter = uri.getQueryParameter("gad_source");
            if (z7 && !TextUtils.isEmpty(queryParameter)) {
                bundle.putString("gad_source", queryParameter);
            }
            String queryParameter2 = uri.getQueryParameter("utm_term");
            if (!TextUtils.isEmpty(queryParameter2)) {
                bundle.putString("term", queryParameter2);
            }
            String queryParameter3 = uri.getQueryParameter("utm_content");
            if (!TextUtils.isEmpty(queryParameter3)) {
                bundle.putString("content", queryParameter3);
            }
            String queryParameter4 = uri.getQueryParameter("aclid");
            if (!TextUtils.isEmpty(queryParameter4)) {
                bundle.putString("aclid", queryParameter4);
            }
            String queryParameter5 = uri.getQueryParameter("cp1");
            if (!TextUtils.isEmpty(queryParameter5)) {
                bundle.putString("cp1", queryParameter5);
            }
            String queryParameter6 = uri.getQueryParameter("anid");
            if (!TextUtils.isEmpty(queryParameter6)) {
                bundle.putString("anid", queryParameter6);
            }
            if (!TextUtils.isEmpty(str6)) {
                bundle.putString("campaign_id", str6);
            }
            if (!TextUtils.isEmpty(str7)) {
                bundle.putString("dclid", str7);
            }
            String queryParameter7 = uri.getQueryParameter("utm_source_platform");
            if (!TextUtils.isEmpty(queryParameter7)) {
                bundle.putString("source_platform", queryParameter7);
            }
            String queryParameter8 = uri.getQueryParameter("utm_creative_format");
            if (!TextUtils.isEmpty(queryParameter8)) {
                bundle.putString("creative_format", queryParameter8);
            }
            String queryParameter9 = uri.getQueryParameter("utm_marketing_tactic");
            if (!TextUtils.isEmpty(queryParameter9)) {
                bundle.putString("marketing_tactic", queryParameter9);
            }
            if (!TextUtils.isEmpty(str8)) {
                bundle.putString("srsltid", str8);
            }
            if (!TextUtils.isEmpty(str9)) {
                bundle.putString(str10, str9);
            }
            return bundle;
        } catch (UnsupportedOperationException e4) {
            f().f4829i.a(e4, "Install referrer url isn't a hierarchical URI");
            return null;
        }
    }

    public final long A0() {
        throw new UnsupportedOperationException("Method not decompiled: W6.k4.A0():long");
    }

    public final Bundle B(Bundle bundle) {
        Bundle bundle2 = new Bundle();
        if (bundle != null) {
            for (String str : bundle.keySet()) {
                Object k02 = k0(bundle.get(str), str);
                if (k02 == null) {
                    C0403c2 f7 = f();
                    f7.k.a(((D2) this.f2001a).f4600m.f(str), "Param value can't be null");
                } else {
                    N(bundle2, str, k02);
                }
            }
        }
        return bundle2;
    }

    public final long B0() {
        long andIncrement;
        long j2;
        if (this.f4929d.get() != 0) {
            synchronized (this.f4929d) {
                this.f4929d.compareAndSet(-1L, 1L);
                andIncrement = this.f4929d.getAndIncrement();
            }
            return andIncrement;
        }
        synchronized (this.f4929d) {
            long nanoTime = System.nanoTime();
            ((D2) this.f2001a).f4601n.getClass();
            long nextLong = new Random(nanoTime ^ System.currentTimeMillis()).nextLong();
            int i5 = this.f4930e + 1;
            this.f4930e = i5;
            j2 = nextLong + i5;
        }
        return j2;
    }

    public final android.os.Bundle C(java.lang.String r18, android.os.Bundle r19, java.util.List r20, boolean r21) {
        throw new UnsupportedOperationException("Method not decompiled: W6.k4.C(java.lang.String, android.os.Bundle, java.util.List, boolean):android.os.Bundle");
    }

    public final MeasurementManagerFutures C0() {
        if (this.f4931f == null) {
            Context context = ((D2) this.f2001a).f4589a;
            MeasurementManagerFutures.f15572a.getClass();
            kotlin.jvm.internal.i.g(context, "context");
            AbstractC0590d.f5759a.getClass();
            int i5 = Build.VERSION.SDK_INT;
            Y2.a aVar = Y2.a.f5439a;
            if (i5 >= 30) {
                aVar.a();
            }
            AbstractC0590d.a aVar2 = (i5 >= 30 ? aVar.a() : 0) >= 5 ? new AbstractC0590d.a(context) : null;
            this.f4931f = aVar2 != null ? new MeasurementManagerFutures.Api33Ext5JavaImpl(aVar2) : null;
        }
        return this.f4931f;
    }

    public final String D0() {
        byte[] bArr = new byte[16];
        F0().nextBytes(bArr);
        return String.format(Locale.US, "%032x", new BigInteger(1, bArr));
    }

    public final zzbf E(String str, Bundle bundle, String str2, long j2, boolean z7) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        if (w(str) != 0) {
            f().f4826f.a(((D2) this.f2001a).f4600m.g(str), "Invalid conditional property event name");
            throw new IllegalArgumentException();
        }
        Bundle bundle2 = bundle != null ? new Bundle(bundle) : new Bundle();
        bundle2.putString("_o", str2);
        Bundle C7 = C(str, bundle2, Collections.singletonList("_o"), true);
        if (z7) {
            C7 = B(C7);
        }
        o6.J.j(C7);
        return new zzbf(str, new zzbe(C7), str2, j2);
    }

    public final Object F(int i5, Object obj, boolean z7, boolean z8) {
        if (obj == null) {
            return null;
        }
        if ((obj instanceof Long) || (obj instanceof Double)) {
            return obj;
        }
        if (obj instanceof Integer) {
            return Long.valueOf(((Integer) obj).intValue());
        }
        if (obj instanceof Byte) {
            return Long.valueOf(((Byte) obj).byteValue());
        }
        if (obj instanceof Short) {
            return Long.valueOf(((Short) obj).shortValue());
        }
        if (obj instanceof Boolean) {
            return Long.valueOf(((Boolean) obj).booleanValue() ? 1L : 0L);
        }
        if (obj instanceof Float) {
            return Double.valueOf(((Float) obj).doubleValue());
        }
        if ((obj instanceof String) || (obj instanceof Character) || (obj instanceof CharSequence)) {
            return G(String.valueOf(obj), i5, z7);
        }
        if (!z8) {
            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 B7 = B((Bundle) parcelable);
                if (!B7.isEmpty()) {
                    arrayList.add(B7);
                }
            }
        }
        return arrayList.toArray(new Bundle[arrayList.size()]);
    }

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

    public final void H(C0423g2 c0423g2, int i5) {
        Iterator it = new TreeSet(c0423g2.f4876d.keySet()).iterator();
        int i7 = 0;
        while (it.hasNext()) {
            String str = (String) it.next();
            if (x0(str) && (i7 = i7 + 1) > i5) {
                String h3 = AbstractC0151g.h(i5, "Event can't contain more than ", " params");
                C0403c2 f7 = f();
                D2 d22 = (D2) this.f2001a;
                String c7 = d22.f4600m.c(c0423g2.f4873a);
                Bundle bundle = c0423g2.f4876d;
                f7.f4828h.c(h3, c7, d22.f4600m.a(bundle));
                m0(5, bundle);
                bundle.remove(str);
            }
        }
    }

    public final void L(Bundle bundle, long j2) {
        long j5 = bundle.getLong("_et");
        if (j5 != 0) {
            C0403c2 f7 = f();
            f7.f4829i.a(Long.valueOf(j5), "Params already contained engagement");
        }
        bundle.putLong("_et", j2 + j5);
    }

    public final void M(Bundle bundle, Bundle bundle2) {
        if (bundle2 == null) {
            return;
        }
        for (String str : bundle2.keySet()) {
            if (!bundle.containsKey(str)) {
                q().N(bundle, str, bundle2.get(str));
            }
        }
    }

    public final void N(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);
        } else if (str != null) {
            String simpleName = obj != null ? obj.getClass().getSimpleName() : null;
            f().k.c("Not putting event parameter. Invalid value type. name, type", ((D2) this.f2001a).f4600m.f(str), simpleName);
        }
    }

    public final void O(InterfaceC1002k0 interfaceC1002k0, int i5) {
        Bundle bundle = new Bundle();
        bundle.putInt("r", i5);
        try {
            interfaceC1002k0.m(bundle);
        } catch (RemoteException e4) {
            C0403c2 c0403c2 = ((D2) this.f2001a).f4597i;
            D2.g(c0403c2);
            c0403c2.f4829i.a(e4, "Error returning int value to wrapper");
        }
    }

    public final void P(InterfaceC1002k0 interfaceC1002k0, long j2) {
        Bundle bundle = new Bundle();
        bundle.putLong("r", j2);
        try {
            interfaceC1002k0.m(bundle);
        } catch (RemoteException e4) {
            C0403c2 c0403c2 = ((D2) this.f2001a).f4597i;
            D2.g(c0403c2);
            c0403c2.f4829i.a(e4, "Error returning long value to wrapper");
        }
    }

    public final void Q(InterfaceC1002k0 interfaceC1002k0, Bundle bundle) {
        try {
            interfaceC1002k0.m(bundle);
        } catch (RemoteException e4) {
            C0403c2 c0403c2 = ((D2) this.f2001a).f4597i;
            D2.g(c0403c2);
            c0403c2.f4829i.a(e4, "Error returning bundle value to wrapper");
        }
    }

    public final void R(InterfaceC1002k0 interfaceC1002k0, ArrayList arrayList) {
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList("r", arrayList);
        try {
            interfaceC1002k0.m(bundle);
        } catch (RemoteException e4) {
            C0403c2 c0403c2 = ((D2) this.f2001a).f4597i;
            D2.g(c0403c2);
            c0403c2.f4829i.a(e4, "Error returning bundle list to wrapper");
        }
    }

    public final void S(InterfaceC1002k0 interfaceC1002k0, boolean z7) {
        Bundle bundle = new Bundle();
        bundle.putBoolean("r", z7);
        try {
            interfaceC1002k0.m(bundle);
        } catch (RemoteException e4) {
            C0403c2 c0403c2 = ((D2) this.f2001a).f4597i;
            D2.g(c0403c2);
            c0403c2.f4829i.a(e4, "Error returning boolean value to wrapper");
        }
    }

    public final void T(InterfaceC1002k0 interfaceC1002k0, byte[] bArr) {
        Bundle bundle = new Bundle();
        bundle.putByteArray("r", bArr);
        try {
            interfaceC1002k0.m(bundle);
        } catch (RemoteException e4) {
            C0403c2 c0403c2 = ((D2) this.f2001a).f4597i;
            D2.g(c0403c2);
            c0403c2.f4829i.a(e4, "Error returning byte array to wrapper");
        }
    }

    public final void U(String str, InterfaceC1002k0 interfaceC1002k0) {
        Bundle bundle = new Bundle();
        bundle.putString("r", str);
        try {
            interfaceC1002k0.m(bundle);
        } catch (RemoteException e4) {
            C0403c2 c0403c2 = ((D2) this.f2001a).f4597i;
            D2.g(c0403c2);
            c0403c2.f4829i.a(e4, "Error returning string value to wrapper");
        }
    }

    public final void V(java.lang.String r18, java.lang.String r19, android.os.Bundle r20, java.util.List r21, boolean r22) {
        throw new UnsupportedOperationException("Method not decompiled: W6.k4.V(java.lang.String, java.lang.String, android.os.Bundle, java.util.List, boolean):void");
    }

    public final void W(Parcelable[] parcelableArr, int i5) {
        o6.J.j(parcelableArr);
        for (Parcelable parcelable : parcelableArr) {
            Bundle bundle = (Bundle) parcelable;
            Iterator it = new TreeSet(bundle.keySet()).iterator();
            int i7 = 0;
            while (it.hasNext()) {
                String str = (String) it.next();
                if (x0(str) && !f0(str, T2.f4766j) && (i7 = i7 + 1) > i5) {
                    C0403c2 f7 = f();
                    String h3 = AbstractC0151g.h(i5, "Param can't contain more than ", " item-scoped custom parameters");
                    D2 d22 = (D2) this.f2001a;
                    f7.f4828h.c(h3, d22.f4600m.f(str), d22.f4600m.a(bundle));
                    m0(28, bundle);
                    bundle.remove(str);
                }
            }
        }
    }

    public final boolean X(int i5, String str, String str2) {
        if (str2 == null) {
            f().f4828h.a(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.codePointCount(0, str2.length()) <= i5) {
            return true;
        }
        C0403c2 f7 = f();
        f7.f4828h.d("Name is too long. Type, maximum supported length, name", str, Integer.valueOf(i5), str2);
        return false;
    }

    public final boolean b0(String str, double d7) {
        try {
            SharedPreferences.Editor edit = ((D2) this.f2001a).f4589a.getSharedPreferences("google.analytics.deferred.deeplink.prefs", 0).edit();
            edit.putString("deeplink", str);
            edit.putLong("timestamp", Double.doubleToRawLongBits(d7));
            return edit.commit();
        } catch (RuntimeException e4) {
            f().f4826f.a(e4, "Failed to persist Deferred Deep Link. exception");
            return false;
        }
    }

    public final boolean c0(String str, String str2) {
        boolean isEmpty = TextUtils.isEmpty(str);
        D2 d22 = (D2) this.f2001a;
        if (!isEmpty) {
            o6.J.j(str);
            if (str.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$")) {
                return true;
            }
            if (TextUtils.isEmpty(d22.f4590b)) {
                C0403c2 f7 = f();
                f7.f4828h.a(C0403c2.v(str), "Invalid google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI. provided id");
                return false;
            }
        } else {
            if (!TextUtils.isEmpty(str2)) {
                o6.J.j(str2);
                if (str2.matches("^(1:\\d+:android:[a-f0-9]+|ca-app-pub-.*)$")) {
                    return true;
                }
                C0403c2 f8 = f();
                f8.f4828h.a(C0403c2.v(str2), "Invalid admob_app_id. Analytics disabled.");
                return false;
            }
            if (TextUtils.isEmpty(d22.f4590b)) {
                f().f4828h.b("Missing google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI");
            }
        }
        return false;
    }

    public final boolean d0(String str, String str2, int i5, 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 valueOf = String.valueOf(obj);
        if (valueOf.codePointCount(0, valueOf.length()) > i5) {
            C0403c2 f7 = f();
            f7.k.d("Value is too long; discarded. Value kind, name, value length", str, str2, Integer.valueOf(valueOf.length()));
            return false;
        }
        return true;
    }

    public final boolean g0(String str, String[] strArr, String[] strArr2, String str2) {
        if (str2 == null) {
            f().f4828h.a(str, "Name is required and can't be null. Type");
            return false;
        }
        String[] strArr3 = f4926i;
        for (int i5 = 0; i5 < 3; i5++) {
            if (str2.startsWith(strArr3[i5])) {
                f().f4828h.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)) {
            return true;
        }
        f().f4828h.c("Name is reserved. Type, name", str, str2);
        return false;
    }

    public final boolean i0(int i5) {
        Boolean bool = ((D2) this.f2001a).r().f5198e;
        if (v0() < i5 / 1000) {
            return (bool == null || bool.booleanValue()) ? false : true;
        }
        return true;
    }

    public final int j0(String str) {
        if (!o0("user property", str)) {
            return 6;
        }
        if (g0("user property", T2.f4761e, null, str)) {
            return !X(24, "user property", str) ? 6 : 0;
        }
        return 15;
    }

    public final Object k0(Object obj, String str) {
        boolean equals = "_ev".equals(str);
        int i5 = 500;
        D2 d22 = (D2) this.f2001a;
        if (equals) {
            d22.f4595g.getClass();
            return F(Math.max(500, DefaultUserEventsConfig.MAX_CHARACTERS_PER_EVENT_PROPERTY_VALUE), obj, true, true);
        }
        if (w0(str)) {
            d22.f4595g.getClass();
            i5 = Math.max(500, DefaultUserEventsConfig.MAX_CHARACTERS_PER_EVENT_PROPERTY_VALUE);
        } else {
            d22.f4595g.getClass();
        }
        return F(i5, obj, false, true);
    }

    public final boolean n0(Context context, String str) {
        Signature[] signatureArr;
        X500Principal x500Principal = new X500Principal("CN=Android Debug,O=Android,C=US");
        try {
            PackageInfo b8 = B6.c.a(context).b(64, str);
            if (b8 == null || (signatureArr = b8.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) {
            f().f4826f.a(e4, "Package name not found");
            return true;
        } catch (CertificateException e7) {
            f().f4826f.a(e7, "Error obtaining certificate");
            return true;
        }
    }

    public final boolean o0(String str, String str2) {
        if (str2 == null) {
            f().f4828h.a(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.length() == 0) {
            f().f4828h.a(str, "Name is required and can't be empty. Type");
            return false;
        }
        int codePointAt = str2.codePointAt(0);
        if (!Character.isLetter(codePointAt) && codePointAt != 95) {
            f().f4828h.c("Name must start with a letter or _ (underscore). 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)) {
                f().f4828h.c("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
                return false;
            }
            charCount += Character.charCount(codePointAt2);
        }
        return true;
    }

    public final Object p0(Object obj, String str) {
        return "_ldl".equals(str) ? F(z0(str), obj, true, false) : F(z0(str), obj, false, false);
    }

    public final boolean r0(String str, String str2) {
        if (str2 == null) {
            f().f4828h.a(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.length() == 0) {
            f().f4828h.a(str, "Name is required and can't be empty. Type");
            return false;
        }
        int codePointAt = str2.codePointAt(0);
        if (!Character.isLetter(codePointAt)) {
            f().f4828h.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)) {
                f().f4828h.c("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
                return false;
            }
            charCount += Character.charCount(codePointAt2);
        }
        return true;
    }

    public final boolean s0(String str, String str2) {
        R4.a();
        D2 d22 = (D2) this.f2001a;
        if (d22.f4595g.C(null, AbstractC0494v.f5175x0) && !TextUtils.isEmpty(str2)) {
            return true;
        }
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        return d22.f4595g.t("debug.firebase.analytics.app").equals(str);
    }

    public final boolean t0(String str) {
        r();
        if (B6.c.a(((D2) this.f2001a).f4589a).f452a.checkCallingOrSelfPermission(str) == 0) {
            return true;
        }
        f().f4832m.a(str, "Permission not granted");
        return false;
    }

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

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

    public final int v0() {
        if (this.f4933h == null) {
            C1469d c1469d = C1469d.f22417b;
            Context context = ((D2) this.f2001a).f4589a;
            c1469d.getClass();
            AtomicBoolean atomicBoolean = AbstractC1470e.f22418a;
            int i5 = 0;
            try {
                i5 = context.getPackageManager().getPackageInfo("com.google.android.gms", 0).versionCode;
            } catch (PackageManager.NameNotFoundException unused) {
                Log.w("GooglePlayServicesUtil", "Google Play services is missing.");
            }
            this.f4933h = Integer.valueOf(i5 / 1000);
        }
        return this.f4933h.intValue();
    }

    public final int w(String str) {
        if (!o0("event", str)) {
            return 2;
        }
        if (g0("event", T2.f4757a, T2.f4758b, str)) {
            return !X(40, "event", str) ? 2 : 0;
        }
        return 13;
    }

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

    public final boolean y0(String str) {
        List<ResolveInfo> queryIntentActivities;
        return (TextUtils.isEmpty(str) || (queryIntentActivities = ((D2) this.f2001a).f4589a.getPackageManager().queryIntentActivities(new Intent("android.intent.action.VIEW", Uri.parse(str)), 0)) == null || queryIntentActivities.isEmpty()) ? false : true;
    }
}