package com.linecorp.line.admolin.vast4; import a1.a; import ai.clova.cic.clientlib.builtins.audio.echocanceller.AcousticEchoCanceller; import am3.c; import android.util.Xml; import b.d; import com.linecorp.line.admolin.vast4.annotation.XmlAttribute; import com.linecorp.line.admolin.vast4.annotation.XmlElement; import com.linecorp.line.admolin.vast4.annotation.XmlValue; import com.linecorp.line.admolin.vast4.generated.AdDefinitionBaseType; import com.linecorp.line.admolin.vast4.generated.AdVerificationsInlineType; import com.linecorp.line.admolin.vast4.generated.CompanionAdType; import com.linecorp.line.admolin.vast4.generated.CompanionAdsCollectionType; import com.linecorp.line.admolin.vast4.generated.CreativeExtensionsType; import com.linecorp.line.admolin.vast4.generated.CreativeInlineChildType; import com.linecorp.line.admolin.vast4.generated.CreativeResourceNonVideoType; import com.linecorp.line.admolin.vast4.generated.ImpressionType; import com.linecorp.line.admolin.vast4.generated.InlineType; import com.linecorp.line.admolin.vast4.generated.LinearInlineChildType; import com.linecorp.line.admolin.vast4.generated.NonLinearAdInlineChildType; import com.linecorp.line.admolin.vast4.generated.TrackingEventsType; import com.linecorp.line.admolin.vast4.generated.VAST; import com.linecorp.line.admolin.vast4.generated.VerificationInlineType; import com.linecorp.line.admolin.vast4.generated.VideoClicksBaseType; import com.linecorp.line.admolin.vast4.generated.VideoClicksInlineChildType; import com.linecorp.line.admolin.vast4.generated.ViewableImpressionType; import com.linecorp.line.admolin.vast4.generated.WrapperType; import em3.q; import em3.q0; import f1.g; import java.io.ByteArrayInputStream; import java.io.IOException; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Type; import java.math.BigDecimal; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.Objects; import kotlin.Metadata; import kotlin.jvm.internal.DefaultConstructorMarker; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import ql3.j; import ql3.u; import sm3.b; import sm3.b0; import sm3.r; import sm3.x; import z1.i; @Metadata(d1 = {"\u0000R\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\n\u0018\u0000 (2\u00020\u0001:\u0001(B\u0005¢\u0006\u0002\u0010\u0002J\u000e\u0010\u0017\u001a\u00020\u00182\u0006\u0010\u0019\u001a\u00020\u0004J\u0018\u0010\u001a\u001a\u00020\u00042\u0006\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\u0004H\u0002J\u0010\u0010\u001e\u001a\u00020\u001f2\u0006\u0010\u001b\u001a\u00020\u001cH\u0002J#\u0010 \u001a\u0002H!\"\b\b\u0000\u0010!*\u00020\u0001*\u0002H!2\u0006\u0010\u001b\u001a\u00020\u001cH\u0002¢\u0006\u0002\u0010\"J#\u0010#\u001a\u0002H!\"\b\b\u0000\u0010!*\u00020\u0001*\u0002H!2\u0006\u0010\u001b\u001a\u00020\u001cH\u0002¢\u0006\u0002\u0010\"J#\u0010$\u001a\u0002H!\"\b\b\u0000\u0010!*\u00020\u0001*\u0002H!2\u0006\u0010\u001b\u001a\u00020\u001cH\u0002¢\u0006\u0002\u0010\"J\u001c\u0010%\u001a\u00020\u001f*\u00020\u00072\u0006\u0010&\u001a\u00020\u00012\u0006\u0010'\u001a\u00020\u0004H\u0002R\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0004¢\u0006\u0002\n\u0000R\"\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006*\u0006\u0012\u0002\b\u00030\b8BX\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\nR\u001a\u0010\u000b\u001a\u0004\u0018\u00010\f*\u00020\u00078BX\u0004¢\u0006\u0006\u001a\u0004\b\r\u0010\u000eR\u001a\u0010\u000f\u001a\u0004\u0018\u00010\u0010*\u00020\u00078BX\u0004¢\u0006\u0006\u001a\u0004\b\u0011\u0010\u0012R\u001a\u0010\u0013\u001a\u0004\u0018\u00010\u0014*\u00020\u00078BX\u0004¢\u0006\u0006\u001a\u0004\b\u0015\u0010\u0016¨\u0006)"}, d2 = {"Lcom/linecorp/line/admolin/vast4/LadVastParser;", "", "()V", "ns", "", "allFields", "", "Ljava/lang/reflect/Field;", "Ljava/lang/Class;", "getAllFields", "(Ljava/lang/Class;)[Ljava/lang/reflect/Field;", "xmlAttribute", "Lcom/linecorp/line/admolin/vast4/annotation/XmlAttribute;", "getXmlAttribute", "(Ljava/lang/reflect/Field;)Lcom/linecorp/line/admolin/vast4/annotation/XmlAttribute;", "xmlElement", "Lcom/linecorp/line/admolin/vast4/annotation/XmlElement;", "getXmlElement", "(Ljava/lang/reflect/Field;)Lcom/linecorp/line/admolin/vast4/annotation/XmlElement;", "xmlValue", "Lcom/linecorp/line/admolin/vast4/annotation/XmlValue;", "getXmlValue", "(Ljava/lang/reflect/Field;)Lcom/linecorp/line/admolin/vast4/annotation/XmlValue;", "parse", "Lcom/linecorp/line/admolin/vast4/generated/VAST;", "xml", "readText", "parser", "Lorg/xmlpull/v1/XmlPullParser;", "name", "skip", "", "readAttribute", "T", "(Ljava/lang/Object;Lorg/xmlpull/v1/XmlPullParser;)Ljava/lang/Object;", "readElement", "readXmlValue", "setValue", "targetObj", "value", "Companion", "ladsdk_release"}, k = 1, mv = {1, 6, 0}, xi = 48) public final class LadVastParser { public static final Companion Companion = new Companion(null); private static final String TAG = "VastParser"; /* renamed from: ns reason: collision with root package name */ private final String f33838ns; @Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010 \n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0005\u001a\u00020\u00012\u0006\u0010\u0006\u001a\u00020\u0004H\u0002J\u0016\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\u00010\b2\u0006\u0010\u0006\u001a\u00020\u0004H\u0002J\u0018\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u00042\u0006\u0010\f\u001a\u00020\u0004H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lcom/linecorp/line/admolin/vast4/LadVastParser$Companion;", "", "()V", "TAG", "", "createInstance", "name", "createList", "", "log", "", "tag", "message", "ladsdk_release"}, k = 1, mv = {1, 6, 0}, xi = 48) public static final class Companion { private Companion() { } public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private final Object createInstance(String str) { Object obj; switch (str.hashCode()) { case -2101083431: if (str.equals("InLine")) { obj = new InlineType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -2077435339: if (str.equals("AdVerifications")) { obj = new AdVerificationsInlineType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -2049897434: if (str.equals("VideoClicks")) { obj = new VideoClicksInlineChildType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -2018804923: if (str.equals("Linear")) { obj = new LinearInlineChildType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -1692490108: if (str.equals("Creatives")) { obj = new InlineType.Creatives(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -1633884078: if (str.equals("AdSystem")) { obj = new AdDefinitionBaseType.AdSystem(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -1320080837: if (str.equals("Verification")) { obj = new VerificationInlineType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -1034806157: if (str.equals("Wrapper")) { obj = new WrapperType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -617879491: if (str.equals("ClickThrough")) { obj = new VideoClicksInlineChildType.ClickThrough(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -385055469: if (str.equals("MediaFiles")) { obj = new LinearInlineChildType.MediaFiles(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -371923645: if (str.equals("CreativeExtensions")) { obj = new CreativeExtensionsType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -346586338: if (str.equals("NonLinearAds")) { obj = new CreativeInlineChildType.NonLinearAds(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case -150968480: if (str.equals("MediaFile")) { obj = new LinearInlineChildType.MediaFiles.MediaFile(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 2115: if (str.equals("Ad")) { obj = new VAST.Ad(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 2627148: if (str.equals("VAST")) { obj = new VAST(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 115155230: if (str.equals("Category")) { obj = new InlineType.Category(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 184043572: if (str.equals("Extensions")) { obj = new AdDefinitionBaseType.Extensions(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 190783917: if (str.equals("InteractiveCreativeFile")) { obj = new LinearInlineChildType.MediaFiles.InteractiveCreativeFile(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 591135468: if (str.equals("Companion")) { obj = new CompanionAdType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 611554000: if (str.equals("TrackingEvents")) { obj = new TrackingEventsType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 676623548: if (str.equals("StaticResource")) { obj = new CreativeResourceNonVideoType.StaticResource(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1083804936: if (str.equals("ViewableImpression")) { obj = new ViewableImpressionType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1150879268: if (str.equals("CompanionAds")) { obj = new CompanionAdsCollectionType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1260870047: if (str.equals("Viewable")) { obj = new String(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1335132887: if (str.equals("Tracking")) { obj = new TrackingEventsType.Tracking(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1349597094: if (str.equals("Pricing")) { obj = new AdDefinitionBaseType.Pricing(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1391410207: if (str.equals("Extension")) { obj = new AdDefinitionBaseType.Extensions.Extension(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1539775849: if (str.equals("UniversalAdId")) { obj = new CreativeInlineChildType.UniversalAdId(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1561251035: if (str.equals("JavaScriptResource")) { obj = new VerificationInlineType.JavaScriptResource(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1863752013: if (str.equals("NonLinearClickTracking")) { obj = new NonLinearAdInlineChildType.NonLinearClickTracking(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 1885066191: if (str.equals("Creative")) { obj = new CreativeInlineChildType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 2048210994: if (str.equals("NonLinear")) { obj = new NonLinearAdInlineChildType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 2107600959: if (str.equals("ClickTracking")) { obj = new VideoClicksBaseType.ClickTracking(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); case 2114088489: if (str.equals("Impression")) { obj = new ImpressionType(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createInstance(", str, ')')); return obj; } new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); default: new IllegalStateException(a.a("createInstance:", str)); throw new IllegalStateException(("createInstance:" + str).toString()); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private final List<Object> createList(String str) { ArrayList arrayList; switch (str.hashCode()) { case -1320080837: if (str.equals("Verification")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case -150968480: if (str.equals("MediaFile")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 2115: if (str.equals("Ad")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 115155230: if (str.equals("Category")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 190783917: if (str.equals("InteractiveCreativeFile")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 591135468: if (str.equals("Companion")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 676623548: if (str.equals("StaticResource")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 1260870047: if (str.equals("Viewable")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 1335132887: if (str.equals("Tracking")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 1391410207: if (str.equals("Extension")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 1561251035: if (str.equals("JavaScriptResource")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 1863752013: if (str.equals("NonLinearClickTracking")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 1885066191: if (str.equals("Creative")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 2048210994: if (str.equals("NonLinear")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 2107600959: if (str.equals("ClickTracking")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); case 2114088489: if (str.equals("Impression")) { arrayList = new ArrayList(); LadVastParser.Companion.log(LadVastParser.TAG, i.a("createList(", str, ')')); return arrayList; } new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); default: new IllegalStateException(a.a("createList:", str)); throw new IllegalStateException(("createList:" + str).toString()); } } /* access modifiers changed from: private */ /* access modifiers changed from: public */ private final void log(String str, String str2) { for (T t14 : b0.I0(str2, AcousticEchoCanceller.SAMPLE_RATE_HZ_MIN)) { } } } private final Field[] getAllFields(Class<?> cls) { Class<? super Object> superclass = cls.getSuperclass(); if (superclass != null) { Field[] declaredFields = cls.getDeclaredFields(); q.e(declaredFields, "declaredFields"); return (Field[]) j.q(declaredFields, getAllFields(superclass)); } Field[] declaredFields2 = cls.getDeclaredFields(); q.e(declaredFields2, "declaredFields"); return declaredFields2; } private final XmlAttribute getXmlAttribute(Field field) { Annotation[] annotations = field.getAnnotations(); q.e(annotations, "annotations"); return (XmlAttribute) u.R(j.n(annotations, XmlAttribute.class)); } private final XmlElement getXmlElement(Field field) { Annotation[] annotations = field.getAnnotations(); q.e(annotations, "annotations"); return (XmlElement) u.R(j.n(annotations, XmlElement.class)); } private final XmlValue getXmlValue(Field field) { Annotation[] annotations = field.getAnnotations(); q.e(annotations, "annotations"); return (XmlValue) u.R(j.n(annotations, XmlValue.class)); } private final <T> T readAttribute(T t14, XmlPullParser xmlPullParser) { String attributeValue; Field[] allFields = getAllFields(t14.getClass()); for (Field field : allFields) { XmlAttribute xmlAttribute = getXmlAttribute(field); if (!(xmlAttribute == null || (attributeValue = xmlPullParser.getAttributeValue(this.f33838ns, xmlAttribute.name())) == null)) { setValue(field, t14, attributeValue); Companion companion = Companion; StringBuilder a14 = d.a("readAttribute ["); a14.append(xmlPullParser.getName()); a14.append("] "); a14.append(field.getName()); a14.append('='); a14.append(field.get(t14)); companion.log(TAG, a14.toString()); } } return t14; } /* JADX DEBUG: Multi-variable search result rejected for r12v0, resolved type: com.linecorp.line.admolin.vast4.LadVastParser */ /* JADX WARN: Multi-variable type inference failed */ private final <T> T readElement(T t14, XmlPullParser xmlPullParser) { Object obj; xmlPullParser.require(2, this.f33838ns, xmlPullParser.getName()); readAttribute(t14, xmlPullParser); while (xmlPullParser.next() != 3) { if (xmlPullParser.getEventType() == 4) { readXmlValue(t14, xmlPullParser); } else { String name = xmlPullParser.getName(); if (name != null) { Field[] allFields = getAllFields(t14.getClass()); boolean z14 = false; for (Field field : allFields) { XmlElement xmlElement = getXmlElement(field); if (q.b(name, xmlElement != null ? xmlElement.name() : null)) { field.setAccessible(true); if (r.G(String.valueOf(field.getGenericType()), List.class.getName(), false, 2)) { if (field.get(t14) == null) { field.set(t14, Companion.createList(name)); } Object createInstance = Companion.createInstance(name); Object obj2 = field.get(t14); Objects.requireNonNull(obj2, "null cannot be cast to non-null type kotlin.collections.MutableList<kotlin.Any>"); List b14 = q0.b(obj2); if (createInstance instanceof String) { obj = readText(xmlPullParser, name); } else { obj = readElement(createInstance, xmlPullParser); } b14.add(obj); } else if (q.b(field.getGenericType(), String.class)) { field.set(t14, readText(xmlPullParser, name)); } else { field.set(t14, readElement(Companion.createInstance(name), xmlPullParser)); } Companion companion = Companion; StringBuilder a14 = g.a("readElement [", name, "] "); a14.append(field.getName()); a14.append('='); a14.append(field.get(t14)); companion.log(TAG, a14.toString()); z14 = true; } } if (!z14) { Companion companion2 = Companion; StringBuilder a15 = g.a("skip ", name, ": "); a15.append(t14.getClass().getName()); companion2.log(TAG, a15.toString()); skip(xmlPullParser); } } } } return t14; } private final String readText(XmlPullParser xmlPullParser, String str) { String str2; xmlPullParser.require(2, this.f33838ns, str); if (xmlPullParser.next() == 4) { str2 = xmlPullParser.getText(); q.e(str2, "parser.text"); xmlPullParser.nextTag(); } else { str2 = ""; } xmlPullParser.require(3, this.f33838ns, str); return x.C0(str2).toString(); } private final <T> T readXmlValue(T t14, XmlPullParser xmlPullParser) { Field field; Field[] allFields = getAllFields(t14.getClass()); int length = allFields.length; int i14 = 0; while (true) { if (i14 >= length) { field = null; break; } field = allFields[i14]; if (getXmlValue(field) != null) { break; } i14++; } if (field != null) { String name = xmlPullParser.getName(); String text = xmlPullParser.getText(); q.e(text, "value"); setValue(field, t14, text); Companion companion = Companion; StringBuilder a14 = g.a("readXmlValue [", name, "] "); a14.append(field.getName()); a14.append('='); a14.append(field.get(t14)); companion.log(TAG, a14.toString()); } return t14; } private final void setValue(Field field, Object obj, String str) { field.setAccessible(true); Type genericType = field.getGenericType(); if (q.b(genericType, String.class)) { field.set(obj, x.C0(str).toString()); } else if (q.b(genericType, Integer.TYPE)) { field.setInt(obj, Integer.parseInt(x.C0(str).toString())); } else if (q.b(genericType, Long.class)) { field.setLong(obj, Long.parseLong(x.C0(str).toString())); } else if (q.b(genericType, Boolean.class)) { field.set(obj, Boolean.valueOf(Boolean.parseBoolean(x.C0(str).toString()))); } else if (q.b(genericType, Double.class)) { field.setDouble(obj, Double.parseDouble(x.C0(str).toString())); } else if (q.b(genericType, Short.class)) { field.setShort(obj, Short.parseShort(x.C0(str).toString())); } else if (q.b(genericType, BigInteger.class)) { field.set(obj, new BigInteger(x.C0(str).toString())); } else if (q.b(genericType, BigDecimal.class)) { field.set(obj, new BigDecimal(x.C0(str).toString())); } else { Companion companion = Companion; StringBuilder a14 = d.a("setValue : unknown type "); a14.append(field.getGenericType()); a14.append(", value="); a14.append(str); companion.log(TAG, a14.toString()); } } private final void skip(XmlPullParser xmlPullParser) { if (xmlPullParser.getEventType() == 2) { int i14 = 1; while (i14 != 0) { int next = xmlPullParser.next(); if (next == 2) { i14++; } else if (next == 3) { i14--; } } return; } throw new IllegalStateException(); } /* JADX WARNING: Code restructure failed: missing block: B:10:0x008b, code lost: throw r0; */ /* JADX WARNING: Code restructure failed: missing block: B:8:0x0087, code lost: r0 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:9:0x0088, code lost: am3.c.a(r1, r8); */ public final VAST parse(String str) throws XmlPullParserException, IOException { q.f(str, "xml"); Companion companion = Companion; companion.log(TAG, "start parse: " + str); byte[] bytes = r.A(r.A(x.C0(str).toString(), "\\\"", "\"", false, 4), "\n", "", false, 4).getBytes(b.f143620b); q.e(bytes, "this as java.lang.String).getBytes(charset)"); ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); XmlPullParser newPullParser = Xml.newPullParser(); q.e(newPullParser, "newPullParser()"); newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", false); newPullParser.setInput(byteArrayInputStream, null); newPullParser.nextTag(); VAST vast = (VAST) readElement(companion.createInstance("VAST"), newPullParser); companion.log(TAG, "end parse : " + vast); companion.log(TAG, "finish"); c.a(byteArrayInputStream, null); return vast; } }