package defpackage;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ServiceInfo;
import android.content.pm.Signature;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.ext.SdkExtensions;
import android.text.TextUtils;
import j$.util.Objects;
import java.io.ByteArrayInputStream;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import java.util.TreeSet;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicLong;
import javax.security.auth.x500.X500Principal;

/* JADX INFO: renamed from: ᵣʾ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C3335 extends AbstractC4440 {

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public Boolean f12795;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public Integer f12796;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public SecureRandom f12797;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final AtomicLong f12798;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public int f12799;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public C4929 f12800;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public static final String[] f12794 = {"firebase_", "google_", "ga_"};

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public static final String[] f12793 = {"_err"};

    public C3335(C1103 c1103) {
        super(c1103);
        this.f12796 = null;
        this.f12798 = new AtomicLong(0L);
    }

    /* JADX INFO: renamed from: ˀᵗ, reason: contains not printable characters */
    public static long m7605(byte[] bArr) {
        ᵘᵞʿⁱ.ᵶᵥᵝ(bArr);
        int length = bArr.length;
        long j = 0;
        if (length <= 0) {
            ᵷᵝˎ.ᵱʡˏ();
            return 0L;
        }
        int i = 0;
        for (int i2 = length - 1; i2 >= 0 && i2 >= bArr.length - 8; i2--) {
            j += (((long) bArr[i2]) & 255) << i;
            i += 8;
        }
        return j;
    }

    /* JADX INFO: renamed from: ˀᵝᵙᵛ, reason: contains not printable characters */
    public static boolean m7606(String str) {
        ᵘᵞʿⁱ.ˊᵫᵗ(str);
        return str.charAt(0) != '_' || str.equals("_ep");
    }

    /* JADX INFO: renamed from: ˁʢᵛ, reason: contains not printable characters */
    public static MessageDigest m7607() {
        MessageDigest messageDigest;
        for (int i = 0; i < 2; i++) {
            try {
                messageDigest = MessageDigest.getInstance("MD5");
            } catch (NoSuchAlgorithmException unused) {
            }
            if (messageDigest != null) {
                return messageDigest;
            }
        }
        return null;
    }

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public static String m7608(int i, String str, boolean z) {
        if (str == null) {
            return null;
        }
        if (str.codePointCount(0, str.length()) <= i) {
            return str;
        }
        if (z) {
            return str.substring(0, str.offsetByCodePoints(0, i)).concat("...");
        }
        return null;
    }

    /* JADX INFO: renamed from: ˊʧᵖ, reason: contains not printable characters */
    public static boolean m7609(Intent intent) {
        String stringExtra = intent.getStringExtra("android.intent.extra.REFERRER_NAME");
        if ("android-app://com.google.android.googlequicksearchbox/https/www.google.com".equals(stringExtra) || "android-app://com.google.appcrawler".equals(stringExtra)) {
            return true;
        }
        if (TextUtils.isEmpty(stringExtra)) {
            return false;
        }
        try {
            String host = new URL(stringExtra).getHost();
            if (TextUtils.isEmpty(host)) {
                return false;
            }
            return host.matches("^(www\\.)?google(\\.com?)?(\\.[a-z]{2}t?)?$");
        } catch (MalformedURLException unused) {
            return false;
        }
    }

    /* JADX INFO: renamed from: ˊˌˊ, reason: contains not printable characters */
    public static void m7610(InterfaceC4029 interfaceC4029, String str, int i, String str2, String str3, int i2) {
        Bundle bundle = new Bundle();
        m7611(i, bundle);
        if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
            bundle.putString(str2, str3);
        }
        if (i == 6 || i == 7 || i == 2) {
            bundle.putLong("_el", i2);
        }
        interfaceC4029.mo7126(str, "_err", bundle);
    }

    /* JADX INFO: renamed from: ˋʿᐧ, reason: contains not printable characters */
    public static final boolean m7611(int i, Bundle bundle) {
        if (bundle == null || bundle.getLong("_err") != 0) {
            return false;
        }
        bundle.putLong("_err", i);
        return true;
    }

    /* JADX INFO: renamed from: ˋᵯᵩ, reason: contains not printable characters */
    public static boolean m7612(String str, String[] strArr) {
        ᵘᵞʿⁱ.ᵶᵥᵝ(strArr);
        for (String str2 : strArr) {
            if (Objects.equals(str, str2)) {
                return true;
            }
        }
        return false;
    }

    /* JADX INFO: renamed from: ˏᵩʨ, reason: contains not printable characters */
    public static boolean m7613(Context context) {
        ᵘᵞʿⁱ.ᵶᵥᵝ(context);
        return Build.VERSION.SDK_INT >= 24 ? m7617(context, "com.google.android.gms.measurement.AppMeasurementJobService") : m7617(context, "com.google.android.gms.measurement.AppMeasurementService");
    }

    /* JADX INFO: renamed from: ᵕᵜʽᵰ, reason: contains not printable characters */
    public static ArrayList m7614(List list) {
        if (list == null) {
            return new ArrayList(0);
        }
        ArrayList arrayList = new ArrayList(list.size());
        Iterator it = list.iterator();
        while (it.hasNext()) {
            C3833 c3833 = (C3833) it.next();
            Bundle bundle = new Bundle();
            bundle.putString("app_id", c3833.f14633);
            bundle.putString("origin", c3833.f14637);
            bundle.putLong("creation_timestamp", c3833.f14638);
            bundle.putString("name", c3833.f14636.f4262);
            Object objM3298 = c3833.f14636.m3298();
            ᵘᵞʿⁱ.ᵶᵥᵝ(objM3298);
            ᵷˆᵣ.ˊᵨᵧ(bundle, objM3298);
            bundle.putBoolean("active", c3833.f14639);
            String str = c3833.f14640;
            if (str != null) {
                bundle.putString("trigger_event_name", str);
            }
            C0357 c0357 = c3833.f14632;
            if (c0357 != null) {
                bundle.putString("timed_out_event_name", c0357.f2152);
                C3590 c3590 = c0357.f2154;
                if (c3590 != null) {
                    bundle.putBundle("timed_out_event_params", c3590.m8121());
                }
            }
            bundle.putLong("trigger_timeout", c3833.f14634);
            C0357 c03572 = c3833.f14641;
            if (c03572 != null) {
                bundle.putString("triggered_event_name", c03572.f2152);
                C3590 c35902 = c03572.f2154;
                if (c35902 != null) {
                    bundle.putBundle("triggered_event_params", c35902.m8121());
                }
            }
            bundle.putLong("triggered_timestamp", c3833.f14636.f4261);
            bundle.putLong("time_to_live", c3833.f14635);
            C0357 c03573 = c3833.f14631;
            if (c03573 != null) {
                bundle.putString("expired_event_name", c03573.f2152);
                C3590 c35903 = c03573.f2154;
                if (c35903 != null) {
                    bundle.putBundle("expired_event_params", c35903.m8121());
                }
            }
            arrayList.add(bundle);
        }
        return arrayList;
    }

    /* JADX INFO: renamed from: ᵗᵭ, reason: contains not printable characters */
    public static boolean m7615(String str) {
        return !TextUtils.isEmpty(str) && str.startsWith("_");
    }

    /* JADX INFO: renamed from: ᵘᵝ, reason: contains not printable characters */
    public static byte[] m7616(Parcelable parcelable) {
        if (parcelable == null) {
            return null;
        }
        Parcel parcelObtain = Parcel.obtain();
        try {
            parcelable.writeToParcel(parcelObtain, 0);
            return parcelObtain.marshall();
        } finally {
            parcelObtain.recycle();
        }
    }

    /* JADX INFO: renamed from: ᵛˀˊ, reason: contains not printable characters */
    public static boolean m7617(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;
    }

    /* JADX INFO: renamed from: ᵜᵤ, reason: contains not printable characters */
    public static final boolean m7618(String str, String str2) {
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        return str.equals("*") || Arrays.asList(str.split(",")).contains(str2);
    }

    /* JADX INFO: renamed from: ᵟᵴᵥ, reason: contains not printable characters */
    public static boolean m7619(Context context) {
        ActivityInfo receiverInfo;
        ᵘᵞʿⁱ.ᵶᵥᵝ(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;
    }

    /* JADX INFO: renamed from: ᵡᵶ, reason: contains not printable characters */
    public static int m7620() {
        if (Build.VERSION.SDK_INT < 30 || SdkExtensions.getExtensionVersion(30) <= 3) {
            return 0;
        }
        return SdkExtensions.getExtensionVersion(1000000);
    }

    /* JADX INFO: renamed from: ᵪʚᵯʝ, reason: contains not printable characters */
    public static boolean m7621(Object obj) {
        return (obj instanceof Parcelable[]) || (obj instanceof ArrayList) || (obj instanceof Bundle);
    }

    /* JADX INFO: renamed from: ᵽˀᵥ, reason: contains not printable characters */
    public static void m7622(C3160 c3160, Bundle bundle, boolean z) {
        if (bundle != null && c3160 != null) {
            if (!bundle.containsKey("_sc") || z) {
                String str = c3160.f12023;
                if (str != null) {
                    bundle.putString("_sn", str);
                } else {
                    bundle.remove("_sn");
                }
                String str2 = c3160.f12020;
                if (str2 != null) {
                    bundle.putString("_sc", str2);
                } else {
                    bundle.remove("_sc");
                }
                bundle.putLong("_si", c3160.f12021);
                return;
            }
            z = false;
        }
        if (bundle != null && c3160 == null && z) {
            bundle.remove("_sn");
            bundle.remove("_sc");
            bundle.remove("_si");
        }
    }

    /* JADX INFO: renamed from: ʽᵡᵢᵾ, reason: contains not printable characters */
    public final void m7623(Bundle bundle, int i, String str, Object obj) {
        if (m7611(i, bundle)) {
            ((C1103) ((ᵜᵪʾ) this).ˌᴵ).getClass();
            bundle.putString("_ev", m7608(40, str, true));
            if (obj != null) {
                if ((obj instanceof String) || (obj instanceof CharSequence)) {
                    bundle.putLong("_el", obj.toString().length());
                }
            }
        }
    }

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public final boolean m7624(String str, String str2, int i, 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 string = obj.toString();
        if (string.codePointCount(0, string.length()) <= i) {
            return true;
        }
        C3485 c3485 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4729;
        C1103.m3564(c3485);
        c3485.f13413.m4477("Value is too long; discarded. Value kind, name, value length", str, str2, Integer.valueOf(string.length()));
        return false;
    }

    /* JADX INFO: renamed from: ʿᵯᴵ, reason: contains not printable characters */
    public final void m7625(InterfaceC3046 interfaceC3046, ArrayList arrayList) {
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList("r", arrayList);
        try {
            interfaceC3046.mo2444(bundle);
        } catch (RemoteException e) {
            C3485 c3485 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4729;
            C1103.m3564(c3485);
            c3485.f13424.m4474(e, "Error returning bundle list to wrapper");
        }
    }

    /* JADX INFO: renamed from: ʿᵿʽᵞ, reason: contains not printable characters */
    public final C4929 m7626() {
        C0867 c0867;
        if (this.f12800 == null) {
            Context context = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4713;
            int i = Build.VERSION.SDK_INT;
            C3346 c3346 = C3346.f12818;
            if (i >= 33) {
                c3346.m7676();
            }
            if ((i >= 33 ? c3346.m7676() : 0) >= 5) {
                c0867 = new C0867(context, 1);
            } else {
                C0994 c0994 = C0994.f4352;
                if (((i == 31 || i == 32) ? c0994.m3320() : 0) >= 9) {
                    try {
                        c0867 = new C0867(context, 0);
                    } catch (NoClassDefFoundError unused) {
                        int i2 = Build.VERSION.SDK_INT;
                        if (i2 == 31 || i2 == 32) {
                            c0994.m3320();
                        }
                        c0867 = null;
                    }
                } else {
                    c0867 = null;
                }
            }
            this.f12800 = c0867 != null ? new C4929(c0867) : null;
        }
        return this.f12800;
    }

    /* JADX INFO: renamed from: ˀᵛᵟ, reason: contains not printable characters */
    public final SecureRandom m7627() {
        ˈᵲᵢ();
        if (this.f12797 == null) {
            this.f12797 = new SecureRandom();
        }
        return this.f12797;
    }

    /* JADX WARN: Removed duplicated region for block: B:34:0x009c  */
    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int m7628(String str, String str2, Object obj, Bundle bundle, List list, boolean z, boolean z2) {
        int i;
        int size;
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        ˈᵲᵢ();
        int i2 = 0;
        if (!m7621(obj)) {
            i = 0;
        } else {
            if (!z2) {
                return 21;
            }
            if (!m7612(str2, ᵬʕˎʽ.ᵻˈᵦʼ)) {
                return 20;
            }
            C1618 c1618M3573 = c1103.m3573();
            c1618M3573.m6166();
            c1618M3573.m5699();
            if (c1618M3573.m4461()) {
                C3335 c3335 = ((C1103) ((ᵜᵪʾ) c1618M3573).ˌᴵ).f4730;
                C1103.m3567(c3335);
                if (c3335.m7667() < 200900) {
                    return 25;
                }
            }
            boolean z3 = obj instanceof Parcelable[];
            if (z3) {
                size = ((Parcelable[]) obj).length;
            } else {
                if (obj instanceof ArrayList) {
                    size = ((ArrayList) obj).size();
                }
                i = 0;
            }
            if (size > 200) {
                C3485 c3485 = c1103.f4729;
                C1103.m3564(c3485);
                c3485.f13413.m4477("Parameter array is too long; discarded. Value kind, name, array length", "param", str2, Integer.valueOf(size));
                i = 17;
                if (z3) {
                    Parcelable[] parcelableArr = (Parcelable[]) obj;
                    if (parcelableArr.length > 200) {
                        bundle.putParcelableArray(str2, (Parcelable[]) Arrays.copyOf(parcelableArr, 200));
                    }
                } else if (obj instanceof ArrayList) {
                    ArrayList arrayList = (ArrayList) obj;
                    if (arrayList.size() > 200) {
                        bundle.putParcelableArrayList(str2, new ArrayList<>(arrayList.subList(0, 200)));
                    }
                }
            }
        }
        int iMax = 500;
        if (m7615(str) || m7615(str2)) {
            c1103.f4726.getClass();
            iMax = Math.max(500, 256);
        } else {
            c1103.f4726.getClass();
        }
        if (!m7624("param", str2, iMax, obj)) {
            if (!z2) {
                return 4;
            }
            if (obj instanceof Bundle) {
                m7649(str, str2, (Bundle) obj, list, z);
                return i;
            }
            if (obj instanceof Parcelable[]) {
                Parcelable[] parcelableArr2 = (Parcelable[]) obj;
                int length = parcelableArr2.length;
                while (i2 < length) {
                    Parcelable parcelable = parcelableArr2[i2];
                    if (!(parcelable instanceof Bundle)) {
                        C3485 c34852 = c1103.f4729;
                        C1103.m3564(c34852);
                        c34852.f13413.m4475("All Parcelable[] elements must be of type Bundle. Value type, name", parcelable.getClass(), str2);
                        return 4;
                    }
                    m7649(str, str2, (Bundle) parcelable, list, z);
                    i2++;
                }
            } else {
                if (!(obj instanceof ArrayList)) {
                    return 4;
                }
                ArrayList arrayList2 = (ArrayList) obj;
                int size2 = arrayList2.size();
                while (i2 < size2) {
                    Object obj2 = arrayList2.get(i2);
                    if (!(obj2 instanceof Bundle)) {
                        C3485 c34853 = c1103.f4729;
                        C1103.m3564(c34853);
                        c34853.f13413.m4475("All ArrayList elements must be of type Bundle. Value type, name", obj2 != null ? obj2.getClass() : "null", str2);
                        return 4;
                    }
                    m7649(str, str2, (Bundle) obj2, list, z);
                    i2++;
                }
            }
        }
        return i;
    }

    /* JADX INFO: renamed from: ˁᵺˈ, reason: contains not printable characters */
    public final int m7629(String str) {
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        if ("_ldl".equals(str)) {
            c1103.getClass();
            return 2048;
        }
        if ("_id".equals(str)) {
            c1103.getClass();
            return 256;
        }
        if ("_lgclid".equals(str)) {
            c1103.getClass();
            return 100;
        }
        c1103.getClass();
        return 36;
    }

    /* JADX INFO: renamed from: ˆʤᵳ, reason: contains not printable characters */
    public final boolean m7630(int i) {
        Boolean bool = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).m3573().f6479;
        if (m7667() < i / 1000) {
            return (bool == null || bool.booleanValue()) ? false : true;
        }
        return true;
    }

    /* JADX INFO: renamed from: ˆˀᵯ, reason: contains not printable characters */
    public final void m7631(InterfaceC3046 interfaceC3046, byte[] bArr) {
        Bundle bundle = new Bundle();
        bundle.putByteArray("r", bArr);
        try {
            interfaceC3046.mo2444(bundle);
        } catch (RemoteException e) {
            C3485 c3485 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4729;
            C1103.m3564(c3485);
            c3485.f13424.m4474(e, "Error returning byte array to wrapper");
        }
    }

    /* JADX INFO: renamed from: ˆᵱʣ, reason: contains not printable characters */
    public final boolean m7632(int i, String str, String str2) {
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        if (str2 == null) {
            C3485 c3485 = c1103.f4729;
            C1103.m3564(c3485);
            c3485.f13417.m4474(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.codePointCount(0, str2.length()) <= i) {
            return true;
        }
        C3485 c34852 = c1103.f4729;
        C1103.m3564(c34852);
        c34852.f13417.m4477("Name is too long. Type, maximum supported length, name", str, Integer.valueOf(i), str2);
        return false;
    }

    /* JADX INFO: renamed from: ˈⁱᵡ, reason: contains not printable characters */
    public final int m7633(Object obj, String str) {
        return "_ldl".equals(str) ? m7624("user property referrer", str, m7629(str), obj) : m7624("user property", str, m7629(str), obj) ? 0 : 7;
    }

    /* JADX INFO: renamed from: ˉˆᵗ, reason: contains not printable characters */
    public final Object m7634(int i, Object obj, boolean z, boolean z2) {
        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 m7608(i, obj.toString(), z);
        }
        if (!z2) {
            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 bundleM7666 = m7666((Bundle) parcelable);
                if (!bundleM7666.isEmpty()) {
                    arrayList.add(bundleM7666);
                }
            }
        }
        return arrayList.toArray(new Bundle[arrayList.size()]);
    }

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public final boolean m7635(String str) {
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        if (TextUtils.isEmpty(str)) {
            C3485 c3485 = c1103.f4729;
            C1103.m3564(c3485);
            c3485.f13417.m4476("Missing google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI");
            return false;
        }
        ᵘᵞʿⁱ.ᵶᵥᵝ(str);
        if (str.matches("^1:\\d+:android:[a-f0-9]+$")) {
            return true;
        }
        C3485 c34852 = c1103.f4729;
        C1103.m3564(c34852);
        c34852.f13417.m4474(C3485.m7979(str), "Invalid google_app_id. Firebase Analytics disabled. See https://goo.gl/NAOOOI. provided id");
        return false;
    }

    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public final Bundle m7636(String str, Bundle bundle, List list, boolean z) {
        int iM7663;
        List list2 = list;
        boolean zM7612 = m7612(str, ᵱˉˈ.ᵝᵶ);
        if (bundle == null) {
            return null;
        }
        Bundle bundle2 = new Bundle(bundle);
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        C3691 c3691 = c1103.f4726;
        C2063 c2063 = c1103.f4717;
        C3335 c3335 = ((C1103) ((ᵜᵪʾ) c3691).ˌᴵ).f4730;
        C1103.m3567(c3335);
        int i = c3335.m7630(201500000) ? 100 : 25;
        int i2 = 0;
        boolean z2 = false;
        for (String str2 : new TreeSet(bundle.keySet())) {
            if (list2 == null || !list2.contains(str2)) {
                iM7663 = !z ? m7663(str2) : 0;
                if (iM7663 == 0) {
                    iM7663 = m7640(str2);
                }
            } else {
                iM7663 = 0;
            }
            if (iM7663 != 0) {
                m7623(bundle2, iM7663, str2, iM7663 == 3 ? str2 : null);
                bundle2.remove(str2);
            } else {
                int iM7628 = m7628(str, str2, bundle.get(str2), bundle2, list2, z, zM7612);
                if (iM7628 == 17) {
                    m7623(bundle2, 17, str2, Boolean.FALSE);
                } else if (iM7628 != 0 && !"_ev".equals(str2)) {
                    m7623(bundle2, iM7628, iM7628 == 21 ? str : str2, bundle.get(str2));
                    bundle2.remove(str2);
                }
                if (m7606(str2)) {
                    i2++;
                    if (i2 > i) {
                        if (!z2) {
                            StringBuilder sb = new StringBuilder(String.valueOf(i).length() + 37);
                            sb.append("Event can't contain more than ");
                            sb.append(i);
                            sb.append(" params");
                            String string = sb.toString();
                            C3485 c3485 = c1103.f4729;
                            C1103.m3564(c3485);
                            c3485.f13417.m4475(string, c2063.m5504(str), c2063.m5503(bundle));
                        }
                        m7611(5, bundle2);
                        bundle2.remove(str2);
                        z2 = true;
                    }
                }
                list2 = list;
            }
            list2 = list;
        }
        return bundle2;
    }

    /* JADX INFO: renamed from: ˊᵶᵕᵛ, reason: contains not printable characters */
    public final boolean m7637(String str, String[] strArr, String[] strArr2, String str2) {
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        if (str2 == null) {
            C3485 c3485 = c1103.f4729;
            C1103.m3564(c3485);
            c3485.f13417.m4474(str, "Name is required and can't be null. Type");
            return false;
        }
        for (int i = 0; i < 3; i++) {
            if (str2.startsWith(f12794[i])) {
                C3485 c34852 = c1103.f4729;
                C1103.m3564(c34852);
                c34852.f13417.m4475("Name starts with reserved prefix. Type, name", str, str2);
                return false;
            }
        }
        if (strArr == null || !m7612(str2, strArr)) {
            return true;
        }
        if (strArr2 != null && m7612(str2, strArr2)) {
            return true;
        }
        C3485 c34853 = c1103.f4729;
        C1103.m3564(c34853);
        c34853.f13417.m4475("Name is reserved. Type, name", str, str2);
        return false;
    }

    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public final Object m7638(Object obj, String str) {
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        int iMax = 500;
        if ("_ev".equals(str)) {
            c1103.f4726.getClass();
            return m7634(Math.max(500, 256), obj, true, true);
        }
        if (m7615(str)) {
            c1103.f4726.getClass();
            iMax = Math.max(500, 256);
        } else {
            c1103.f4726.getClass();
        }
        return m7634(iMax, obj, false, true);
    }

    /* JADX INFO: renamed from: ˋᵤᵦ, reason: contains not printable characters */
    public final int m7639(String str) {
        if (!m7645("event", str)) {
            return 2;
        }
        if (m7637("event", ᵱˉˈ.ᵵᵽ, ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4726.m8314(null, AbstractC3818.f14475) ? ᵱˉˈ.ᵻʽᵯ : ᵱˉˈ.ˊᵫᵗ, str)) {
            return !m7632(40, "event", str) ? 2 : 0;
        }
        return 13;
    }

    @Override // defpackage.AbstractC4440
    /* JADX INFO: renamed from: ˌᵨʠᵫ */
    public final boolean mo5247() {
        return true;
    }

    /* JADX INFO: renamed from: ˎʞ, reason: contains not printable characters */
    public final int m7640(String str) {
        if (!m7645("event param", str)) {
            return 3;
        }
        if (!m7637("event param", null, null, str)) {
            return 14;
        }
        ((C1103) ((ᵜᵪʾ) this).ˌᴵ).getClass();
        return !m7632(40, "event param", str) ? 3 : 0;
    }

    /* JADX INFO: renamed from: ˏʜᵪ, reason: contains not printable characters */
    public final boolean m7641(Context context, String str) {
        Signature[] signatureArr;
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        X500Principal x500Principal = new X500Principal("CN=Android Debug,O=Android,C=US");
        try {
            PackageInfo packageInfoM9254 = C1593.m4436(context).m9254(64, str);
            if (packageInfoM9254 == null || (signatureArr = packageInfoM9254.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 e) {
            C3485 c3485 = c1103.f4729;
            C1103.m3564(c3485);
            c3485.f13423.m4474(e, "Package name not found");
            return true;
        } catch (CertificateException e2) {
            C3485 c34852 = c1103.f4729;
            C1103.m3564(c34852);
            c34852.f13423.m4474(e2, "Error obtaining certificate");
            return true;
        }
    }

    /* JADX INFO: renamed from: ˏʽˊᵰ, reason: contains not printable characters */
    public final void m7642(String str, InterfaceC3046 interfaceC3046) {
        Bundle bundle = new Bundle();
        bundle.putString("r", str);
        try {
            interfaceC3046.mo2444(bundle);
        } catch (RemoteException e) {
            C3485 c3485 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4729;
            C1103.m3564(c3485);
            c3485.f13424.m4474(e, "Error returning string value to wrapper");
        }
    }

    /* JADX INFO: renamed from: ːᵝٴᵶ, reason: contains not printable characters */
    public final boolean m7643(String str) {
        ˈᵲᵢ();
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        if (C1593.m4436(c1103.f4713).f16324.checkCallingOrSelfPermission(str) == 0) {
            return true;
        }
        C3485 c3485 = c1103.f4729;
        C1103.m3564(c3485);
        c3485.f13416.m4474(str, "Permission not granted");
        return false;
    }

    /* JADX INFO: renamed from: ˑʢ, reason: contains not printable characters */
    public final void m7644(Bundle bundle, Bundle bundle2) {
        if (bundle2 == null) {
            return;
        }
        for (String str : bundle2.keySet()) {
            if (!bundle.containsKey(str)) {
                C3335 c3335 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4730;
                C1103.m3567(c3335);
                c3335.m7648(bundle, str, bundle2.get(str));
            }
        }
    }

    /* JADX INFO: renamed from: ᵘᵫᵡ, reason: contains not printable characters */
    public final boolean m7645(String str, String str2) {
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        if (str2 == null) {
            C3485 c3485 = c1103.f4729;
            C1103.m3564(c3485);
            c3485.f13417.m4474(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.length() == 0) {
            C3485 c34852 = c1103.f4729;
            C1103.m3564(c34852);
            c34852.f13417.m4474(str, "Name is required and can't be empty. Type");
            return false;
        }
        int iCodePointAt = str2.codePointAt(0);
        if (!Character.isLetter(iCodePointAt)) {
            if (iCodePointAt != 95) {
                C3485 c34853 = c1103.f4729;
                C1103.m3564(c34853);
                c34853.f13417.m4475("Name must start with a letter or _ (underscore). Type, name", str, str2);
                return false;
            }
            iCodePointAt = 95;
        }
        int length = str2.length();
        int iCharCount = Character.charCount(iCodePointAt);
        while (iCharCount < length) {
            int iCodePointAt2 = str2.codePointAt(iCharCount);
            if (iCodePointAt2 != 95 && !Character.isLetterOrDigit(iCodePointAt2)) {
                C3485 c34854 = c1103.f4729;
                C1103.m3564(c34854);
                c34854.f13417.m4475("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
                return false;
            }
            iCharCount += Character.charCount(iCodePointAt2);
        }
        return true;
    }

    /* JADX INFO: renamed from: ᵚᵹᵔᵜ, reason: contains not printable characters */
    public final void m7646(InterfaceC3046 interfaceC3046, boolean z) {
        Bundle bundle = new Bundle();
        bundle.putBoolean("r", z);
        try {
            interfaceC3046.mo2444(bundle);
        } catch (RemoteException e) {
            C3485 c3485 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4729;
            C1103.m3564(c3485);
            c3485.f13424.m4474(e, "Error returning boolean value to wrapper");
        }
    }

    /* JADX INFO: renamed from: ᵛˑﹳ, reason: contains not printable characters */
    public final void m7647(C0536 c0536, int i) {
        Bundle bundle = c0536.f2757;
        int i2 = 0;
        boolean z = false;
        for (String str : new TreeSet(bundle.keySet())) {
            if (m7606(str) && (i2 = i2 + 1) > i) {
                if (!z) {
                    StringBuilder sb = new StringBuilder(String.valueOf(i).length() + 37);
                    sb.append("Event can't contain more than ");
                    sb.append(i);
                    sb.append(" params");
                    String string = sb.toString();
                    C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
                    C3485 c3485 = c1103.f4729;
                    C2063 c2063 = c1103.f4717;
                    C1103.m3564(c3485);
                    c3485.f13417.m4475(string, c2063.m5504(c0536.f2758), c2063.m5503(bundle));
                    m7611(5, bundle);
                }
                bundle.remove(str);
                z = true;
            }
        }
    }

    /* JADX INFO: renamed from: ᵞᵛᵘ, reason: contains not printable characters */
    public final void m7648(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;
            C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
            C3485 c3485 = c1103.f4729;
            C1103.m3564(c3485);
            c3485.f13413.m4475("Not putting event parameter. Invalid value type. name, type", c1103.f4717.m5501(str), simpleName);
        }
    }

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public final void m7649(String str, String str2, Bundle bundle, List list, boolean z) {
        int iM7663;
        int iM7628;
        List list2 = list;
        if (bundle == null) {
            return;
        }
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        C3691 c3691 = c1103.f4726;
        C3485 c3485 = c1103.f4729;
        C2063 c2063 = c1103.f4717;
        C3335 c3335 = ((C1103) ((ᵜᵪʾ) c3691).ˌᴵ).f4730;
        C1103.m3567(c3335);
        int i = true != c3335.m7630(231100000) ? 0 : 35;
        int i2 = 0;
        boolean z2 = false;
        for (String str3 : new TreeSet(bundle.keySet())) {
            if (list2 == null || !list2.contains(str3)) {
                iM7663 = !z ? m7663(str3) : 0;
                if (iM7663 == 0) {
                    iM7663 = m7640(str3);
                }
            } else {
                iM7663 = 0;
            }
            if (iM7663 != 0) {
                m7623(bundle, iM7663, str3, iM7663 == 3 ? str3 : null);
                bundle.remove(str3);
            } else {
                if (m7621(bundle.get(str3))) {
                    C1103.m3564(c3485);
                    c3485.f13413.m4477("Nested Bundle parameters are not allowed; discarded. event name, param name, child param name", str, str2, str3);
                    iM7628 = 22;
                } else {
                    iM7628 = m7628(str, str3, bundle.get(str3), bundle, list2, z, false);
                }
                if (iM7628 != 0 && !"_ev".equals(str3)) {
                    m7623(bundle, iM7628, str3, bundle.get(str3));
                    bundle.remove(str3);
                } else if (m7606(str3) && !m7612(str3, ᵬʕˎʽ.ᵵᵽ)) {
                    i2++;
                    if (!m7630(231100000)) {
                        C1103.m3564(c3485);
                        c3485.f13417.m4475("Item array not supported on client's version of Google Play Services (Android Only)", c2063.m5504(str), c2063.m5503(bundle));
                        m7611(23, bundle);
                        bundle.remove(str3);
                    } else if (i2 > i) {
                        if (!z2) {
                            C1103.m3564(c3485);
                            C1623 c1623 = c3485.f13417;
                            StringBuilder sb = new StringBuilder(String.valueOf(i).length() + 55);
                            sb.append("Item can't contain more than ");
                            sb.append(i);
                            sb.append(" item-scoped custom params");
                            c1623.m4475(sb.toString(), c2063.m5504(str), c2063.m5503(bundle));
                        }
                        m7611(28, bundle);
                        bundle.remove(str3);
                        list2 = list;
                        z2 = true;
                    }
                }
            }
            list2 = list;
        }
    }

    /* JADX INFO: renamed from: ᵠᵚˀᵫ, reason: contains not printable characters */
    public final long m7650() {
        long andIncrement;
        long j;
        AtomicLong atomicLong = this.f12798;
        if (atomicLong.get() != 0) {
            AtomicLong atomicLong2 = this.f12798;
            synchronized (atomicLong2) {
                atomicLong2.compareAndSet(-1L, 1L);
                andIncrement = atomicLong2.getAndIncrement();
            }
            return andIncrement;
        }
        synchronized (atomicLong) {
            long jNanoTime = System.nanoTime();
            ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4701.getClass();
            long jNextLong = new Random(jNanoTime ^ System.currentTimeMillis()).nextLong();
            int i = this.f12799 + 1;
            this.f12799 = i;
            j = jNextLong + ((long) i);
        }
        return j;
    }

    /* JADX INFO: renamed from: ᵠᵲˁ, reason: contains not printable characters */
    public final String m7651() {
        byte[] bArr = new byte[16];
        m7627().nextBytes(bArr);
        return String.format(Locale.US, "%032x", new BigInteger(1, bArr));
    }

    /* JADX WARN: Removed duplicated region for block: B:53:0x00b9  */
    /* JADX INFO: renamed from: ᵡᵶᵬʤ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final long m7652() {
        boolean zBooleanValue;
        Integer num;
        Object e;
        ˈᵲᵢ();
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        C2303 c2303M3569 = c1103.m3569();
        C3485 c3485 = c1103.f4729;
        if (!m7618((String) AbstractC3818.f14565.m1988(null), c2303M3569.m5932())) {
            return 0L;
        }
        long j = Build.VERSION.SDK_INT < 30 ? 4L : SdkExtensions.getExtensionVersion(30) < 4 ? 8L : m7620() < ((Integer) AbstractC3818.f14516.m1988(null)).intValue() ? 16L : 0L;
        if (!m7643("android.permission.ACCESS_ADSERVICES_ATTRIBUTION")) {
            j |= 2;
        }
        if (j == 0) {
            if (this.f12795 == null) {
                C4929 c4929M7626 = m7626();
                zBooleanValue = false;
                if (c4929M7626 != null) {
                    try {
                        num = (Integer) c4929M7626.m10224().get(10000L, TimeUnit.MILLISECONDS);
                        if (num != null) {
                            try {
                                if (num.intValue() == 1) {
                                    zBooleanValue = true;
                                }
                            } catch (InterruptedException e2) {
                                e = e2;
                                C1103.m3564(c3485);
                                c3485.f13424.m4474(e, "Measurement manager api exception");
                                this.f12795 = Boolean.FALSE;
                            } catch (CancellationException e3) {
                                e = e3;
                                C1103.m3564(c3485);
                                c3485.f13424.m4474(e, "Measurement manager api exception");
                                this.f12795 = Boolean.FALSE;
                            } catch (ExecutionException e4) {
                                e = e4;
                                C1103.m3564(c3485);
                                c3485.f13424.m4474(e, "Measurement manager api exception");
                                this.f12795 = Boolean.FALSE;
                            } catch (TimeoutException e5) {
                                e = e5;
                                C1103.m3564(c3485);
                                c3485.f13424.m4474(e, "Measurement manager api exception");
                                this.f12795 = Boolean.FALSE;
                            }
                        }
                        this.f12795 = Boolean.valueOf(zBooleanValue);
                    } catch (InterruptedException | CancellationException | ExecutionException | TimeoutException e6) {
                        num = null;
                        e = e6;
                    }
                    C1103.m3564(c3485);
                    c3485.f13414.m4474(num, "Measurement manager api status result");
                    zBooleanValue = this.f12795.booleanValue();
                }
                if (!zBooleanValue) {
                    j = 64;
                }
            } else {
                zBooleanValue = this.f12795.booleanValue();
                if (!zBooleanValue) {
                }
            }
        }
        if (j == 0) {
            return 1L;
        }
        return j;
    }

    /* JADX INFO: renamed from: ᵣʚʿ, reason: contains not printable characters */
    public final Bundle m7653(Uri uri) {
        String queryParameter;
        String queryParameter2;
        String queryParameter3;
        String queryParameter4;
        String queryParameter5;
        String queryParameter6;
        String queryParameter7;
        String queryParameter8;
        String queryParameter9;
        C1103 c1103;
        C1103 c11032 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        if (uri != null) {
            try {
                if (uri.isHierarchical()) {
                    queryParameter2 = uri.getQueryParameter("utm_campaign");
                    queryParameter3 = uri.getQueryParameter("utm_source");
                    queryParameter4 = uri.getQueryParameter("utm_medium");
                    queryParameter5 = uri.getQueryParameter("gclid");
                    queryParameter6 = uri.getQueryParameter("gbraid");
                    queryParameter7 = uri.getQueryParameter("utm_id");
                    queryParameter8 = uri.getQueryParameter("dclid");
                    queryParameter9 = uri.getQueryParameter("srsltid");
                    queryParameter = uri.getQueryParameter("sfmc_id");
                } else {
                    queryParameter = null;
                    queryParameter2 = null;
                    queryParameter3 = null;
                    queryParameter4 = null;
                    queryParameter5 = null;
                    queryParameter6 = null;
                    queryParameter7 = null;
                    queryParameter8 = null;
                    queryParameter9 = null;
                }
                if (!TextUtils.isEmpty(queryParameter2) || !TextUtils.isEmpty(queryParameter3) || !TextUtils.isEmpty(queryParameter4) || !TextUtils.isEmpty(queryParameter5) || !TextUtils.isEmpty(queryParameter6) || !TextUtils.isEmpty(queryParameter7) || !TextUtils.isEmpty(queryParameter8) || !TextUtils.isEmpty(queryParameter9) || !TextUtils.isEmpty(queryParameter)) {
                    Bundle bundle = new Bundle();
                    if (TextUtils.isEmpty(queryParameter2)) {
                        c1103 = c11032;
                    } else {
                        c1103 = c11032;
                        bundle.putString("campaign", queryParameter2);
                    }
                    if (!TextUtils.isEmpty(queryParameter3)) {
                        bundle.putString("source", queryParameter3);
                    }
                    if (!TextUtils.isEmpty(queryParameter4)) {
                        bundle.putString("medium", queryParameter4);
                    }
                    if (!TextUtils.isEmpty(queryParameter5)) {
                        bundle.putString("gclid", queryParameter5);
                    }
                    if (!TextUtils.isEmpty(queryParameter6)) {
                        bundle.putString("gbraid", queryParameter6);
                    }
                    String queryParameter10 = uri.getQueryParameter("gad_source");
                    if (!TextUtils.isEmpty(queryParameter10)) {
                        bundle.putString("gad_source", queryParameter10);
                    }
                    String queryParameter11 = uri.getQueryParameter("utm_term");
                    if (!TextUtils.isEmpty(queryParameter11)) {
                        bundle.putString("term", queryParameter11);
                    }
                    String queryParameter12 = uri.getQueryParameter("utm_content");
                    if (!TextUtils.isEmpty(queryParameter12)) {
                        bundle.putString("content", queryParameter12);
                    }
                    String queryParameter13 = uri.getQueryParameter("aclid");
                    if (!TextUtils.isEmpty(queryParameter13)) {
                        bundle.putString("aclid", queryParameter13);
                    }
                    String queryParameter14 = uri.getQueryParameter("cp1");
                    if (!TextUtils.isEmpty(queryParameter14)) {
                        bundle.putString("cp1", queryParameter14);
                    }
                    String queryParameter15 = uri.getQueryParameter("anid");
                    if (!TextUtils.isEmpty(queryParameter15)) {
                        bundle.putString("anid", queryParameter15);
                    }
                    if (!TextUtils.isEmpty(queryParameter7)) {
                        bundle.putString("campaign_id", queryParameter7);
                    }
                    if (!TextUtils.isEmpty(queryParameter8)) {
                        bundle.putString("dclid", queryParameter8);
                    }
                    String queryParameter16 = uri.getQueryParameter("utm_source_platform");
                    if (!TextUtils.isEmpty(queryParameter16)) {
                        bundle.putString("source_platform", queryParameter16);
                    }
                    String queryParameter17 = uri.getQueryParameter("utm_creative_format");
                    if (!TextUtils.isEmpty(queryParameter17)) {
                        bundle.putString("creative_format", queryParameter17);
                    }
                    String queryParameter18 = uri.getQueryParameter("utm_marketing_tactic");
                    if (!TextUtils.isEmpty(queryParameter18)) {
                        bundle.putString("marketing_tactic", queryParameter18);
                    }
                    if (!TextUtils.isEmpty(queryParameter9)) {
                        bundle.putString("srsltid", queryParameter9);
                    }
                    if (!TextUtils.isEmpty(queryParameter)) {
                        bundle.putString("sfmc_id", queryParameter);
                    }
                    for (String str : uri.getQueryParameterNames()) {
                        if (str.startsWith("gad_")) {
                            String queryParameter19 = uri.getQueryParameter(str);
                            if (!TextUtils.isEmpty(queryParameter19)) {
                                bundle.putString(str, queryParameter19);
                            }
                        }
                    }
                    C1103 c11033 = c1103;
                    if (c11033.f4726.m8314(null, AbstractC3818.f14523)) {
                        String string = new Uri.Builder().scheme(uri.getScheme()).authority(uri.getAuthority()).path(uri.getPath()).build().toString();
                        c11033.f4726.getClass();
                        int iMax = Math.max(500, 256);
                        if (string.length() > iMax) {
                            string = m7608(iMax - 3, string, true);
                        }
                        if (!TextUtils.isEmpty(string)) {
                            bundle.putString("deep_link_url", string);
                        }
                    }
                    return bundle;
                }
            } catch (UnsupportedOperationException e) {
                C3485 c3485 = c11032.f4729;
                C1103.m3564(c3485);
                c3485.f13424.m4474(e, "Install referrer url isn't a hierarchical URI");
                return null;
            }
        }
        return null;
    }

    /* JADX INFO: renamed from: ᵥﹶ, reason: contains not printable characters */
    public final int m7654(String str) {
        if (!m7645("user property", str)) {
            return 6;
        }
        if (!m7637("user property", ˑᵕʾ.ːˏᵟᵯ, null, str)) {
            return 15;
        }
        ((C1103) ((ᵜᵪʾ) this).ˌᴵ).getClass();
        return !m7632(24, "user property", str) ? 6 : 0;
    }

    /* JADX INFO: renamed from: ᵧᵠᵾ, reason: contains not printable characters */
    public final boolean m7655(String str, String str2) {
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        if (str2 == null) {
            C3485 c3485 = c1103.f4729;
            C1103.m3564(c3485);
            c3485.f13417.m4474(str, "Name is required and can't be null. Type");
            return false;
        }
        if (str2.length() == 0) {
            C3485 c34852 = c1103.f4729;
            C1103.m3564(c34852);
            c34852.f13417.m4474(str, "Name is required and can't be empty. Type");
            return false;
        }
        int iCodePointAt = str2.codePointAt(0);
        if (!Character.isLetter(iCodePointAt)) {
            C3485 c34853 = c1103.f4729;
            C1103.m3564(c34853);
            c34853.f13417.m4475("Name must start with a letter. Type, name", str, str2);
            return false;
        }
        int length = str2.length();
        int iCharCount = Character.charCount(iCodePointAt);
        while (iCharCount < length) {
            int iCodePointAt2 = str2.codePointAt(iCharCount);
            if (iCodePointAt2 != 95 && !Character.isLetterOrDigit(iCodePointAt2)) {
                C3485 c34854 = c1103.f4729;
                C1103.m3564(c34854);
                c34854.f13417.m4475("Name must consist of letters, digits or _ (underscores). Type, name", str, str2);
                return false;
            }
            iCharCount += Character.charCount(iCodePointAt2);
        }
        return true;
    }

    /* JADX INFO: renamed from: ᵧᵢᵴᵸ, reason: contains not printable characters */
    public final void m7656(InterfaceC3046 interfaceC3046, int i) {
        Bundle bundle = new Bundle();
        bundle.putInt("r", i);
        try {
            interfaceC3046.mo2444(bundle);
        } catch (RemoteException e) {
            C3485 c3485 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4729;
            C1103.m3564(c3485);
            c3485.f13424.m4474(e, "Error returning int value to wrapper");
        }
    }

    /* JADX INFO: renamed from: ᵨˈʼﹶ, reason: contains not printable characters */
    public final Object m7657(Object obj, String str) {
        return "_ldl".equals(str) ? m7634(m7629(str), obj, true, false) : m7634(m7629(str), obj, false, false);
    }

    /* JADX INFO: renamed from: ᵫˈᵹ, reason: contains not printable characters */
    public final boolean m7658(String str, String str2) {
        if (!TextUtils.isEmpty(str2)) {
            return true;
        }
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        return ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4726.m8304("debug.firebase.analytics.app").equals(str);
    }

    /* JADX INFO: renamed from: ᵬᵦˋ, reason: contains not printable characters */
    public final C0357 m7659(String str, Bundle bundle, String str2, long j, long j2, boolean z) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        if (m7639(str) != 0) {
            C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
            C3485 c3485 = c1103.f4729;
            C1103.m3564(c3485);
            c3485.f13423.m4474(c1103.f4717.m5502(str), "Invalid conditional property event name");
            ᵷᵝˎ.ᵷᵺʾᵖ();
            return null;
        }
        Bundle bundle2 = bundle != null ? new Bundle(bundle) : new Bundle();
        bundle2.putString("_o", str2);
        Bundle bundleM7636 = m7636(str, bundle2, Collections.singletonList("_o"), true);
        if (z) {
            bundleM7636 = m7666(bundleM7636);
        }
        ᵘᵞʿⁱ.ᵶᵥᵝ(bundleM7636);
        return new C0357(str, new C3590(bundleM7636), str2, j, j2);
    }

    /* JADX INFO: renamed from: ᵮᵟᵡ, reason: contains not printable characters */
    public final void m7660(Bundle bundle, long j) {
        long j2 = bundle.getLong("_et");
        if (j2 != 0) {
            C3485 c3485 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4729;
            C1103.m3564(c3485);
            c3485.f13424.m4474(Long.valueOf(j2), "Params already contained engagement");
        } else {
            j2 = 0;
        }
        bundle.putLong("_et", j + j2);
    }

    /* JADX INFO: renamed from: ᵯˇ, reason: contains not printable characters */
    public final void m7661(InterfaceC3046 interfaceC3046, long j) {
        Bundle bundle = new Bundle();
        bundle.putLong("r", j);
        try {
            interfaceC3046.mo2444(bundle);
        } catch (RemoteException e) {
            C3485 c3485 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4729;
            C1103.m3564(c3485);
            c3485.f13424.m4474(e, "Error returning long value to wrapper");
        }
    }

    /* JADX INFO: renamed from: ᵰʜ, reason: contains not printable characters */
    public final boolean m7662(String str) {
        return ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4726.m8314(null, AbstractC3818.f14475) ? m7612(str, ᵱˉˈ.ᵶᵥᵝ) : m7612(str, ᵱˉˈ.ᵱᵽʡᵚ);
    }

    /* JADX INFO: renamed from: ᵱʢᵢ, reason: contains not printable characters */
    public final int m7663(String str) {
        if (!m7655("event param", str)) {
            return 3;
        }
        if (!m7637("event param", null, null, str)) {
            return 14;
        }
        ((C1103) ((ᵜᵪʾ) this).ˌᴵ).getClass();
        return !m7632(40, "event param", str) ? 3 : 0;
    }

    /* JADX INFO: renamed from: ᵱᵭ, reason: contains not printable characters */
    public final void m7664(InterfaceC3046 interfaceC3046, Bundle bundle) {
        try {
            interfaceC3046.mo2444(bundle);
        } catch (RemoteException e) {
            C3485 c3485 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4729;
            C1103.m3564(c3485);
            c3485.f13424.m4474(e, "Error returning bundle value to wrapper");
        }
    }

    /* JADX INFO: renamed from: ᵵᵬᵽ, reason: contains not printable characters */
    public final void m7665(Parcelable[] parcelableArr, int i) {
        ᵘᵞʿⁱ.ᵶᵥᵝ(parcelableArr);
        for (Parcelable parcelable : parcelableArr) {
            Bundle bundle = (Bundle) parcelable;
            int i2 = 0;
            boolean z = false;
            for (String str : new TreeSet(bundle.keySet())) {
                if (m7606(str) && !m7612(str, ᵬʕˎʽ.ᵵᵽ) && (i2 = i2 + 1) > i) {
                    if (!z) {
                        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
                        C3485 c3485 = c1103.f4729;
                        C2063 c2063 = c1103.f4717;
                        C1103.m3564(c3485);
                        C1623 c1623 = c3485.f13417;
                        StringBuilder sb = new StringBuilder(String.valueOf(i).length() + 60);
                        sb.append("Param can't contain more than ");
                        sb.append(i);
                        sb.append(" item-scoped custom parameters");
                        c1623.m4475(sb.toString(), c2063.m5501(str), c2063.m5503(bundle));
                    }
                    m7611(28, bundle);
                    bundle.remove(str);
                    z = true;
                }
            }
        }
    }

    /* JADX INFO: renamed from: ᵵᵸᵕᵸ, reason: contains not printable characters */
    public final Bundle m7666(Bundle bundle) {
        Bundle bundle2 = new Bundle();
        if (bundle != null) {
            for (String str : bundle.keySet()) {
                Object objM7638 = m7638(bundle.get(str), str);
                if (objM7638 == null) {
                    C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
                    C3485 c3485 = c1103.f4729;
                    C1103.m3564(c3485);
                    c3485.f13413.m4474(c1103.f4717.m5501(str), "Param value can't be null");
                } else {
                    m7648(bundle2, str, objM7638);
                }
            }
        }
        return bundle2;
    }

    /* JADX INFO: renamed from: ᵹʾᵢᵯ, reason: contains not printable characters */
    public final int m7667() {
        if (this.f12796 == null) {
            C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
            C5073 c5073 = C5073.f19129;
            Context context = c1103.f4713;
            c5073.getClass();
            int i = AbstractC3932.f15022;
            int i2 = 0;
            try {
                i2 = context.getPackageManager().getPackageInfo("com.google.android.gms", 0).versionCode;
            } catch (PackageManager.NameNotFoundException unused) {
            }
            this.f12796 = Integer.valueOf(i2 / 1000);
        }
        return this.f12796.intValue();
    }
}
