package o; import android.content.Context; import android.os.Build; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; import java.util.Iterator; import java.util.Set; import kotlin.TypeCastException; import o.C13127fRi; import o.C13129fRk; import org.xmlpull.v1.XmlPullParser; /* renamed from: o.fRl, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C13130fRl extends LayoutInflater { public static final Sts a = new Sts(0); private static final InterfaceC13393fZL b; private static final Set e; private final InterfaceC13123fRe c; private final boolean d; private boolean g; private boolean i; private final InterfaceC13123fRe j; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public C13130fRl(LayoutInflater layoutInflater, Context context, boolean z) { super(layoutInflater, context); C13129fRk c13129fRk; C14957gcv.b((Object) layoutInflater, ""); C14957gcv.b((Object) context, ""); this.d = Build.VERSION.SDK_INT > 28 || C17488xFm.e(); this.c = new IeS(this); this.j = new RVV(this); C13129fRk.RVV rvv = C13129fRk.d; c13129fRk = C13129fRk.i; if (c13129fRk == null) { c13129fRk = new C13129fRk.HBt().c(); C13129fRk.i = c13129fRk; } this.i = c13129fRk.e; if (z) { return; } if (getFactory2() != null && !(getFactory2() instanceof ojQ)) { setFactory2(getFactory2()); } if (getFactory() == null || (getFactory() instanceof saX)) { return; } setFactory(getFactory()); } @Override // android.view.LayoutInflater public final LayoutInflater cloneInContext(Context context) { C14957gcv.b((Object) context, ""); return new C13130fRl(this, context, true); } @Override // android.view.LayoutInflater public final View inflate(int i, ViewGroup viewGroup, boolean z) { View inflate = super.inflate(i, viewGroup, z); if (inflate != null && this.i) { inflate.setTag(C13127fRi.LWm.viewpump_layout_res, Integer.valueOf(i)); } return inflate; } @Override // android.view.LayoutInflater public final View inflate(XmlPullParser xmlPullParser, ViewGroup viewGroup, boolean z) { C13129fRk c13129fRk; Method method; C14957gcv.b((Object) xmlPullParser, ""); if (!this.g) { C13129fRk.RVV rvv = C13129fRk.d; c13129fRk = C13129fRk.i; if (c13129fRk == null) { c13129fRk = new C13129fRk.HBt().c(); C13129fRk.i = c13129fRk; } if (c13129fRk.c) { if (getContext() instanceof LayoutInflater.Factory2) { C14957gcv.b((Object) LayoutInflater.class, ""); C14957gcv.b((Object) "setPrivateFactory", ""); Method[] methods = LayoutInflater.class.getMethods(); int length = methods.length; int i = 0; while (true) { if (i >= length) { method = null; break; } method = methods[i]; C14957gcv.a(method, ""); if (C14957gcv.b((Object) method.getName(), (Object) "setPrivateFactory")) { method.setAccessible(true); break; } i++; } Object[] objArr = new Object[1]; Object context = getContext(); if (context == null) { throw new TypeCastException("null cannot be cast to non-null type android.view.LayoutInflater.Factory2"); } objArr[0] = new HBt((LayoutInflater.Factory2) context, this); C14957gcv.b((Object) this, ""); C14957gcv.b((Object) objArr, ""); if (method != null) { try { method.invoke(this, Arrays.copyOf(objArr, 1)); } catch (IllegalAccessException e2) { } catch (InvocationTargetException e3) { } } this.g = true; } else { this.g = true; } } } View inflate = super.inflate(xmlPullParser, viewGroup, z); C14957gcv.a(inflate, ""); return inflate; } @Override // android.view.LayoutInflater public final void setFactory(LayoutInflater.Factory factory) { C14957gcv.b((Object) factory, ""); if (!(factory instanceof saX)) { factory = new saX(factory); } super.setFactory(factory); } @Override // android.view.LayoutInflater public final void setFactory2(LayoutInflater.Factory2 factory2) { C14957gcv.b((Object) factory2, ""); if (!(factory2 instanceof ojQ)) { factory2 = new ojQ(factory2); } super.setFactory2(factory2); } @Override // android.view.LayoutInflater protected final View onCreateView(View view, String str, AttributeSet attributeSet) throws ClassNotFoundException { C13129fRk c13129fRk; C14957gcv.b((Object) str, ""); C13129fRk.RVV rvv = C13129fRk.d; c13129fRk = C13129fRk.i; if (c13129fRk == null) { c13129fRk = new C13129fRk.HBt().c(); C13129fRk.i = c13129fRk; } Context context = getContext(); C14957gcv.a(context, ""); C13124fRf c13124fRf = new C13124fRf(str, context, attributeSet, view, this.j); C14957gcv.b((Object) c13124fRf, ""); return new C13134fRp(c13129fRk.b, 0, c13124fRf).b(c13124fRf).c; } @Override // android.view.LayoutInflater protected final View onCreateView(String str, AttributeSet attributeSet) throws ClassNotFoundException { C13129fRk c13129fRk; C14957gcv.b((Object) str, ""); C13129fRk.RVV rvv = C13129fRk.d; c13129fRk = C13129fRk.i; if (c13129fRk == null) { c13129fRk = new C13129fRk.HBt().c(); C13129fRk.i = c13129fRk; } Context context = getContext(); C14957gcv.a(context, ""); C13124fRf c13124fRf = new C13124fRf(str, context, attributeSet, this.c); C14957gcv.b((Object) c13124fRf, ""); return new C13134fRp(c13129fRk.b, 0, c13124fRf).b(c13124fRf).c; } /* JADX INFO: Access modifiers changed from: private */ public final View aCJ_(View view, String str, Context context, AttributeSet attributeSet) { C13129fRk c13129fRk; C13129fRk.RVV rvv = C13129fRk.d; c13129fRk = C13129fRk.i; if (c13129fRk == null) { c13129fRk = new C13129fRk.HBt().c(); C13129fRk.i = c13129fRk; } if (!c13129fRk.a || view != null || gdZ.a((CharSequence) str, '.', 0, false) < 0) { return view; } if (this.d) { return cloneInContext(context).createView(str, null, attributeSet); } Object obj = Sts.d().get(this); if (obj == null) { throw new TypeCastException("null cannot be cast to non-null type kotlin.Array"); } Object[] objArr = (Object[]) obj; Object obj2 = objArr[0]; objArr[0] = context; Field d = Sts.d(); C14957gcv.b((Object) d, ""); C14957gcv.b((Object) this, ""); C14957gcv.b((Object) objArr, ""); try { d.set(this, objArr); } catch (IllegalAccessException unused) { } try { view = createView(str, null, attributeSet); objArr[0] = obj2; } catch (ClassNotFoundException unused2) { objArr[0] = obj2; } catch (Throwable th) { objArr[0] = obj2; Field d2 = Sts.d(); C14957gcv.b((Object) d2, ""); C14957gcv.b((Object) this, ""); C14957gcv.b((Object) objArr, ""); try { d2.set(this, objArr); } catch (IllegalAccessException unused3) { } throw th; } Field d3 = Sts.d(); C14957gcv.b((Object) d3, ""); C14957gcv.b((Object) this, ""); C14957gcv.b((Object) objArr, ""); try { d3.set(this, objArr); return view; } catch (IllegalAccessException unused4) { return view; } } /* JADX INFO: Access modifiers changed from: private */ public final View aCK_(View view, String str, AttributeSet attributeSet) { try { return super.onCreateView(view, str, attributeSet); } catch (ClassNotFoundException unused) { return null; } } /* JADX INFO: Access modifiers changed from: private */ public final View aCL_(String str, AttributeSet attributeSet) { try { return super.onCreateView(str, attributeSet); } catch (ClassNotFoundException unused) { return null; } } /* renamed from: o.fRl$RVV */ /* loaded from: classes6.dex */ static final class RVV implements InterfaceC13123fRe { private final C13130fRl b; public RVV(C13130fRl c13130fRl) { C14957gcv.b((Object) c13130fRl, ""); this.b = c13130fRl; } @Override // o.InterfaceC13123fRe public final View aCR_(View view, String str, Context context, AttributeSet attributeSet) { C14957gcv.b((Object) str, ""); C14957gcv.b((Object) context, ""); return this.b.aCK_(view, str, attributeSet); } } /* renamed from: o.fRl$IeS */ /* loaded from: classes6.dex */ static final class IeS implements InterfaceC13123fRe { private final C13130fRl b; public IeS(C13130fRl c13130fRl) { C14957gcv.b((Object) c13130fRl, ""); this.b = c13130fRl; } @Override // o.InterfaceC13123fRe public final View aCR_(View view, String str, Context context, AttributeSet attributeSet) { C14957gcv.b((Object) str, ""); C14957gcv.b((Object) context, ""); Iterator it = C13130fRl.e.iterator(); View view2 = null; while (it.hasNext()) { try { view2 = this.b.createView(str, (String) it.next(), attributeSet); } catch (ClassNotFoundException unused) { } if (view2 != null) { break; } } return view2 == null ? this.b.aCL_(str, attributeSet) : view2; } } /* renamed from: o.fRl$saX */ /* loaded from: classes6.dex */ static final class saX implements LayoutInflater.Factory { private final InterfaceC13123fRe a; public saX(LayoutInflater.Factory factory) { C14957gcv.b((Object) factory, ""); this.a = new jbe(factory); } @Override // android.view.LayoutInflater.Factory public final View onCreateView(String str, Context context, AttributeSet attributeSet) { C13129fRk c13129fRk; C14957gcv.b((Object) str, ""); C14957gcv.b((Object) context, ""); C13129fRk.RVV rvv = C13129fRk.d; c13129fRk = C13129fRk.i; if (c13129fRk == null) { c13129fRk = new C13129fRk.HBt().c(); C13129fRk.i = c13129fRk; } C13124fRf c13124fRf = new C13124fRf(str, context, attributeSet, this.a); C14957gcv.b((Object) c13124fRf, ""); return new C13134fRp(c13129fRk.b, 0, c13124fRf).b(c13124fRf).c; } } /* renamed from: o.fRl$jbe */ /* loaded from: classes6.dex */ static final class jbe implements InterfaceC13123fRe { private final LayoutInflater.Factory b; public jbe(LayoutInflater.Factory factory) { C14957gcv.b((Object) factory, ""); this.b = factory; } @Override // o.InterfaceC13123fRe public final View aCR_(View view, String str, Context context, AttributeSet attributeSet) { C14957gcv.b((Object) str, ""); C14957gcv.b((Object) context, ""); return this.b.onCreateView(str, context, attributeSet); } } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.fRl$ojQ */ /* loaded from: classes6.dex */ public static class ojQ implements LayoutInflater.Factory2 { private final ZqN a; public ojQ(LayoutInflater.Factory2 factory2) { C14957gcv.b((Object) factory2, ""); this.a = new ZqN(factory2); } @Override // android.view.LayoutInflater.Factory public View onCreateView(String str, Context context, AttributeSet attributeSet) { C14957gcv.b((Object) str, ""); C14957gcv.b((Object) context, ""); return onCreateView(null, str, context, attributeSet); } @Override // android.view.LayoutInflater.Factory2 public View onCreateView(View view, String str, Context context, AttributeSet attributeSet) { C13129fRk c13129fRk; C14957gcv.b((Object) str, ""); C14957gcv.b((Object) context, ""); C13129fRk.RVV rvv = C13129fRk.d; c13129fRk = C13129fRk.i; if (c13129fRk == null) { c13129fRk = new C13129fRk.HBt().c(); C13129fRk.i = c13129fRk; } C13124fRf c13124fRf = new C13124fRf(str, context, attributeSet, view, this.a); C14957gcv.b((Object) c13124fRf, ""); return new C13134fRp(c13129fRk.b, 0, c13124fRf).b(c13124fRf).c; } } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.fRl$ZqN */ /* loaded from: classes6.dex */ public static class ZqN implements InterfaceC13123fRe { private final LayoutInflater.Factory2 a; public ZqN(LayoutInflater.Factory2 factory2) { C14957gcv.b((Object) factory2, ""); this.a = factory2; } @Override // o.InterfaceC13123fRe public View aCR_(View view, String str, Context context, AttributeSet attributeSet) { C14957gcv.b((Object) str, ""); C14957gcv.b((Object) context, ""); return this.a.onCreateView(view, str, context, attributeSet); } protected final LayoutInflater.Factory2 aCP_() { return this.a; } } /* renamed from: o.fRl$HBt */ /* loaded from: classes6.dex */ static final class HBt extends ojQ { private final tOB d; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public HBt(LayoutInflater.Factory2 factory2, C13130fRl c13130fRl) { super(factory2); C14957gcv.b((Object) factory2, ""); C14957gcv.b((Object) c13130fRl, ""); this.d = new tOB(factory2, c13130fRl); } @Override // o.C13130fRl.ojQ, android.view.LayoutInflater.Factory2 public final View onCreateView(View view, String str, Context context, AttributeSet attributeSet) { C13129fRk c13129fRk; C14957gcv.b((Object) str, ""); C14957gcv.b((Object) context, ""); C13129fRk.RVV rvv = C13129fRk.d; c13129fRk = C13129fRk.i; if (c13129fRk == null) { c13129fRk = new C13129fRk.HBt().c(); C13129fRk.i = c13129fRk; } C13124fRf c13124fRf = new C13124fRf(str, context, attributeSet, view, this.d); C14957gcv.b((Object) c13124fRf, ""); return new C13134fRp(c13129fRk.b, 0, c13124fRf).b(c13124fRf).c; } } /* renamed from: o.fRl$tOB */ /* loaded from: classes6.dex */ static final class tOB extends ZqN { private final C13130fRl e; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public tOB(LayoutInflater.Factory2 factory2, C13130fRl c13130fRl) { super(factory2); C14957gcv.b((Object) factory2, ""); C14957gcv.b((Object) c13130fRl, ""); this.e = c13130fRl; } @Override // o.C13130fRl.ZqN, o.InterfaceC13123fRe public final View aCR_(View view, String str, Context context, AttributeSet attributeSet) { C14957gcv.b((Object) str, ""); C14957gcv.b((Object) context, ""); return this.e.aCJ_(aCP_().onCreateView(view, str, context, attributeSet), str, context, attributeSet); } } /* renamed from: o.fRl$Sts */ /* loaded from: classes6.dex */ public static final class Sts { private static InterfaceC14984gdp[] e = {C14929gcJ.b(new gcF(C14929gcJ.c(Sts.class), "CONSTRUCTOR_ARGS_FIELD", "getCONSTRUCTOR_ARGS_FIELD()Ljava/lang/reflect/Field;"))}; private Sts() { } public /* synthetic */ Sts(byte b) { this(); } public static final /* synthetic */ Field d() { InterfaceC13393fZL interfaceC13393fZL = C13130fRl.b; Sts sts = C13130fRl.a; InterfaceC14984gdp interfaceC14984gdp = e[0]; return (Field) interfaceC13393fZL.e(); } } static { String[] strArr = {"android.widget.", "android.webkit."}; C14957gcv.e(strArr, ""); e = C14875gap.e(strArr); LWm lWm = LWm.b; C14957gcv.e(lWm, ""); b = new fZZ(lWm); } /* renamed from: o.fRl$LWm */ /* loaded from: classes6.dex */ static final class LWm extends AbstractC14961gcz implements InterfaceC14890gbN { public static final LWm b = new LWm(); @Override // o.InterfaceC14890gbN public final /* synthetic */ Field invoke() { Field declaredField = LayoutInflater.class.getDeclaredField("mConstructorArgs"); if (declaredField == null) { throw new IllegalArgumentException("No constructor arguments field found in LayoutInflater!".toString()); } declaredField.setAccessible(true); return declaredField; } LWm() { super(0); } } }