TikTok.apk(点击下载) / C64020PBp.java


package X;

import android.graphics.Matrix;
import android.util.Xml;
import com.bytedance.android.livesdk.livesetting.broadcast.LiveBroadcastTaskResourceIdSetting;
import com.bytedance.android.livesdk.livesetting.gift.LiveGuideWattingDurationSetting;
import com.bytedance.android.livesdk.livesetting.other.subscribe_enhance.SubscriptionExpireRemindHourSetting;
import com.bytedance.android.livesdk.livesetting.wallet.LiveRechargeAgeThresholdSetting;
import com.bytedance.covode.number.Covode;
import com.lynx.tasm.base.LLog;
import com.lynx.tasm.utils.ColorUtils;
import com.swift.sandhook.utils.FileUtils;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Locale;
import java.util.zip.GZIPInputStream;
import org.xml.sax.Attributes;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

/* renamed from: X.PBp  reason: case insensitive filesystem */
public final class C64020PBp {
    public C64021PBq LIZ;
    public AbstractC64032PCb LIZIZ;
    public boolean LIZJ;
    public int LIZLLL;

    static {
        Covode.recordClassIndex(39656);
    }

    public static float LIZ(String str, int i2) {
        float LIZ2 = new PCP().LIZ(str, 0, i2);
        if (!Float.isNaN(LIZ2)) {
            return LIZ2;
        }
        throw new C64045PCo("Invalid float value: ".concat(String.valueOf(str)));
    }

    public static C64025PBu LIZ(C64023PBs pBs) {
        return pBs.LIZ("auto") ? new C64025PBu() : pBs.LJI();
    }

    private Float LIZ(String str) {
        if (str.length() != 0) {
            int length = str.length();
            boolean z = false;
            if (str.charAt(str.length() - 1) == '%') {
                length--;
                z = true;
            }
            try {
                float LIZ2 = LIZ(str, length);
                float f = 100.0f;
                if (z) {
                    LIZ2 /= 100.0f;
                }
                if (LIZ2 < 0.0f) {
                    f = 0.0f;
                } else if (LIZ2 <= 100.0f) {
                    f = LIZ2;
                }
                return Float.valueOf(f);
            } catch (NumberFormatException e) {
                throw new C64045PCo("Invalid offset value in <stop>: ".concat(String.valueOf(str)), e);
            }
        } else {
            throw new C64045PCo("Invalid offset value in <stop> (empty string)");
        }
    }

    public static void LIZ(C64022PBr pBr, String str, String str2) {
        if (str2.length() != 0 && !str2.equals("inherit")) {
            switch (C64048PCr.LIZIZ[EnumC64049PCs.LIZ(str).ordinal()]) {
                case LiveGuideWattingDurationSetting.DEFAULT /*{ENCODED_INT: 30}*/:
                    pBr.LIZIZ = LJI(str2);
                    if (pBr.LIZIZ != null) {
                        pBr.LIZ |= 1;
                        return;
                    }
                    return;
                case 31:
                    pBr.LIZJ = LJIIIZ(str2);
                    if (pBr.LIZJ != null) {
                        pBr.LIZ |= 2;
                        return;
                    }
                    return;
                case FileUtils.FileMode.MODE_IRGRP /*{ENCODED_INT: 32}*/:
                    pBr.LIZLLL = LJ(str2);
                    if (pBr.LIZLLL != null) {
                        pBr.LIZ |= 4;
                        return;
                    }
                    return;
                case 33:
                    pBr.LJ = LJI(str2);
                    if (pBr.LJ != null) {
                        pBr.LIZ |= 8;
                        return;
                    }
                    return;
                case 34:
                    pBr.LJFF = LJ(str2);
                    if (pBr.LJFF != null) {
                        pBr.LIZ |= 16;
                        return;
                    }
                    return;
                case 35:
                    try {
                        pBr.LJI = LIZJ(str2);
                        pBr.LIZ |= 32;
                        return;
                    } catch (C64045PCo unused) {
                        return;
                    }
                case 36:
                    pBr.LJII = LJIIJ(str2);
                    if (pBr.LJII != null) {
                        pBr.LIZ |= 64;
                        return;
                    }
                    return;
                case 37:
                    pBr.LJIIIIZZ = LJIIJJI(str2);
                    if (pBr.LJIIIIZZ != null) {
                        pBr.LIZ |= 128;
                        return;
                    }
                    return;
                case 38:
                    try {
                        pBr.LJIIIZ = Float.valueOf(LIZLLL(str2));
                        pBr.LIZ |= 256;
                        return;
                    } catch (C64045PCo unused2) {
                        return;
                    }
                case 39:
                    if ("none".equals(str2)) {
                        pBr.LJIIJ = null;
                        pBr.LIZ |= 512;
                        return;
                    }
                    pBr.LJIIJ = LJIIL(str2);
                    if (pBr.LJIIJ != null) {
                        pBr.LIZ |= 512;
                        return;
                    }
                    return;
                case 40:
                    try {
                        pBr.LJIIJJI = LIZJ(str2);
                        pBr.LIZ |= 1024;
                        return;
                    } catch (C64045PCo unused3) {
                        return;
                    }
                case 41:
                    pBr.LJIIL = LJ(str2);
                    pBr.LIZ |= 2048;
                    return;
                case 42:
                    try {
                        pBr.LJIILIIL = LJIIIIZZ(str2);
                        pBr.LIZ |= 4096;
                        return;
                    } catch (C64045PCo unused4) {
                        return;
                    }
                case LiveBroadcastTaskResourceIdSetting.DEFAULT /*{ENCODED_INT: 43}*/:
                    pBr.LJIILJJIL = LJIILIIL(str2);
                    if (pBr.LJIILJJIL != null) {
                        pBr.LIZ |= 524288;
                        return;
                    }
                    return;
                case 44:
                    if (str2.indexOf(124) < 0 && "|inline|block|list-item|run-in|compact|marker|table|inline-table|table-row-group|table-header-group|table-footer-group|table-row|table-column-group|table-column|table-cell|table-caption|none|".contains("|" + str2 + '|')) {
                        pBr.LJIILLIIL = Boolean.valueOf(!str2.equals("none"));
                        pBr.LIZ |= 16777216;
                        return;
                    }
                    return;
                case 45:
                    if (str2.indexOf(124) < 0 && "|visible|hidden|collapse|".contains("|" + str2 + '|')) {
                        pBr.LJIIZILJ = Boolean.valueOf(str2.equals("visible"));
                        pBr.LIZ |= 33554432;
                        return;
                    }
                    return;
                case 46:
                    if (str2.equals("currentColor")) {
                        pBr.LJIJ = C64042PCl.LIZ;
                    } else {
                        try {
                            pBr.LJIJ = LJIIIIZZ(str2);
                        } catch (C64045PCo unused5) {
                            return;
                        }
                    }
                    pBr.LIZ |= 67108864;
                    return;
                case 47:
                    pBr.LJIJI = LJ(str2);
                    pBr.LIZ |= 134217728;
                    return;
                case 48:
                    pBr.LJIILL = LJIILJJIL(str2);
                    if (pBr.LJIILL != null) {
                        pBr.LIZ |= 1048576;
                        return;
                    }
                    return;
                case 49:
                    pBr.LJIJJ = LJIIZILJ(str2);
                    pBr.LIZ |= 268435456;
                    return;
                case 50:
                    pBr.LJIJJLI = LJIIIZ(str2);
                    pBr.LIZ |= 536870912;
                    return;
                case 51:
                    if (str2.equals("currentColor")) {
                        pBr.LJIL = C64042PCl.LIZ;
                    } else {
                        try {
                            pBr.LJIL = LJIIIIZZ(str2);
                        } catch (C64045PCo unused6) {
                            return;
                        }
                    }
                    pBr.LIZ |= 2147483648L;
                    return;
                case 52:
                    pBr.LJJ = LJ(str2);
                    pBr.LIZ |= 4294967296L;
                    return;
                case 53:
                    if (str2.equals("currentColor")) {
                        pBr.LJJI = C64042PCl.LIZ;
                    } else {
                        try {
                            pBr.LJJI = LJIIIIZZ(str2);
                        } catch (C64045PCo unused7) {
                            return;
                        }
                    }
                    pBr.LIZ |= 8589934592L;
                    return;
                case 54:
                    pBr.LJJIFFI = LJ(str2);
                    pBr.LIZ |= 17179869184L;
                    return;
                case 55:
                    pBr.LJJII = LJIILL(str2);
                    if (pBr.LJJII != null) {
                        pBr.LIZ |= 34359738368L;
                        return;
                    }
                    return;
                case 56:
                    pBr.LJJIII = LJIILLIIL(str2);
                    if (pBr.LJJIII != null) {
                        pBr.LIZ |= 137438953472L;
                        return;
                    }
                    return;
                default:
                    return;
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:29:0x0026, code lost:
        continue;
     */
    private void LIZ(AbstractC64026PBv pBv, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int i3 = C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()];
            if (i3 != 6) {
                switch (i3) {
                    case 19:
                        if ("objectBoundingBox".equals(trim)) {
                            pBv.LIZIZ = false;
                            continue;
                        } else if ("userSpaceOnUse".equals(trim)) {
                            pBv.LIZIZ = true;
                            break;
                        } else {
                            throw new C64045PCo("Invalid value for attribute gradientUnits");
                        }
                    case 20:
                        pBv.LIZJ = LIZIZ(trim);
                        continue;
                    case 21:
                        try {
                            pBv.LIZLLL = PCA.valueOf(trim);
                            continue;
                        } catch (IllegalArgumentException unused) {
                            throw new C64045PCo("Invalid spreadMethod attribute. \"" + trim + "\" is not a valid value.");
                        }
                }
            } else if ("".equals(attributes.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i2))) {
                pBv.LJ = trim;
            }
        }
    }

    private void LIZ(PC6 pc6, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int i3 = C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()];
            if (i3 == 1) {
                pc6.LIZLLL = LIZJ(trim);
            } else if (i3 == 2) {
                pc6.LJ = LIZJ(trim);
            } else if (i3 == 3) {
                pc6.LJFF = LIZJ(trim);
                if (pc6.LJFF.LIZIZ()) {
                    throw new C64045PCo("Invalid <pattern> element. width cannot be negative");
                }
            } else if (i3 == 4) {
                pc6.LJI = LIZJ(trim);
                if (pc6.LJI.LIZIZ()) {
                    throw new C64045PCo("Invalid <pattern> element. height cannot be negative");
                }
            } else if (i3 != 6) {
                switch (i3) {
                    case 26:
                        if (!"objectBoundingBox".equals(trim)) {
                            if ("userSpaceOnUse".equals(trim)) {
                                pc6.LIZ = true;
                                break;
                            } else {
                                break;
                            }
                        } else {
                            pc6.LIZ = false;
                            continue;
                        }
                    case 27:
                        if (!"objectBoundingBox".equals(trim)) {
                            if ("userSpaceOnUse".equals(trim)) {
                                pc6.LIZIZ = true;
                                break;
                            } else {
                                break;
                            }
                        } else {
                            pc6.LIZIZ = false;
                            continue;
                        }
                    case 28:
                        pc6.LIZJ = LIZIZ(trim);
                        continue;
                }
            } else if ("".equals(attributes.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i2))) {
                pc6.LJII = trim;
            }
        }
    }

    private void LIZ(PC8 pc8, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            if (C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()] == 24) {
                pc8.LIZ = LIZ(trim);
            }
        }
    }

    private void LIZ(PC9 pc9, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int i3 = C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()];
            if (i3 == 1) {
                pc9.LIZIZ = LIZJ(trim);
            } else if (i3 == 2) {
                pc9.LIZJ = LIZJ(trim);
            } else if (i3 == 3) {
                pc9.LIZLLL = LIZJ(trim);
                if (pc9.LIZLLL.LIZIZ()) {
                    throw new C64045PCo("Invalid <use> element. width cannot be negative");
                }
            } else if (i3 == 4) {
                pc9.LJ = LIZJ(trim);
                if (pc9.LJ.LIZIZ()) {
                    throw new C64045PCo("Invalid <use> element. height cannot be negative");
                }
            } else if (i3 != 6) {
                if (i3 == 7) {
                    LIZ(pc9, trim);
                }
            } else if ("".equals(attributes.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i2))) {
                pc9.LIZ = trim;
            }
        }
    }

    private void LIZ(PCK pck, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String qName = attributes.getQName(i2);
            if (qName.equals("id") || qName.equals("xml:id")) {
                pck.LJIIJ = attributes.getValue(i2).trim();
                return;
            } else if (qName.equals("xml:space")) {
                String trim = attributes.getValue(i2).trim();
                if (JF4.LIZJ.equals(trim)) {
                    pck.LJIIJJI = Boolean.FALSE;
                    return;
                } else if ("preserve".equals(trim)) {
                    pck.LJIIJJI = Boolean.TRUE;
                    return;
                } else {
                    throw new C64045PCo("Invalid value for \"xml:space\" attribute: ".concat(String.valueOf(trim)));
                }
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:20:0x002a, code lost:
        continue;
     */
    private void LIZ(PCL pcl, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int i3 = C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()];
            if (i3 == 22) {
                pcl.LJIIIIZZ = LIZJ(trim);
            } else if (i3 != 23) {
                switch (i3) {
                    case 12:
                        pcl.LJFF = LIZJ(trim);
                        continue;
                    case 13:
                        pcl.LJI = LIZJ(trim);
                        continue;
                    case 14:
                        pcl.LJII = LIZJ(trim);
                        if (!pcl.LJII.LIZIZ()) {
                            continue;
                        } else {
                            throw new C64045PCo("Invalid <radialGradient> element. r cannot be negative");
                        }
                }
            } else {
                pcl.LJIIIZ = LIZJ(trim);
            }
        }
    }

    private void LIZ(PCM pcm, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int i3 = C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()];
            if (i3 == 1) {
                pcm.LIZJ = LIZJ(trim);
            } else if (i3 == 2) {
                pcm.LIZLLL = LIZJ(trim);
            } else if (i3 == 3) {
                pcm.LJ = LIZJ(trim);
                if (pcm.LJ.LIZIZ()) {
                    throw new C64045PCo("Invalid <use> element. width cannot be negative");
                }
            } else if (i3 == 4) {
                pcm.LJFF = LIZJ(trim);
                if (pcm.LJFF.LIZIZ()) {
                    throw new C64045PCo("Invalid <use> element. height cannot be negative");
                }
            } else if (i3 == 6 && ("".equals(attributes.getURI(i2)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i2)))) {
                pcm.LIZ = trim;
            }
        }
    }

    private void LIZ(PCN pcn, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int i3 = C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()];
            if (i3 == 1) {
                pcn.LIZ = LIZJ(trim);
            } else if (i3 == 2) {
                pcn.LIZIZ = LIZJ(trim);
            } else if (i3 == 3) {
                pcn.LIZJ = LIZJ(trim);
                if (pcn.LIZJ.LIZIZ()) {
                    throw new C64045PCo("Invalid <svg> element. width cannot be negative");
                }
            } else if (i3 == 4) {
                pcn.LIZLLL = LIZJ(trim);
                if (pcn.LIZLLL.LIZIZ()) {
                    throw new C64045PCo("Invalid <svg> element. height cannot be negative");
                }
            } else if (i3 == 5) {
                pcn.LJ = trim;
            }
        }
    }

    private void LIZ(PCO pco, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int i3 = C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()];
            if (i3 == 1) {
                pco.LIZ = LIZJ(trim);
            } else if (i3 == 2) {
                pco.LIZIZ = LIZJ(trim);
            } else if (i3 == 3) {
                pco.LIZJ = LIZJ(trim);
                if (pco.LIZJ.LIZIZ()) {
                    throw new C64045PCo("Invalid <rect> element. width cannot be negative");
                }
            } else if (i3 == 4) {
                pco.LIZLLL = LIZJ(trim);
                if (pco.LIZLLL.LIZIZ()) {
                    throw new C64045PCo("Invalid <rect> element. height cannot be negative");
                }
            } else if (i3 == 10) {
                pco.LJFF = LIZJ(trim);
                if (pco.LJFF.LIZIZ()) {
                    throw new C64045PCo("Invalid <rect> element. rx cannot be negative");
                }
            } else if (i3 != 11) {
                continue;
            } else {
                pco.LJI = LIZJ(trim);
                if (pco.LJI.LIZIZ()) {
                    throw new C64045PCo("Invalid <rect> element. ry cannot be negative");
                }
            }
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:110:0x0075 A[SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:89:0x0205  */
    private void LIZ(PCQ pcq, Attributes attributes) {
        char charAt;
        float LIZLLL2;
        float f;
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int i3 = C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()];
            byte b = 8;
            float f2 = 0.0f;
            if (i3 == 8) {
                C64023PBs pBs = new C64023PBs(trim);
                C64029PBy pBy = new C64029PBy();
                if (!pBs.LIZ()) {
                    int intValue = pBs.LJFF().intValue();
                    int i4 = 109;
                    if (intValue == 77 || intValue == 109) {
                        float f3 = 0.0f;
                        float f4 = 0.0f;
                        float f5 = 0.0f;
                        float f6 = 0.0f;
                        float f7 = 0.0f;
                        float f8 = 0.0f;
                        while (true) {
                            pBs.LIZIZ();
                            int i5 = 108;
                            switch (intValue) {
                                case 65:
                                case 97:
                                    float LIZLLL3 = pBs.LIZLLL();
                                    float LIZ2 = pBs.LIZ(LIZLLL3);
                                    float LIZ3 = pBs.LIZ(LIZ2);
                                    Boolean LIZ4 = pBs.LIZ(Float.valueOf(LIZ3));
                                    Boolean LIZ5 = pBs.LIZ(LIZ4);
                                    if (LIZ5 == null) {
                                        LIZLLL2 = Float.NaN;
                                    } else {
                                        pBs.LIZJ();
                                        LIZLLL2 = pBs.LIZLLL();
                                    }
                                    float LIZ6 = pBs.LIZ(LIZLLL2);
                                    if (!Float.isNaN(LIZ6) && LIZLLL3 >= f2 && LIZ2 >= f2) {
                                        if (intValue == 97) {
                                            LIZLLL2 += f3;
                                            LIZ6 += f5;
                                        }
                                        pBy.LIZ(LIZLLL3, LIZ2, LIZ3, LIZ4.booleanValue(), LIZ5.booleanValue(), LIZLLL2, LIZ6);
                                        f3 = LIZLLL2;
                                        f4 = f3;
                                        f5 = LIZ6;
                                        f6 = f5;
                                        pBs.LIZJ();
                                        if (!pBs.LIZ()) {
                                            break;
                                        } else {
                                            if (pBs.LIZIZ != pBs.LIZJ && (((charAt = pBs.LIZ.charAt(pBs.LIZIZ)) >= 'a' && charAt <= 'z') || (charAt >= 'A' && charAt <= 'Z'))) {
                                                intValue = pBs.LJFF().intValue();
                                            }
                                            b = 8;
                                            f2 = 0.0f;
                                            i4 = 109;
                                        }
                                    }
                                case 67:
                                case 99:
                                    float LIZLLL4 = pBs.LIZLLL();
                                    float LIZ7 = pBs.LIZ(LIZLLL4);
                                    f4 = pBs.LIZ(LIZ7);
                                    f6 = pBs.LIZ(f4);
                                    float LIZ8 = pBs.LIZ(f6);
                                    f = pBs.LIZ(LIZ8);
                                    if (Float.isNaN(f)) {
                                        break;
                                    } else {
                                        if (intValue == 99) {
                                            LIZ8 += f3;
                                            f += f5;
                                            LIZLLL4 += f3;
                                            LIZ7 += f5;
                                            f4 += f3;
                                            f6 += f5;
                                        }
                                        pBy.LIZ(LIZLLL4, LIZ7, f4, f6, LIZ8, f);
                                        f3 = LIZ8;
                                        f5 = f;
                                        pBs.LIZJ();
                                        if (!pBs.LIZ()) {
                                        }
                                    }
                                    break;
                                case SubscriptionExpireRemindHourSetting.DEFAULT /*{ENCODED_INT: 72}*/:
                                case 104:
                                    float LIZLLL5 = pBs.LIZLLL();
                                    if (Float.isNaN(LIZLLL5)) {
                                        break;
                                    } else {
                                        if (intValue == 104) {
                                            LIZLLL5 += f3;
                                        }
                                        f3 = LIZLLL5;
                                        pBy.LIZIZ(f3, f5);
                                        f4 = f3;
                                        pBs.LIZJ();
                                        if (!pBs.LIZ()) {
                                        }
                                    }
                                    break;
                                case 76:
                                case 108:
                                    float LIZLLL6 = pBs.LIZLLL();
                                    float LIZ9 = pBs.LIZ(LIZLLL6);
                                    if (Float.isNaN(LIZ9)) {
                                        break;
                                    } else {
                                        if (intValue == 108) {
                                            LIZLLL6 += f3;
                                            LIZ9 += f5;
                                        }
                                        f3 = LIZLLL6;
                                        f5 = LIZ9;
                                        pBy.LIZIZ(f3, f5);
                                        f4 = f3;
                                        f6 = f5;
                                        pBs.LIZJ();
                                        if (!pBs.LIZ()) {
                                        }
                                    }
                                    break;
                                case 77:
                                case 109:
                                    float LIZLLL7 = pBs.LIZLLL();
                                    float LIZ10 = pBs.LIZ(LIZLLL7);
                                    if (Float.isNaN(LIZ10)) {
                                        break;
                                    } else {
                                        if (intValue == i4 && pBy.LIZ != 0) {
                                            LIZLLL7 += f3;
                                            LIZ10 += f5;
                                        }
                                        f3 = LIZLLL7;
                                        f5 = LIZ10;
                                        pBy.LIZ(f3, f5);
                                        if (intValue != i4) {
                                            i5 = 76;
                                        }
                                        f4 = f3;
                                        f7 = f4;
                                        f6 = f5;
                                        f8 = f6;
                                        intValue = i5;
                                        pBs.LIZJ();
                                        if (!pBs.LIZ()) {
                                        }
                                    }
                                    break;
                                case 81:
                                case 113:
                                    f4 = pBs.LIZLLL();
                                    f6 = pBs.LIZ(f4);
                                    float LIZ11 = pBs.LIZ(f6);
                                    float LIZ12 = pBs.LIZ(LIZ11);
                                    if (Float.isNaN(LIZ12)) {
                                        break;
                                    } else {
                                        if (intValue == 113) {
                                            LIZ11 += f3;
                                            LIZ12 += f5;
                                            f4 += f3;
                                            f6 += f5;
                                        }
                                        f3 = LIZ11;
                                        f5 = LIZ12;
                                        pBy.LIZ(f4, f6, f3, f5);
                                        pBs.LIZJ();
                                        if (!pBs.LIZ()) {
                                        }
                                    }
                                    break;
                                case 83:
                                case 115:
                                    float f9 = (f3 * 2.0f) - f4;
                                    float f10 = (2.0f * f5) - f6;
                                    f4 = pBs.LIZLLL();
                                    f6 = pBs.LIZ(f4);
                                    float LIZ13 = pBs.LIZ(f6);
                                    f = pBs.LIZ(LIZ13);
                                    if (Float.isNaN(f)) {
                                        break;
                                    } else {
                                        if (intValue == 115) {
                                            LIZ13 += f3;
                                            f += f5;
                                            f4 += f3;
                                            f6 += f5;
                                        }
                                        pBy.LIZ(f9, f10, f4, f6, LIZ13, f);
                                        f3 = LIZ13;
                                        f5 = f;
                                        pBs.LIZJ();
                                        if (!pBs.LIZ()) {
                                        }
                                    }
                                    break;
                                case 84:
                                case 116:
                                    f4 = (f3 * 2.0f) - f4;
                                    f6 = (2.0f * f5) - f6;
                                    float LIZLLL8 = pBs.LIZLLL();
                                    float LIZ14 = pBs.LIZ(LIZLLL8);
                                    if (Float.isNaN(LIZ14)) {
                                        break;
                                    } else {
                                        if (intValue == 116) {
                                            LIZLLL8 += f3;
                                            LIZ14 += f5;
                                        }
                                        f3 = LIZLLL8;
                                        f5 = LIZ14;
                                        pBy.LIZ(f4, f6, f3, f5);
                                        pBs.LIZJ();
                                        if (!pBs.LIZ()) {
                                        }
                                    }
                                    break;
                                case 86:
                                case 118:
                                    float LIZLLL9 = pBs.LIZLLL();
                                    if (Float.isNaN(LIZLLL9)) {
                                        break;
                                    } else {
                                        if (intValue == 118) {
                                            LIZLLL9 += f5;
                                        }
                                        f5 = LIZLLL9;
                                        pBy.LIZIZ(f3, f5);
                                        f6 = f5;
                                        pBs.LIZJ();
                                        if (!pBs.LIZ()) {
                                        }
                                    }
                                    break;
                                case 90:
                                case 122:
                                    pBy.LIZ(b);
                                    f3 = f7;
                                    f4 = f3;
                                    f5 = f8;
                                    f6 = f5;
                                    pBs.LIZJ();
                                    if (!pBs.LIZ()) {
                                    }
                                    break;
                            }
                        }
                    }
                }
                pcq.LIZ = pBy;
            } else if (i3 != 9) {
                continue;
            } else {
                pcq.LIZIZ = Float.valueOf(LIZLLL(trim));
                if (pcq.LIZIZ.floatValue() < 0.0f) {
                    throw new C64045PCo("Invalid <path> element. pathLength cannot be negative");
                }
            }
        }
    }

    private void LIZ(PCR pcr, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            switch (EnumC64049PCs.LIZ(attributes.getLocalName(i2))) {
                case rx:
                    pcr.LIZJ = LIZJ(trim);
                    if (!pcr.LIZJ.LIZIZ()) {
                        break;
                    } else {
                        throw new C64045PCo("Invalid <ellipse> element. rx cannot be negative");
                    }
                case ry:
                    pcr.LIZLLL = LIZJ(trim);
                    if (!pcr.LIZLLL.LIZIZ()) {
                        break;
                    } else {
                        throw new C64045PCo("Invalid <ellipse> element. ry cannot be negative");
                    }
                case cx:
                    pcr.LIZ = LIZJ(trim);
                    break;
                case cy:
                    pcr.LIZIZ = LIZJ(trim);
                    break;
            }
        }
    }

    private void LIZ(PCS pcs, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            switch (C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()]) {
                case 15:
                    pcs.LIZ = LIZJ(trim);
                    break;
                case 16:
                    pcs.LIZIZ = LIZJ(trim);
                    break;
                case 17:
                    pcs.LIZJ = LIZJ(trim);
                    break;
                case LiveRechargeAgeThresholdSetting.DEFAULT /*{ENCODED_INT: 18}*/:
                    pcs.LIZLLL = LIZJ(trim);
                    break;
            }
        }
    }

    private void LIZ(PCU pcu, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            switch (C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()]) {
                case 15:
                    pcu.LJFF = LIZJ(trim);
                    break;
                case 16:
                    pcu.LJI = LIZJ(trim);
                    break;
                case 17:
                    pcu.LJII = LIZJ(trim);
                    break;
                case LiveRechargeAgeThresholdSetting.DEFAULT /*{ENCODED_INT: 18}*/:
                    pcu.LJIIIIZZ = LIZJ(trim);
                    break;
            }
        }
    }

    private void LIZ(PCV pcv, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            switch (EnumC64049PCs.LIZ(attributes.getLocalName(i2))) {
                case cx:
                    pcv.LIZ = LIZJ(trim);
                    break;
                case cy:
                    pcv.LIZIZ = LIZJ(trim);
                    break;
                case r:
                    pcv.LIZJ = LIZJ(trim);
                    if (!pcv.LIZJ.LIZIZ()) {
                        break;
                    } else {
                        throw new C64045PCo("Invalid <circle> element. r cannot be negative");
                    }
            }
        }
    }

    private void LIZ(PCY pcy, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            if (C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()] == 25) {
                if ("objectBoundingBox".equals(trim)) {
                    pcy.LIZ = false;
                } else if ("userSpaceOnUse".equals(trim)) {
                    pcy.LIZ = true;
                } else {
                    throw new C64045PCo("Invalid value for attribute clipPathUnits");
                }
            }
        }
    }

    private void LIZ(C64031PCa pCa, Attributes attributes, String str) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            if (EnumC64049PCs.LIZ(attributes.getLocalName(i2)) == EnumC64049PCs.points) {
                C64023PBs pBs = new C64023PBs(attributes.getValue(i2));
                ArrayList<Float> arrayList = new ArrayList();
                pBs.LIZIZ();
                while (!pBs.LIZ()) {
                    float LIZLLL2 = pBs.LIZLLL();
                    if (!Float.isNaN(LIZLLL2)) {
                        pBs.LIZJ();
                        float LIZLLL3 = pBs.LIZLLL();
                        if (!Float.isNaN(LIZLLL3)) {
                            pBs.LIZJ();
                            arrayList.add(Float.valueOf(LIZLLL2));
                            arrayList.add(Float.valueOf(LIZLLL3));
                        } else {
                            throw new C64045PCo("Invalid <" + str + "> points attribute. There should be an even number of coordinates.");
                        }
                    } else {
                        throw new C64045PCo("Invalid <" + str + "> points attribute. Non-coordinate content found in list.");
                    }
                }
                pCa.LIZ = new float[arrayList.size()];
                int i3 = 0;
                for (Float f : arrayList) {
                    pCa.LIZ[i3] = f.floatValue();
                    i3++;
                }
            }
        }
    }

    private void LIZ(AbstractC64036PCf pCf, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            String trim = attributes.getValue(i2).trim();
            int i3 = C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i2)).ordinal()];
            if (i3 == 7) {
                LIZ(pCf, trim);
            } else if (i3 != 57) {
                continue;
            } else {
                C64023PBs pBs = new C64023PBs(trim);
                pBs.LIZIZ();
                float LIZIZ2 = C51627KOy.LIZIZ(pBs.LJIIIIZZ(), 0.0f);
                pBs.LIZJ();
                float LIZIZ3 = C51627KOy.LIZIZ(pBs.LJIIIIZZ(), 0.0f);
                pBs.LIZJ();
                float LIZIZ4 = C51627KOy.LIZIZ(pBs.LJIIIIZZ(), 0.0f);
                pBs.LIZJ();
                float LIZIZ5 = C51627KOy.LIZIZ(pBs.LJIIIIZZ(), 0.0f);
                if (Float.isNaN(LIZIZ2) || Float.isNaN(LIZIZ3) || Float.isNaN(LIZIZ4) || Float.isNaN(LIZIZ5)) {
                    throw new C64045PCo("Invalid viewBox definition - should have four numbers");
                } else if (LIZIZ4 < 0.0f) {
                    throw new C64045PCo("Invalid viewBox. width cannot be negative");
                } else if (LIZIZ5 >= 0.0f) {
                    pCf.LJIIZILJ = new C64028PBx(LIZIZ2, LIZIZ3, LIZIZ4, LIZIZ5);
                } else {
                    throw new C64045PCo("Invalid viewBox. height cannot be negative");
                }
            }
        }
    }

    public static void LIZ(AbstractC64038PCh pCh, String str) {
        pCh.LJIILLIIL = LJFF(str);
    }

    private void LIZ(AbstractC64043PCm pCm, Attributes attributes) {
        for (int i2 = 0; i2 < attributes.getLength(); i2++) {
            if (EnumC64049PCs.LIZ(attributes.getLocalName(i2)) == EnumC64049PCs.transform) {
                pCm.LIZ(LIZIZ(attributes.getValue(i2)));
            }
        }
    }

    private void LIZ(String str, Object... objArr) {
        LLog.LIZ(3, "SVGParser", AnonymousClass0EJ.LIZ(str, objArr));
    }

    private Matrix LIZIZ(String str) {
        Matrix matrix = new Matrix();
        C64023PBs pBs = new C64023PBs(str);
        pBs.LIZIZ();
        while (!pBs.LIZ()) {
            String LJIIIZ = pBs.LJIIIZ();
            if (LJIIIZ != null) {
                LJIIIZ.hashCode();
                char c = 65535;
                switch (LJIIIZ.hashCode()) {
                    case -1081239615:
                        if (LJIIIZ.equals("matrix")) {
                            c = 0;
                            break;
                        }
                        break;
                    case -925180581:
                        if (LJIIIZ.equals("rotate")) {
                            c = 1;
                            break;
                        }
                        break;
                    case 109250890:
                        if (LJIIIZ.equals("scale")) {
                            c = 2;
                            break;
                        }
                        break;
                    case 109493390:
                        if (LJIIIZ.equals("skewX")) {
                            c = 3;
                            break;
                        }
                        break;
                    case 109493391:
                        if (LJIIIZ.equals("skewY")) {
                            c = 4;
                            break;
                        }
                        break;
                    case 1052832078:
                        if (LJIIIZ.equals("translate")) {
                            c = 5;
                            break;
                        }
                        break;
                }
                switch (c) {
                    case 0:
                        pBs.LIZIZ();
                        float LIZLLL2 = pBs.LIZLLL();
                        pBs.LIZJ();
                        float LIZLLL3 = pBs.LIZLLL();
                        pBs.LIZJ();
                        float LIZLLL4 = pBs.LIZLLL();
                        pBs.LIZJ();
                        float LIZLLL5 = pBs.LIZLLL();
                        pBs.LIZJ();
                        float LIZLLL6 = pBs.LIZLLL();
                        pBs.LIZJ();
                        float LIZLLL7 = pBs.LIZLLL();
                        pBs.LIZIZ();
                        if (!Float.isNaN(LIZLLL7) && pBs.LIZ(')')) {
                            Matrix matrix2 = new Matrix();
                            matrix2.setValues(new float[]{LIZLLL2, LIZLLL4, LIZLLL6, LIZLLL3, LIZLLL5, LIZLLL7, 0.0f, 0.0f, 1.0f});
                            matrix.preConcat(matrix2);
                            break;
                        } else {
                            throw new C64045PCo("Invalid transform list: ".concat(String.valueOf(str)));
                        }
                        break;
                    case 1:
                        pBs.LIZIZ();
                        float LIZLLL8 = pBs.LIZLLL();
                        float LJ = pBs.LJ();
                        float LJ2 = pBs.LJ();
                        pBs.LIZIZ();
                        if (Float.isNaN(LIZLLL8) || !pBs.LIZ(')')) {
                            throw new C64045PCo("Invalid transform list: ".concat(String.valueOf(str)));
                        } else if (Float.isNaN(LJ)) {
                            matrix.preRotate(LIZLLL8);
                            break;
                        } else if (!Float.isNaN(LJ2)) {
                            matrix.preRotate(LIZLLL8, LJ, LJ2);
                            break;
                        } else {
                            throw new C64045PCo("Invalid transform list: ".concat(String.valueOf(str)));
                        }
                        break;
                    case 2:
                        pBs.LIZIZ();
                        float LIZLLL9 = pBs.LIZLLL();
                        float LJ3 = pBs.LJ();
                        pBs.LIZIZ();
                        if (!Float.isNaN(LIZLLL9) && pBs.LIZ(')')) {
                            if (!Float.isNaN(LJ3)) {
                                matrix.preScale(LIZLLL9, LJ3);
                                break;
                            } else {
                                matrix.preScale(LIZLLL9, LIZLLL9);
                                break;
                            }
                        } else {
                            throw new C64045PCo("Invalid transform list: ".concat(String.valueOf(str)));
                        }
                        break;
                    case 3:
                        pBs.LIZIZ();
                        float LIZLLL10 = pBs.LIZLLL();
                        pBs.LIZIZ();
                        if (!Float.isNaN(LIZLLL10) && pBs.LIZ(')')) {
                            matrix.preSkew((float) Math.tan(Math.toRadians((double) LIZLLL10)), 0.0f);
                            break;
                        } else {
                            throw new C64045PCo("Invalid transform list: ".concat(String.valueOf(str)));
                        }
                    case 4:
                        pBs.LIZIZ();
                        float LIZLLL11 = pBs.LIZLLL();
                        pBs.LIZIZ();
                        if (!Float.isNaN(LIZLLL11) && pBs.LIZ(')')) {
                            matrix.preSkew(0.0f, (float) Math.tan(Math.toRadians((double) LIZLLL11)));
                            break;
                        } else {
                            throw new C64045PCo("Invalid transform list: ".concat(String.valueOf(str)));
                        }
                    case 5:
                        pBs.LIZIZ();
                        float LIZLLL12 = pBs.LIZLLL();
                        float LJ4 = pBs.LJ();
                        pBs.LIZIZ();
                        if (!Float.isNaN(LIZLLL12) && pBs.LIZ(')')) {
                            if (!Float.isNaN(LJ4)) {
                                matrix.preTranslate(LIZLLL12, LJ4);
                                break;
                            } else {
                                matrix.preTranslate(LIZLLL12, 0.0f);
                                break;
                            }
                        } else {
                            throw new C64045PCo("Invalid transform list: ".concat(String.valueOf(str)));
                        }
                        break;
                    default:
                        throw new C64045PCo("Invalid transform list fn: " + LJIIIZ + ")");
                }
                if (pBs.LIZ()) {
                    return matrix;
                }
                pBs.LIZJ();
            } else {
                throw new C64045PCo("Bad transform function encountered in transform list: ".concat(String.valueOf(str)));
            }
        }
        return matrix;
    }

    private void LIZIZ(PCK pck, Attributes attributes) {
        int i2;
        for (int i3 = 0; i3 < attributes.getLength(); i3++) {
            String trim = attributes.getValue(i3).trim();
            if (trim.length() != 0) {
                if (C64048PCr.LIZIZ[EnumC64049PCs.LIZ(attributes.getLocalName(i3)).ordinal()] == 29) {
                    C64041PCk pCk = new C64041PCk(trim.replaceAll("/\\*.*?\\*/", ""));
                    while (!pCk.LIZ()) {
                        pCk.LIZIZ();
                        if (pCk.LIZ()) {
                            i2 = pCk.LIZIZ;
                        } else {
                            int i4 = pCk.LIZIZ;
                            i2 = pCk.LIZIZ;
                            int charAt = pCk.LIZ.charAt(pCk.LIZIZ);
                            if (charAt == 45) {
                                charAt = pCk.LJII();
                            }
                            if ((charAt >= 65 && charAt <= 90) || ((charAt >= 97 && charAt <= 122) || charAt == 95)) {
                                int LJII = pCk.LJII();
                                while (true) {
                                    if ((LJII < 65 || LJII > 90) && ((LJII < 97 || LJII > 122) && !((LJII >= 48 && LJII <= 57) || LJII == 45 || LJII == 95))) {
                                        break;
                                    }
                                    LJII = pCk.LJII();
                                }
                                i2 = pCk.LIZIZ;
                            }
                            pCk.LIZIZ = i4;
                        }
                        String str = null;
                        if (i2 != pCk.LIZIZ) {
                            str = pCk.LIZ.substring(pCk.LIZIZ, i2);
                            pCk.LIZIZ = i2;
                        }
                        pCk.LIZIZ();
                        if (!pCk.LIZ(';')) {
                            if (!pCk.LIZ(':')) {
                                break;
                            }
                            pCk.LIZIZ();
                            if (!pCk.LIZ()) {
                                int i5 = pCk.LIZIZ;
                                int i6 = pCk.LIZIZ;
                                int charAt2 = pCk.LIZ.charAt(pCk.LIZIZ);
                                while (charAt2 != -1 && charAt2 != 59 && charAt2 != 125 && charAt2 != 33 && charAt2 != 10 && charAt2 != 13) {
                                    if (!pCk.LIZ(charAt2)) {
                                        i6 = pCk.LIZIZ + 1;
                                    }
                                    charAt2 = pCk.LJII();
                                }
                                if (pCk.LIZIZ > i5) {
                                    String substring = pCk.LIZ.substring(i5, i6);
                                    if (substring != null) {
                                        pCk.LIZIZ();
                                        if (pCk.LIZ() || pCk.LIZ(';')) {
                                            if (pck.LJIILIIL == null) {
                                                pck.LJIILIIL = new C64022PBr();
                                            }
                                            LIZ(pck.LJIILIIL, str, substring);
                                            pCk.LIZIZ();
                                        }
                                    }
                                } else {
                                    pCk.LIZIZ = i5;
                                }
                            }
                        }
                    }
                } else {
                    if (pck.LJIIL == null) {
                        pck.LJIIL = new C64022PBr();
                    }
                    LIZ(pck.LJIIL, attributes.getLocalName(i3), attributes.getValue(i3).trim());
                }
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:201:0x041e, code lost:
        continue;
     */
    private void LIZIZ(InputStream inputStream) {
        try {
            XmlPullParser newPullParser = Xml.newPullParser();
            Attributes pcf = new PCF(this, newPullParser);
            newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-docdecl", true);
            newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", true);
            newPullParser.setInput(inputStream, "utf-8");
            for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.nextToken()) {
                if (eventType == 0) {
                    this.LIZ = new C64021PBq();
                } else if (eventType == 2) {
                    String name = newPullParser.getName();
                    if (newPullParser.getPrefix() != null) {
                        name = newPullParser.getPrefix() + ':' + name;
                    }
                    String namespace = newPullParser.getNamespace();
                    String name2 = newPullParser.getName();
                    if (this.LIZJ) {
                        this.LIZLLL++;
                    } else if ("http://www.w3.org/2000/svg".equals(namespace) || "".equals(namespace)) {
                        if (name2.length() > 0) {
                            name = name2;
                        }
                        switch (C64048PCr.LIZ[PCT.LIZ(name).ordinal()]) {
                            case 1:
                                LIZ("<svg>", new Object[0]);
                                PCN pcn = new PCN();
                                pcn.LJIILJJIL = this.LIZ;
                                pcn.LJIILL = this.LIZIZ;
                                LIZ((PCK) pcn, pcf);
                                LIZIZ(pcn, pcf);
                                LIZ((AbstractC64036PCf) pcn, pcf);
                                LIZ(pcn, pcf);
                                AbstractC64032PCb pCb = this.LIZIZ;
                                if (pCb == null) {
                                    this.LIZ.LIZ = pcn;
                                } else {
                                    pCb.LIZ(pcn);
                                }
                                this.LIZIZ = pcn;
                                continue;
                            case 2:
                                LIZ("<g>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCX pcx = new PCX();
                                    pcx.LJIILJJIL = this.LIZ;
                                    pcx.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pcx, pcf);
                                    LIZIZ(pcx, pcf);
                                    LIZ((AbstractC64043PCm) pcx, pcf);
                                    this.LIZIZ.LIZ(pcx);
                                    this.LIZIZ = pcx;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 3:
                                LIZ("<defs>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    C64037PCg pCg = new C64037PCg();
                                    pCg.LJIILJJIL = this.LIZ;
                                    pCg.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pCg, pcf);
                                    LIZIZ(pCg, pcf);
                                    LIZ((AbstractC64043PCm) pCg, pcf);
                                    this.LIZIZ.LIZ(pCg);
                                    this.LIZIZ = pCg;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 4:
                                LIZ("<use>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCM pcm = new PCM();
                                    pcm.LJIILJJIL = this.LIZ;
                                    pcm.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pcm, pcf);
                                    LIZIZ(pcm, pcf);
                                    LIZ((AbstractC64043PCm) pcm, pcf);
                                    LIZ(pcm, pcf);
                                    this.LIZIZ.LIZ(pcm);
                                    this.LIZIZ = pcm;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 5:
                                LIZ("<path>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCQ pcq = new PCQ();
                                    pcq.LJIILJJIL = this.LIZ;
                                    pcq.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pcq, pcf);
                                    LIZIZ(pcq, pcf);
                                    LIZ((AbstractC64043PCm) pcq, pcf);
                                    LIZ(pcq, pcf);
                                    this.LIZIZ.LIZ(pcq);
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 6:
                                LIZ("<rect>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCO pco = new PCO();
                                    pco.LJIILJJIL = this.LIZ;
                                    pco.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pco, pcf);
                                    LIZIZ(pco, pcf);
                                    LIZ((AbstractC64043PCm) pco, pcf);
                                    LIZ(pco, pcf);
                                    this.LIZIZ.LIZ(pco);
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 7:
                                LIZ("<circle>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCV pcv = new PCV();
                                    pcv.LJIILJJIL = this.LIZ;
                                    pcv.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pcv, pcf);
                                    LIZIZ(pcv, pcf);
                                    LIZ((AbstractC64043PCm) pcv, pcf);
                                    LIZ(pcv, pcf);
                                    this.LIZIZ.LIZ(pcv);
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 8:
                                LIZ("<ellipse>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCR pcr = new PCR();
                                    pcr.LJIILJJIL = this.LIZ;
                                    pcr.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pcr, pcf);
                                    LIZIZ(pcr, pcf);
                                    LIZ((AbstractC64043PCm) pcr, pcf);
                                    LIZ(pcr, pcf);
                                    this.LIZIZ.LIZ(pcr);
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 9:
                                LIZ("<line>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCS pcs = new PCS();
                                    pcs.LJIILJJIL = this.LIZ;
                                    pcs.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pcs, pcf);
                                    LIZIZ(pcs, pcf);
                                    LIZ((AbstractC64043PCm) pcs, pcf);
                                    LIZ(pcs, pcf);
                                    this.LIZIZ.LIZ(pcs);
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 10:
                                LIZ("<polyline>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    C64031PCa pCa = new C64031PCa();
                                    pCa.LJIILJJIL = this.LIZ;
                                    pCa.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pCa, pcf);
                                    LIZIZ(pCa, pcf);
                                    LIZ((AbstractC64043PCm) pCa, pcf);
                                    LIZ(pCa, pcf, "polyline");
                                    this.LIZIZ.LIZ(pCa);
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 11:
                                LIZ("<polygon>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    C64040PCj pCj = new C64040PCj();
                                    pCj.LJIILJJIL = this.LIZ;
                                    pCj.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pCj, pcf);
                                    LIZIZ(pCj, pcf);
                                    LIZ((AbstractC64043PCm) pCj, pcf);
                                    LIZ(pCj, pcf, "polygon");
                                    this.LIZIZ.LIZ(pCj);
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 12:
                                LIZ("<linearGradient>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCU pcu = new PCU();
                                    pcu.LJIILJJIL = this.LIZ;
                                    pcu.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pcu, pcf);
                                    LIZIZ(pcu, pcf);
                                    LIZ((AbstractC64026PBv) pcu, pcf);
                                    LIZ(pcu, pcf);
                                    this.LIZIZ.LIZ(pcu);
                                    this.LIZIZ = pcu;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 13:
                                LIZ("<radialGradient>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCL pcl = new PCL();
                                    pcl.LJIILJJIL = this.LIZ;
                                    pcl.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pcl, pcf);
                                    LIZIZ(pcl, pcf);
                                    LIZ((AbstractC64026PBv) pcl, pcf);
                                    LIZ(pcl, pcf);
                                    this.LIZIZ.LIZ(pcl);
                                    this.LIZIZ = pcl;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 14:
                                LIZ("<stop>", new Object[0]);
                                AbstractC64032PCb pCb2 = this.LIZIZ;
                                if (pCb2 == null) {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                } else if (pCb2 instanceof AbstractC64026PBv) {
                                    PC8 pc8 = new PC8();
                                    pc8.LJIILJJIL = this.LIZ;
                                    pc8.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pc8, pcf);
                                    LIZIZ(pc8, pcf);
                                    LIZ(pc8, pcf);
                                    this.LIZIZ.LIZ(pc8);
                                    this.LIZIZ = pc8;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. <stop> elements are only valid inside <linearGradient> or <radialGradient> elements.");
                                }
                            case 15:
                                LIZ("<clipPath>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCY pcy = new PCY();
                                    pcy.LJIILJJIL = this.LIZ;
                                    pcy.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pcy, pcf);
                                    LIZIZ(pcy, pcf);
                                    LIZ((AbstractC64043PCm) pcy, pcf);
                                    LIZ(pcy, pcf);
                                    this.LIZIZ.LIZ(pcy);
                                    this.LIZIZ = pcy;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 16:
                                LIZ("<pattern>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PC6 pc6 = new PC6();
                                    pc6.LJIILJJIL = this.LIZ;
                                    pc6.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pc6, pcf);
                                    LIZIZ(pc6, pcf);
                                    LIZ((AbstractC64036PCf) pc6, pcf);
                                    LIZ(pc6, pcf);
                                    this.LIZIZ.LIZ(pc6);
                                    this.LIZIZ = pc6;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case 17:
                                LIZ("<image>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PC9 pc9 = new PC9();
                                    pc9.LJIILJJIL = this.LIZ;
                                    pc9.LJIILL = this.LIZIZ;
                                    LIZ((PCK) pc9, pcf);
                                    LIZIZ(pc9, pcf);
                                    LIZ((AbstractC64043PCm) pc9, pcf);
                                    LIZ(pc9, pcf);
                                    this.LIZIZ.LIZ(pc9);
                                    this.LIZIZ = pc9;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            case LiveRechargeAgeThresholdSetting.DEFAULT /*{ENCODED_INT: 18}*/:
                                LIZ("<solidColor>", new Object[0]);
                                if (this.LIZIZ != null) {
                                    PCH pch = new PCH();
                                    pch.LJIILJJIL = this.LIZ;
                                    pch.LJIILL = this.LIZIZ;
                                    LIZ(pch, pcf);
                                    LIZIZ(pch, pcf);
                                    this.LIZIZ.LIZ(pch);
                                    this.LIZIZ = pch;
                                    continue;
                                } else {
                                    throw new C64045PCo("Invalid document. Root element must be <svg>");
                                }
                            default:
                                this.LIZJ = true;
                                this.LIZLLL = 1;
                                continue;
                        }
                    }
                } else if (eventType != 3) {
                    continue;
                } else {
                    String name3 = newPullParser.getName();
                    if (newPullParser.getPrefix() != null) {
                        name3 = newPullParser.getPrefix() + ':' + name3;
                    }
                    String namespace2 = newPullParser.getNamespace();
                    String name4 = newPullParser.getName();
                    if (this.LIZJ) {
                        int i2 = this.LIZLLL - 1;
                        this.LIZLLL = i2;
                        if (i2 == 0) {
                            this.LIZJ = false;
                        }
                    } else if ("http://www.w3.org/2000/svg".equals(namespace2) || "".equals(namespace2)) {
                        if (name4.length() > 0) {
                            name3 = name4;
                        }
                        int i3 = C64048PCr.LIZ[PCT.LIZ(name3).ordinal()];
                        if (!(i3 == 1 || i3 == 2 || i3 == 3 || i3 == 4)) {
                            switch (i3) {
                            }
                        }
                        AbstractC64032PCb pCb3 = this.LIZIZ;
                        if (pCb3 != null) {
                            this.LIZIZ = ((C64039PCi) pCb3).LJIILL;
                        } else {
                            throw new C64045PCo(AnonymousClass0EJ.LIZ("Unbalanced end element </%s> found", new Object[]{name3}));
                        }
                    }
                }
            }
        } catch (XmlPullParserException e) {
            throw new C64045PCo("XML parser problem", e);
        } catch (Exception e2) {
            throw new C64045PCo("unexpected error", e2);
        }
    }

    public static C64025PBu LIZJ(String str) {
        if (str.length() != 0) {
            int length = str.length();
            EnumC64027PBw pBw = EnumC64027PBw.px;
            char charAt = str.charAt(length - 1);
            if (charAt == '%') {
                length--;
                pBw = EnumC64027PBw.percent;
            } else {
                if (str.endsWith("rpx")) {
                    pBw = EnumC64027PBw.rpx;
                } else if (str.endsWith("rem")) {
                    pBw = EnumC64027PBw.rem;
                } else if (str.endsWith("em")) {
                    pBw = EnumC64027PBw.em;
                    length -= 2;
                } else if (length > 2 && Character.isLetter(charAt) && Character.isLetter(str.charAt(length - 2))) {
                    length -= 2;
                    try {
                        pBw = EnumC64027PBw.valueOf(str.substring(length).toLowerCase(Locale.US));
                    } catch (IllegalArgumentException unused) {
                        throw new C64045PCo("Invalid length unit specifier: ".concat(String.valueOf(str)));
                    }
                }
                length -= 3;
            }
            try {
                return new C64025PBu(LIZ(str, length), pBw);
            } catch (NumberFormatException e) {
                throw new C64045PCo("Invalid length value: ".concat(String.valueOf(str)), e);
            }
        } else {
            throw new C64045PCo("Invalid length value (empty string)");
        }
    }

    public static float LIZLLL(String str) {
        int length = str.length();
        if (length != 0) {
            return LIZ(str, length);
        }
        throw new C64045PCo("Invalid float value (empty string)");
    }

    public static Float LJ(String str) {
        try {
            float LIZLLL2 = LIZLLL(str);
            if (LIZLLL2 < 0.0f) {
                LIZLLL2 = 0.0f;
            } else if (LIZLLL2 > 1.0f) {
                LIZLLL2 = 1.0f;
            }
            return Float.valueOf(LIZLLL2);
        } catch (C64045PCo unused) {
            return null;
        }
    }

    public static C64030PBz LJFF(String str) {
        C64023PBs pBs = new C64023PBs(str);
        pBs.LIZIZ();
        String LJIIIIZZ = pBs.LJIIIIZZ();
        if ("defer".equals(LJIIIIZZ)) {
            pBs.LIZIZ();
            LJIIIIZZ = pBs.LJIIIIZZ();
        }
        PC1 LIZ2 = PC2.LIZ(LJIIIIZZ);
        PCB pcb = null;
        pBs.LIZIZ();
        if (!pBs.LIZ()) {
            String LJIIIIZZ2 = pBs.LJIIIIZZ();
            LJIIIIZZ2.hashCode();
            if (LJIIIIZZ2.equals("meet")) {
                pcb = PCB.meet;
            } else if (!LJIIIIZZ2.equals("slice")) {
                throw new C64045PCo("Invalid preserveAspectRatio definition: ".concat(String.valueOf(str)));
            } else {
                pcb = PCB.slice;
            }
        }
        return new C64030PBz(LIZ2, pcb);
    }

    public static AbstractC64044PCn LJI(String str) {
        if (!str.startsWith("url(")) {
            return LJII(str);
        }
        int indexOf = str.indexOf(")");
        AbstractC64044PCn pCn = null;
        if (indexOf == -1) {
            return new PCD(str.substring(4).trim(), null);
        }
        String trim = str.substring(4, indexOf).trim();
        String trim2 = str.substring(indexOf + 1).trim();
        if (trim2.length() > 0) {
            pCn = LJII(trim2);
        }
        return new PCD(trim, pCn);
    }

    public static AbstractC64044PCn LJII(String str) {
        str.hashCode();
        if (str.equals("none")) {
            return PCC.LIZJ;
        }
        if (str.equals("currentColor")) {
            return C64042PCl.LIZ;
        }
        try {
            return LJIIIIZZ(str);
        } catch (C64045PCo unused) {
            return null;
        }
    }

    public static PCC LJIIIIZZ(String str) {
        try {
            return new PCC(ColorUtils.LIZ(str));
        } catch (Exception e) {
            throw new C64045PCo(e.toString());
        }
    }

    public static PCJ LJIIIZ(String str) {
        if ("nonzero".equals(str)) {
            return PCJ.NonZero;
        }
        if ("evenodd".equals(str)) {
            return PCJ.EvenOdd;
        }
        return null;
    }

    public static PC5 LJIIJ(String str) {
        if ("butt".equals(str)) {
            return PC5.Butt;
        }
        if ("round".equals(str)) {
            return PC5.Round;
        }
        if ("square".equals(str)) {
            return PC5.Square;
        }
        return null;
    }

    public static PC4 LJIIJJI(String str) {
        if ("miter".equals(str)) {
            return PC4.Miter;
        }
        if ("round".equals(str)) {
            return PC4.Round;
        }
        if ("bevel".equals(str)) {
            return PC4.Bevel;
        }
        return null;
    }

    public static C64025PBu[] LJIIL(String str) {
        C64025PBu LJI;
        C64023PBs pBs = new C64023PBs(str);
        pBs.LIZIZ();
        if (pBs.LIZ() || (LJI = pBs.LJI()) == null || LJI.LIZIZ()) {
            return null;
        }
        float f = LJI.LIZ;
        ArrayList arrayList = new ArrayList();
        arrayList.add(LJI);
        while (!pBs.LIZ()) {
            pBs.LIZJ();
            C64025PBu LJI2 = pBs.LJI();
            if (LJI2 == null || LJI2.LIZIZ()) {
                return null;
            }
            arrayList.add(LJI2);
            f += LJI2.LIZ;
        }
        if (f == 0.0f) {
            return null;
        }
        return (C64025PBu[]) arrayList.toArray(new C64025PBu[arrayList.size()]);
    }

    public static Boolean LJIILIIL(String str) {
        str.hashCode();
        switch (str.hashCode()) {
            case -1217487446:
                if (!str.equals("hidden")) {
                    return null;
                }
                return Boolean.FALSE;
            case -907680051:
                if (!str.equals("scroll")) {
                    return null;
                }
                return Boolean.FALSE;
            case 3005871:
                if (!str.equals("auto")) {
                    return null;
                }
                return Boolean.TRUE;
            case 466743410:
                if (!str.equals("visible")) {
                    return null;
                }
                return Boolean.TRUE;
            default:
                return null;
        }
    }

    public static C64033PCc LJIILJJIL(String str) {
        if ("auto".equals(str) || !str.startsWith("rect(")) {
            return null;
        }
        C64023PBs pBs = new C64023PBs(str.substring(5));
        pBs.LIZIZ();
        C64025PBu LIZ2 = LIZ(pBs);
        pBs.LIZJ();
        C64025PBu LIZ3 = LIZ(pBs);
        pBs.LIZJ();
        C64025PBu LIZ4 = LIZ(pBs);
        pBs.LIZJ();
        C64025PBu LIZ5 = LIZ(pBs);
        pBs.LIZIZ();
        if (pBs.LIZ(')') || pBs.LIZ()) {
            return new C64033PCc(LIZ2, LIZ3, LIZ4, LIZ5);
        }
        return null;
    }

    public static PCE LJIILL(String str) {
        str.hashCode();
        if (str.equals("none")) {
            return PCE.None;
        }
        if (!str.equals("non-scaling-stroke")) {
            return null;
        }
        return PCE.NonScalingStroke;
    }

    public static PC7 LJIILLIIL(String str) {
        str.hashCode();
        switch (str.hashCode()) {
            case -933002398:
                if (!str.equals("optimizeQuality")) {
                    return null;
                }
                return PC7.optimizeQuality;
            case 3005871:
                if (!str.equals("auto")) {
                    return null;
                }
                return PC7.auto;
            case 362741610:
                if (!str.equals("optimizeSpeed")) {
                    return null;
                }
                return PC7.optimizeSpeed;
            default:
                return null;
        }
    }

    public static String LJIIZILJ(String str) {
        if (!str.equals("none") && str.startsWith("url(")) {
            return str.endsWith(")") ? str.substring(4, str.length() - 1).trim() : str.substring(4).trim();
        }
        return null;
    }

    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing exception handler attribute for start block: B:8:0x0032 */
    public final C64021PBq LIZ(InputStream inputStream) {
        if (!inputStream.markSupported()) {
            inputStream = new BufferedInputStream(inputStream);
        }
        inputStream.mark(3);
        int read = inputStream.read() + (inputStream.read() << 8);
        inputStream.reset();
        if (read == 35615) {
            inputStream = new BufferedInputStream(new GZIPInputStream(inputStream));
        }
        try {
            LIZIZ(inputStream);
            return this.LIZ;
        } finally {
            try {
                inputStream.close();
            } catch (IOException unused) {
            }
        }
    }
}