package p; import android.content.res.Resources; import android.content.res.TypedArray; import android.util.Base64; import android.util.Xml; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /* loaded from: classes.dex */ public abstract class e { public interface a { } public static final class b implements a { /* renamed from: a, reason: collision with root package name */ private final c[] f12863a; public b(c[] cVarArr) { this.f12863a = cVarArr; } public c[] a() { return this.f12863a; } } public static final class c { /* renamed from: a, reason: collision with root package name */ private final String f12864a; /* renamed from: b, reason: collision with root package name */ private int f12865b; /* renamed from: c, reason: collision with root package name */ private boolean f12866c; /* renamed from: d, reason: collision with root package name */ private String f12867d; /* renamed from: e, reason: collision with root package name */ private int f12868e; /* renamed from: f, reason: collision with root package name */ private int f12869f; public c(String str, int i10, boolean z10, String str2, int i11, int i12) { this.f12864a = str; this.f12865b = i10; this.f12866c = z10; this.f12867d = str2; this.f12868e = i11; this.f12869f = i12; } public String a() { return this.f12864a; } public int b() { return this.f12869f; } public int c() { return this.f12868e; } public String d() { return this.f12867d; } public int e() { return this.f12865b; } public boolean f() { return this.f12866c; } } public static final class d implements a { /* renamed from: a, reason: collision with root package name */ private final w.d f12870a; /* renamed from: b, reason: collision with root package name */ private final int f12871b; /* renamed from: c, reason: collision with root package name */ private final int f12872c; /* renamed from: d, reason: collision with root package name */ private final String f12873d; public d(w.d dVar, int i10, int i11, String str) { this.f12870a = dVar; this.f12872c = i10; this.f12871b = i11; this.f12873d = str; } public int a() { return this.f12872c; } public w.d b() { return this.f12870a; } public String c() { return this.f12873d; } public int d() { return this.f12871b; } } private static int a(TypedArray typedArray, int i10) { return typedArray.getType(i10); } public static a b(XmlPullParser xmlPullParser, Resources resources) { int next; do { next = xmlPullParser.next(); if (next == 2) { break; } } while (next != 1); if (next == 2) { return d(xmlPullParser, resources); } throw new XmlPullParserException("No start tag found"); } public static List c(Resources resources, int i10) { if (i10 == 0) { return Collections.emptyList(); } TypedArray obtainTypedArray = resources.obtainTypedArray(i10); try { if (obtainTypedArray.length() == 0) { return Collections.emptyList(); } ArrayList arrayList = new ArrayList(); if (a(obtainTypedArray, 0) == 1) { for (int i11 = 0; i11 < obtainTypedArray.length(); i11++) { int resourceId = obtainTypedArray.getResourceId(i11, 0); if (resourceId != 0) { arrayList.add(h(resources.getStringArray(resourceId))); } } } else { arrayList.add(h(resources.getStringArray(i10))); } return arrayList; } finally { obtainTypedArray.recycle(); } } private static a d(XmlPullParser xmlPullParser, Resources resources) { xmlPullParser.require(2, null, "font-family"); if (xmlPullParser.getName().equals("font-family")) { return e(xmlPullParser, resources); } g(xmlPullParser); return null; } private static a e(XmlPullParser xmlPullParser, Resources resources) { TypedArray obtainAttributes = resources.obtainAttributes(Xml.asAttributeSet(xmlPullParser), o.d.f12575h); String string = obtainAttributes.getString(o.d.f12576i); String string2 = obtainAttributes.getString(o.d.f12580m); String string3 = obtainAttributes.getString(o.d.f12581n); int resourceId = obtainAttributes.getResourceId(o.d.f12577j, 0); int integer = obtainAttributes.getInteger(o.d.f12578k, 1); int integer2 = obtainAttributes.getInteger(o.d.f12579l, 500); String string4 = obtainAttributes.getString(o.d.f12582o); obtainAttributes.recycle(); if (string != null && string2 != null && string3 != null) { while (xmlPullParser.next() != 3) { g(xmlPullParser); } return new d(new w.d(string, string2, string3, c(resources, resourceId)), integer, integer2, string4); } ArrayList arrayList = new ArrayList(); while (xmlPullParser.next() != 3) { if (xmlPullParser.getEventType() == 2) { if (xmlPullParser.getName().equals("font")) { arrayList.add(f(xmlPullParser, resources)); } else { g(xmlPullParser); } } } if (arrayList.isEmpty()) { return null; } return new b((c[]) arrayList.toArray(new c[arrayList.size()])); } private static c f(XmlPullParser xmlPullParser, Resources resources) { TypedArray obtainAttributes = resources.obtainAttributes(Xml.asAttributeSet(xmlPullParser), o.d.f12583p); int i10 = o.d.f12592y; if (!obtainAttributes.hasValue(i10)) { i10 = o.d.f12585r; } int i11 = obtainAttributes.getInt(i10, 400); int i12 = o.d.f12590w; if (!obtainAttributes.hasValue(i12)) { i12 = o.d.f12586s; } boolean z10 = 1 == obtainAttributes.getInt(i12, 0); int i13 = o.d.f12593z; if (!obtainAttributes.hasValue(i13)) { i13 = o.d.f12587t; } int i14 = o.d.f12591x; if (!obtainAttributes.hasValue(i14)) { i14 = o.d.f12588u; } String string = obtainAttributes.getString(i14); int i15 = obtainAttributes.getInt(i13, 0); int i16 = o.d.f12589v; if (!obtainAttributes.hasValue(i16)) { i16 = o.d.f12584q; } int resourceId = obtainAttributes.getResourceId(i16, 0); String string2 = obtainAttributes.getString(i16); obtainAttributes.recycle(); while (xmlPullParser.next() != 3) { g(xmlPullParser); } return new c(string2, i11, z10, string, i15, resourceId); } private static void g(XmlPullParser xmlPullParser) { int i10 = 1; while (i10 > 0) { int next = xmlPullParser.next(); if (next == 2) { i10++; } else if (next == 3) { i10--; } } } private static List h(String[] strArr) { ArrayList arrayList = new ArrayList(); for (String str : strArr) { arrayList.add(Base64.decode(str, 0)); } return arrayList; } }