package o;

import android.app.ActivityManager;
import android.app.Application;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Process;
import android.text.InputFilter;
import android.util.Log;
import android.util.Xml;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import com.google.android.gms.common.util.ProcessUtils;
import com.google.android.material.internal.CheckableImageButton;
import com.google.android.material.textfield.TextInputLayout;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import org.xmlpull.v1.XmlSerializer;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public abstract class IJ {
    public static final C2943xq b;
    public static final C2943xq c;
    public static Method j;
    public static Method k;
    public static boolean l;
    public static final Object a = new Object();
    public static final L60[] d = new L60[0];
    public static final Object e = new Object();
    public static final Object f = new Object();
    public static final Object g = new Object();
    public static final Object h = new Object();
    public static final Object i = new Object();

    static {
        int i2 = 4;
        b = new C2943xq("REMOVED_TASK", i2);
        c = new C2943xq("CLOSED_EMPTY", i2);
    }

    /* JADX WARN: Code restructure failed: missing block: B:22:0x003d, code lost:
    
        r1 = r3.getAttributeValue(null, "application_locales");
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static java.lang.String A(android.content.Context r8) {
        /*
            java.lang.Object r0 = o.IJ.a
            monitor-enter(r0)
            java.lang.String r1 = ""
            java.lang.String r2 = "androidx.appcompat.app.AppCompatDelegate.application_locales_record_file"
            java.io.FileInputStream r2 = r8.openFileInput(r2)     // Catch: java.lang.Throwable -> L4a java.io.FileNotFoundException -> L63
            org.xmlpull.v1.XmlPullParser r3 = android.util.Xml.newPullParser()     // Catch: java.lang.Throwable -> L29 java.lang.Throwable -> L52
            java.lang.String r4 = "UTF-8"
            r3.setInput(r2, r4)     // Catch: java.lang.Throwable -> L29 java.lang.Throwable -> L52
            int r4 = r3.getDepth()     // Catch: java.lang.Throwable -> L29 java.lang.Throwable -> L52
        L18:
            int r5 = r3.next()     // Catch: java.lang.Throwable -> L29 java.lang.Throwable -> L52
            r6 = 1
            if (r5 == r6) goto L44
            r6 = 3
            if (r5 != r6) goto L2b
            int r7 = r3.getDepth()     // Catch: java.lang.Throwable -> L29 java.lang.Throwable -> L52
            if (r7 <= r4) goto L44
            goto L2b
        L29:
            r8 = move-exception
            goto L4c
        L2b:
            if (r5 == r6) goto L18
            r6 = 4
            if (r5 != r6) goto L31
            goto L18
        L31:
            java.lang.String r5 = r3.getName()     // Catch: java.lang.Throwable -> L29 java.lang.Throwable -> L52
            java.lang.String r6 = "locales"
            boolean r5 = r5.equals(r6)     // Catch: java.lang.Throwable -> L29 java.lang.Throwable -> L52
            if (r5 == 0) goto L18
            java.lang.String r4 = "application_locales"
            r5 = 0
            java.lang.String r1 = r3.getAttributeValue(r5, r4)     // Catch: java.lang.Throwable -> L29 java.lang.Throwable -> L52
        L44:
            if (r2 == 0) goto L55
        L46:
            r2.close()     // Catch: java.lang.Throwable -> L4a java.io.IOException -> L55
            goto L55
        L4a:
            r8 = move-exception
            goto L65
        L4c:
            if (r2 == 0) goto L51
            r2.close()     // Catch: java.lang.Throwable -> L4a java.io.IOException -> L51
        L51:
            throw r8     // Catch: java.lang.Throwable -> L4a
        L52:
            if (r2 == 0) goto L55
            goto L46
        L55:
            boolean r2 = r1.isEmpty()     // Catch: java.lang.Throwable -> L4a
            if (r2 != 0) goto L5c
            goto L61
        L5c:
            java.lang.String r2 = "androidx.appcompat.app.AppCompatDelegate.application_locales_record_file"
            r8.deleteFile(r2)     // Catch: java.lang.Throwable -> L4a
        L61:
            monitor-exit(r0)     // Catch: java.lang.Throwable -> L4a
            return r1
        L63:
            monitor-exit(r0)     // Catch: java.lang.Throwable -> L4a
            return r1
        L65:
            monitor-exit(r0)     // Catch: java.lang.Throwable -> L4a
            throw r8
        */
        throw new UnsupportedOperationException("Method not decompiled: o.IJ.A(android.content.Context):java.lang.String");
    }

    public static final Object B(Object obj) {
        return obj instanceof C2075oj ? new H20(((C2075oj) obj).a) : obj;
    }

    public static void C(TextInputLayout textInputLayout, CheckableImageButton checkableImageButton, ColorStateList colorStateList) {
        Drawable drawable = checkableImageButton.getDrawable();
        if (checkableImageButton.getDrawable() == null || colorStateList == null || !colorStateList.isStateful()) {
            return;
        }
        int[] drawableState = textInputLayout.getDrawableState();
        int[] drawableState2 = checkableImageButton.getDrawableState();
        int length = drawableState.length;
        int[] iArrCopyOf = Arrays.copyOf(drawableState, drawableState.length + drawableState2.length);
        System.arraycopy(drawableState2, 0, iArrCopyOf, length, drawableState2.length);
        int colorForState = colorStateList.getColorForState(iArrCopyOf, colorStateList.getDefaultColor());
        Drawable drawableMutate = drawable.mutate();
        drawableMutate.setTintList(ColorStateList.valueOf(colorForState));
        checkableImageButton.setImageDrawable(drawableMutate);
    }

    public static void F(CheckableImageButton checkableImageButton, View.OnLongClickListener onLongClickListener) {
        WeakHashMap weakHashMap = Oj0.a;
        boolean zHasOnClickListeners = checkableImageButton.hasOnClickListeners();
        boolean z = onLongClickListener != null;
        boolean z2 = zHasOnClickListeners || z;
        checkableImageButton.setFocusable(z2);
        checkableImageButton.setClickable(zHasOnClickListeners);
        checkableImageButton.setPressable(zHasOnClickListeners);
        checkableImageButton.setLongClickable(z);
        checkableImageButton.setImportantForAccessibility(z2 ? 1 : 2);
    }

    public static C1201fa0 G(float f2, float f3, Object obj, int i2) {
        if ((i2 & 1) != 0) {
            f2 = 1.0f;
        }
        if ((i2 & 2) != 0) {
            f3 = 1500.0f;
        }
        if ((i2 & 4) != 0) {
            obj = null;
        }
        return new C1201fa0(f2, f3, obj);
    }

    public static final void H(Object obj) {
        if (obj instanceof H20) {
            throw ((H20) obj).l;
        }
    }

    public static final void I(List list, O4 o4) {
        Path path;
        int i2;
        float f2;
        int i3;
        AbstractC1958nW abstractC1958nW;
        float f3;
        float f4;
        float f5;
        float f6;
        float f7;
        float f8;
        float f9;
        float f10;
        List list2 = list;
        Path path2 = o4.a;
        Path path3 = o4.a;
        Path.FillType fillType = path2.getFillType();
        Path.FillType fillType2 = Path.FillType.EVEN_ODD;
        boolean z = fillType == fillType2;
        path3.rewind();
        if (!z) {
            fillType2 = Path.FillType.WINDING;
        }
        path3.setFillType(fillType2);
        AbstractC1958nW abstractC1958nW2 = list2.isEmpty() ? VV.c : (AbstractC1958nW) list2.get(0);
        int size = list2.size();
        float f11 = 0.0f;
        int i4 = 0;
        float f12 = 0.0f;
        float f13 = 0.0f;
        float f14 = 0.0f;
        float f15 = 0.0f;
        float f16 = 0.0f;
        float f17 = 0.0f;
        while (i4 < size) {
            AbstractC1958nW abstractC1958nW3 = (AbstractC1958nW) list2.get(i4);
            if (abstractC1958nW3 instanceof VV) {
                path3.close();
                path = path3;
                i2 = size;
                f2 = f11;
                i3 = i4;
                abstractC1958nW = abstractC1958nW3;
                f12 = f16;
                f14 = f12;
                f13 = f17;
                f15 = f13;
            } else {
                if (abstractC1958nW3 instanceof C1388hW) {
                    C1388hW c1388hW = (C1388hW) abstractC1958nW3;
                    float f18 = c1388hW.c;
                    f14 += f18;
                    float f19 = c1388hW.d;
                    f15 += f19;
                    path3.rMoveTo(f18, f19);
                    path = path3;
                    i2 = size;
                    f2 = f11;
                    i3 = i4;
                    f16 = f14;
                    f17 = f15;
                } else {
                    if (abstractC1958nW3 instanceof ZV) {
                        ZV zv = (ZV) abstractC1958nW3;
                        float f20 = zv.c;
                        float f21 = zv.d;
                        path3.moveTo(f20, f21);
                        f15 = f21;
                        f17 = f15;
                        path = path3;
                        f14 = f20;
                        f16 = f14;
                    } else {
                        if (abstractC1958nW3 instanceof C1292gW) {
                            C1292gW c1292gW = (C1292gW) abstractC1958nW3;
                            float f22 = c1292gW.d;
                            float f23 = c1292gW.c;
                            path3.rLineTo(f23, f22);
                            f14 += f23;
                            f15 += f22;
                        } else if (abstractC1958nW3 instanceof YV) {
                            YV yv = (YV) abstractC1958nW3;
                            float f24 = yv.d;
                            float f25 = yv.c;
                            path3.lineTo(f25, f24);
                            f14 = f25;
                            path = path3;
                            f15 = f24;
                        } else if (abstractC1958nW3 instanceof C1196fW) {
                            float f26 = ((C1196fW) abstractC1958nW3).c;
                            path3.rLineTo(f26, f11);
                            f14 += f26;
                        } else if (abstractC1958nW3 instanceof XV) {
                            float f27 = ((XV) abstractC1958nW3).c;
                            path3.lineTo(f27, f15);
                            f14 = f27;
                        } else {
                            if (abstractC1958nW3 instanceof C1768lW) {
                                f10 = ((C1768lW) abstractC1958nW3).c;
                                path3.rLineTo(f11, f10);
                            } else if (abstractC1958nW3 instanceof C1863mW) {
                                float f28 = ((C1863mW) abstractC1958nW3).c;
                                path3.lineTo(f14, f28);
                                f15 = f28;
                            } else if (abstractC1958nW3 instanceof C1100eW) {
                                C1100eW c1100eW = (C1100eW) abstractC1958nW3;
                                path3.rCubicTo(c1100eW.c, c1100eW.d, c1100eW.e, c1100eW.f, c1100eW.g, c1100eW.h);
                                f12 = c1100eW.e + f14;
                                f13 = c1100eW.f + f15;
                                f14 += c1100eW.g;
                                f10 = c1100eW.h;
                            } else {
                                if (abstractC1958nW3 instanceof WV) {
                                    WV wv = (WV) abstractC1958nW3;
                                    path3.cubicTo(wv.c, wv.d, wv.e, wv.f, wv.g, wv.h);
                                    f12 = wv.e;
                                    f13 = wv.f;
                                    f6 = wv.g;
                                    f7 = wv.h;
                                } else if (abstractC1958nW3 instanceof C1578jW) {
                                    if (abstractC1958nW2.a) {
                                        f9 = f15 - f13;
                                        f8 = f14 - f12;
                                    } else {
                                        f8 = f11;
                                        f9 = f8;
                                    }
                                    C1578jW c1578jW = (C1578jW) abstractC1958nW3;
                                    path3.rCubicTo(f8, f9, c1578jW.c, c1578jW.d, c1578jW.e, c1578jW.f);
                                    f12 = c1578jW.c + f14;
                                    f13 = c1578jW.d + f15;
                                    f14 += c1578jW.e;
                                    f10 = c1578jW.f;
                                } else if (abstractC1958nW3 instanceof C0814bW) {
                                    if (abstractC1958nW2.a) {
                                        float f29 = 2;
                                        f14 = (f14 * f29) - f12;
                                        f15 = (f29 * f15) - f13;
                                    }
                                    C0814bW c0814bW = (C0814bW) abstractC1958nW3;
                                    path3.cubicTo(f14, f15, c0814bW.c, c0814bW.d, c0814bW.e, c0814bW.f);
                                    f12 = c0814bW.c;
                                    f13 = c0814bW.d;
                                    f6 = c0814bW.e;
                                    f7 = c0814bW.f;
                                } else if (abstractC1958nW3 instanceof C1484iW) {
                                    C1484iW c1484iW = (C1484iW) abstractC1958nW3;
                                    float f30 = c1484iW.f;
                                    float f31 = c1484iW.e;
                                    float f32 = c1484iW.d;
                                    float f33 = c1484iW.c;
                                    path3.rQuadTo(f33, f32, f31, f30);
                                    float f34 = f33 + f14;
                                    float f35 = f32 + f15;
                                    f14 += f31;
                                    f15 += f30;
                                    f12 = f34;
                                    path = path3;
                                    f13 = f35;
                                } else {
                                    if (abstractC1958nW3 instanceof C0718aW) {
                                        C0718aW c0718aW = (C0718aW) abstractC1958nW3;
                                        float f36 = c0718aW.f;
                                        float f37 = c0718aW.e;
                                        float f38 = c0718aW.d;
                                        f5 = c0718aW.c;
                                        path3.quadTo(f5, f38, f37, f36);
                                        path = path3;
                                        f15 = f36;
                                        f14 = f37;
                                        f13 = f38;
                                    } else if (abstractC1958nW3 instanceof C1673kW) {
                                        if (abstractC1958nW2.b) {
                                            f3 = f14 - f12;
                                            f4 = f15 - f13;
                                        } else {
                                            f3 = f11;
                                            f4 = f3;
                                        }
                                        C1673kW c1673kW = (C1673kW) abstractC1958nW3;
                                        float f39 = c1673kW.d;
                                        float f40 = c1673kW.c;
                                        path3.rQuadTo(f3, f4, f40, f39);
                                        f5 = f3 + f14;
                                        float f41 = f4 + f15;
                                        f14 += f40;
                                        f15 += f39;
                                        path = path3;
                                        f13 = f41;
                                    } else if (abstractC1958nW3 instanceof C0909cW) {
                                        if (abstractC1958nW2.b) {
                                            float f42 = 2;
                                            f14 = (f14 * f42) - f12;
                                            f15 = (f42 * f15) - f13;
                                        }
                                        C0909cW c0909cW = (C0909cW) abstractC1958nW3;
                                        float f43 = c0909cW.d;
                                        float f44 = c0909cW.c;
                                        path3.quadTo(f14, f15, f44, f43);
                                        path = path3;
                                        i2 = size;
                                        f2 = f11;
                                        i3 = i4;
                                        f13 = f15;
                                        abstractC1958nW = abstractC1958nW3;
                                        f15 = f43;
                                        f12 = f14;
                                        f14 = f44;
                                    } else if (abstractC1958nW3 instanceof C1005dW) {
                                        C1005dW c1005dW = (C1005dW) abstractC1958nW3;
                                        float f45 = c1005dW.h + f14;
                                        float f46 = c1005dW.i + f15;
                                        i2 = size;
                                        f2 = 0.0f;
                                        path = path3;
                                        i3 = i4;
                                        k(o4, f14, f15, f45, f46, c1005dW.c, c1005dW.d, c1005dW.e, c1005dW.f, c1005dW.g);
                                        f12 = f45;
                                        f14 = f12;
                                        f13 = f46;
                                        f15 = f13;
                                        abstractC1958nW = abstractC1958nW3;
                                    } else {
                                        path = path3;
                                        i2 = size;
                                        f2 = f11;
                                        i3 = i4;
                                        if (!(abstractC1958nW3 instanceof UV)) {
                                            throw new C2170pj();
                                        }
                                        UV uv = (UV) abstractC1958nW3;
                                        float f47 = uv.i;
                                        float f48 = uv.h;
                                        abstractC1958nW = abstractC1958nW3;
                                        k(o4, f14, f15, f48, f47, uv.c, uv.d, uv.e, uv.f, uv.g);
                                        f13 = f47;
                                        f15 = f13;
                                        f12 = f48;
                                        f14 = f12;
                                    }
                                    i2 = size;
                                    f2 = f11;
                                    i3 = i4;
                                    abstractC1958nW = abstractC1958nW3;
                                    f12 = f5;
                                }
                                f15 = f7;
                                path = path3;
                                f14 = f6;
                            }
                            f15 += f10;
                        }
                        path = path3;
                    }
                    i2 = size;
                    f2 = f11;
                    i3 = i4;
                }
                abstractC1958nW = abstractC1958nW3;
            }
            i4 = i3 + 1;
            list2 = list;
            size = i2;
            path3 = path;
            abstractC1958nW2 = abstractC1958nW;
            f11 = f2;
        }
    }

    public static String J(int i2) {
        return i2 == 0 ? "Clear" : i2 == 1 ? "Src" : i2 == 2 ? "Dst" : i2 == 3 ? "SrcOver" : i2 == 4 ? "DstOver" : i2 == 5 ? "SrcIn" : i2 == 6 ? "DstIn" : i2 == 7 ? "SrcOut" : i2 == 8 ? "DstOut" : i2 == 9 ? "SrcAtop" : i2 == 10 ? "DstAtop" : i2 == 11 ? "Xor" : i2 == 12 ? "Plus" : i2 == 13 ? "Modulate" : i2 == 14 ? "Screen" : i2 == 15 ? "Overlay" : i2 == 16 ? "Darken" : i2 == 17 ? "Lighten" : i2 == 18 ? "ColorDodge" : i2 == 19 ? "ColorBurn" : i2 == 20 ? "HardLight" : i2 == 21 ? "Softlight" : i2 == 22 ? "Difference" : i2 == 23 ? "Exclusion" : i2 == 24 ? "Multiply" : i2 == 25 ? "Hue" : i2 == 26 ? "Saturation" : i2 == 27 ? "Color" : i2 == 28 ? "Luminosity" : "Unknown";
    }

    public static C1311gh0 K(int i2, int i3, InterfaceC0564Vt interfaceC0564Vt) {
        if ((i3 & 1) != 0) {
            i2 = 300;
        }
        int i4 = (i3 & 2) != 0 ? 0 : 90;
        if ((i3 & 4) != 0) {
            interfaceC0564Vt = AbstractC0590Wt.a;
        }
        return new C1311gh0(i2, i4, interfaceC0564Vt);
    }

    public static final long a(float f2, float f3) {
        long jFloatToRawIntBits = (Float.floatToRawIntBits(f3) & 4294967295L) | (Float.floatToRawIntBits(f2) << 32);
        int i2 = C1690kg0.c;
        return jFloatToRawIntBits;
    }

    public static void b(TextInputLayout textInputLayout, CheckableImageButton checkableImageButton, ColorStateList colorStateList, PorterDuff.Mode mode) {
        Drawable drawable = checkableImageButton.getDrawable();
        if (drawable != null) {
            drawable = drawable.mutate();
            if (colorStateList == null || !colorStateList.isStateful()) {
                drawable.setTintList(colorStateList);
            } else {
                int[] drawableState = textInputLayout.getDrawableState();
                int[] drawableState2 = checkableImageButton.getDrawableState();
                int length = drawableState.length;
                int[] iArrCopyOf = Arrays.copyOf(drawableState, drawableState.length + drawableState2.length);
                System.arraycopy(drawableState2, 0, iArrCopyOf, length, drawableState2.length);
                drawable.setTintList(ColorStateList.valueOf(colorStateList.getColorForState(iArrCopyOf, colorStateList.getDefaultColor())));
            }
            if (mode != null) {
                drawable.setTintMode(mode);
            }
        }
        if (checkableImageButton.getDrawable() != drawable) {
            checkableImageButton.setImageDrawable(drawable);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:20:0x005d A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:23:0x0069  */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /* JADX WARN: Type inference failed for: r9v4, types: [java.lang.Object, java.util.Collection, java.util.List] */
    /* JADX WARN: Type inference failed for: r9v8, types: [java.lang.Object, java.util.Collection, java.util.List] */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:19:0x005b -> B:21:0x005e). Please report as a decompilation issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final java.lang.Object c(o.Vb0 r7, o.DX r8, o.AbstractC0728ad r9) {
        /*
            boolean r0 = r9 instanceof o.RA
            if (r0 == 0) goto L13
            r0 = r9
            o.RA r0 = (o.RA) r0
            int r1 = r0.r
            r2 = -2147483648(0xffffffff80000000, float:-0.0)
            r3 = r1 & r2
            if (r3 == 0) goto L13
            int r1 = r1 - r2
            r0.r = r1
            goto L18
        L13:
            o.RA r0 = new o.RA
            r0.<init>(r9)
        L18:
            java.lang.Object r9 = r0.q
            int r1 = r0.r
            r2 = 0
            r3 = 1
            if (r1 == 0) goto L35
            if (r1 != r3) goto L2d
            o.DX r7 = r0.p
            o.Vb0 r8 = r0.f311o
            H(r9)
            r6 = r8
            r8 = r7
            r7 = r6
            goto L5e
        L2d:
            java.lang.IllegalStateException r7 = new java.lang.IllegalStateException
            java.lang.String r8 = "call to 'resume' before 'invoke' with coroutine"
            r7.<init>(r8)
            throw r7
        L35:
            H(r9)
            o.Wb0 r9 = r7.p
            o.CX r9 = r9.D
            java.lang.Object r9 = r9.a
            int r1 = r9.size()
            r4 = r2
        L43:
            if (r4 >= r1) goto L7a
            java.lang.Object r5 = r9.get(r4)
            o.IX r5 = (o.IX) r5
            boolean r5 = r5.d
            if (r5 == 0) goto L77
        L4f:
            r0.f311o = r7
            r0.p = r8
            r0.r = r3
            java.lang.Object r9 = r7.a(r8, r0)
            o.Dn r1 = o.EnumC0091Dn.l
            if (r9 != r1) goto L5e
            return r1
        L5e:
            o.CX r9 = (o.CX) r9
            java.lang.Object r9 = r9.a
            int r1 = r9.size()
            r4 = r2
        L67:
            if (r4 >= r1) goto L7a
            java.lang.Object r5 = r9.get(r4)
            o.IX r5 = (o.IX) r5
            boolean r5 = r5.d
            if (r5 == 0) goto L74
            goto L4f
        L74:
            int r4 = r4 + 1
            goto L67
        L77:
            int r4 = r4 + 1
            goto L43
        L7a:
            o.Oh0 r7 = o.Oh0.a
            return r7
        */
        throw new UnsupportedOperationException("Method not decompiled: o.IJ.c(o.Vb0, o.DX, o.ad):java.lang.Object");
    }

    public static final Object d(MX mx, SC sc, InterfaceC0220Im interfaceC0220Im) {
        Object objH0 = ((Wb0) mx).H0(new SA(interfaceC0220Im.h(), sc, (InterfaceC0220Im) null), interfaceC0220Im);
        return objH0 == EnumC0091Dn.l ? objH0 : Oh0.a;
    }

    public static final Set e(L60 l60) {
        if (l60 instanceof InterfaceC0446Rf) {
            return ((InterfaceC0446Rf) l60).g();
        }
        HashSet hashSet = new HashSet(l60.d());
        int iD = l60.d();
        for (int i2 = 0; i2 < iD; i2++) {
            hashSet.add(l60.e(i2));
        }
        return hashSet;
    }

    public static final C1495id0 f(InterfaceC0535Uq interfaceC0535Uq) {
        C2443sd0 c2443sd0;
        C1303gd0 c1303gd0 = new C1303gd0();
        YT.U(interfaceC0535Uq, C1684kd0.a, new S1(24, new S1(25, c1303gd0), new C2200q(1, c1303gd0, C1303gd0.class, "addFilter", "addFilter$foundation_release(Lkotlin/jvm/functions/Function1;)V", 0, 0, 3)));
        UQ uq = new UQ();
        UQ uq2 = c1303gd0.a;
        Object[] objArr = uq2.a;
        int i2 = uq2.b;
        int i3 = 0;
        boolean z = true;
        AbstractC1399hd0 abstractC1399hd0 = null;
        while (true) {
            c2443sd0 = C2443sd0.b;
            if (i3 >= i2) {
                break;
            }
            AbstractC1399hd0 abstractC1399hd02 = (AbstractC1399hd0) objArr[i3];
            if (!z || abstractC1399hd02 != c2443sd0) {
                if (abstractC1399hd02 == c2443sd0 && abstractC1399hd0 == c2443sd0) {
                    z = false;
                    break;
                    break;
                }
                if (abstractC1399hd02 != c2443sd0) {
                    UQ uq3 = c1303gd0.b;
                    Object[] objArr2 = uq3.a;
                    int i4 = uq3.b;
                    for (int i5 = 0; i5 < i4; i5++) {
                        if (!((Boolean) ((OC) objArr2[i5]).g(abstractC1399hd02)).booleanValue()) {
                            z = false;
                            break;
                        }
                    }
                }
                uq.a(abstractC1399hd02);
                z = false;
                abstractC1399hd0 = abstractC1399hd02;
            }
            i3++;
        }
        if (((AbstractC1399hd0) (uq.g() ? null : uq.a[uq.b - 1])) == c2443sd0) {
            uq.j(uq.b - 1);
        }
        SQ sq = uq.c;
        if (sq == null) {
            sq = new SQ(0, uq);
            uq.c = sq;
        }
        return new C1495id0(sq);
    }

    public static final L60[] g(List list) {
        L60[] l60Arr;
        if (list == null || list.isEmpty()) {
            list = null;
        }
        return (list == null || (l60Arr = (L60[]) list.toArray(new L60[0])) == null) ? d : l60Arr;
    }

    public static ImageView.ScaleType h(int i2) {
        return i2 != 0 ? i2 != 1 ? i2 != 2 ? i2 != 3 ? i2 != 5 ? i2 != 6 ? ImageView.ScaleType.CENTER : ImageView.ScaleType.CENTER_INSIDE : ImageView.ScaleType.CENTER_CROP : ImageView.ScaleType.FIT_END : ImageView.ScaleType.FIT_CENTER : ImageView.ScaleType.FIT_START : ImageView.ScaleType.FIT_XY;
    }

    public static DQ i(String str, String str2, AbstractC0752ap abstractC0752ap) {
        StringBuilder sb = new StringBuilder();
        sb.append("form-data; name=");
        C2804wO c2804wO = EQ.m;
        AbstractC2798wI.e(str, sb);
        if (str2 != null) {
            sb.append("; filename=");
            AbstractC2798wI.e(str2, sb);
        }
        String string = sb.toString();
        KE ke = new KE(0);
        ke.c("Content-Disposition", string);
        LE leD = ke.d();
        if (leD.a("Content-Type") != null) {
            throw new IllegalArgumentException("Unexpected header: Content-Type");
        }
        if (leD.a("Content-Length") == null) {
            return new DQ(leD, abstractC0752ap);
        }
        throw new IllegalArgumentException("Unexpected header: Content-Length");
    }

    public static void j(String str, String str2, Object obj) {
        if (Log.isLoggable(u(str), 3)) {
            String.format(str2, obj);
        }
    }

    public static final void k(O4 o4, double d2, double d3, double d4, double d5, double d6, double d7, double d8, boolean z, boolean z2) {
        double d9;
        double d10;
        double d11 = d6;
        double d12 = (d8 / 180) * 3.141592653589793d;
        double dCos = Math.cos(d12);
        double dSin = Math.sin(d12);
        double d13 = ((d3 * dSin) + (d2 * dCos)) / d11;
        double d14 = ((d3 * dCos) + ((-d2) * dSin)) / d7;
        double d15 = ((d5 * dSin) + (d4 * dCos)) / d11;
        double d16 = ((d5 * dCos) + ((-d4) * dSin)) / d7;
        double d17 = d13 - d15;
        double d18 = d14 - d16;
        double d19 = 2;
        double d20 = (d13 + d15) / d19;
        double d21 = (d14 + d16) / d19;
        double d22 = (d18 * d18) + (d17 * d17);
        if (d22 == 0.0d) {
            return;
        }
        double d23 = (1.0d / d22) - 0.25d;
        if (d23 < 0.0d) {
            double dSqrt = (float) (Math.sqrt(d22) / 1.99999d);
            k(o4, d2, d3, d4, d5, d11 * dSqrt, d7 * dSqrt, d8, z, z2);
            return;
        }
        double dSqrt2 = Math.sqrt(d23);
        double d24 = d17 * dSqrt2;
        double d25 = dSqrt2 * d18;
        if (z == z2) {
            d9 = d20 - d25;
            d10 = d21 + d24;
        } else {
            d9 = d20 + d25;
            d10 = d21 - d24;
        }
        double dAtan2 = Math.atan2(d14 - d10, d13 - d9);
        double dAtan22 = Math.atan2(d16 - d10, d15 - d9) - dAtan2;
        if (z2 != (dAtan22 >= 0.0d)) {
            dAtan22 = dAtan22 > 0.0d ? dAtan22 - 6.283185307179586d : dAtan22 + 6.283185307179586d;
        }
        double d26 = d9 * d11;
        double d27 = d10 * d7;
        double d28 = (d26 * dCos) - (d27 * dSin);
        double d29 = (d27 * dCos) + (d26 * dSin);
        double d30 = 4;
        int iCeil = (int) Math.ceil(Math.abs((dAtan22 * d30) / 3.141592653589793d));
        double dCos2 = Math.cos(d12);
        double dSin2 = Math.sin(d12);
        double dCos3 = Math.cos(dAtan2);
        double dSin3 = Math.sin(dAtan2);
        double d31 = dAtan22;
        double d32 = -d11;
        double d33 = d32 * dCos2;
        double d34 = d7 * dSin2;
        double d35 = (d33 * dSin3) - (d34 * dCos3);
        double d36 = d32 * dSin2;
        double d37 = d7 * dCos2;
        double d38 = (dCos3 * d37) + (dSin3 * d36);
        double d39 = d31 / iCeil;
        double d40 = dAtan2;
        double d41 = d35;
        int i2 = 0;
        double d42 = d2;
        double d43 = d38;
        double d44 = d3;
        while (i2 < iCeil) {
            double d45 = d40 + d39;
            double dSin4 = Math.sin(d45);
            double dCos4 = Math.cos(d45);
            int i3 = i2;
            double d46 = (((d11 * dCos2) * dCos4) + d28) - (d34 * dSin4);
            int i4 = iCeil;
            double d47 = (d37 * dSin4) + (d11 * dSin2 * dCos4) + d29;
            double d48 = (d33 * dSin4) - (d34 * dCos4);
            double d49 = (dCos4 * d37) + (dSin4 * d36);
            double d50 = d45 - d40;
            double dTan = Math.tan(d50 / d19);
            double dSqrt3 = ((Math.sqrt(((3.0d * dTan) * dTan) + d30) - 1) * Math.sin(d50)) / 3;
            o4.a.cubicTo((float) ((d41 * dSqrt3) + d42), (float) ((d43 * dSqrt3) + d44), (float) (d46 - (dSqrt3 * d48)), (float) (d47 - (dSqrt3 * d49)), (float) d46, (float) d47);
            dSin2 = dSin2;
            d42 = d46;
            i2 = i3 + 1;
            d28 = d28;
            d30 = d30;
            d40 = d45;
            d43 = d49;
            d41 = d48;
            d44 = d47;
            iCeil = i4;
            d11 = d6;
        }
    }

    public static void l(Canvas canvas, boolean z) throws IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {
        Method method;
        int i2 = Build.VERSION.SDK_INT;
        if (i2 >= 29) {
            if (z) {
                canvas.enableZ();
                return;
            } else {
                canvas.disableZ();
                return;
            }
        }
        if (!l) {
            try {
                if (i2 == 28) {
                    Method declaredMethod = Class.class.getDeclaredMethod("getDeclaredMethod", String.class, new Class[0].getClass());
                    j = (Method) declaredMethod.invoke(Canvas.class, "insertReorderBarrier", new Class[0]);
                    k = (Method) declaredMethod.invoke(Canvas.class, "insertInorderBarrier", new Class[0]);
                } else {
                    j = Canvas.class.getDeclaredMethod("insertReorderBarrier", null);
                    k = Canvas.class.getDeclaredMethod("insertInorderBarrier", null);
                }
                Method method2 = j;
                if (method2 != null) {
                    method2.setAccessible(true);
                }
                Method method3 = k;
                if (method3 != null) {
                    method3.setAccessible(true);
                }
            } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException unused) {
            }
            l = true;
        }
        if (z) {
            try {
                Method method4 = j;
                if (method4 != null) {
                    method4.invoke(canvas, null);
                }
            } catch (IllegalAccessException | InvocationTargetException unused2) {
                return;
            }
        }
        if (z || (method = k) == null) {
            return;
        }
        method.invoke(canvas, null);
    }

    public static InterfaceC2557tn m(InterfaceC2557tn interfaceC2557tn, InterfaceC2652un interfaceC2652un) {
        if (F3.c(interfaceC2557tn.getKey(), interfaceC2652un)) {
            return interfaceC2557tn;
        }
        return null;
    }

    public static ArrayList n(Context context) {
        List<ActivityManager.RunningAppProcessInfo> runningAppProcesses;
        int i2 = context.getApplicationInfo().uid;
        String str = context.getApplicationInfo().processName;
        Object systemService = context.getSystemService("activity");
        ActivityManager activityManager = systemService instanceof ActivityManager ? (ActivityManager) systemService : null;
        if (activityManager == null || (runningAppProcesses = activityManager.getRunningAppProcesses()) == null) {
            runningAppProcesses = C0332Mv.l;
        }
        ArrayList arrayList = new ArrayList();
        for (Object obj : runningAppProcesses) {
            if (obj != null) {
                arrayList.add(obj);
            }
        }
        ArrayList arrayList2 = new ArrayList();
        int size = arrayList.size();
        int i3 = 0;
        int i4 = 0;
        while (i4 < size) {
            Object obj2 = arrayList.get(i4);
            i4++;
            if (((ActivityManager.RunningAppProcessInfo) obj2).uid == i2) {
                arrayList2.add(obj2);
            }
        }
        ArrayList arrayList3 = new ArrayList(AbstractC0034Bi.W(arrayList2, 10));
        int size2 = arrayList2.size();
        while (i3 < size2) {
            Object obj3 = arrayList2.get(i3);
            i3++;
            ActivityManager.RunningAppProcessInfo runningAppProcessInfo = (ActivityManager.RunningAppProcessInfo) obj3;
            String str2 = runningAppProcessInfo.processName;
            arrayList3.add(new PY(F3.c(str2, str), str2, runningAppProcessInfo.pid, runningAppProcessInfo.importance));
        }
        return arrayList3;
    }

    public static G0 o(View view) {
        if (Build.VERSION.SDK_INT < 26) {
            return null;
        }
        return new G0(2, AbstractC1456i7.d(view));
    }

    /* 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
    java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "jadx.core.dex.visitors.regions.SwitchOverStringVisitor$SwitchData.getNewCases()" is null
    	at jadx.core.dex.visitors.regions.SwitchOverStringVisitor.restoreSwitchOverString(SwitchOverStringVisitor.java:109)
    	at jadx.core.dex.visitors.regions.SwitchOverStringVisitor.visitRegion(SwitchOverStringVisitor.java:66)
    	at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseIterativeStepInternal(DepthRegionTraversal.java:77)
    	at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseIterativeStepInternal(DepthRegionTraversal.java:82)
     */
    public static final Class q(InterfaceC2894xJ interfaceC2894xJ) {
        Class clsA = ((InterfaceC0448Rh) interfaceC2894xJ).a();
        if (clsA.isPrimitive()) {
            String name = clsA.getName();
            switch (name.hashCode()) {
                case -1325958191:
                    if (name.equals("double")) {
                        return Double.class;
                    }
                    break;
                case 104431:
                    if (name.equals("int")) {
                        return Integer.class;
                    }
                    break;
                case 3039496:
                    if (name.equals("byte")) {
                        return Byte.class;
                    }
                    break;
                case 3052374:
                    if (name.equals("char")) {
                        return Character.class;
                    }
                    break;
                case 3327612:
                    if (name.equals("long")) {
                        return Long.class;
                    }
                    break;
                case 3625364:
                    if (name.equals("void")) {
                        return Void.class;
                    }
                    break;
                case 64711720:
                    if (name.equals("boolean")) {
                        return Boolean.class;
                    }
                    break;
                case 97526364:
                    if (name.equals("float")) {
                        return Float.class;
                    }
                    break;
                case 109413500:
                    if (name.equals("short")) {
                        return Short.class;
                    }
                    break;
            }
        }
        return clsA;
    }

    public static final long r(KeyEvent keyEvent) {
        return AbstractC1155f00.c(keyEvent.getKeyCode());
    }

    public static PY s(Context context) {
        Object obj;
        String myProcessName;
        int iMyPid = Process.myPid();
        ArrayList arrayListN = n(context);
        int size = arrayListN.size();
        int i2 = 0;
        while (true) {
            if (i2 >= size) {
                obj = null;
                break;
            }
            obj = arrayListN.get(i2);
            i2++;
            if (((PY) obj).b == iMyPid) {
                break;
            }
        }
        PY py = (PY) obj;
        if (py != null) {
            return py;
        }
        int i3 = Build.VERSION.SDK_INT;
        if (i3 > 33) {
            myProcessName = Process.myProcessName();
        } else if ((i3 < 28 || (myProcessName = Application.getProcessName()) == null) && (myProcessName = ProcessUtils.getMyProcessName()) == null) {
            myProcessName = "";
        }
        return new PY(false, myProcessName, iMyPid, 0);
    }

    public static final Object t(N50 n50, Z50 z50) {
        Object objG = n50.l.g(z50);
        if (objG == null) {
            return null;
        }
        return objG;
    }

    public static String u(String str) {
        if (Build.VERSION.SDK_INT >= 26) {
            return "TRuntime.".concat(str);
        }
        String strConcat = "TRuntime.".concat(str);
        return strConcat.length() > 23 ? strConcat.substring(0, 23) : strConcat;
    }

    public static final int v(KeyEvent keyEvent) {
        int action = keyEvent.getAction();
        if (action != 0) {
            return action != 1 ? 0 : 1;
        }
        return 2;
    }

    public static C1277gH w(InterfaceC0330Mt interfaceC0330Mt, int i2) {
        return new C1277gH(interfaceC0330Mt, (i2 & 2) != 0 ? 1 : 2, 0);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r10v8, types: [java.util.Map] */
    public static final void x(Context context) {
        LinkedHashMap linkedHashMapSingletonMap;
        if (context.getDatabasePath("androidx.work.workdb").exists()) {
            C0669Zu c0669ZuE = C0669Zu.e();
            String[] strArr = AbstractC1987nm0.a;
            c0669ZuE.getClass();
            File databasePath = context.getDatabasePath("androidx.work.workdb");
            File file = new File(C1360h7.a.a(context), "androidx.work.workdb");
            String[] strArr2 = AbstractC1987nm0.a;
            int iZ = GN.Z(strArr2.length);
            if (iZ < 16) {
                iZ = 16;
            }
            LinkedHashMap linkedHashMap = new LinkedHashMap(iZ);
            for (String str : strArr2) {
                linkedHashMap.put(new File(databasePath.getPath() + str), new File(file.getPath() + str));
            }
            if (linkedHashMap.isEmpty()) {
                linkedHashMapSingletonMap = Collections.singletonMap(databasePath, file);
            } else {
                LinkedHashMap linkedHashMap2 = new LinkedHashMap(linkedHashMap);
                linkedHashMap2.put(databasePath, file);
                linkedHashMapSingletonMap = linkedHashMap2;
            }
            for (Map.Entry entry : linkedHashMapSingletonMap.entrySet()) {
                File file2 = (File) entry.getKey();
                File file3 = (File) entry.getValue();
                if (file2.exists()) {
                    if (file3.exists()) {
                        C0669Zu c0669ZuE2 = C0669Zu.e();
                        String[] strArr3 = AbstractC1987nm0.a;
                        file3.toString();
                        c0669ZuE2.getClass();
                    }
                    if (file2.renameTo(file3)) {
                        file2.toString();
                        file3.toString();
                    } else {
                        file2.toString();
                        file3.toString();
                    }
                    C0669Zu c0669ZuE3 = C0669Zu.e();
                    String[] strArr4 = AbstractC1987nm0.a;
                    c0669ZuE3.getClass();
                }
            }
        }
    }

    public static InterfaceC2747vn y(InterfaceC2557tn interfaceC2557tn, InterfaceC2652un interfaceC2652un) {
        return F3.c(interfaceC2557tn.getKey(), interfaceC2652un) ? C0281Kv.l : interfaceC2557tn;
    }

    public static void z(Context context, String str) {
        synchronized (a) {
            if (str.equals("")) {
                context.deleteFile("androidx.appcompat.app.AppCompatDelegate.application_locales_record_file");
                return;
            }
            try {
                FileOutputStream fileOutputStreamOpenFileOutput = context.openFileOutput("androidx.appcompat.app.AppCompatDelegate.application_locales_record_file", 0);
                XmlSerializer xmlSerializerNewSerializer = Xml.newSerializer();
                try {
                    xmlSerializerNewSerializer.setOutput(fileOutputStreamOpenFileOutput, null);
                    xmlSerializerNewSerializer.startDocument("UTF-8", Boolean.TRUE);
                    xmlSerializerNewSerializer.startTag(null, "locales");
                    xmlSerializerNewSerializer.attribute(null, "application_locales", str);
                    xmlSerializerNewSerializer.endTag(null, "locales");
                    xmlSerializerNewSerializer.endDocument();
                } catch (Exception unused) {
                    if (fileOutputStreamOpenFileOutput != null) {
                    }
                } catch (Throwable th) {
                    if (fileOutputStreamOpenFileOutput != null) {
                        try {
                            fileOutputStreamOpenFileOutput.close();
                        } catch (IOException unused2) {
                        }
                    }
                    throw th;
                }
                if (fileOutputStreamOpenFileOutput != null) {
                    try {
                        fileOutputStreamOpenFileOutput.close();
                    } catch (IOException unused3) {
                    }
                }
            } catch (FileNotFoundException unused4) {
            }
        }
    }

    public abstract void D(boolean z);

    public abstract void E(boolean z);

    public abstract InputFilter[] p(InputFilter[] inputFilterArr);
}
