package defpackage;

import android.R;
import android.app.Activity;
import android.app.Dialog;
import android.app.UiModeManager;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.AndroidRuntimeException;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.window.OnBackInvokedDispatcher;
import androidx.appcompat.widget.ActionBarContextView;
import androidx.appcompat.widget.ActionBarOverlayLayout;
import androidx.appcompat.widget.ActionMenuView;
import androidx.appcompat.widget.ContentFrameLayout;
import androidx.appcompat.widget.Toolbar;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.LinkedHashSet;
import java.util.Locale;
import java.util.WeakHashMap;

/* renamed from: ᵮᵟᵡ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class LayoutInflaterFactory2C4211 extends AbstractC4175 implements InterfaceC3085, LayoutInflater.Factory2 {

    /* renamed from: ˆʕ, reason: contains not printable characters */
    public static final C2771 f15742 = new C2771(0);

    /* renamed from: ˎᵶᵹ, reason: contains not printable characters */
    public static final int[] f15743 = {R.attr.windowBackground};

    /* renamed from: ᵯᵽ, reason: contains not printable characters */
    public static final boolean f15744 = !"robolectric".equals(Build.FINGERPRINT);

    /* renamed from: ʽᵢˊ, reason: contains not printable characters */
    public int f15745;

    /* renamed from: ʾˋˊᵽ, reason: contains not printable characters */
    public boolean f15746;

    /* renamed from: ʾᵻᵭٴ, reason: contains not printable characters */
    public C1017[] f15747;

    /* renamed from: ʿᵘˆ, reason: contains not printable characters */
    public C5400 f15748;

    /* renamed from: ˀˁᵨ, reason: contains not printable characters */
    public boolean f15749;

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public PopupWindow f15750;

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public CharSequence f15751;

    /* renamed from: ˆᵴᵜˏ, reason: contains not printable characters */
    public boolean f15752;

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public RunnableC2912 f15753;

    /* renamed from: ˉᵴﹶ, reason: contains not printable characters */
    public Rect f15754;

    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public TextView f15755;

    /* renamed from: ˊʾˊ, reason: contains not printable characters */
    public boolean f15756;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public ActionBarContextView f15757;

    /* renamed from: ˌᵹᵨˑ, reason: contains not printable characters */
    public boolean f15759;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final Object f15760;

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public boolean f15761;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public AbstractC3261 f15762;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public C3966 f15763;

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public C2931 f15765;

    /* renamed from: ᵠᵪˀᵻ, reason: contains not printable characters */
    public boolean f15767;

    /* renamed from: ᵠᵿː, reason: contains not printable characters */
    public boolean f15768;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public C1819 f15769;

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public ViewGroup f15770;

    /* renamed from: ᵣᵟᵔ, reason: contains not printable characters */
    public boolean f15771;

    /* renamed from: ᵤᵼˑʠ, reason: contains not printable characters */
    public boolean f15772;

    /* renamed from: ᵥʩᵩˑ, reason: contains not printable characters */
    public Configuration f15773;

    /* renamed from: ᵦᵳˎ, reason: contains not printable characters */
    public OnBackInvokedDispatcher f15774;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public Window f15775;

    /* renamed from: ᵨٴ, reason: contains not printable characters */
    public int f15776;

    /* renamed from: ᵪᵛʿ, reason: contains not printable characters */
    public C4151 f15777;

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public boolean f15778;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final Context f15779;

    /* renamed from: ᵰʖʢ, reason: contains not printable characters */
    public C5400 f15780;

    /* renamed from: ᵲᵟ, reason: contains not printable characters */
    public final int f15781;

    /* renamed from: ᵳᵮᵸ, reason: contains not printable characters */
    public C1223 f15782;

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public boolean f15783;

    /* renamed from: ᵴᵯᵴⁱ, reason: contains not printable characters */
    public Rect f15784;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public C0368 f15785;

    /* renamed from: ᵷᵦﹳ, reason: contains not printable characters */
    public boolean f15786;

    /* renamed from: ᵷᵱ, reason: contains not printable characters */
    public boolean f15787;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public WindowCallbackC1403 f15788;

    /* renamed from: ᵺᵜᵰ, reason: contains not printable characters */
    public int f15789;

    /* renamed from: ᵺᵠ, reason: contains not printable characters */
    public C1017 f15790;

    /* renamed from: ᵽʛ, reason: contains not printable characters */
    public boolean f15791;

    /* renamed from: ﹶـ, reason: contains not printable characters */
    public boolean f15792;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public ActionBarOverlayLayout f15793;

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public C1014 f15766 = null;

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public final boolean f15758 = true;

    /* renamed from: ᵎʾ, reason: contains not printable characters */
    public final RunnableC2912 f15764 = new RunnableC2912(this, 0);

    public LayoutInflaterFactory2C4211(Context context, Window window, InterfaceC5006 interfaceC5006, Object obj) {
        AbstractActivityC3177 abstractActivityC3177 = null;
        this.f15781 = -100;
        this.f15779 = context;
        this.f15760 = obj;
        if (obj instanceof Dialog) {
            while (true) {
                if (context != null) {
                    if (!(context instanceof AbstractActivityC3177)) {
                        if (!(context instanceof ContextWrapper)) {
                            break;
                        } else {
                            context = ((ContextWrapper) context).getBaseContext();
                        }
                    } else {
                        abstractActivityC3177 = (AbstractActivityC3177) context;
                        break;
                    }
                } else {
                    break;
                }
            }
            if (abstractActivityC3177 != null) {
                this.f15781 = ((LayoutInflaterFactory2C4211) abstractActivityC3177.m7532()).f15781;
            }
        }
        if (this.f15781 == -100) {
            String name = this.f15760.getClass().getName();
            C2771 c2771 = f15742;
            Integer num = (Integer) c2771.get(name);
            if (num != null) {
                this.f15781 = num.intValue();
                c2771.remove(this.f15760.getClass().getName());
            }
        }
        if (window != null) {
            m9150(window);
        }
        C3159.m7511();
    }

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public static Configuration m9145(Context context, int i, C2358 c2358, Configuration configuration, boolean z) {
        int i2 = i != 1 ? i != 2 ? z ? 0 : context.getApplicationContext().getResources().getConfiguration().uiMode & 48 : 32 : 16;
        Configuration configuration2 = new Configuration();
        configuration2.fontScale = 0.0f;
        if (configuration != null) {
            configuration2.setTo(configuration);
        }
        configuration2.uiMode = i2 | (configuration2.uiMode & (-49));
        if (c2358 != null) {
            InterfaceC3917 interfaceC3917 = c2358.f9227;
            if (Build.VERSION.SDK_INT >= 24) {
                AbstractC2602.m6546(configuration2, c2358);
                return configuration2;
            }
            configuration2.setLocale(interfaceC3917.get(0));
            configuration2.setLayoutDirection(interfaceC3917.get(0));
        }
        return configuration2;
    }

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public static C2358 m9146(Configuration configuration) {
        return Build.VERSION.SDK_INT >= 24 ? AbstractC2602.m6523(configuration) : C2358.m6111(configuration.locale.toLanguageTag());
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public static C2358 m9147(Context context) {
        C2358 c2358;
        C2358 c2358M6111;
        int i = Build.VERSION.SDK_INT;
        if (i >= 33 || (c2358 = AbstractC4175.f15605) == null) {
            return null;
        }
        InterfaceC3917 interfaceC3917 = c2358.f9227;
        C2358 c2358M9146 = m9146(context.getApplicationContext().getResources().getConfiguration());
        int i2 = 0;
        if (i < 24) {
            c2358M6111 = interfaceC3917.isEmpty() ? C2358.f9226 : C2358.m6111(interfaceC3917.get(0).toLanguageTag());
        } else if (interfaceC3917.isEmpty()) {
            c2358M6111 = C2358.f9226;
        } else {
            LinkedHashSet linkedHashSet = new LinkedHashSet();
            while (i2 < c2358M9146.f9227.size() + interfaceC3917.size()) {
                Locale locale = i2 < interfaceC3917.size() ? interfaceC3917.get(i2) : c2358M9146.f9227.get(i2 - interfaceC3917.size());
                if (locale != null) {
                    linkedHashSet.add(locale);
                }
                i2++;
            }
            c2358M6111 = C2358.m6110((Locale[]) linkedHashSet.toArray(new Locale[linkedHashSet.size()]));
        }
        return c2358M6111.f9227.isEmpty() ? c2358M9146 : c2358M6111;
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Removed duplicated region for block: B:20:0x0071  */
    @Override // android.view.LayoutInflater.Factory2
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final android.view.View onCreateView(android.view.View r9, java.lang.String r10, android.content.Context r11, android.util.AttributeSet r12) {
        /*
            Method dump skipped, instructions count: 690
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.LayoutInflaterFactory2C4211.onCreateView(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet):android.view.View");
    }

    @Override // android.view.LayoutInflater.Factory
    public final View onCreateView(String str, Context context, AttributeSet attributeSet) {
        return onCreateView(null, str, context, attributeSet);
    }

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final boolean m9148() {
        InterfaceC0105 interfaceC0105;
        C4436 c4436;
        boolean z = this.f15772;
        this.f15772 = false;
        C1017 c1017M9167 = m9167(0);
        if (!c1017M9167.f4469) {
            AbstractC3261 abstractC3261 = this.f15762;
            if (abstractC3261 != null) {
                abstractC3261.mo3243();
                return true;
            }
            m9166();
            C3966 c3966 = this.f15763;
            if (c3966 == null || (interfaceC0105 = c3966.f14955) == null || (c4436 = ((C0062) interfaceC0105).f1272.f250) == null || c4436.f16580 == null) {
                return false;
            }
            C4436 c44362 = ((C0062) interfaceC0105).f1272.f250;
            C2652 c2652 = c44362 == null ? null : c44362.f16580;
            if (c2652 != null) {
                c2652.collapseActionView();
            }
        } else if (!z) {
            m9149(c1017M9167, true);
            return true;
        }
        return true;
    }

    @Override // defpackage.AbstractC4175
    /* renamed from: ˇʼʤˎ */
    public final boolean mo9089(int i) {
        if (i == 8) {
            i = 108;
        } else if (i == 9) {
            i = 109;
        }
        if (this.f15759 && i == 108) {
            return false;
        }
        if (this.f15791 && i == 1) {
            this.f15791 = false;
        }
        if (i == 1) {
            m9158();
            this.f15759 = true;
            return true;
        }
        if (i == 2) {
            m9158();
            this.f15761 = true;
            return true;
        }
        if (i == 5) {
            m9158();
            this.f15778 = true;
            return true;
        }
        if (i == 10) {
            m9158();
            this.f15756 = true;
            return true;
        }
        if (i == 108) {
            m9158();
            this.f15791 = true;
            return true;
        }
        if (i != 109) {
            return this.f15775.requestFeature(i);
        }
        m9158();
        this.f15749 = true;
        return true;
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final void m9149(C1017 c1017, boolean z) {
        C2047 c2047;
        ActionBarOverlayLayout actionBarOverlayLayout;
        C1065 c1065;
        if (z && c1017.f4467 == 0 && (actionBarOverlayLayout = this.f15793) != null) {
            actionBarOverlayLayout.m28();
            ActionMenuView actionMenuView = ((C0062) actionBarOverlayLayout.f128).f1272.f243;
            if (actionMenuView != null && (c1065 = actionMenuView.f145) != null && c1065.m3451()) {
                m9162(c1017.f4474);
                return;
            }
        }
        WindowManager windowManager = (WindowManager) this.f15779.getSystemService("window");
        if (windowManager != null && c1017.f4469 && (c2047 = c1017.f4460) != null) {
            windowManager.removeView(c2047);
            if (z) {
                m9161(c1017.f4467, c1017, null);
            }
        }
        c1017.f4473 = false;
        c1017.f4462 = false;
        c1017.f4469 = false;
        c1017.f4464 = null;
        c1017.f4468 = true;
        if (this.f15790 == c1017) {
            this.f15790 = null;
        }
        if (c1017.f4467 == 0) {
            m9165();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:35:0x0074  */
    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m9150(android.view.Window r8) {
        /*
            r7 = this;
            java.lang.String r0 = "AppCompat has already installed itself into the Window"
            android.view.Window r1 = r7.f15775
            if (r1 != 0) goto L7e
            android.view.Window$Callback r1 = r8.getCallback()
            boolean r2 = r1 instanceof defpackage.WindowCallbackC1403
            if (r2 != 0) goto L7a
            ˊᵷˊ r0 = new ˊᵷˊ
            r0.<init>(r7, r1)
            r7.f15788 = r0
            r8.setCallback(r0)
            android.content.Context r0 = r7.f15779
            int[] r1 = defpackage.LayoutInflaterFactory2C4211.f15743
            r2 = 0
            android.content.res.TypedArray r1 = r0.obtainStyledAttributes(r2, r1)
            r3 = 0
            boolean r4 = r1.hasValue(r3)
            if (r4 == 0) goto L3f
            int r3 = r1.getResourceId(r3, r3)
            if (r3 == 0) goto L3f
            ᵠᵽ r4 = defpackage.C3159.m7512()
            monitor-enter(r4)
            ːᵬᵘ r5 = r4.f11991     // Catch: java.lang.Throwable -> L3c
            r6 = 1
            android.graphics.drawable.Drawable r0 = r5.m5498(r0, r3, r6)     // Catch: java.lang.Throwable -> L3c
            monitor-exit(r4)
            goto L40
        L3c:
            r7 = move-exception
            monitor-exit(r4)     // Catch: java.lang.Throwable -> L3c
            throw r7
        L3f:
            r0 = r2
        L40:
            if (r0 == 0) goto L45
            r8.setBackgroundDrawable(r0)
        L45:
            r1.recycle()
            r7.f15775 = r8
            int r8 = android.os.Build.VERSION.SDK_INT
            r0 = 33
            if (r8 < r0) goto L79
            android.window.OnBackInvokedDispatcher r8 = r7.f15774
            if (r8 != 0) goto L79
            java.lang.Object r0 = r7.f15760
            if (r8 == 0) goto L61
            ˉᵯᵢ r1 = r7.f15782
            if (r1 == 0) goto L61
            defpackage.AbstractC2777.m6857(r8, r1)
            r7.f15782 = r2
        L61:
            boolean r8 = r0 instanceof android.app.Activity
            if (r8 == 0) goto L74
            android.app.Activity r0 = (android.app.Activity) r0
            android.view.Window r8 = r0.getWindow()
            if (r8 == 0) goto L74
            android.window.OnBackInvokedDispatcher r8 = defpackage.AbstractC2777.m6854(r0)
            r7.f15774 = r8
            goto L76
        L74:
            r7.f15774 = r2
        L76:
            r7.m9165()
        L79:
            return
        L7a:
            ᵹˉᵞ.ᵳٴᵶ(r0)
            return
        L7e:
            ᵹˉᵞ.ᵳٴᵶ(r0)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.LayoutInflaterFactory2C4211.m9150(android.view.Window):void");
    }

    @Override // defpackage.AbstractC4175
    /* renamed from: ˎˏʜʾ */
    public final void mo9090(View view) {
        m9160();
        ViewGroup viewGroup = (ViewGroup) this.f15770.findViewById(R.id.content);
        viewGroup.removeAllViews();
        viewGroup.addView(view);
        this.f15788.m4286(this.f15775.getCallback());
    }

    /* JADX WARN: Removed duplicated region for block: B:59:0x00ce  */
    /* renamed from: ˎˑː, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean m9151(defpackage.C1017 r13, android.view.KeyEvent r14) {
        /*
            Method dump skipped, instructions count: 352
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.LayoutInflaterFactory2C4211.m9151(ˈˀˋ, android.view.KeyEvent):boolean");
    }

    @Override // defpackage.AbstractC4175
    /* renamed from: ˏˋٴ */
    public final void mo9091(int i) {
        m9160();
        ViewGroup viewGroup = (ViewGroup) this.f15770.findViewById(R.id.content);
        viewGroup.removeAllViews();
        LayoutInflater.from(this.f15779).inflate(i, viewGroup);
        this.f15788.m4286(this.f15775.getCallback());
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x004d  */
    @Override // defpackage.AbstractC4175
    /* renamed from: ˏᵙ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void mo9092() {
        /*
            r3 = this;
            java.lang.Object r0 = r3.f15760
            boolean r0 = r0 instanceof android.app.Activity
            if (r0 == 0) goto L11
            java.lang.Object r0 = defpackage.AbstractC4175.f15599
            monitor-enter(r0)
            defpackage.AbstractC4175.m9088(r3)     // Catch: java.lang.Throwable -> Le
            monitor-exit(r0)     // Catch: java.lang.Throwable -> Le
            goto L11
        Le:
            r3 = move-exception
            monitor-exit(r0)     // Catch: java.lang.Throwable -> Le
            throw r3
        L11:
            boolean r0 = r3.f15746
            if (r0 == 0) goto L20
            android.view.Window r0 = r3.f15775
            android.view.View r0 = r0.getDecorView()
            ᵝᵠᵹ r1 = r3.f15764
            r0.removeCallbacks(r1)
        L20:
            r0 = 1
            r3.f15771 = r0
            int r0 = r3.f15781
            r1 = -100
            if (r0 == r1) goto L4d
            java.lang.Object r0 = r3.f15760
            boolean r1 = r0 instanceof android.app.Activity
            if (r1 == 0) goto L4d
            android.app.Activity r0 = (android.app.Activity) r0
            boolean r0 = r0.isChangingConfigurations()
            if (r0 == 0) goto L4d
            ᵛᵹ r0 = defpackage.LayoutInflaterFactory2C4211.f15742
            java.lang.Object r1 = r3.f15760
            java.lang.Class r1 = r1.getClass()
            java.lang.String r1 = r1.getName()
            int r2 = r3.f15781
            java.lang.Integer r2 = java.lang.Integer.valueOf(r2)
            r0.put(r1, r2)
            goto L5c
        L4d:
            ᵛᵹ r0 = defpackage.LayoutInflaterFactory2C4211.f15742
            java.lang.Object r1 = r3.f15760
            java.lang.Class r1 = r1.getClass()
            java.lang.String r1 = r1.getName()
            r0.remove(r1)
        L5c:
            ᵾˈ r0 = r3.f15748
            if (r0 == 0) goto L63
            r0.m5299()
        L63:
            ᵾˈ r3 = r3.f15780
            if (r3 == 0) goto L6a
            r3.m5299()
        L6a:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.LayoutInflaterFactory2C4211.mo9092():void");
    }

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final boolean m9152(C1017 c1017, int i, KeyEvent keyEvent) {
        MenuC2418 menuC2418;
        if (keyEvent.isSystem()) {
            return false;
        }
        if ((c1017.f4473 || m9151(c1017, keyEvent)) && (menuC2418 = c1017.f4474) != null) {
            return menuC2418.performShortcut(i, keyEvent, 1);
        }
        return false;
    }

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public final void m9153() {
        if (this.f15775 == null) {
            Object obj = this.f15760;
            if (obj instanceof Activity) {
                m9150(((Activity) obj).getWindow());
            }
        }
        if (this.f15775 != null) {
            return;
        }
        ᵹˉᵞ.ᵳٴᵶ("We have not been given a Window");
    }

    @Override // defpackage.AbstractC4175
    /* renamed from: ᵝᵵᵺ */
    public final void mo9093(View view, ViewGroup.LayoutParams layoutParams) {
        m9160();
        ViewGroup viewGroup = (ViewGroup) this.f15770.findViewById(R.id.content);
        viewGroup.removeAllViews();
        viewGroup.addView(view, layoutParams);
        this.f15788.m4286(this.f15775.getCallback());
    }

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public final void m9154(int i) {
        C1017 c1017M9167 = m9167(i);
        if (c1017M9167.f4474 != null) {
            Bundle bundle = new Bundle();
            c1017M9167.f4474.m6193(bundle);
            if (bundle.size() > 0) {
                c1017M9167.f4461 = bundle;
            }
            c1017M9167.f4474.m6190();
            c1017M9167.f4474.clear();
        }
        c1017M9167.f4470 = true;
        c1017M9167.f4468 = true;
        if ((i == 108 || i == 0) && this.f15793 != null) {
            C1017 c1017M91672 = m9167(0);
            c1017M91672.f4473 = false;
            m9151(c1017M91672, null);
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:87:0x0175, code lost:
    
        if (r2.f19106.getCount() > 0) goto L88;
     */
    /* JADX WARN: Removed duplicated region for block: B:100:0x01d2  */
    /* JADX WARN: Removed duplicated region for block: B:105:? A[RETURN, SYNTHETIC] */
    /* renamed from: ᵡˎ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m9155(defpackage.C1017 r18, android.view.KeyEvent r19) {
        /*
            Method dump skipped, instructions count: 473
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.LayoutInflaterFactory2C4211.m9155(ˈˀˋ, android.view.KeyEvent):void");
    }

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final int m9156(Context context, int i) {
        if (i != -100) {
            if (i != -1) {
                if (i != 0) {
                    if (i != 1 && i != 2) {
                        if (i != 3) {
                            ᵹˉᵞ.ᵳٴᵶ("Unknown value set for night mode. Please use one of the MODE_NIGHT values from AppCompatDelegate.");
                            return 0;
                        }
                        if (this.f15780 == null) {
                            this.f15780 = new C5400(this, context);
                        }
                        return this.f15780.mo5297();
                    }
                } else if (((UiModeManager) context.getApplicationContext().getSystemService("uimode")).getNightMode() != 0) {
                    return m9159(context).mo5297();
                }
            }
            return i;
        }
        return -1;
    }

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final void m9157(int i) {
        this.f15789 = (1 << i) | this.f15789;
        if (this.f15746) {
            return;
        }
        View decorView = this.f15775.getDecorView();
        WeakHashMap weakHashMap = AbstractC2873.f11133;
        decorView.postOnAnimation(this.f15764);
        this.f15746 = true;
    }

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final void m9158() {
        if (this.f15783) {
            throw new AndroidRuntimeException("Window feature must be requested before adding content");
        }
    }

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final AbstractC1891 m9159(Context context) {
        if (this.f15748 == null) {
            if (C1601.f6351 == null) {
                Context applicationContext = context.getApplicationContext();
                C1601.f6351 = new C1601(applicationContext, (LocationManager) applicationContext.getSystemService("location"));
            }
            this.f15748 = new C5400(this, C1601.f6351);
        }
        return this.f15748;
    }

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public final void m9160() {
        ViewGroup viewGroup;
        if (this.f15783) {
            return;
        }
        Context context = this.f15779;
        int[] iArr = AbstractC0542.f2823;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(iArr);
        if (!typedArrayObtainStyledAttributes.hasValue(117)) {
            typedArrayObtainStyledAttributes.recycle();
            ᵹˉᵞ.ᵳٴᵶ("You need to use a Theme.AppCompat theme (or descendant) with this activity.");
            return;
        }
        if (typedArrayObtainStyledAttributes.getBoolean(126, false)) {
            mo9089(1);
        } else if (typedArrayObtainStyledAttributes.getBoolean(117, false)) {
            mo9089(108);
        }
        if (typedArrayObtainStyledAttributes.getBoolean(118, false)) {
            mo9089(109);
        }
        if (typedArrayObtainStyledAttributes.getBoolean(119, false)) {
            mo9089(10);
        }
        this.f15787 = typedArrayObtainStyledAttributes.getBoolean(0, false);
        typedArrayObtainStyledAttributes.recycle();
        m9153();
        this.f15775.getDecorView();
        LayoutInflater layoutInflaterFrom = LayoutInflater.from(context);
        if (this.f15759) {
            viewGroup = this.f15756 ? (ViewGroup) layoutInflaterFrom.inflate(ar.tvplayer.tv.R.layout._11_res_0x7f0e0016, (ViewGroup) null) : (ViewGroup) layoutInflaterFrom.inflate(ar.tvplayer.tv.R.layout._11_res_0x7f0e0015, (ViewGroup) null);
        } else if (this.f15787) {
            viewGroup = (ViewGroup) layoutInflaterFrom.inflate(ar.tvplayer.tv.R.layout._11_res_0x7f0e000c, (ViewGroup) null);
            this.f15749 = false;
            this.f15791 = false;
        } else if (this.f15791) {
            TypedValue typedValue = new TypedValue();
            context.getTheme().resolveAttribute(ar.tvplayer.tv.R.attr._11_res_0x7f04000b, typedValue, true);
            viewGroup = (ViewGroup) LayoutInflater.from(typedValue.resourceId != 0 ? new C4416(context, typedValue.resourceId) : context).inflate(ar.tvplayer.tv.R.layout._11_res_0x7f0e0017, (ViewGroup) null);
            ActionBarOverlayLayout actionBarOverlayLayout = (ActionBarOverlayLayout) viewGroup.findViewById(ar.tvplayer.tv.R.id._11_res_0x7f0b0119);
            this.f15793 = actionBarOverlayLayout;
            actionBarOverlayLayout.setWindowCallback(this.f15775.getCallback());
            if (this.f15749) {
                this.f15793.m25(109);
            }
            if (this.f15761) {
                this.f15793.m25(2);
            }
            if (this.f15778) {
                this.f15793.m25(5);
            }
        } else {
            viewGroup = null;
        }
        if (viewGroup == null) {
            StringBuilder sb = new StringBuilder("AppCompat does not support the current theme features: { windowActionBar: ");
            sb.append(this.f15791);
            sb.append(", windowActionBarOverlay: ");
            sb.append(this.f15749);
            sb.append(", android:windowIsFloating: ");
            sb.append(this.f15787);
            sb.append(", windowActionModeOverlay: ");
            sb.append(this.f15756);
            sb.append(", windowNoTitle: ");
            ᵹˉᵞ.ˌᵜᵹᵩ(AbstractC1327.m4090(sb, this.f15759, " }"));
            return;
        }
        C1819 c1819 = new C1819(this);
        WeakHashMap weakHashMap = AbstractC2873.f11133;
        AbstractC5164.m10665(viewGroup, c1819);
        if (this.f15793 == null) {
            this.f15755 = (TextView) viewGroup.findViewById(ar.tvplayer.tv.R.id.title);
        }
        boolean z = AbstractC2335.f9156;
        try {
            Method method = viewGroup.getClass().getMethod("makeOptionalFitsSystemWindows", null);
            if (!method.isAccessible()) {
                method.setAccessible(true);
            }
            method.invoke(viewGroup, null);
        } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException unused) {
        }
        ContentFrameLayout contentFrameLayout = (ContentFrameLayout) viewGroup.findViewById(ar.tvplayer.tv.R.id._11_res_0x7f0b003c);
        ViewGroup viewGroup2 = (ViewGroup) this.f15775.findViewById(R.id.content);
        if (viewGroup2 != null) {
            while (viewGroup2.getChildCount() > 0) {
                View childAt = viewGroup2.getChildAt(0);
                viewGroup2.removeViewAt(0);
                contentFrameLayout.addView(childAt);
            }
            viewGroup2.setId(-1);
            contentFrameLayout.setId(R.id.content);
            if (viewGroup2 instanceof FrameLayout) {
                ((FrameLayout) viewGroup2).setForeground(null);
            }
        }
        this.f15775.setContentView(viewGroup);
        contentFrameLayout.setAttachListener(new ˊᵘʛ(7, this));
        this.f15770 = viewGroup;
        Object obj = this.f15760;
        CharSequence title = obj instanceof Activity ? ((Activity) obj).getTitle() : this.f15751;
        if (!TextUtils.isEmpty(title)) {
            ActionBarOverlayLayout actionBarOverlayLayout2 = this.f15793;
            if (actionBarOverlayLayout2 != null) {
                actionBarOverlayLayout2.setWindowTitle(title);
            } else {
                C3966 c3966 = this.f15763;
                if (c3966 != null) {
                    C0062 c0062 = (C0062) c3966.f14955;
                    if (!c0062.f1268) {
                        Toolbar toolbar = c0062.f1272;
                        c0062.f1279 = title;
                        if ((c0062.f1276 & 8) != 0) {
                            toolbar.setTitle(title);
                            if (c0062.f1268) {
                                AbstractC2873.m7018(toolbar.getRootView(), title);
                            }
                        }
                    }
                } else {
                    TextView textView = this.f15755;
                    if (textView != null) {
                        textView.setText(title);
                    }
                }
            }
        }
        ContentFrameLayout contentFrameLayout2 = (ContentFrameLayout) this.f15770.findViewById(R.id.content);
        View decorView = this.f15775.getDecorView();
        contentFrameLayout2.f157.set(decorView.getPaddingLeft(), decorView.getPaddingTop(), decorView.getPaddingRight(), decorView.getPaddingBottom());
        if (contentFrameLayout2.isLaidOut()) {
            contentFrameLayout2.requestLayout();
        }
        TypedArray typedArrayObtainStyledAttributes2 = context.obtainStyledAttributes(iArr);
        typedArrayObtainStyledAttributes2.getValue(124, contentFrameLayout2.getMinWidthMajor());
        typedArrayObtainStyledAttributes2.getValue(125, contentFrameLayout2.getMinWidthMinor());
        if (typedArrayObtainStyledAttributes2.hasValue(122)) {
            typedArrayObtainStyledAttributes2.getValue(122, contentFrameLayout2.getFixedWidthMajor());
        }
        if (typedArrayObtainStyledAttributes2.hasValue(123)) {
            typedArrayObtainStyledAttributes2.getValue(123, contentFrameLayout2.getFixedWidthMinor());
        }
        if (typedArrayObtainStyledAttributes2.hasValue(120)) {
            typedArrayObtainStyledAttributes2.getValue(120, contentFrameLayout2.getFixedHeightMajor());
        }
        if (typedArrayObtainStyledAttributes2.hasValue(121)) {
            typedArrayObtainStyledAttributes2.getValue(121, contentFrameLayout2.getFixedHeightMinor());
        }
        typedArrayObtainStyledAttributes2.recycle();
        contentFrameLayout2.requestLayout();
        this.f15783 = true;
        C1017 c1017M9167 = m9167(0);
        if (this.f15771 || c1017M9167.f4474 != null) {
            return;
        }
        m9157(108);
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final void m9161(int i, C1017 c1017, MenuC2418 menuC2418) {
        if (menuC2418 == null) {
            if (c1017 == null && i >= 0) {
                C1017[] c1017Arr = this.f15747;
                if (i < c1017Arr.length) {
                    c1017 = c1017Arr[i];
                }
            }
            if (c1017 != null) {
                menuC2418 = c1017.f4474;
            }
        }
        if ((c1017 == null || c1017.f4469) && !this.f15771) {
            WindowCallbackC1403 windowCallbackC1403 = this.f15788;
            Window.Callback callback = this.f15775.getCallback();
            windowCallbackC1403.getClass();
            try {
                windowCallbackC1403.f5754 = true;
                callback.onPanelClosed(i, menuC2418);
            } finally {
                windowCallbackC1403.f5754 = false;
            }
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:19:0x0044, code lost:
    
        if (r6.m3451() != false) goto L20;
     */
    @Override // defpackage.InterfaceC3085
    /* renamed from: ᵮᵠـˌ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void mo3245(defpackage.MenuC2418 r6) {
        /*
            Method dump skipped, instructions count: 231
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.LayoutInflaterFactory2C4211.mo3245(ᵗʚ):void");
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public final void m9162(MenuC2418 menuC2418) {
        C1065 c1065;
        if (this.f15768) {
            return;
        }
        this.f15768 = true;
        ActionBarOverlayLayout actionBarOverlayLayout = this.f15793;
        actionBarOverlayLayout.m28();
        ActionMenuView actionMenuView = ((C0062) actionBarOverlayLayout.f128).f1272.f243;
        if (actionMenuView != null && (c1065 = actionMenuView.f145) != null) {
            c1065.m3446();
            C5153 c5153 = c1065.f4614;
            if (c5153 != null && c5153.m8477()) {
                c5153.f14259.dismiss();
            }
        }
        Window.Callback callback = this.f15775.getCallback();
        if (callback != null && !this.f15771) {
            callback.onPanelClosed(108, menuC2418);
        }
        this.f15768 = false;
    }

    @Override // defpackage.AbstractC4175
    /* renamed from: ᵴᵳ */
    public final void mo9094() {
        String str;
        this.f15752 = true;
        m9164(false, true);
        m9153();
        Object obj = this.f15760;
        if (obj instanceof Activity) {
            try {
                Activity activity = (Activity) obj;
                try {
                    str = ᵮʛˀ.ᵸˑ(activity, activity.getComponentName());
                } catch (PackageManager.NameNotFoundException e) {
                    throw new IllegalArgumentException(e);
                }
            } catch (IllegalArgumentException unused) {
                str = null;
            }
            if (str != null) {
                C3966 c3966 = this.f15763;
                if (c3966 == null) {
                    this.f15786 = true;
                } else {
                    c3966.m8791(true);
                }
            }
            synchronized (AbstractC4175.f15599) {
                AbstractC4175.m9088(this);
                AbstractC4175.f15597.add(new WeakReference(this));
            }
        }
        this.f15773 = new Configuration(this.f15779.getResources().getConfiguration());
        this.f15792 = true;
    }

    @Override // defpackage.AbstractC4175
    /* renamed from: ᵶᵷᵕ */
    public final void mo9095(CharSequence charSequence) {
        this.f15751 = charSequence;
        ActionBarOverlayLayout actionBarOverlayLayout = this.f15793;
        if (actionBarOverlayLayout != null) {
            actionBarOverlayLayout.setWindowTitle(charSequence);
            return;
        }
        C3966 c3966 = this.f15763;
        if (c3966 == null) {
            TextView textView = this.f15755;
            if (textView != null) {
                textView.setText(charSequence);
                return;
            }
            return;
        }
        C0062 c0062 = (C0062) c3966.f14955;
        if (c0062.f1268) {
            return;
        }
        Toolbar toolbar = c0062.f1272;
        c0062.f1279 = charSequence;
        if ((c0062.f1276 & 8) != 0) {
            toolbar.setTitle(charSequence);
            if (c0062.f1268) {
                AbstractC2873.m7018(toolbar.getRootView(), charSequence);
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:21:0x003f  */
    /* JADX WARN: Removed duplicated region for block: B:78:0x00fd  */
    /* JADX WARN: Removed duplicated region for block: B:91:0x011b  */
    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean m9163(android.view.KeyEvent r7) {
        /*
            Method dump skipped, instructions count: 319
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.LayoutInflaterFactory2C4211.m9163(android.view.KeyEvent):boolean");
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:71:0x00f7  */
    /* renamed from: ᵸˑ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean m9164(boolean r17, boolean r18) {
        /*
            Method dump skipped, instructions count: 588
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.LayoutInflaterFactory2C4211.m9164(boolean, boolean):boolean");
    }

    @Override // defpackage.InterfaceC3085
    /* renamed from: ᵹᵝᵶ */
    public final boolean mo3251(MenuC2418 menuC2418, MenuItem menuItem) {
        C1017 c1017;
        Window.Callback callback = this.f15775.getCallback();
        if (callback != null && !this.f15771) {
            MenuC2418 menuC2418Mo2618 = menuC2418.mo2618();
            C1017[] c1017Arr = this.f15747;
            int length = c1017Arr != null ? c1017Arr.length : 0;
            int i = 0;
            while (true) {
                if (i < length) {
                    c1017 = c1017Arr[i];
                    if (c1017 != null && c1017.f4474 == menuC2418Mo2618) {
                        break;
                    }
                    i++;
                } else {
                    c1017 = null;
                    break;
                }
            }
            if (c1017 != null) {
                return callback.onMenuItemSelected(c1017.f4467, menuItem);
            }
        }
        return false;
    }

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public final void m9165() {
        C1223 c1223;
        if (Build.VERSION.SDK_INT >= 33) {
            boolean z = false;
            if (this.f15774 != null && (m9167(0).f4469 || this.f15762 != null)) {
                z = true;
            }
            if (z && this.f15782 == null) {
                this.f15782 = AbstractC2777.m6860(this.f15774, this);
            } else {
                if (z || (c1223 = this.f15782) == null) {
                    return;
                }
                AbstractC2777.m6857(this.f15774, c1223);
                this.f15782 = null;
            }
        }
    }

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final void m9166() {
        m9160();
        if (this.f15791 && this.f15763 == null) {
            Object obj = this.f15760;
            if (obj instanceof Activity) {
                this.f15763 = new C3966((Activity) obj, this.f15749);
            } else if (obj instanceof Dialog) {
                this.f15763 = new C3966((Dialog) obj);
            }
            C3966 c3966 = this.f15763;
            if (c3966 != null) {
                c3966.m8791(this.f15786);
            }
        }
    }

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final C1017 m9167(int i) {
        C1017[] c1017Arr = this.f15747;
        if (c1017Arr == null || c1017Arr.length <= i) {
            C1017[] c1017Arr2 = new C1017[i + 1];
            if (c1017Arr != null) {
                System.arraycopy(c1017Arr, 0, c1017Arr2, 0, c1017Arr.length);
            }
            this.f15747 = c1017Arr2;
            c1017Arr = c1017Arr2;
        }
        C1017 c1017 = c1017Arr[i];
        if (c1017 != null) {
            return c1017;
        }
        C1017 c10172 = new C1017();
        c10172.f4467 = i;
        c10172.f4468 = false;
        c1017Arr[i] = c10172;
        return c10172;
    }
}
