导航菜单

页面标题

页面副标题

万能钥匙 v1.1.23 - d.java 源代码

正在查看: 万能钥匙 v1.1.23 应用的 d.java JAVA 源代码文件

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


package e4;

import android.net.Uri;
import android.text.TextUtils;
import android.util.Pair;
import android.util.Xml;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import androidx.media3.common.DrmInitData;
import androidx.media3.common.a;
import androidx.media3.extractor.metadata.emsg.EventMessage;
import cn.fly.verify.BuildConfig;
import e4.k;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.xml.sax.helpers.DefaultHandler;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlSerializer;
import q3.g0;
import q3.y;
import rk.c0;
import rk.k0;
import t3.h0;
import t3.i0;
import t3.n0;
import t3.o0;
import t3.s;
import u4.q;

@h0
public class d extends DefaultHandler implements q.a<c> {

    public static final Pattern f11556b = Pattern.compile("(\\d+)(?:/(\\d+))?");

    public static final Pattern f11557c = Pattern.compile("CC([1-4])=.*");

    public static final Pattern f11558d = Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");

    public static final int[] f11559e = {-1, 1, 2, 3, 4, 5, 6, 8, 2, 3, 4, 7, 8, 24, 8, 12, 10, 12, 14, 12, 14};

    public final XmlPullParserFactory f11560a;

    public static final class a {

        public final androidx.media3.common.a f11561a;

        public final c0<b> f11562b;

        public final k f11563c;

        @Nullable
        public final String f11564d;

        public final ArrayList<DrmInitData.SchemeData> f11565e;

        public final ArrayList<e> f11566f;

        public final long f11567g;

        public final List<e> f11568h;

        public final List<e> f11569i;

        public a(androidx.media3.common.a aVar, List<b> list, k kVar, @Nullable String str, ArrayList<DrmInitData.SchemeData> arrayList, ArrayList<e> arrayList2, List<e> list2, List<e> list3, long j10) {
            this.f11561a = aVar;
            this.f11562b = c0.y(list);
            this.f11563c = kVar;
            this.f11564d = str;
            this.f11565e = arrayList;
            this.f11566f = arrayList2;
            this.f11568h = list2;
            this.f11569i = list3;
            this.f11567g = j10;
        }
    }

    public d() {
        try {
            this.f11560a = XmlPullParserFactory.newInstance();
        } catch (XmlPullParserException e10) {
            throw new RuntimeException("Couldn't create XmlPullParserFactory instance", e10);
        }
    }

    public static int C(List<e> list) {
        String str;
        for (int i10 = 0; i10 < list.size(); i10++) {
            e eVar = list.get(i10);
            if ("urn:scte:dash:cc:cea-608:2015".equals(eVar.f11570a) && (str = eVar.f11571b) != null) {
                Matcher matcher = f11557c.matcher(str);
                if (matcher.matches()) {
                    return Integer.parseInt(matcher.group(1));
                }
                s.i("MpdParser", "Unable to parse CEA-608 channel number from: " + eVar.f11571b);
            }
        }
        return -1;
    }

    public static int D(List<e> list) {
        String str;
        for (int i10 = 0; i10 < list.size(); i10++) {
            e eVar = list.get(i10);
            if ("urn:scte:dash:cc:cea-708:2015".equals(eVar.f11570a) && (str = eVar.f11571b) != null) {
                Matcher matcher = f11558d.matcher(str);
                if (matcher.matches()) {
                    return Integer.parseInt(matcher.group(1));
                }
                s.i("MpdParser", "Unable to parse CEA-708 service block number from: " + eVar.f11571b);
            }
        }
        return -1;
    }

    public static long G(XmlPullParser xmlPullParser, String str, long j10) throws q3.h0 {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? j10 : n0.f1(attributeValue);
    }

    public static e H(XmlPullParser xmlPullParser, String str) throws XmlPullParserException, IOException {
        String q02 = q0(xmlPullParser, "schemeIdUri", BuildConfig.FLAVOR);
        String q03 = q0(xmlPullParser, "value", null);
        String q04 = q0(xmlPullParser, "id", null);
        do {
            xmlPullParser.next();
        } while (!o0.d(xmlPullParser, str));
        return new e(q02, q03, q04);
    }

    public static int I(XmlPullParser xmlPullParser) {
        char c10;
        String attributeValue = xmlPullParser.getAttributeValue(null, "value");
        if (attributeValue == null) {
            return -1;
        }
        String e10 = qk.b.e(attributeValue);
        e10.getClass();
        switch (e10.hashCode()) {
            case 1596796:
                if (e10.equals("4000")) {
                    c10 = 0;
                    break;
                }
                c10 = 65535;
                break;
            case 2937391:
                if (e10.equals("a000")) {
                    c10 = 1;
                    break;
                }
                c10 = 65535;
                break;
            case 3094034:
                if (e10.equals("f800")) {
                    c10 = 2;
                    break;
                }
                c10 = 65535;
                break;
            case 3094035:
                if (e10.equals("f801")) {
                    c10 = 3;
                    break;
                }
                c10 = 65535;
                break;
            case 3133436:
                if (e10.equals("fa01")) {
                    c10 = 4;
                    break;
                }
                c10 = 65535;
                break;
            default:
                c10 = 65535;
                break;
        }
        switch (c10) {
        }
        return -1;
    }

    public static int J(XmlPullParser xmlPullParser) {
        int T = T(xmlPullParser, "value", -1);
        if (T <= 0 || T >= 33) {
            return -1;
        }
        return T;
    }

    public static int K(XmlPullParser xmlPullParser) {
        int bitCount;
        String attributeValue = xmlPullParser.getAttributeValue(null, "value");
        if (attributeValue == null || (bitCount = Integer.bitCount(Integer.parseInt(attributeValue, 16))) == 0) {
            return -1;
        }
        return bitCount;
    }

    public static long L(XmlPullParser xmlPullParser, String str, long j10) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? j10 : n0.g1(attributeValue);
    }

    public static String M(List<e> list) {
        for (int i10 = 0; i10 < list.size(); i10++) {
            e eVar = list.get(i10);
            String str = eVar.f11570a;
            if ("tag:dolby.com,2018:dash:EC3_ExtensionType:2018".equals(str) && "JOC".equals(eVar.f11571b)) {
                return "audio/eac3-joc";
            }
            if ("tag:dolby.com,2014:dash:DolbyDigitalPlusExtensionType:2014".equals(str) && "ec+3".equals(eVar.f11571b)) {
                return "audio/eac3-joc";
            }
        }
        return "audio/eac3";
    }

    public static float Q(XmlPullParser xmlPullParser, String str, float f10) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? f10 : Float.parseFloat(attributeValue);
    }

    public static float R(XmlPullParser xmlPullParser, float f10) {
        String attributeValue = xmlPullParser.getAttributeValue(null, "frameRate");
        if (attributeValue != null) {
            Matcher matcher = f11556b.matcher(attributeValue);
            if (matcher.matches()) {
                int parseInt = Integer.parseInt(matcher.group(1));
                return !TextUtils.isEmpty(matcher.group(2)) ? parseInt / Integer.parseInt(r2) : parseInt;
            }
        }
        return f10;
    }

    public static int T(XmlPullParser xmlPullParser, String str, int i10) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? i10 : Integer.parseInt(attributeValue);
    }

    public static long V(List<e> list) {
        for (int i10 = 0; i10 < list.size(); i10++) {
            e eVar = list.get(i10);
            if (qk.b.a("http://dashif.org/guidelines/last-segment-number", eVar.f11570a)) {
                return Long.parseLong(eVar.f11571b);
            }
        }
        return -1L;
    }

    public static long W(XmlPullParser xmlPullParser, String str, long j10) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? j10 : Long.parseLong(attributeValue);
    }

    public static int Y(XmlPullParser xmlPullParser) {
        int T = T(xmlPullParser, "value", -1);
        if (T >= 0) {
            int[] iArr = f11559e;
            if (T < iArr.length) {
                return iArr[T];
            }
        }
        return -1;
    }

    public static int o(int i10, int i11) {
        if (i10 == -1) {
            return i11;
        }
        if (i11 == -1) {
            return i10;
        }
        t3.a.h(i10 == i11);
        return i10;
    }

    @Nullable
    public static String p(@Nullable String str, @Nullable String str2) {
        if (str == null) {
            return str2;
        }
        if (str2 == null) {
            return str;
        }
        t3.a.h(str.equals(str2));
        return str;
    }

    public static void q(ArrayList<DrmInitData.SchemeData> arrayList) {
        String str;
        int i10 = 0;
        while (true) {
            if (i10 >= arrayList.size()) {
                str = null;
                break;
            }
            DrmInitData.SchemeData schemeData = arrayList.get(i10);
            if (q3.i.f16867c.equals(schemeData.f3208b) && (str = schemeData.f3209c) != null) {
                arrayList.remove(i10);
                break;
            }
            i10++;
        }
        if (str == null) {
            return;
        }
        for (int i11 = 0; i11 < arrayList.size(); i11++) {
            DrmInitData.SchemeData schemeData2 = arrayList.get(i11);
            if (q3.i.f16866b.equals(schemeData2.f3208b) && schemeData2.f3209c == null) {
                arrayList.set(i11, new DrmInitData.SchemeData(q3.i.f16867c, str, schemeData2.f3210d, schemeData2.f3211e));
            }
        }
    }

    public static String q0(XmlPullParser xmlPullParser, String str, String str2) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? str2 : attributeValue;
    }

    public static void r(ArrayList<DrmInitData.SchemeData> arrayList) {
        for (int size = arrayList.size() - 1; size >= 0; size--) {
            DrmInitData.SchemeData schemeData = arrayList.get(size);
            if (!schemeData.c()) {
                int i10 = 0;
                while (true) {
                    if (i10 >= arrayList.size()) {
                        break;
                    }
                    if (arrayList.get(i10).a(schemeData)) {
                        arrayList.remove(size);
                        break;
                    }
                    i10++;
                }
            }
        }
    }

    public static String r0(XmlPullParser xmlPullParser, String str) throws XmlPullParserException, IOException {
        String str2 = BuildConfig.FLAVOR;
        do {
            xmlPullParser.next();
            if (xmlPullParser.getEventType() == 4) {
                str2 = xmlPullParser.getText();
            } else {
                v(xmlPullParser);
            }
        } while (!o0.d(xmlPullParser, str));
        return str2;
    }

    public static long s(long j10, long j11) {
        if (j11 != -9223372036854775807L) {
            j10 = j11;
        }
        if (j10 == Long.MAX_VALUE) {
            return -9223372036854775807L;
        }
        return j10;
    }

    @Nullable
    public static String t(@Nullable String str, @Nullable String str2) {
        if (g0.o(str)) {
            return g0.c(str2);
        }
        if (g0.s(str)) {
            return g0.n(str2);
        }
        if (g0.r(str) || g0.p(str)) {
            return str;
        }
        if (!"application/mp4".equals(str)) {
            return null;
        }
        String g10 = g0.g(str2);
        return "text/vtt".equals(g10) ? "application/x-mp4-vtt" : g10;
    }

    public static void v(XmlPullParser xmlPullParser) throws IOException, XmlPullParserException {
        if (o0.e(xmlPullParser)) {
            int i10 = 1;
            while (i10 != 0) {
                xmlPullParser.next();
                if (o0.e(xmlPullParser)) {
                    i10++;
                } else if (o0.c(xmlPullParser)) {
                    i10--;
                }
            }
        }
    }

    public long A(XmlPullParser xmlPullParser, long j10) {
        String attributeValue = xmlPullParser.getAttributeValue(null, "availabilityTimeOffset");
        if (attributeValue == null) {
            return j10;
        }
        if ("INF".equals(attributeValue)) {
            return Long.MAX_VALUE;
        }
        return (long) (Float.parseFloat(attributeValue) * 1000000.0f);
    }

    public List<b> B(XmlPullParser xmlPullParser, List<b> list, boolean z) throws XmlPullParserException, IOException {
        String attributeValue = xmlPullParser.getAttributeValue(null, "dvb:priority");
        int parseInt = attributeValue != null ? Integer.parseInt(attributeValue) : z ? 1 : Integer.MIN_VALUE;
        String attributeValue2 = xmlPullParser.getAttributeValue(null, "dvb:weight");
        int parseInt2 = attributeValue2 != null ? Integer.parseInt(attributeValue2) : 1;
        String attributeValue3 = xmlPullParser.getAttributeValue(null, "serviceLocation");
        String r02 = r0(xmlPullParser, "BaseURL");
        if (i0.c(r02)) {
            if (attributeValue3 == null) {
                attributeValue3 = r02;
            }
            return k0.j(new b[]{new b(r02, attributeValue3, parseInt, parseInt2)});
        }
        ArrayList arrayList = new ArrayList();
        for (int i10 = 0; i10 < list.size(); i10++) {
            b bVar = list.get(i10);
            String e10 = i0.e(bVar.f11539a, r02);
            String str = attributeValue3 == null ? e10 : attributeValue3;
            if (z) {
                parseInt = bVar.f11541c;
                parseInt2 = bVar.f11542d;
                str = bVar.f11540b;
            }
            arrayList.add(new b(e10, str, parseInt, parseInt2));
        }
        return arrayList;
    }

    public android.util.Pair<java.lang.String, androidx.media3.common.DrmInitData.SchemeData> E(org.xmlpull.v1.XmlPullParser r12) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
        throw new UnsupportedOperationException("Method not decompiled: e4.d.E(org.xmlpull.v1.XmlPullParser):android.util.Pair");
    }

    public int F(XmlPullParser xmlPullParser) {
        String attributeValue = xmlPullParser.getAttributeValue(null, "contentType");
        if (TextUtils.isEmpty(attributeValue)) {
            return -1;
        }
        if ("audio".equals(attributeValue)) {
            return 1;
        }
        if ("video".equals(attributeValue)) {
            return 2;
        }
        if ("text".equals(attributeValue)) {
            return 3;
        }
        return "image".equals(attributeValue) ? 4 : -1;
    }

    public Pair<Long, EventMessage> N(XmlPullParser xmlPullParser, String str, String str2, long j10, long j11, ByteArrayOutputStream byteArrayOutputStream) throws IOException, XmlPullParserException {
        long W = W(xmlPullParser, "id", 0L);
        long W2 = W(xmlPullParser, "duration", -9223372036854775807L);
        long W3 = W(xmlPullParser, "presentationTime", 0L);
        long n12 = n0.n1(W2, 1000L, j10);
        long n13 = n0.n1(W3 - j11, 1000000L, j10);
        String q02 = q0(xmlPullParser, "messageData", null);
        byte[] O = O(xmlPullParser, byteArrayOutputStream);
        Long valueOf = Long.valueOf(n13);
        if (q02 != null) {
            O = n0.C0(q02);
        }
        return Pair.create(valueOf, c(str, str2, W, n12, O));
    }

    public byte[] O(XmlPullParser xmlPullParser, ByteArrayOutputStream byteArrayOutputStream) throws XmlPullParserException, IOException {
        byteArrayOutputStream.reset();
        XmlSerializer newSerializer = Xml.newSerializer();
        newSerializer.setOutput(byteArrayOutputStream, qk.d.c.name());
        xmlPullParser.nextToken();
        while (!o0.d(xmlPullParser, "Event")) {
            switch (xmlPullParser.getEventType()) {
                case 0:
                    newSerializer.startDocument(null, Boolean.FALSE);
                    break;
                case 1:
                    newSerializer.endDocument();
                    break;
                case 2:
                    newSerializer.startTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
                    for (int i10 = 0; i10 < xmlPullParser.getAttributeCount(); i10++) {
                        newSerializer.attribute(xmlPullParser.getAttributeNamespace(i10), xmlPullParser.getAttributeName(i10), xmlPullParser.getAttributeValue(i10));
                    }
                    break;
                case 3:
                    newSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
                    break;
                case 4:
                    newSerializer.text(xmlPullParser.getText());
                    break;
                case 5:
                    newSerializer.cdsect(xmlPullParser.getText());
                    break;
                case 6:
                    newSerializer.entityRef(xmlPullParser.getText());
                    break;
                case 7:
                    newSerializer.ignorableWhitespace(xmlPullParser.getText());
                    break;
                case 8:
                    newSerializer.processingInstruction(xmlPullParser.getText());
                    break;
                case 9:
                    newSerializer.comment(xmlPullParser.getText());
                    break;
                case 10:
                    newSerializer.docdecl(xmlPullParser.getText());
                    break;
            }
            xmlPullParser.nextToken();
        }
        newSerializer.flush();
        return byteArrayOutputStream.toByteArray();
    }

    public f P(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
        long j10;
        String str;
        String str2;
        XmlPullParser xmlPullParser2;
        String q02 = q0(xmlPullParser, "schemeIdUri", BuildConfig.FLAVOR);
        String q03 = q0(xmlPullParser, "value", BuildConfig.FLAVOR);
        long W = W(xmlPullParser, "timescale", 1L);
        long W2 = W(xmlPullParser, "presentationTimeOffset", 0L);
        ArrayList arrayList = new ArrayList();
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(NotificationCompat.FLAG_GROUP_SUMMARY);
        while (true) {
            xmlPullParser.next();
            if (o0.f(xmlPullParser, "Event")) {
                j10 = W;
                str = q03;
                str2 = q02;
                xmlPullParser2 = xmlPullParser;
                arrayList.add(N(xmlPullParser2, str2, str, j10, W2, byteArrayOutputStream));
            } else {
                j10 = W;
                str = q03;
                str2 = q02;
                xmlPullParser2 = xmlPullParser;
                v(xmlPullParser2);
            }
            if (o0.d(xmlPullParser2, "EventStream")) {
                break;
            }
            xmlPullParser = xmlPullParser2;
            q02 = str2;
            q03 = str;
            W = j10;
        }
        long[] jArr = new long[arrayList.size()];
        EventMessage[] eventMessageArr = new EventMessage[arrayList.size()];
        for (int i10 = 0; i10 < arrayList.size(); i10++) {
            Pair pair = (Pair) arrayList.get(i10);
            jArr[i10] = ((Long) pair.first).longValue();
            eventMessageArr[i10] = (EventMessage) pair.second;
        }
        return d(str2, str, j10, jArr, eventMessageArr);
    }

    public i S(XmlPullParser xmlPullParser) {
        return c0(xmlPullParser, "sourceURL", "range");
    }

    public y U(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
        return new y(xmlPullParser.getAttributeValue(null, "lang"), r0(xmlPullParser, "Label"));
    }

    public e4.c X(org.xmlpull.v1.XmlPullParser r43, android.net.Uri r44) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
        throw new UnsupportedOperationException("Method not decompiled: e4.d.X(org.xmlpull.v1.XmlPullParser, android.net.Uri):e4.c");
    }

    public android.util.Pair<e4.g, java.lang.Long> Z(org.xmlpull.v1.XmlPullParser r33, java.util.List<e4.b> r34, long r35, long r37, long r39, long r41, boolean r43) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
        throw new UnsupportedOperationException("Method not decompiled: e4.d.Z(org.xmlpull.v1.XmlPullParser, java.util.List, long, long, long, long, boolean):android.util.Pair");
    }

    public final long a(List<k.d> list, long j10, long j11, int i10, long j12) {
        int o10 = i10 >= 0 ? i10 + 1 : (int) n0.o(j12 - j10, j11);
        for (int i11 = 0; i11 < o10; i11++) {
            list.add(l(j10, j11));
            j10 += j11;
        }
        return j10;
    }

    public String[] a0(XmlPullParser xmlPullParser, String str, String[] strArr) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? strArr : attributeValue.split(",");
    }

    public e4.a b(long j10, int i10, List<j> list, List<e> list2, List<e> list3, List<e> list4) {
        return new e4.a(j10, i10, list, list2, list3, list4);
    }

    public h b0(XmlPullParser xmlPullParser) throws IOException, XmlPullParserException {
        String str = null;
        String q02 = q0(xmlPullParser, "moreInformationURL", null);
        String q03 = q0(xmlPullParser, "lang", null);
        String str2 = null;
        String str3 = null;
        while (true) {
            xmlPullParser.next();
            if (o0.f(xmlPullParser, "Title")) {
                str = xmlPullParser.nextText();
            } else if (o0.f(xmlPullParser, "Source")) {
                str2 = xmlPullParser.nextText();
            } else if (o0.f(xmlPullParser, "Copyright")) {
                str3 = xmlPullParser.nextText();
            } else {
                v(xmlPullParser);
            }
            String str4 = str2;
            String str5 = str;
            String str6 = str3;
            if (o0.d(xmlPullParser, "ProgramInformation")) {
                return new h(str5, str4, str6, q02, q03);
            }
            str = str5;
            str2 = str4;
            str3 = str6;
        }
    }

    public EventMessage c(String str, String str2, long j10, long j11, byte[] bArr) {
        return new EventMessage(str, str2, j11, j10, bArr);
    }

    public i c0(XmlPullParser xmlPullParser, String str, String str2) {
        long j10;
        long j11;
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        String attributeValue2 = xmlPullParser.getAttributeValue(null, str2);
        if (attributeValue2 != null) {
            String[] split = attributeValue2.split("-");
            j10 = Long.parseLong(split[0]);
            if (split.length == 2) {
                j11 = (Long.parseLong(split[1]) - j10) + 1;
                return h(attributeValue, j10, j11);
            }
        } else {
            j10 = 0;
        }
        j11 = -1;
        return h(attributeValue, j10, j11);
    }

    public f d(String str, String str2, long j10, long[] jArr, EventMessage[] eventMessageArr) {
        return new f(str, str2, j10, jArr, eventMessageArr);
    }

    public e4.d.a d0(org.xmlpull.v1.XmlPullParser r33, java.util.List<e4.b> r34, @androidx.annotation.Nullable java.lang.String r35, @androidx.annotation.Nullable java.lang.String r36, int r37, int r38, float r39, int r40, int r41, @androidx.annotation.Nullable java.lang.String r42, java.util.List<e4.e> r43, java.util.List<e4.e> r44, java.util.List<e4.e> r45, java.util.List<e4.e> r46, @androidx.annotation.Nullable e4.k r47, long r48, long r50, long r52, long r54, long r56, boolean r58) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
        throw new UnsupportedOperationException("Method not decompiled: e4.d.d0(org.xmlpull.v1.XmlPullParser, java.util.List, java.lang.String, java.lang.String, int, int, float, int, int, java.lang.String, java.util.List, java.util.List, java.util.List, java.util.List, e4.k, long, long, long, long, long, boolean):e4.d$a");
    }

    public androidx.media3.common.a e(@Nullable String str, @Nullable String str2, int i10, int i11, float f10, int i12, int i13, int i14, @Nullable String str3, List<e> list, List<e> list2, @Nullable String str4, List<e> list3, List<e> list4) {
        String str5 = str4;
        String t10 = t(str2, str5);
        if ("audio/eac3".equals(t10)) {
            t10 = M(list4);
            if ("audio/eac3-joc".equals(t10)) {
                str5 = "ec+3";
            }
        }
        int o02 = o0(list);
        int h02 = h0(list) | e0(list2) | g0(list3) | g0(list4);
        Pair<Integer, Integer> s02 = s0(list3);
        a.b e02 = new a.b().a0(str).Q(str2).o0(t10).O(str5).j0(i14).q0(o02).m0(h02).e0(str3);
        int i15 = -1;
        a.b u02 = e02.t0(s02 != null ? ((Integer) s02.first).intValue() : -1).u0(s02 != null ? ((Integer) s02.second).intValue() : -1);
        if (g0.s(t10)) {
            u02.v0(i10).Y(i11).X(f10);
        } else if (g0.o(t10)) {
            u02.N(i12).p0(i13);
        } else if (g0.r(t10)) {
            if ("application/cea-608".equals(t10)) {
                i15 = C(list2);
            } else if ("application/cea-708".equals(t10)) {
                i15 = D(list2);
            }
            u02.L(i15);
        } else if (g0.p(t10)) {
            u02.v0(i10).Y(i11);
        }
        return u02.K();
    }

    public int e0(List<e> list) {
        int t02;
        int i10 = 0;
        for (int i11 = 0; i11 < list.size(); i11++) {
            e eVar = list.get(i11);
            if (qk.b.a("urn:mpeg:dash:role:2011", eVar.f11570a)) {
                t02 = f0(eVar.f11571b);
            } else if (qk.b.a("urn:tva:metadata:cs:AudioPurposeCS:2007", eVar.f11570a)) {
                t02 = t0(eVar.f11571b);
            }
            i10 |= t02;
        }
        return i10;
    }

    public c f(long j10, long j11, long j12, boolean z, long j13, long j14, long j15, long j16, @Nullable h hVar, @Nullable o oVar, @Nullable l lVar, @Nullable Uri uri, List<g> list) {
        return new c(j10, j11, j12, z, j13, j14, j15, j16, hVar, oVar, lVar, uri, list);
    }

    public int f0(@Nullable String str) {
        if (str == null) {
            return 0;
        }
        switch (str) {
        }
        return 0;
    }

    public g g(@Nullable String str, long j10, List<e4.a> list, List<f> list2, @Nullable e eVar) {
        return new g(str, j10, list, list2, eVar);
    }

    public int g0(List<e> list) {
        int i10 = 0;
        for (int i11 = 0; i11 < list.size(); i11++) {
            if (qk.b.a("http://dashif.org/guidelines/trickmode", list.get(i11).f11570a)) {
                i10 = 16384;
            }
        }
        return i10;
    }

    public i h(String str, long j10, long j11) {
        return new i(str, j10, j11);
    }

    public int h0(List<e> list) {
        int i10 = 0;
        for (int i11 = 0; i11 < list.size(); i11++) {
            e eVar = list.get(i11);
            if (qk.b.a("urn:mpeg:dash:role:2011", eVar.f11570a)) {
                i10 |= f0(eVar.f11571b);
            }
        }
        return i10;
    }

    public j i(a aVar, @Nullable String str, List<y> list, @Nullable String str2, ArrayList<DrmInitData.SchemeData> arrayList, ArrayList<e> arrayList2) {
        a.b a10 = aVar.f11561a.a();
        if (str == null || !list.isEmpty()) {
            a10.d0(list);
        } else {
            a10.c0(str);
        }
        String str3 = aVar.f11564d;
        if (str3 == null) {
            str3 = str2;
        }
        ArrayList<DrmInitData.SchemeData> arrayList3 = aVar.f11565e;
        arrayList3.addAll(arrayList);
        if (!arrayList3.isEmpty()) {
            q(arrayList3);
            r(arrayList3);
            a10.U(new DrmInitData(str3, arrayList3));
        }
        ArrayList<e> arrayList4 = aVar.f11566f;
        arrayList4.addAll(arrayList2);
        return j.n(aVar.f11567g, a10.K(), aVar.f11562b, aVar.f11563c, arrayList4, aVar.f11568h, aVar.f11569i, null);
    }

    public k.e i0(XmlPullParser xmlPullParser, @Nullable k.e eVar) throws XmlPullParserException, IOException {
        long W = W(xmlPullParser, "timescale", eVar != null ? eVar.f11607b : 1L);
        long W2 = W(xmlPullParser, "presentationTimeOffset", eVar != null ? eVar.f11608c : 0L);
        long j10 = eVar != null ? eVar.f11621d : 0L;
        long j11 = eVar != null ? eVar.f11622e : 0L;
        String attributeValue = xmlPullParser.getAttributeValue(null, "indexRange");
        if (attributeValue != null) {
            String[] split = attributeValue.split("-");
            j10 = Long.parseLong(split[0]);
            j11 = (Long.parseLong(split[1]) - j10) + 1;
        }
        long j12 = j11;
        i iVar = eVar != null ? eVar.f11606a : null;
        while (true) {
            xmlPullParser.next();
            if (o0.f(xmlPullParser, "Initialization")) {
                iVar = S(xmlPullParser);
            } else {
                v(xmlPullParser);
            }
            i iVar2 = iVar;
            if (o0.d(xmlPullParser, "SegmentBase")) {
                return m(iVar2, W, W2, j10, j12);
            }
            iVar = iVar2;
        }
    }

    public k.b j(i iVar, long j10, long j11, long j12, long j13, @Nullable List<k.d> list, long j14, @Nullable List<i> list2, long j15, long j16) {
        return new k.b(iVar, j10, j11, j12, j13, list, j14, list2, n0.Y0(j15), n0.Y0(j16));
    }

    public k.b j0(XmlPullParser xmlPullParser, @Nullable k.b bVar, long j10, long j11, long j12, long j13, long j14) throws XmlPullParserException, IOException {
        long j15;
        long W = W(xmlPullParser, "timescale", bVar != null ? bVar.f11607b : 1L);
        long W2 = W(xmlPullParser, "presentationTimeOffset", bVar != null ? bVar.f11608c : 0L);
        long W3 = W(xmlPullParser, "duration", bVar != null ? bVar.f11610e : -9223372036854775807L);
        long W4 = W(xmlPullParser, "startNumber", bVar != null ? bVar.f11609d : 1L);
        long s10 = s(j12, j13);
        List<i> list = null;
        i iVar = null;
        List<k.d> list2 = null;
        while (true) {
            xmlPullParser.next();
            if (o0.f(xmlPullParser, "Initialization")) {
                iVar = S(xmlPullParser);
                j15 = W;
            } else if (o0.f(xmlPullParser, "SegmentTimeline")) {
                j15 = W;
                list2 = l0(xmlPullParser, j15, j11);
            } else {
                j15 = W;
                if (o0.f(xmlPullParser, "SegmentURL")) {
                    if (list == null) {
                        list = new ArrayList<>();
                    }
                    list.add(m0(xmlPullParser));
                } else {
                    v(xmlPullParser);
                }
            }
            if (o0.d(xmlPullParser, "SegmentList")) {
                break;
            }
            W = j15;
        }
        if (bVar != null) {
            if (iVar == null) {
                iVar = bVar.f11606a;
            }
            if (list2 == null) {
                list2 = bVar.f11611f;
            }
            if (list == null) {
                list = bVar.f11615j;
            }
        }
        return j(iVar, j15, W2, W4, W3, list2, s10, list, j14, j10);
    }

    public k.c k(i iVar, long j10, long j11, long j12, long j13, long j14, List<k.d> list, long j15, @Nullable n nVar, @Nullable n nVar2, long j16, long j17) {
        return new k.c(iVar, j10, j11, j12, j13, j14, list, j15, nVar, nVar2, n0.Y0(j16), n0.Y0(j17));
    }

    public k.c k0(XmlPullParser xmlPullParser, @Nullable k.c cVar, List<e> list, long j10, long j11, long j12, long j13, long j14) throws XmlPullParserException, IOException {
        long j15;
        d dVar = this;
        long W = W(xmlPullParser, "timescale", cVar != null ? cVar.f11607b : 1L);
        long W2 = W(xmlPullParser, "presentationTimeOffset", cVar != null ? cVar.f11608c : 0L);
        long W3 = W(xmlPullParser, "duration", cVar != null ? cVar.f11610e : -9223372036854775807L);
        long W4 = W(xmlPullParser, "startNumber", cVar != null ? cVar.f11609d : 1L);
        long V = V(list);
        long s10 = s(j12, j13);
        n u02 = dVar.u0(xmlPullParser, "media", cVar != null ? cVar.f11617k : null);
        n u03 = dVar.u0(xmlPullParser, "initialization", cVar != null ? cVar.f11616j : null);
        i iVar = null;
        List<k.d> list2 = null;
        while (true) {
            xmlPullParser.next();
            if (o0.f(xmlPullParser, "Initialization")) {
                iVar = S(xmlPullParser);
                j15 = W;
            } else if (o0.f(xmlPullParser, "SegmentTimeline")) {
                j15 = W;
                list2 = dVar.l0(xmlPullParser, j15, j11);
            } else {
                j15 = W;
                v(xmlPullParser);
            }
            if (o0.d(xmlPullParser, "SegmentTemplate")) {
                break;
            }
            dVar = this;
            s10 = s10;
            V = V;
            W4 = W4;
            W2 = W2;
            W = j15;
        }
        if (cVar != null) {
            if (iVar == null) {
                iVar = cVar.f11606a;
            }
            if (list2 == null) {
                list2 = cVar.f11611f;
            }
        }
        return k(iVar, j15, W2, W4, V, W3, list2, s10, u03, u02, j14, j10);
    }

    public k.d l(long j10, long j11) {
        return new k.d(j10, j11);
    }

    public List<k.d> l0(XmlPullParser xmlPullParser, long j10, long j11) throws XmlPullParserException, IOException {
        ArrayList arrayList = new ArrayList();
        long j12 = 0;
        long j13 = -9223372036854775807L;
        boolean z = false;
        int i10 = 0;
        do {
            xmlPullParser.next();
            if (o0.f(xmlPullParser, "S")) {
                long W = W(xmlPullParser, "t", -9223372036854775807L);
                if (z) {
                    ArrayList arrayList2 = arrayList;
                    j12 = a(arrayList2, j12, j13, i10, W);
                    arrayList = arrayList2;
                }
                if (W != -9223372036854775807L) {
                    j12 = W;
                }
                j13 = W(xmlPullParser, "d", -9223372036854775807L);
                i10 = T(xmlPullParser, "r", 0);
                z = true;
            } else {
                v(xmlPullParser);
            }
        } while (!o0.d(xmlPullParser, "SegmentTimeline"));
        if (z) {
            a(arrayList, j12, j13, i10, n0.n1(j11, j10, 1000L));
        }
        return arrayList;
    }

    public k.e m(i iVar, long j10, long j11, long j12, long j13) {
        return new k.e(iVar, j10, j11, j12, j13);
    }

    public i m0(XmlPullParser xmlPullParser) {
        return c0(xmlPullParser, "media", "mediaRange");
    }

    public o n(String str, String str2) {
        return new o(str, str2);
    }

    public int n0(@Nullable String str) {
        if (str == null) {
            return 0;
        }
        return (str.equals("forced_subtitle") || str.equals("forced-subtitle")) ? 2 : 0;
    }

    public int o0(List<e> list) {
        int i10 = 0;
        for (int i11 = 0; i11 < list.size(); i11++) {
            e eVar = list.get(i11);
            if (qk.b.a("urn:mpeg:dash:role:2011", eVar.f11570a)) {
                i10 |= n0(eVar.f11571b);
            }
        }
        return i10;
    }

    public l p0(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
        long j10 = -9223372036854775807L;
        long j11 = -9223372036854775807L;
        long j12 = -9223372036854775807L;
        float f10 = -3.4028235E38f;
        float f11 = -3.4028235E38f;
        while (true) {
            xmlPullParser.next();
            if (o0.f(xmlPullParser, "Latency")) {
                j10 = W(xmlPullParser, "target", -9223372036854775807L);
                j11 = W(xmlPullParser, "min", -9223372036854775807L);
                j12 = W(xmlPullParser, "max", -9223372036854775807L);
            } else if (o0.f(xmlPullParser, "PlaybackRate")) {
                f10 = Q(xmlPullParser, "min", -3.4028235E38f);
                f11 = Q(xmlPullParser, "max", -3.4028235E38f);
            }
            long j13 = j10;
            long j14 = j11;
            long j15 = j12;
            float f12 = f10;
            float f13 = f11;
            if (o0.d(xmlPullParser, "ServiceDescription")) {
                return new l(j13, j14, j15, f12, f13);
            }
            j10 = j13;
            j11 = j14;
            j12 = j15;
            f10 = f12;
            f11 = f13;
        }
    }

    @Nullable
    public Pair<Integer, Integer> s0(List<e> list) {
        String str;
        for (int i10 = 0; i10 < list.size(); i10++) {
            e eVar = list.get(i10);
            if ((qk.b.a("http://dashif.org/thumbnail_tile", eVar.f11570a) || qk.b.a("http://dashif.org/guidelines/thumbnail_tile", eVar.f11570a)) && (str = eVar.f11571b) != null) {
                String[] y1 = n0.y1(str, "x");
                if (y1.length != 2) {
                    continue;
                } else {
                    try {
                        return Pair.create(Integer.valueOf(Integer.parseInt(y1[0])), Integer.valueOf(Integer.parseInt(y1[1])));
                    } catch (NumberFormatException unused) {
                        continue;
                    }
                }
            }
        }
        return null;
    }

    public int t0(@Nullable String str) {
        if (str == null) {
            return 0;
        }
        switch (str) {
        }
        return 0;
    }

    public final boolean u(String[] strArr) {
        for (String str : strArr) {
            if (str.startsWith("urn:dvb:dash:profile:dvb-dash:")) {
                return true;
            }
        }
        return false;
    }

    @Nullable
    public n u0(XmlPullParser xmlPullParser, String str, @Nullable n nVar) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue != null ? n.b(attributeValue) : nVar;
    }

    public o v0(XmlPullParser xmlPullParser) {
        return n(xmlPullParser.getAttributeValue(null, "schemeIdUri"), xmlPullParser.getAttributeValue(null, "value"));
    }

    @Override
    public c parse(Uri uri, InputStream inputStream) throws IOException {
        try {
            XmlPullParser newPullParser = this.f11560a.newPullParser();
            newPullParser.setInput(inputStream, null);
            if (newPullParser.next() == 2 && "MPD".equals(newPullParser.getName())) {
                return X(newPullParser, uri);
            }
            throw q3.h0.c("inputStream does not contain a valid media presentation description", null);
        } catch (XmlPullParserException e10) {
            throw q3.h0.c(null, e10);
        }
    }

    public e4.a x(org.xmlpull.v1.XmlPullParser r44, java.util.List<e4.b> r45, @androidx.annotation.Nullable e4.k r46, long r47, long r49, long r51, long r53, long r55, boolean r57) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
        throw new UnsupportedOperationException("Method not decompiled: e4.d.x(org.xmlpull.v1.XmlPullParser, java.util.List, e4.k, long, long, long, long, long, boolean):e4.a");
    }

    public void y(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
        v(xmlPullParser);
    }

    public int z(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
        char c10;
        String q02 = q0(xmlPullParser, "schemeIdUri", null);
        q02.getClass();
        int i10 = -1;
        switch (q02.hashCode()) {
            case -2128649360:
                if (q02.equals("urn:dts:dash:audio_channel_configuration:2012")) {
                    c10 = 0;
                    break;
                }
                c10 = 65535;
                break;
            case -1352850286:
                if (q02.equals("urn:mpeg:dash:23003:3:audio_channel_configuration:2011")) {
                    c10 = 1;
                    break;
                }
                c10 = 65535;
                break;
            case -1138141449:
                if (q02.equals("tag:dolby.com,2014:dash:audio_channel_configuration:2011")) {
                    c10 = 2;
                    break;
                }
                c10 = 65535;
                break;
            case -986633423:
                if (q02.equals("urn:mpeg:mpegB:cicp:ChannelConfiguration")) {
                    c10 = 3;
                    break;
                }
                c10 = 65535;
                break;
            case -79006963:
                if (q02.equals("tag:dts.com,2014:dash:audio_channel_configuration:2012")) {
                    c10 = 4;
                    break;
                }
                c10 = 65535;
                break;
            case 312179081:
                if (q02.equals("tag:dts.com,2018:uhd:audio_channel_configuration")) {
                    c10 = 5;
                    break;
                }
                c10 = 65535;
                break;
            case 2036691300:
                if (q02.equals("urn:dolby:dash:audio_channel_configuration:2011")) {
                    c10 = 6;
                    break;
                }
                c10 = 65535;
                break;
            default:
                c10 = 65535;
                break;
        }
        switch (c10) {
            case 0:
            case 4:
                i10 = J(xmlPullParser);
                break;
            case 1:
                i10 = T(xmlPullParser, "value", -1);
                break;
            case 2:
            case 6:
                i10 = I(xmlPullParser);
                break;
            case 3:
                i10 = Y(xmlPullParser);
                break;
            case 5:
                i10 = K(xmlPullParser);
                break;
        }
        do {
            xmlPullParser.next();
        } while (!o0.d(xmlPullParser, "AudioChannelConfiguration"));
        return i10;
    }
}