package com.google.android.gms.internal.ads;

import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.media.MediaFormat;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.StrictMode;
import android.text.Spannable;
import android.text.TextUtils;
import android.util.Pair;
import android.view.View;
import java.nio.ByteBuffer;
import java.security.cert.CertificateEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.concurrent.atomic.AtomicReference;

/* JADX INFO: loaded from: classes2.dex */
public abstract class ni {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final int[] f14617a = {96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350};

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final int[] f14618b = {0, 1, 2, 3, 4, 5, 6, 8, -1, -1, -1, 7, 8, -1, 8, -1};

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final byte[] f14619c = {0, 0, 0, 0, 16, 0, -128, 0, 0, -86, 0, 56, -101, 113};

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final byte[] f14620d = {0, 0, 33, 7, -45, 17, -122, 68, -56, -63, -54, 0, 0, 0};

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final qc1 f14621e = new qc1(1);

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final bp f14622f = new bp("gads:afs:csa:experiment_id", "", 4);

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final bp f14623g = new bp("gads:app_index:experiment_id", "", 4);

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static final bp f14624h = new bp("gads:block_autoclicks_experiment_id", "", 4);

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public static final bp f14625i = new bp("gads:sdk_core_experiment_id", "", 4);

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public static final bp f14626j = new bp("gads:spam_app_context:experiment_id", "", 4);

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public static final bp f14627k = new bp("gads:temporary_experiment_id:1", "", 4);

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public static final bp f14628l = new bp("gads:temporary_experiment_id:10", "", 4);

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public static final bp f14629m = new bp("gads:temporary_experiment_id:11", "", 4);

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public static final bp f14630n = new bp("gads:temporary_experiment_id:12", "", 4);

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public static final bp f14631o = new bp("gads:temporary_experiment_id:13", "", 4);

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public static final bp f14632p = new bp("gads:temporary_experiment_id:14", "", 4);

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public static final bp f14633q = new bp("gads:temporary_experiment_id:15", "", 4);

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public static final bp f14634r = new bp("gads:temporary_experiment_id:2", "", 4);

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public static final bp f14635s = new bp("gads:temporary_experiment_id:3", "", 4);

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public static final bp f14636t = new bp("gads:temporary_experiment_id:4", "", 4);

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public static final bp f14637u = new bp("gads:temporary_experiment_id:5", "", 4);

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public static final bp f14638v = new bp("gads:temporary_experiment_id:6", "", 4);

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public static final bp f14639w = new bp("gads:temporary_experiment_id:7", "", 4);

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public static final bp f14640x = new bp("gads:temporary_experiment_id:8", "", 4);

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public static final bp f14641y = new bp("gads:temporary_experiment_id:9", "", 4);

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public static final bp f14642z = new bp("gads:corewebview:experiment_id", "", 4);
    public static final bp A = new bp("gads:pan:experiment_id", "", 4);
    public static final qc1 B = new qc1(3);
    public static final qc1 C = new qc1(15);
    public static final qc1 D = new qc1(25);
    public static final qc1 E = new qc1(27);
    public static final kd0 F = new kd0(0);
    public static final kd0 G = new kd0(2);
    public static final kd0 H = new kd0(11);
    public static final kd0 I = new kd0(13);
    public static final kd0 J = new kd0(15);
    public static final kd0 K = new kd0(17);
    public static final kd0 L = new kd0(20);
    public static final kd0 M = new kd0(22);
    public static final kd0 N = new kd0(24);
    public static final kd0 O = new kd0(26);
    public static final kd0 P = new kd0(28);
    public static final rs0 Q = new rs0(2);
    public static final rs0 R = new rs0(5);
    public static final rs0 S = new rs0(8);
    public static final rs0 T = new rs0(14);
    public static final rs0 U = new rs0(16);
    public static final rs0 V = new rs0(19);
    public static final rs0 W = new rs0(21);
    public static final rs0 X = new rs0(23);
    public static final rs0 Y = new rs0(25);

    public static long A(int i10, long j10) {
        if (i10 == 1) {
            return j10;
        }
        int i11 = i10 >> 1;
        long j11 = (j10 * j10) % 1073807359;
        return (i10 & 1) == 0 ? A(i11, j11) % 1073807359 : ((A(i11, j11) % 1073807359) * j10) % 1073807359;
    }

    public static h2.f B(int i10, p2 p2Var, p01 p01Var) throws zzat {
        h2.f fVarB = h2.f.b(p2Var, p01Var);
        while (true) {
            int i11 = fVarB.f26404a;
            if (i11 == i10) {
                return fVarB;
            }
            com.bytedance.sdk.component.adexpress.dynamic.dynamicview.b.q(new StringBuilder(String.valueOf(i11).length() + 28), "Ignoring unknown WAV chunk: ", i11);
            long j10 = fVarB.f26405b;
            long j11 = 8 + j10;
            if ((1 & j10) != 0) {
                j11 = 9 + j10;
            }
            if (j11 > 2147483647L) {
                StringBuilder sb = new StringBuilder(String.valueOf(i11).length() + 40);
                sb.append("Chunk is too large (~2GB+) to skip; id: ");
                sb.append(i11);
                throw zzat.zzc(sb.toString());
            }
            p2Var.e((int) j11);
            fVarB = h2.f.b(p2Var, p01Var);
        }
    }

    public static String C(Context context, String str) {
        m7.n nVar = m7.n.C;
        String strZzh = nVar.f30486y.zzh(context);
        String strZzi = nVar.f30486y.zzi(context);
        if (!str.contains("gmp_app_id") && !TextUtils.isEmpty(strZzh)) {
            str = w(str, "gmp_app_id", strZzh).toString();
        }
        return (str.contains("fbs_aiid") || TextUtils.isEmpty(strZzi)) ? str : w(str, "fbs_aiid", strZzi).toString();
    }

    public static long D(String[] strArr, int i10) {
        long jA = (((long) zj.a(strArr[0])) + 2147483647L) % 1073807359;
        for (int i11 = 1; i11 < i10; i11++) {
            jA = (((((long) zj.a(strArr[i11])) + 2147483647L) % 1073807359) + ((jA * 16785407) % 1073807359)) % 1073807359;
        }
        return jA;
    }

    public static void E(Context context) {
        SharedPreferences sharedPreferences = context.getSharedPreferences("admob", 0);
        if (sharedPreferences == null) {
            return;
        }
        sharedPreferences.edit().putInt("init_without_write", 0).putInt("crash_without_write", 0).commit();
    }

    public static void F(SQLiteDatabase sQLiteDatabase, long j10, byte[] bArr) {
        ContentValues contentValues = new ContentValues();
        contentValues.put("timestamp", Long.valueOf(j10));
        contentValues.put("serialized_proto_data", bArr);
        if (sQLiteDatabase.update("offline_signal_contents", contentValues, "timestamp = ?", new String[]{String.valueOf(j10)}) == 0) {
            sQLiteDatabase.insert("offline_signal_contents", null, contentValues);
        }
    }

    public static int G(Context context, String str) {
        SharedPreferences sharedPreferences = context.getSharedPreferences("admob", 0);
        if (sharedPreferences == null) {
            return 0;
        }
        try {
            return sharedPreferences.getInt(str, 0);
        } catch (ClassCastException unused) {
            return 0;
        }
    }

    public static void H(SQLiteDatabase sQLiteDatabase, boolean z10, boolean z11) {
        if (!z11) {
            sQLiteDatabase.execSQL(String.format("UPDATE offline_signal_statistics SET value = value+1 WHERE statistic_name = '%s'", "total_requests"));
            return;
        }
        sQLiteDatabase.execSQL(String.format("UPDATE offline_signal_statistics SET value = value+1 WHERE statistic_name = '%s'", "completed_requests"));
        if (z10) {
            return;
        }
        sQLiteDatabase.execSQL(String.format("UPDATE offline_signal_statistics SET value = value+1 WHERE statistic_name = '%s'", "failed_requests"));
    }

    public static int I(ib1 ib1Var) {
        int iB = com.google.android.gms.ads.nonagon.signalgeneration.b.b(ib1Var) - 1;
        return (iB == 0 || iB == 1) ? 7 : 23;
    }

    public static Cursor J(SQLiteDatabase sQLiteDatabase, int i10) {
        String[] strArr = {"value"};
        String[] strArr2 = new String[1];
        if (i10 == 0) {
            strArr2[0] = "failed_requests";
        } else if (i10 == 1) {
            strArr2[0] = "total_requests";
        } else if (i10 != 2) {
            strArr2[0] = "completed_requests";
        } else {
            strArr2[0] = "last_successful_request_time";
        }
        return sQLiteDatabase.query("offline_signal_statistics", strArr, "statistic_name = ?", strArr2, null, null, null);
    }

    public static void K(SQLiteDatabase sQLiteDatabase, String str) {
        ContentValues contentValues = new ContentValues();
        contentValues.put("value", (Integer) 0);
        sQLiteDatabase.update("offline_signal_statistics", contentValues, "statistic_name = ?", new String[]{str});
    }

    public static void L(com.google.common.util.concurrent.w wVar, md1 md1Var, id1 id1Var, boolean z10) {
        if (((Boolean) ip.f12589c.j()).booleanValue()) {
            wu1 wu1VarS = wu1.s(wVar);
            n5.s sVar = new n5.s();
            sVar.f30880b = md1Var;
            sVar.f30881c = id1Var;
            sVar.f30879a = z10;
            ih1.z1(wu1VarS, sVar, b30.f9365g);
        }
    }

    public static void M(SQLiteDatabase sQLiteDatabase, String str) {
        ContentValues contentValues = new ContentValues();
        contentValues.put("statistic_name", str);
        contentValues.put("value", (Integer) 0);
        sQLiteDatabase.insert("offline_signal_statistics", null, contentValues);
    }

    public static Bundle a(Pair... pairArr) {
        Bundle bundle = new Bundle();
        if (((Boolean) n7.y.f31093e.f31096c.b(ao.B2)).booleanValue()) {
            for (int i10 = 0; i10 < 2; i10++) {
                Pair pair = pairArr[i10];
                if (!TextUtils.isEmpty((CharSequence) pair.first) && ((Long) pair.second).longValue() > 0) {
                    bundle.putLong((String) pair.first, ((Long) pair.second).longValue());
                }
            }
        }
        return bundle;
    }

    public static Object b(uq1 uq1Var) {
        StrictMode.ThreadPolicy threadPolicy = StrictMode.getThreadPolicy();
        try {
            StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder(threadPolicy).permitDiskReads().permitDiskWrites().build());
            return uq1Var.zza();
        } finally {
            StrictMode.setThreadPolicy(threadPolicy);
        }
    }

    public static String c(Context context, String str, ArrayList arrayList) throws PackageManager.NameNotFoundException, CertificateEncodingException {
        if (Build.VERSION.SDK_INT <= 30 && !Build.VERSION.CODENAME.equals("S")) {
            return null;
        }
        lv1 lv1Var = new lv1();
        context.getPackageManager().requestChecksums(str, false, 8, arrayList, new gg(lv1Var, 1));
        return (String) lv1Var.get();
    }

    public static String d(View view) {
        if (!view.isAttachedToWindow()) {
            return "notAttached";
        }
        int visibility = view.getVisibility();
        if (visibility == 8) {
            return "viewGone";
        }
        if (visibility == 4) {
            return "viewInvisible";
        }
        if (visibility != 0) {
            return "viewNotVisible";
        }
        if (view.getAlpha() == 0.0f) {
            return "viewAlphaZero";
        }
        return null;
    }

    public static String e(String str, Context context, boolean z10, HashMap map) {
        y10 y10Var;
        String strZzj;
        tn tnVar = ao.O0;
        n7.y yVar = n7.y.f31093e;
        if (((Boolean) yVar.f31096c.b(tnVar)).booleanValue() && !z10) {
            return str;
        }
        m7.n nVar = m7.n.C;
        if (!nVar.f30486y.a(context) || TextUtils.isEmpty(str) || (strZzj = (y10Var = nVar.f30486y).zzj(context)) == null) {
            return str;
        }
        tn tnVar2 = ao.H0;
        yn ynVar = yVar.f31096c;
        String str2 = (String) ynVar.b(tnVar2);
        boolean zBooleanValue = ((Boolean) ynVar.b(ao.G0)).booleanValue();
        p7.r0 r0Var = nVar.f30464c;
        if (zBooleanValue && str.contains(str2)) {
            if (r0Var.B(str)) {
                y10Var.zzk(context, strZzj, (Map) map.get("_ac"));
                return C(context, str).replace(str2, strZzj);
            }
            if (!r0Var.C(str)) {
                return str;
            }
            y10Var.zzl(context, strZzj, (Map) map.get("_ai"));
            return C(context, str).replace(str2, strZzj);
        }
        if (str.contains("fbs_aeid") || ((Boolean) ynVar.b(ao.F0)).booleanValue()) {
            return str;
        }
        if (r0Var.B(str)) {
            y10Var.zzk(context, strZzj, (Map) map.get("_ac"));
            return w(C(context, str), "fbs_aeid", strZzj).toString();
        }
        if (!r0Var.C(str)) {
            return str;
        }
        y10Var.zzl(context, strZzj, (Map) map.get("_ai"));
        return w(C(context, str), "fbs_aeid", strZzj).toString();
    }

    public static n7.f4 f(Context context, List list) {
        ArrayList arrayList = new ArrayList();
        Iterator it = list.iterator();
        while (it.hasNext()) {
            xa1 xa1Var = (xa1) it.next();
            if (xa1Var.f18393c) {
                arrayList.add(g7.g.f26287o);
            } else {
                arrayList.add(new g7.g(xa1Var.f18391a, xa1Var.f18392b));
            }
        }
        return new n7.f4(context, (g7.g[]) arrayList.toArray(new g7.g[arrayList.size()]));
    }

    public static void g() {
        qf1.f15728a.booleanValue();
    }

    public static void h(int i10, String str, Throwable th) {
        StringBuilder sb = new StringBuilder(String.valueOf(i10).length() + 20);
        sb.append("Ad failed to load : ");
        sb.append(i10);
        q7.j.c(sb.toString());
        p7.l0.h();
        if (i10 == 3) {
            return;
        }
        m7.n.C.f30469h.e(str, th);
    }

    public static void i(MediaFormat mediaFormat, List list) {
        for (int i10 = 0; i10 < list.size(); i10++) {
            mediaFormat.setByteBuffer(defpackage.e.n(new StringBuilder(String.valueOf(i10).length() + 4), "csd-", i10), ByteBuffer.wrap((byte[]) list.get(i10)));
        }
    }

    public static void j(Spannable spannable, Object obj, int i10, int i11) {
        for (Object obj2 : spannable.getSpans(i10, i11, obj.getClass())) {
            if (spannable.getSpanStart(obj2) == i10 && spannable.getSpanEnd(obj2) == i11 && spannable.getSpanFlags(obj2) == 33) {
                spannable.removeSpan(obj2);
            }
        }
        spannable.setSpan(obj, i10, i11, 33);
    }

    public static void k(com.google.common.util.concurrent.w wVar, String str) {
        ih1.z1(wVar, new c30(str), b30.f9365g);
    }

    public static void l(String str) {
        if (((Boolean) wp.f18173a.j()).booleanValue()) {
            q7.j.a(str);
        }
    }

    public static void m(AtomicReference atomicReference, e91 e91Var) {
        Object obj = atomicReference.get();
        if (obj == null) {
            return;
        }
        try {
            e91Var.zza(obj);
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        } catch (NullPointerException unused) {
        }
    }

    public static void n(k8.a aVar, Throwable th, String str) {
        dz.a((Context) k8.b.O(aVar)).e(th, str, ((Double) xp.f18507f.j()).floatValue());
    }

    public static boolean o(p2 p2Var) {
        p01 p01Var = new p01(8);
        int i10 = h2.f.b(p2Var, p01Var).f26404a;
        if (i10 != 1380533830 && i10 != 1380333108) {
            return false;
        }
        p2Var.h(0, 4, p01Var.f15225a);
        p01Var.C(0);
        int iB = p01Var.b();
        if (iB == 1463899717) {
            return true;
        }
        StringBuilder sb = new StringBuilder(String.valueOf(iB).length() + 23);
        sb.append("Unsupported form type: ");
        sb.append(iB);
        vt0.d(sb.toString());
        return false;
    }

    public static void p() {
        if (!rf1.f16117a.f916b) {
            throw new IllegalStateException("Method called before OM SDK activation");
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:57:0x00d3, code lost:
    
        if (r11 != 3) goto L64;
     */
    /* JADX WARN: Removed duplicated region for block: B:42:0x00ad  */
    /* JADX WARN: Removed duplicated region for block: B:55:0x00cd  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static l2.h q(androidx.media3.extractor.b1 b1Var, boolean z10) throws zzat {
        int i10;
        int iP = b1Var.p(5);
        if (iP == 31) {
            iP = b1Var.p(6) + 32;
        }
        int iZ = z(b1Var);
        int iP2 = b1Var.p(4);
        String strN = defpackage.e.n(new StringBuilder(String.valueOf(iP).length() + 8), "mp4a.40.", iP);
        if (iP == 5 || iP == 29) {
            iZ = z(b1Var);
            int iP3 = b1Var.p(5);
            if (iP3 == 31) {
                iP3 = b1Var.p(6) + 32;
            }
            iP = iP3;
            if (iP == 22) {
                iP2 = b1Var.p(4);
            }
        }
        if (z10) {
            int i11 = 3;
            if (iP != 1 && iP != 2 && iP != 3 && iP != 4 && iP != 6 && iP != 7 && iP != 17) {
                switch (iP) {
                    case 19:
                    case 20:
                    case 21:
                    case 22:
                    case 23:
                        break;
                    default:
                        StringBuilder sb = new StringBuilder(String.valueOf(iP).length() + 31);
                        sb.append("Unsupported audio object type: ");
                        sb.append(iP);
                        throw zzat.zzc(sb.toString());
                }
            }
            if (b1Var.o()) {
                vt0.c("Unexpected frameLengthFlag = 1");
            }
            if (b1Var.o()) {
                b1Var.n(14);
            }
            boolean zO = b1Var.o();
            if (iP2 == 0) {
                throw new UnsupportedOperationException();
            }
            if (iP == 6) {
                b1Var.n(3);
                if (zO) {
                    if (iP == 22) {
                        b1Var.n(16);
                        i10 = 22;
                    } else {
                        i10 = iP;
                    }
                    if (i10 == 17 || i10 == 19 || i10 == 20 || i10 == 23) {
                        b1Var.n(3);
                    }
                    b1Var.n(1);
                }
                switch (iP) {
                    case 17:
                    case 19:
                    case 20:
                    case 21:
                    case 22:
                    case 23:
                        int iP4 = b1Var.p(2);
                        if (iP4 == 2) {
                            i11 = iP4;
                        }
                        StringBuilder sb2 = new StringBuilder(com.google.android.gms.measurement.internal.u1.b(i11, 22));
                        sb2.append("Unsupported epConfig: ");
                        sb2.append(i11);
                        throw zzat.zzc(sb2.toString());
                }
            }
            if (iP == 20) {
                iP = 20;
                b1Var.n(3);
            }
            if (zO) {
            }
            switch (iP) {
            }
        }
        int i12 = f14618b[iP2];
        if (i12 != -1) {
            return new l2.h(strN, iZ, i12);
        }
        throw zzat.zzb(null, null);
    }

    public static void r(int i10, long j10, String str, int i11, PriorityQueue priorityQueue) {
        bk bkVar = new bk(i11, j10, str);
        if ((priorityQueue.size() != i10 || (((bk) priorityQueue.peek()).f9558c <= i11 && ((bk) priorityQueue.peek()).f9556a <= j10)) && !priorityQueue.contains(bkVar)) {
            priorityQueue.add(bkVar);
            if (priorityQueue.size() > i10) {
                priorityQueue.poll();
            }
        }
    }

    public static void s(Context context, boolean z10) {
        if (z10) {
            q7.j.c("This request is sent from a test device.");
            return;
        }
        q7.e eVar = n7.x.f31085g.f31086a;
        String strZzD = q7.e.zzD(context);
        StringBuilder sb = new StringBuilder(String.valueOf(strZzD).length() + 102);
        sb.append("Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList(\"");
        sb.append(strZzD);
        sb.append("\")) to get test ads on this device.");
        q7.j.c(sb.toString());
    }

    public static void t(MediaFormat mediaFormat, String str, int i10) {
        if (i10 != -1) {
            mediaFormat.setInteger(str, i10);
        }
    }

    public static void u(com.google.common.util.concurrent.w wVar, id1 id1Var) {
        if (((Boolean) ip.f12589c.j()).booleanValue()) {
            ih1.z1(wu1.s(wVar), new ld1(id1Var), b30.f9365g);
        }
    }

    public static int v(SQLiteDatabase sQLiteDatabase, int i10) {
        int i11 = 0;
        if (i10 == 2) {
            return 0;
        }
        Cursor cursorJ = J(sQLiteDatabase, i10);
        if (cursorJ.getCount() > 0) {
            cursorJ.moveToNext();
            i11 = cursorJ.getInt(cursorJ.getColumnIndexOrThrow("value"));
        }
        cursorJ.close();
        return i11;
    }

    public static Uri w(String str, String str2, String str3) {
        int iIndexOf = str.indexOf("&adurl");
        if (iIndexOf == -1) {
            iIndexOf = str.indexOf("?adurl");
        }
        if (iIndexOf == -1) {
            return Uri.parse(str).buildUpon().appendQueryParameter(str2, str3).build();
        }
        int i10 = iIndexOf + 1;
        StringBuilder sb = new StringBuilder(str.substring(0, i10));
        u.a.h(sb, str2, "=", str3, "&");
        sb.append(str.substring(i10));
        return Uri.parse(sb.toString());
    }

    public static String x(String[] strArr, int i10, int i11) {
        int i12 = i11 + i10;
        if (strArr.length < i12) {
            q7.j.b("Unable to construct shingle");
            return "";
        }
        StringBuilder sb = new StringBuilder();
        while (true) {
            int i13 = i12 - 1;
            if (i10 >= i13) {
                sb.append(strArr[i13]);
                return sb.toString();
            }
            sb.append(strArr[i10]);
            sb.append(' ');
            i10++;
        }
    }

    public static void y(ArrayList arrayList, bp bpVar) {
        String str = (String) bpVar.j();
        if (TextUtils.isEmpty(str)) {
            return;
        }
        arrayList.add(str);
    }

    public static int z(androidx.media3.extractor.b1 b1Var) throws zzat {
        int iP = b1Var.p(4);
        if (iP == 15) {
            if (b1Var.h() >= 24) {
                return b1Var.p(24);
            }
            throw zzat.zzb("AAC header insufficient data", null);
        }
        if (iP < 13) {
            return f14617a[iP];
        }
        throw zzat.zzb("AAC header wrong Sampling Frequency Index", null);
    }
}
