package K.K.K.ʬ;

import android.app.Activity;
import android.app.AppOpsManager;
import android.app.Application;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Path;
import android.graphics.PointF;
import android.graphics.PorterDuff;
import android.graphics.Shader;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableContainer;
import android.graphics.drawable.InsetDrawable;
import android.hardware.Camera;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.Handler;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.StrictMode;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Base64;
import android.util.Log;
import android.util.LongSparseArray;
import android.util.StateSet;
import android.util.TypedValue;
import android.util.Xml;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.widget.CompoundButton;
import android.widget.PopupWindow;
import androidx.constraintlayout.motion.widget.MotionLayout;
import androidx.constraintlayout.solver.SolverVariable;
import androidx.constraintlayout.solver.widgets.ConstraintAnchor;
import androidx.constraintlayout.solver.widgets.ConstraintWidget;
import androidx.core.R$attr;
import androidx.core.R$styleable;
import androidx.recyclerview.widget.RecyclerView;
import com.appsflyer.share.Constants;
import com.facebook.internal.security.CertificateUtil;
import com.google.android.material.bottomappbar.BottomAppBarTopEdgeTreatment;
import com.google.android.material.chip.Chip;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import org.json.JSONArray;
import org.json.JSONObject;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import ඓ.K.K.K.C1293;
import ῲ.ᨨ.ʬ.C1708;
import ῲ.ᨨ.ʬ.C1721;
import ῲ.ᨨ.ʬ.ᕣ.AbstractC1712;
import ῲ.ᨨ.ʬ.ᕣ.AbstractC1713;
import ῲ.ᨨ.ʬ.ᕣ.C1710;
import ῲ.ᨨ.ʬ.ᕣ.C1714;
import ῲ.ᨨ.ῲ.C1806;
import ῲ.ᨨ.ῲ.ῲ.AbstractC1798;
import ῲ.ᨨ.ῲ.ῲ.AbstractC1799;
import ῲ.ᨨ.ῲ.ῲ.C1796;
import ῲ.ᨨ.ῲ.ῲ.C1797;
import ῲ.ᨨ.ῲ.ῲ.C1802;
import ῲ.ᨨ.ῲ.ῲ.C1804;
import ῲ.ᨨ.㴹.C1844;
import ῲ.ῲ.㴹.AbstractC2047;
import ῲ.ῲ.㴹.View$OnLongClickListenerC2005;
import ῲ.ⁱ.ῲ.C2073;
import ῲ.ⁱ.ῲ.C2080;
import ῲ.ⁱ.ῲ.㿎.C2082;
import ῲ.ⁱ.ῲ.㿎.C2083;
import ῲ.ⁱ.ῲ.㿎.C2101;
import ῲ.ⁱ.ῲ.㿎.C2102;
import ῲ.ⁱ.ῲ.㿎.ᕣ.C2098;
import K.K.㸾.K.C2389;

/* renamed from: K.K.K.ʬ.ῲ  reason: contains not printable characters */
public class C2369 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public static Field f8179;

    /* renamed from: Ԕ  reason: contains not printable characters */
    public static boolean f8180;

    /* renamed from: ؿ  reason: contains not printable characters */
    public static boolean f8181;

    /* renamed from: ݜ  reason: contains not printable characters */
    public static Field f8182;

    /* renamed from: ඓ  reason: contains not printable characters */
    public static Class<?> f8183;

    /* renamed from: ᓣ  reason: contains not printable characters */
    public static Method f8184;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public static Method f8185;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public static Field f8186;

    /* renamed from: ῲ  reason: contains not printable characters */
    public static String f8187;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public static Field f8188;

    /* renamed from: K  reason: contains not printable characters */
    public static Application f8189;

    /* renamed from: 㑃  reason: contains not printable characters */
    public static boolean f8190;

    /* renamed from: 㗗  reason: contains not printable characters */
    public static Field f8191;

    /* renamed from: 㗽  reason: contains not printable characters */
    public static boolean f8192;

    /* renamed from: 㳳  reason: contains not printable characters */
    public static boolean f8193;

    /* renamed from: 㴹  reason: contains not printable characters */
    public static boolean f8194;

    /* renamed from: 㸾  reason: contains not printable characters */
    public static boolean f8195;

    /* renamed from: 㿎  reason: contains not printable characters */
    public static boolean f8196;

    /* renamed from: 䀟  reason: contains not printable characters */
    public static boolean f8197;

    /* renamed from: 䁗  reason: contains not printable characters */
    public static Method f8198;

    /* renamed from: ʬ  reason: contains not printable characters */
    public static Path m6267(String str) {
        Path path = new Path();
        C1708[] r1 = m6288(str);
        if (r1 == null) {
            return null;
        }
        try {
            C1708.m4379(r1, path);
            return path;
        } catch (RuntimeException e) {
            throw new RuntimeException(C1293.m3412("Error in parsing ", str), e);
        }
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public static Camera.CameraInfo m6268(int i) {
        try {
            Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
            try {
                Camera.getCameraInfo(i, cameraInfo);
                return cameraInfo;
            } catch (Exception unused) {
                return cameraInfo;
            }
        } catch (Exception unused2) {
            return null;
        }
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public static String m6269() {
        return Locale.getDefault().toString();
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public static boolean m6270(Context context, String str) {
        return context.getPackageManager().checkPermission(str, context.getPackageName()) == 0;
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public static Drawable m6273(Drawable drawable) {
        return (Build.VERSION.SDK_INT < 23 && !(drawable instanceof AbstractC1713)) ? new C1714(drawable) : drawable;
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public static void m6274(String str) {
        if (m6345(str)) {
            Log.e("Guardian" + "-sdk", str);
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static int m6275() {
        return m6276(1);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static int m6276(int i) {
        int numberOfCameras = Camera.getNumberOfCameras();
        for (int i2 = 0; i2 < numberOfCameras; i2++) {
            Camera.CameraInfo r2 = m6268(i2);
            if (r2 != null && r2.facing == i) {
                return i2;
            }
        }
        return -1;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static int m6279(ViewGroup.MarginLayoutParams marginLayoutParams) {
        int i = Build.VERSION.SDK_INT;
        return marginLayoutParams.getMarginStart();
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static boolean m6286(Context context, String str) {
        return context != null && C1806.m4687(context, str) == 0;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static float m6289(float f, float f2, float f3) {
        return f < f2 ? f2 : f > f3 ? f3 : f;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6291() {
        return m6276(0);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6294(int i, int i2, int i3) {
        return i < i2 ? i2 : i > i3 ? i3 : i;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6295(int i, Activity activity) {
        Camera.CameraInfo r3 = m6268(i);
        if (r3 == null) {
            return -1;
        }
        int rotation = activity.getWindowManager().getDefaultDisplay().getRotation();
        int i2 = 0;
        if (rotation != 0) {
            if (rotation == 1) {
                i2 = 90;
            } else if (rotation == 2) {
                i2 = 180;
            } else if (rotation == 3) {
                i2 = BottomAppBarTopEdgeTreatment.ANGLE_UP;
            }
        }
        int i3 = r3.facing;
        int i4 = r3.orientation;
        return (i3 == 1 ? 360 - ((i4 + i2) % 360) : (i4 - i2) + 360) % 360;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static String m6313(Context context) {
        return context.getFilesDir().getAbsolutePath() + "/model";
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C2389 m6325(JSONObject jSONObject) {
        try {
            C2389 r0 = new C2389();
            jSONObject.optDouble("leftEyeOpenProb");
            jSONObject.optDouble("rightEyeOpenProb");
            r0.f8282 = (float) jSONObject.optDouble("mouthOpenProb");
            r0.f8278 = (float) jSONObject.optDouble("faceQuality");
            r0.f8280 = (float) jSONObject.optDouble("yaw");
            JSONArray optJSONArray = jSONObject.optJSONArray("faceBoundingbox");
            r0.f8281.left = (float) optJSONArray.optDouble(0);
            r0.f8281.top = (float) optJSONArray.optDouble(1);
            r0.f8281.right = (float) optJSONArray.optDouble(2);
            r0.f8281.bottom = (float) optJSONArray.optDouble(3);
            JSONArray optJSONArray2 = jSONObject.optJSONArray("landmark");
            if (optJSONArray2.length() % 2 == 0) {
                r0.f8279 = new PointF[(optJSONArray2.length() / 2)];
                int i = 0;
                for (int i2 = 0; i2 < optJSONArray2.length() / 2; i2++) {
                    r0.f8279[i2] = new PointF();
                    r0.f8279[i2].x = (float) optJSONArray2.optDouble(i);
                    int i3 = i + 1;
                    r0.f8279[i2].y = (float) optJSONArray2.optDouble(i3);
                    i = i3 + 1;
                }
            }
            return r0;
        } catch (Exception unused) {
            return null;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:35:0x0084 A[SYNTHETIC, Splitter:B:35:0x0084] */
    /* JADX WARNING: Removed duplicated region for block: B:47:0x00a5 A[SYNTHETIC, Splitter:B:47:0x00a5] */
    /* JADX WARNING: Removed duplicated region for block: B:52:0x00b3 A[SYNTHETIC, Splitter:B:52:0x00b3] */
    /* JADX WARNING: Removed duplicated region for block: B:59:? A[RETURN, SYNTHETIC] */
    /* renamed from: K  reason: contains not printable characters */
    public static void m6335(String str, Context context) {
        FileOutputStream fileOutputStream;
        InputStream inputStream;
        Throwable th;
        Exception e;
        String r0 = m6313(context);
        File file = new File(r0);
        if (!file.exists()) {
            file.mkdirs();
        }
        File file2 = new File(C1293.m3413(r0, Constants.URL_PATH_DELIMITER, str));
        if (!file2.exists()) {
            InputStream inputStream2 = null;
            try {
                inputStream = context.getAssets().open("model/" + str);
                try {
                    fileOutputStream = new FileOutputStream(file2);
                } catch (Exception e2) {
                    inputStream2 = inputStream;
                    e = e2;
                    fileOutputStream = null;
                    try {
                        m6274(e.getMessage());
                        if (inputStream2 != null) {
                        }
                        if (fileOutputStream == null) {
                        }
                        fileOutputStream.close();
                    } catch (Throwable th2) {
                        th = th2;
                        inputStream = inputStream2;
                        if (inputStream != null) {
                        }
                        if (fileOutputStream != null) {
                        }
                        throw th;
                    }
                } catch (Throwable th3) {
                    th = th3;
                    fileOutputStream = null;
                    if (inputStream != null) {
                    }
                    if (fileOutputStream != null) {
                    }
                    throw th;
                }
                try {
                    byte[] bArr = new byte[RecyclerView.AbstractC0269.FLAG_ADAPTER_FULLUPDATE];
                    while (true) {
                        int read = inputStream.read(bArr);
                        if (read == -1) {
                            break;
                        }
                        fileOutputStream.write(bArr, 0, read);
                    }
                    fileOutputStream.flush();
                    try {
                        inputStream.close();
                    } catch (IOException e3) {
                        m6274(e3.getMessage());
                    }
                } catch (Exception e4) {
                    inputStream2 = inputStream;
                    e = e4;
                    m6274(e.getMessage());
                    if (inputStream2 != null) {
                    }
                    if (fileOutputStream == null) {
                    }
                    fileOutputStream.close();
                } catch (Throwable th4) {
                    th = th4;
                    if (inputStream != null) {
                    }
                    if (fileOutputStream != null) {
                    }
                    throw th;
                }
            } catch (Exception e5) {
                e = e5;
                fileOutputStream = null;
                m6274(e.getMessage());
                if (inputStream2 != null) {
                    try {
                        inputStream2.close();
                    } catch (IOException e6) {
                        m6274(e6.getMessage());
                    }
                }
                if (fileOutputStream == null) {
                    return;
                }
                fileOutputStream.close();
            } catch (Throwable th5) {
                fileOutputStream = null;
                th = th5;
                inputStream = null;
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (IOException e7) {
                        m6274(e7.getMessage());
                    }
                }
                if (fileOutputStream != null) {
                    try {
                        fileOutputStream.close();
                    } catch (IOException e8) {
                        m6274(e8.getMessage());
                    }
                }
                throw th;
            }
            try {
                fileOutputStream.close();
            } catch (IOException e9) {
                m6274(e9.getMessage());
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m6345(String str) {
        return !TextUtils.isEmpty(str);
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public static Shader.TileMode m6350(int i) {
        if (i == 1) {
            return Shader.TileMode.REPEAT;
        }
        if (i != 2) {
            return Shader.TileMode.CLAMP;
        }
        return Shader.TileMode.MIRROR;
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public static int m6351(int i) {
        if (i <= 4) {
            return 8;
        }
        return i * 2;
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public static String m6353() {
        StackTraceElement stackTraceElement = new Throwable().getStackTrace()[1];
        StringBuilder r1 = C1293.m3416(".(");
        r1.append(stackTraceElement.getFileName());
        r1.append(CertificateUtil.DELIMITER);
        r1.append(stackTraceElement.getLineNumber());
        r1.append(")");
        return r1.toString();
    }

    /* JADX WARNING: Can't wrap try/catch for region: R(15:0|1|2|3|4|5|6|(2:7|(1:9)(1:44))|10|11|12|13|14|15|47) */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing exception handler attribute for start block: B:13:0x0031 */
    /* JADX WARNING: Removed duplicated region for block: B:26:0x0044 A[SYNTHETIC, Splitter:B:26:0x0044] */
    /* JADX WARNING: Removed duplicated region for block: B:30:0x004b A[SYNTHETIC, Splitter:B:30:0x004b] */
    /* JADX WARNING: Removed duplicated region for block: B:37:0x0053 A[SYNTHETIC, Splitter:B:37:0x0053] */
    /* JADX WARNING: Removed duplicated region for block: B:41:0x005a A[SYNTHETIC, Splitter:B:41:0x005a] */
    /* JADX WARNING: Removed duplicated region for block: B:48:? A[RETURN, SYNTHETIC] */
    /* renamed from: 㸾  reason: contains not printable characters */
    public static String m6354(Context context, String str) {
        ByteArrayOutputStream byteArrayOutputStream;
        FileInputStream fileInputStream;
        Throwable th;
        try {
            fileInputStream = context.openFileInput(str);
            try {
                byteArrayOutputStream = new ByteArrayOutputStream(Math.max(8192, fileInputStream.available()));
            } catch (Exception unused) {
                byteArrayOutputStream = null;
                if (fileInputStream != null) {
                    try {
                        fileInputStream.close();
                    } catch (IOException unused2) {
                    }
                }
                if (byteArrayOutputStream == null) {
                    return null;
                }
                try {
                    byteArrayOutputStream.close();
                    return null;
                } catch (IOException unused3) {
                    return null;
                }
            } catch (Throwable th2) {
                th = th2;
                byteArrayOutputStream = null;
                if (fileInputStream != null) {
                    try {
                        fileInputStream.close();
                    } catch (IOException unused4) {
                    }
                }
                if (byteArrayOutputStream != null) {
                    try {
                        byteArrayOutputStream.close();
                    } catch (IOException unused5) {
                    }
                }
                throw th;
            }
            try {
                byte[] bArr = new byte[8192];
                while (true) {
                    int read = fileInputStream.read(bArr);
                    if (read < 0) {
                        break;
                    }
                    byteArrayOutputStream.write(bArr, 0, read);
                }
                String str2 = new String(Base64.decode(byteArrayOutputStream.toByteArray(), 0));
                fileInputStream.close();
                byteArrayOutputStream.close();
                return str2;
            } catch (Exception unused6) {
                if (fileInputStream != null) {
                }
                if (byteArrayOutputStream == null) {
                }
            } catch (Throwable th3) {
                th = th3;
                if (fileInputStream != null) {
                }
                if (byteArrayOutputStream != null) {
                }
                throw th;
            }
        } catch (Exception unused7) {
            fileInputStream = null;
            byteArrayOutputStream = null;
            if (fileInputStream != null) {
            }
            if (byteArrayOutputStream == null) {
            }
        } catch (Throwable th4) {
            th = th4;
            fileInputStream = null;
            byteArrayOutputStream = null;
            if (fileInputStream != null) {
            }
            if (byteArrayOutputStream != null) {
            }
            throw th;
        }
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public static void m6355(String str) {
        if (m6345(str)) {
            Log.d("Guardian" + "-sdk", str);
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static boolean m6287(Object obj, Object obj2) {
        int i = Build.VERSION.SDK_INT;
        return Objects.equals(obj, obj2);
    }

    /* JADX DEBUG: Multi-variable search result rejected for r1v0, resolved type: android.graphics.drawable.Drawable */
    /* JADX WARN: Multi-variable type inference failed */
    /* renamed from: 㸾  reason: contains not printable characters */
    public static <T extends Drawable> T m6352(Drawable drawable) {
        return drawable instanceof AbstractC1712 ? (T) ((C1710) drawable).f6010 : drawable;
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public static int m6272(int i) {
        if (i == 1) {
            return 0;
        }
        if (i == 2) {
            return 1;
        }
        if (i == 4) {
            return 2;
        }
        if (i == 8) {
            return 3;
        }
        if (i == 16) {
            return 4;
        }
        if (i == 32) {
            return 5;
        }
        if (i == 64) {
            return 6;
        }
        if (i == 128) {
            return 7;
        }
        if (i == 256) {
            return 8;
        }
        throw new IllegalArgumentException(C1293.m3408("type needs to be >= FIRST and <= LAST, type=", i));
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public static boolean m6271(Drawable drawable) {
        int i = Build.VERSION.SDK_INT;
        return drawable.isAutoMirrored();
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static File m6282(Context context) {
        File cacheDir = context.getCacheDir();
        if (cacheDir == null) {
            return null;
        }
        StringBuilder r1 = C1293.m3416(".font");
        r1.append(Process.myPid());
        r1.append("-");
        r1.append(Process.myTid());
        r1.append("-");
        String sb = r1.toString();
        for (int i = 0; i < 100; i++) {
            File file = new File(cacheDir, C1293.m3408(sb, i));
            try {
                if (file.createNewFile()) {
                    return file;
                }
            } catch (IOException unused) {
            }
        }
        return null;
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public static int m6266(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
        if (!m6346(xmlPullParser, str)) {
            return i2;
        }
        return typedArray.getResourceId(i, i2);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static Drawable m6280(Resources resources, int i, Resources.Theme theme) throws Resources.NotFoundException {
        int i2 = Build.VERSION.SDK_INT;
        return resources.getDrawable(i, theme);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:37:0x008f, code lost:
        if (r14 == false) goto L_0x0091;
     */
    /* JADX WARNING: Removed duplicated region for block: B:17:0x0048  */
    /* JADX WARNING: Removed duplicated region for block: B:45:0x009c A[Catch:{ NumberFormatException -> 0x00be }, LOOP:3: B:25:0x0071->B:45:0x009c, LOOP_END] */
    /* JADX WARNING: Removed duplicated region for block: B:69:0x00db A[SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:79:0x009b A[SYNTHETIC] */
    /* renamed from: ῲ  reason: contains not printable characters */
    public static C1708[] m6288(String str) {
        String trim;
        float[] fArr;
        if (str == null) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        int i = 0;
        int i2 = 1;
        int i3 = 0;
        while (i2 < str.length()) {
            while (i2 < str.length()) {
                char charAt = str.charAt(i2);
                if ((charAt - 'Z') * (charAt - 'A') > 0) {
                    if ((charAt - 'z') * (charAt - 'a') > 0) {
                        continue;
                        i2++;
                    }
                }
                if (!(charAt == 'e' || charAt == 'E')) {
                    trim = str.substring(i3, i2).trim();
                    if (trim.length() > 0) {
                        if (trim.charAt(i) == 'z' || trim.charAt(i) == 'Z') {
                            fArr = new float[i];
                        } else {
                            try {
                                float[] fArr2 = new float[trim.length()];
                                int length = trim.length();
                                int i4 = 1;
                                int i5 = 0;
                                while (i4 < length) {
                                    int i6 = i4;
                                    boolean z = false;
                                    boolean z2 = false;
                                    boolean z3 = false;
                                    boolean z4 = false;
                                    while (true) {
                                        if (i6 < trim.length()) {
                                            char charAt2 = trim.charAt(i6);
                                            if (charAt2 != ' ') {
                                                if (charAt2 == 'E' || charAt2 == 'e') {
                                                    z4 = true;
                                                    if (!z) {
                                                        i6++;
                                                    }
                                                } else {
                                                    switch (charAt2) {
                                                        case '-':
                                                            if (i6 != i4) {
                                                            }
                                                            break;
                                                        case '.':
                                                            if (!z3) {
                                                                z3 = true;
                                                                break;
                                                            }
                                                            z2 = true;
                                                            break;
                                                    }
                                                    z4 = false;
                                                    if (!z) {
                                                    }
                                                }
                                            }
                                            z = true;
                                            z4 = false;
                                            if (!z) {
                                            }
                                        }
                                    }
                                    if (i4 < i6) {
                                        fArr2[i5] = Float.parseFloat(trim.substring(i4, i6));
                                        i5++;
                                    }
                                    if (!z2) {
                                        i6++;
                                    }
                                    i4 = i6;
                                    i = 0;
                                }
                                fArr = m6348(fArr2, i, i5);
                                i = 0;
                            } catch (NumberFormatException e) {
                                throw new RuntimeException(C1293.m3413("error in parsing \"", trim, "\""), e);
                            }
                        }
                        arrayList.add(new C1708(trim.charAt(i), fArr));
                    }
                    i3 = i2;
                    i2++;
                    i = 0;
                }
                i2++;
            }
            trim = str.substring(i3, i2).trim();
            if (trim.length() > 0) {
            }
            i3 = i2;
            i2++;
            i = 0;
        }
        if (i2 - i3 == 1 && i3 < str.length()) {
            arrayList.add(new C1708(str.charAt(i3), new float[0]));
        }
        return (C1708[]) arrayList.toArray(new C1708[arrayList.size()]);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6327(Context context, String str, String str2) {
        if (context != null) {
            try {
                byte[] encode = Base64.encode(str2.getBytes(), 0);
                context.deleteFile(str);
                context.openFileOutput(str, 0).write(encode);
            } catch (Exception unused) {
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static InputConnection m6310(InputConnection inputConnection, EditorInfo editorInfo, View view) {
        if (inputConnection != null && editorInfo.hintText == null) {
            ViewParent parent = view.getParent();
            while (true) {
                if (!(parent instanceof View)) {
                    break;
                } else if (parent instanceof AbstractC2047) {
                    editorInfo.hintText = ((AbstractC2047) parent).m5327();
                    break;
                } else {
                    parent = parent.getParent();
                }
            }
        }
        return inputConnection;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6334(Object obj, StringBuilder sb) {
        int lastIndexOf;
        if (obj == null) {
            sb.append("null");
            return;
        }
        String simpleName = obj.getClass().getSimpleName();
        if (simpleName.length() <= 0 && (lastIndexOf = (simpleName = obj.getClass().getName()).lastIndexOf(46)) > 0) {
            simpleName = simpleName.substring(lastIndexOf + 1);
        }
        sb.append(simpleName);
        sb.append('{');
        sb.append(Integer.toHexString(System.identityHashCode(obj)));
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static int m6277(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
        if (!m6346(xmlPullParser, str)) {
            return i2;
        }
        return typedArray.getInt(i, i2);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static void m6284(Drawable drawable, int i) {
        int i2 = Build.VERSION.SDK_INT;
        drawable.setTint(i);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static void m6285(Object obj) {
        LongSparseArray longSparseArray;
        if (!f8194) {
            try {
                f8183 = Class.forName("android.content.res.ThemedResourceCache");
            } catch (ClassNotFoundException e) {
                Log.e("ResourcesFlusher", "Could not find ThemedResourceCache class", e);
            }
            f8194 = true;
        }
        Class<?> cls = f8183;
        if (cls != null) {
            if (!f8196) {
                try {
                    f8188 = cls.getDeclaredField("mUnthemedEntries");
                    f8188.setAccessible(true);
                } catch (NoSuchFieldException e2) {
                    Log.e("ResourcesFlusher", "Could not retrieve ThemedResourceCache#mUnthemedEntries field", e2);
                }
                f8196 = true;
            }
            Field field = f8188;
            if (field != null) {
                try {
                    longSparseArray = (LongSparseArray) field.get(obj);
                } catch (IllegalAccessException e3) {
                    Log.e("ResourcesFlusher", "Could not retrieve value from ThemedResourceCache#mUnthemedEntries", e3);
                    longSparseArray = null;
                }
                if (longSparseArray != null) {
                    longSparseArray.clear();
                }
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6331(View view, CharSequence charSequence) {
        if (Build.VERSION.SDK_INT >= 26) {
            view.setTooltipText(charSequence);
            return;
        }
        View$OnLongClickListenerC2005 r0 = View$OnLongClickListenerC2005.f6808;
        if (r0 != null && r0.f6813 == view) {
            View$OnLongClickListenerC2005.m5193((View$OnLongClickListenerC2005) null);
        }
        if (TextUtils.isEmpty(charSequence)) {
            View$OnLongClickListenerC2005 r3 = View$OnLongClickListenerC2005.f6809;
            if (r3 != null && r3.f6813 == view) {
                r3.m5194();
            }
            view.setOnLongClickListener(null);
            view.setLongClickable(false);
            view.setOnHoverListener(null);
            return;
        }
        new View$OnLongClickListenerC2005(view, charSequence);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m6342(ConstraintWidget.DimensionBehaviour dimensionBehaviour, ConstraintWidget.DimensionBehaviour dimensionBehaviour2, ConstraintWidget.DimensionBehaviour dimensionBehaviour3, ConstraintWidget.DimensionBehaviour dimensionBehaviour4) {
        return (dimensionBehaviour3 == ConstraintWidget.DimensionBehaviour.FIXED || dimensionBehaviour3 == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT || (dimensionBehaviour3 == ConstraintWidget.DimensionBehaviour.MATCH_PARENT && dimensionBehaviour != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT)) || (dimensionBehaviour4 == ConstraintWidget.DimensionBehaviour.FIXED || dimensionBehaviour4 == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT || (dimensionBehaviour4 == ConstraintWidget.DimensionBehaviour.MATCH_PARENT && dimensionBehaviour2 != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT));
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static TypedValue m6281(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i) {
        if (!m6346(xmlPullParser, str)) {
            return null;
        }
        return typedArray.peekValue(i);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:136:0x0229, code lost:
        if (r2.f834 == 2) goto L_0x022b;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:185:0x02fb, code lost:
        if (r5[r16].f812.f813 == r6) goto L_0x02ff;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:81:0x0165, code lost:
        if (r4[r2].f812.f813 == r6) goto L_0x0169;
     */
    /* JADX WARNING: Removed duplicated region for block: B:141:0x023a  */
    /* JADX WARNING: Removed duplicated region for block: B:193:0x0318  */
    /* JADX WARNING: Removed duplicated region for block: B:214:0x037c  */
    /* JADX WARNING: Removed duplicated region for block: B:221:0x03a4  */
    /* JADX WARNING: Removed duplicated region for block: B:227:0x03b4  */
    /* JADX WARNING: Removed duplicated region for block: B:258:0x04be A[ADDED_TO_REGION] */
    /* JADX WARNING: Removed duplicated region for block: B:278:0x0525 A[ADDED_TO_REGION] */
    /* JADX WARNING: Removed duplicated region for block: B:337:0x0620  */
    /* JADX WARNING: Removed duplicated region for block: B:338:0x0622  */
    /* JADX WARNING: Removed duplicated region for block: B:346:0x063e  */
    /* JADX WARNING: Removed duplicated region for block: B:352:0x064b  */
    /* JADX WARNING: Removed duplicated region for block: B:399:0x071d  */
    /* JADX WARNING: Removed duplicated region for block: B:412:0x0775  */
    /* JADX WARNING: Removed duplicated region for block: B:413:0x0778  */
    /* JADX WARNING: Removed duplicated region for block: B:416:0x077e  */
    /* JADX WARNING: Removed duplicated region for block: B:417:0x0781  */
    /* JADX WARNING: Removed duplicated region for block: B:419:0x0785  */
    /* JADX WARNING: Removed duplicated region for block: B:425:0x0796  */
    /* JADX WARNING: Removed duplicated region for block: B:46:0x00f8  */
    /* JADX WARNING: Removed duplicated region for block: B:56:0x0118  */
    /* JADX WARNING: Removed duplicated region for block: B:59:0x011e  */
    /* renamed from: K  reason: contains not printable characters */
    public static void m6337(C2082 r36, C2080 r37, ArrayList<ConstraintWidget> arrayList, int i) {
        int i2;
        int i3;
        C2101[] r14;
        int i4;
        C2101[] r28;
        int i5;
        boolean z;
        int i6;
        float f;
        boolean z2;
        boolean z3;
        boolean z4;
        ConstraintWidget constraintWidget;
        ConstraintWidget constraintWidget2;
        ConstraintWidget constraintWidget3;
        SolverVariable solverVariable;
        int i7;
        ConstraintWidget constraintWidget4;
        ConstraintAnchor constraintAnchor;
        ConstraintAnchor constraintAnchor2;
        ConstraintAnchor constraintAnchor3;
        ConstraintWidget constraintWidget5;
        int i8;
        SolverVariable solverVariable2;
        SolverVariable solverVariable3;
        ConstraintAnchor constraintAnchor4;
        ConstraintWidget constraintWidget6;
        ConstraintWidget constraintWidget7;
        int i9;
        ConstraintWidget constraintWidget8;
        ConstraintWidget constraintWidget9;
        ConstraintAnchor constraintAnchor5;
        SolverVariable solverVariable4;
        SolverVariable solverVariable5;
        float f2;
        int size;
        int i10;
        C2101 r33;
        int i11;
        ArrayList<ConstraintWidget> arrayList2;
        ConstraintWidget constraintWidget10;
        float f3;
        ConstraintWidget constraintWidget11;
        C2101[] r282;
        ConstraintWidget constraintWidget12;
        int i12;
        ConstraintWidget constraintWidget13;
        int i13;
        boolean z5;
        boolean z6;
        ConstraintWidget constraintWidget14;
        boolean z7;
        ConstraintWidget constraintWidget15;
        int i14;
        C2082 r0 = r36;
        ArrayList<ConstraintWidget> arrayList3 = arrayList;
        int i15 = 2;
        if (i == 0) {
            i3 = r0.f7202;
            r14 = r0.f7200;
            i2 = 0;
        } else {
            i3 = r0.f7190;
            r14 = r0.f7188;
            i2 = 2;
        }
        int i16 = 0;
        while (i16 < i3) {
            C2101 r1 = r14[i16];
            int i17 = 8;
            int i18 = 1;
            if (!r1.f7276) {
                int i19 = r1.f7270 * 2;
                ConstraintWidget constraintWidget16 = r1.f7268;
                ConstraintWidget constraintWidget17 = constraintWidget16;
                boolean z8 = false;
                while (!z8) {
                    r1.f7265 += i18;
                    ConstraintWidget[] constraintWidgetArr = constraintWidget16.f868;
                    int i20 = r1.f7270;
                    constraintWidgetArr[i20] = null;
                    constraintWidget16.f862[i20] = null;
                    if (constraintWidget16.f840 != i17) {
                        r1.f7269 += i18;
                        if (constraintWidget16.m480(i20) != ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
                            int i21 = r1.f7277;
                            int i22 = r1.f7270;
                            if (i22 == 0) {
                                i14 = constraintWidget16.m478();
                            } else {
                                i14 = i22 == i18 ? constraintWidget16.m473() : 0;
                            }
                            r1.f7277 = i21 + i14;
                        }
                        r1.f7277 = constraintWidget16.f856[i19].m456() + r1.f7277;
                        int i23 = i19 + 1;
                        r1.f7277 = constraintWidget16.f856[i23].m456() + r1.f7277;
                        r1.f7259 = constraintWidget16.f856[i19].m456() + r1.f7259;
                        r1.f7259 = constraintWidget16.f856[i23].m456() + r1.f7259;
                        if (r1.f7266 == null) {
                            r1.f7266 = constraintWidget16;
                        }
                        r1.f7274 = constraintWidget16;
                        ConstraintWidget.DimensionBehaviour[] dimensionBehaviourArr = constraintWidget16.f886;
                        int i24 = r1.f7270;
                        if (dimensionBehaviourArr[i24] == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
                            int[] iArr = constraintWidget16.f847;
                            if (iArr[i24] == 0 || iArr[i24] == 3 || iArr[i24] == i15) {
                                r1.f7272++;
                                float[] fArr = constraintWidget16.f883;
                                int i25 = r1.f7270;
                                float f4 = fArr[i25];
                                if (f4 > 0.0f) {
                                    r1.f7264 += fArr[i25];
                                }
                                int i26 = r1.f7270;
                                if (constraintWidget16.f840 != 8 && constraintWidget16.f886[i26] == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
                                    int[] iArr2 = constraintWidget16.f847;
                                    if (iArr2[i26] == 0 || iArr2[i26] == 3) {
                                        z7 = true;
                                        if (z7) {
                                            if (f4 < 0.0f) {
                                                r1.f7263 = true;
                                            } else {
                                                r1.f7271 = true;
                                            }
                                            if (r1.f7275 == null) {
                                                r1.f7275 = new ArrayList<>();
                                            }
                                            r1.f7275.add(constraintWidget16);
                                        }
                                        if (r1.f7273 == null) {
                                            r1.f7273 = constraintWidget16;
                                        }
                                        constraintWidget15 = r1.f7267;
                                        if (constraintWidget15 != null) {
                                            constraintWidget15.f862[r1.f7270] = constraintWidget16;
                                        }
                                        r1.f7267 = constraintWidget16;
                                    }
                                }
                                z7 = false;
                                if (z7) {
                                }
                                if (r1.f7273 == null) {
                                }
                                constraintWidget15 = r1.f7267;
                                if (constraintWidget15 != null) {
                                }
                                r1.f7267 = constraintWidget16;
                            }
                            if (r1.f7270 == 0) {
                                if (constraintWidget16.f874 == 0 && constraintWidget16.f877 == 0) {
                                    int i27 = constraintWidget16.f829;
                                }
                            } else if (constraintWidget16.f827 == 0 && constraintWidget16.f824 == 0) {
                                int i28 = constraintWidget16.f894;
                            }
                            float f5 = constraintWidget16.f842;
                        }
                    }
                    if (constraintWidget17 != constraintWidget16) {
                        constraintWidget17.f868[r1.f7270] = constraintWidget16;
                    }
                    ConstraintAnchor constraintAnchor6 = constraintWidget16.f856[i19 + 1].f812;
                    if (constraintAnchor6 != null) {
                        constraintWidget14 = constraintAnchor6.f813;
                        ConstraintAnchor[] constraintAnchorArr = constraintWidget14.f856;
                        if (constraintAnchorArr[i19].f812 != null) {
                        }
                    }
                    constraintWidget14 = null;
                    if (constraintWidget14 == null) {
                        constraintWidget14 = constraintWidget16;
                        z8 = true;
                    }
                    constraintWidget17 = constraintWidget16;
                    i18 = 1;
                    i17 = 8;
                    i15 = 2;
                    constraintWidget16 = constraintWidget14;
                }
                ConstraintWidget constraintWidget18 = r1.f7266;
                if (constraintWidget18 != null) {
                    r1.f7277 -= constraintWidget18.f856[i19].m456();
                }
                ConstraintWidget constraintWidget19 = r1.f7274;
                if (constraintWidget19 != null) {
                    r1.f7277 -= constraintWidget19.f856[i19 + 1].m456();
                }
                r1.f7258 = constraintWidget16;
                if (r1.f7270 != 0 || !r1.f7260) {
                    r1.f7262 = r1.f7268;
                } else {
                    r1.f7262 = r1.f7258;
                }
                r1.f7261 = r1.f7271 && r1.f7263;
            }
            r1.f7276 = true;
            if (arrayList3 == null || arrayList3.contains(r1.f7268)) {
                ConstraintWidget constraintWidget20 = r1.f7268;
                ConstraintWidget constraintWidget21 = r1.f7258;
                ConstraintWidget constraintWidget22 = r1.f7266;
                ConstraintWidget constraintWidget23 = r1.f7274;
                ConstraintWidget constraintWidget24 = r1.f7262;
                float f6 = r1.f7264;
                ConstraintWidget constraintWidget25 = r1.f7273;
                ConstraintWidget constraintWidget26 = r1.f7267;
                boolean z9 = r0.f886[i] == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT;
                if (i == 0) {
                    z5 = constraintWidget24.f898 == 0;
                    f = f6;
                    boolean z10 = constraintWidget24.f898 == 1;
                    if (constraintWidget24.f898 == 2) {
                        z6 = z10;
                        i6 = i16;
                    } else {
                        z6 = z10;
                        i6 = i16;
                        z = z6;
                        z2 = z5;
                        z3 = false;
                        ConstraintWidget constraintWidget27 = constraintWidget20;
                        z4 = false;
                        while (!z4) {
                            ConstraintAnchor constraintAnchor7 = constraintWidget27.f856[i2];
                            int i29 = z3 ? 1 : 4;
                            int r283 = constraintAnchor7.m456();
                            boolean z11 = constraintWidget27.f886[i] == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT && constraintWidget27.f847[i] == 0;
                            ConstraintAnchor constraintAnchor8 = constraintAnchor7.f812;
                            if (!(constraintAnchor8 == null || constraintWidget27 == constraintWidget20)) {
                                r283 = constraintAnchor8.m456() + r283;
                            }
                            if (!z3 || constraintWidget27 == constraintWidget20 || constraintWidget27 == constraintWidget22) {
                                r282 = r14;
                            } else {
                                r282 = r14;
                                i29 = 8;
                            }
                            ConstraintAnchor constraintAnchor9 = constraintAnchor7.f812;
                            if (constraintAnchor9 != null) {
                                if (constraintWidget27 == constraintWidget22) {
                                    i12 = i3;
                                    constraintWidget12 = constraintWidget24;
                                    r37.m5449(constraintAnchor7.f808, constraintAnchor9.f808, r283, 6);
                                } else {
                                    constraintWidget12 = constraintWidget24;
                                    i12 = i3;
                                    r37.m5449(constraintAnchor7.f808, constraintAnchor9.f808, r283, 8);
                                }
                                r37.m5455(constraintAnchor7.f808, constraintAnchor7.f812.f808, r283, (!z11 || z3) ? i29 : 5);
                            } else {
                                constraintWidget12 = constraintWidget24;
                                i12 = i3;
                            }
                            if (z9) {
                                if (constraintWidget27.f840 == 8 || constraintWidget27.f886[i] != ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
                                    i13 = 0;
                                } else {
                                    ConstraintAnchor[] constraintAnchorArr2 = constraintWidget27.f856;
                                    i13 = 0;
                                    r37.m5449(constraintAnchorArr2[i2 + 1].f808, constraintAnchorArr2[i2].f808, 0, 5);
                                }
                                r37.m5449(constraintWidget27.f856[i2].f808, r0.f856[i2].f808, i13, 8);
                            }
                            ConstraintAnchor constraintAnchor10 = constraintWidget27.f856[i2 + 1].f812;
                            if (constraintAnchor10 != null) {
                                constraintWidget13 = constraintAnchor10.f813;
                                ConstraintAnchor[] constraintAnchorArr3 = constraintWidget13.f856;
                                if (constraintAnchorArr3[i2].f812 != null) {
                                }
                            }
                            constraintWidget13 = null;
                            if (constraintWidget13 != null) {
                                constraintWidget27 = constraintWidget13;
                                z4 = z4;
                            } else {
                                z4 = true;
                            }
                            r14 = r282;
                            i3 = i12;
                            constraintWidget24 = constraintWidget12;
                        }
                        r28 = r14;
                        i4 = i3;
                        if (constraintWidget23 != null) {
                            int i30 = i2 + 1;
                            if (constraintWidget21.f856[i30].f812 != null) {
                                ConstraintAnchor constraintAnchor11 = constraintWidget23.f856[i30];
                                if ((constraintWidget23.f886[i] == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT && constraintWidget23.f847[i] == 0) && !z3) {
                                    ConstraintAnchor constraintAnchor12 = constraintAnchor11.f812;
                                    if (constraintAnchor12.f813 == r0) {
                                        r37.m5455(constraintAnchor11.f808, constraintAnchor12.f808, -constraintAnchor11.m456(), 5);
                                        r37.m5444(constraintAnchor11.f808, constraintWidget21.f856[i30].f812.f808, -constraintAnchor11.m456(), 6);
                                        if (z9) {
                                            int i31 = i2 + 1;
                                            SolverVariable solverVariable6 = r0.f856[i31].f808;
                                            ConstraintAnchor[] constraintAnchorArr4 = constraintWidget21.f856;
                                            r37.m5449(solverVariable6, constraintAnchorArr4[i31].f808, constraintAnchorArr4[i31].m456(), 8);
                                        }
                                        ArrayList<ConstraintWidget> arrayList4 = r1.f7275;
                                        if (arrayList4 != null && (size = arrayList4.size()) > 1) {
                                            float f7 = (r1.f7263 || r1.f7261) ? f : (float) r1.f7272;
                                            ConstraintWidget constraintWidget28 = null;
                                            i10 = 0;
                                            float f8 = 0.0f;
                                            while (i10 < size) {
                                                ConstraintWidget constraintWidget29 = arrayList4.get(i10);
                                                float f9 = constraintWidget29.f883[i];
                                                if (f9 >= 0.0f) {
                                                    arrayList2 = arrayList4;
                                                    f3 = 0.0f;
                                                } else if (r1.f7261) {
                                                    ConstraintAnchor[] constraintAnchorArr5 = constraintWidget29.f856;
                                                    arrayList2 = arrayList4;
                                                    r37.m5455(constraintAnchorArr5[i2 + 1].f808, constraintAnchorArr5[i2].f808, 0, 4);
                                                    r33 = r1;
                                                    i11 = size;
                                                    constraintWidget10 = constraintWidget21;
                                                    i10++;
                                                    constraintWidget21 = constraintWidget10;
                                                    arrayList4 = arrayList2;
                                                    size = i11;
                                                    r1 = r33;
                                                } else {
                                                    arrayList2 = arrayList4;
                                                    f3 = 0.0f;
                                                    f9 = 1.0f;
                                                }
                                                int i32 = (f9 > f3 ? 1 : (f9 == f3 ? 0 : -1));
                                                if (i32 == 0) {
                                                    ConstraintAnchor[] constraintAnchorArr6 = constraintWidget29.f856;
                                                    r37.m5455(constraintAnchorArr6[i2 + 1].f808, constraintAnchorArr6[i2].f808, 0, 8);
                                                    r33 = r1;
                                                    i11 = size;
                                                    constraintWidget10 = constraintWidget21;
                                                    i10++;
                                                    constraintWidget21 = constraintWidget10;
                                                    arrayList4 = arrayList2;
                                                    size = i11;
                                                    r1 = r33;
                                                } else {
                                                    if (constraintWidget28 != null) {
                                                        ConstraintAnchor[] constraintAnchorArr7 = constraintWidget28.f856;
                                                        SolverVariable solverVariable7 = constraintAnchorArr7[i2].f808;
                                                        int i33 = i2 + 1;
                                                        SolverVariable solverVariable8 = constraintAnchorArr7[i33].f808;
                                                        ConstraintAnchor[] constraintAnchorArr8 = constraintWidget29.f856;
                                                        i11 = size;
                                                        SolverVariable solverVariable9 = constraintAnchorArr8[i2].f808;
                                                        SolverVariable solverVariable10 = constraintAnchorArr8[i33].f808;
                                                        constraintWidget11 = constraintWidget29;
                                                        C2073 r5 = r37.m5448();
                                                        r33 = r1;
                                                        r5.f7139 = 0.0f;
                                                        constraintWidget10 = constraintWidget21;
                                                        if (f7 == 0.0f || f8 == f9) {
                                                            r5.f7138.m5420(solverVariable7, 1.0f);
                                                            r5.f7138.m5420(solverVariable8, -1.0f);
                                                            r5.f7138.m5420(solverVariable10, 1.0f);
                                                            r5.f7138.m5420(solverVariable9, -1.0f);
                                                        } else if (f8 == 0.0f) {
                                                            r5.f7138.m5420(solverVariable7, 1.0f);
                                                            r5.f7138.m5420(solverVariable8, -1.0f);
                                                        } else if (i32 == 0) {
                                                            r5.f7138.m5420(solverVariable9, 1.0f);
                                                            r5.f7138.m5420(solverVariable10, -1.0f);
                                                        } else {
                                                            float f10 = (f8 / f7) / (f9 / f7);
                                                            r5.f7138.m5420(solverVariable7, 1.0f);
                                                            r5.f7138.m5420(solverVariable8, -1.0f);
                                                            r5.f7138.m5420(solverVariable10, f10);
                                                            r5.f7138.m5420(solverVariable9, -f10);
                                                        }
                                                        r37.m5461(r5);
                                                    } else {
                                                        r33 = r1;
                                                        i11 = size;
                                                        constraintWidget11 = constraintWidget29;
                                                        constraintWidget10 = constraintWidget21;
                                                    }
                                                    f8 = f9;
                                                    constraintWidget28 = constraintWidget11;
                                                    i10++;
                                                    constraintWidget21 = constraintWidget10;
                                                    arrayList4 = arrayList2;
                                                    size = i11;
                                                    r1 = r33;
                                                }
                                            }
                                        }
                                        if (constraintWidget22 != null || (constraintWidget22 != constraintWidget23 && !z3)) {
                                            constraintWidget = constraintWidget23;
                                            constraintWidget3 = constraintWidget22;
                                            constraintWidget2 = constraintWidget21;
                                            i7 = i6;
                                            if (z2 || constraintWidget3 == null) {
                                                i5 = i7;
                                                int i34 = 8;
                                                if (z && constraintWidget3 != null) {
                                                    int i35 = r1.f7272;
                                                    boolean z12 = i35 <= 0 && r1.f7265 == i35;
                                                    ConstraintWidget constraintWidget30 = constraintWidget3;
                                                    constraintWidget4 = constraintWidget30;
                                                    while (constraintWidget4 != null) {
                                                        ConstraintWidget constraintWidget31 = constraintWidget4.f868[i];
                                                        while (constraintWidget31 != null && constraintWidget31.f840 == i34) {
                                                            constraintWidget31 = constraintWidget31.f868[i];
                                                        }
                                                        if (constraintWidget4 == constraintWidget3 || constraintWidget4 == constraintWidget || constraintWidget31 == null) {
                                                            constraintWidget5 = constraintWidget30;
                                                            i8 = 8;
                                                        } else {
                                                            ConstraintWidget constraintWidget32 = constraintWidget31 == constraintWidget ? null : constraintWidget31;
                                                            ConstraintAnchor constraintAnchor13 = constraintWidget4.f856[i2];
                                                            SolverVariable solverVariable11 = constraintAnchor13.f808;
                                                            ConstraintAnchor constraintAnchor14 = constraintAnchor13.f812;
                                                            if (constraintAnchor14 != null) {
                                                                SolverVariable solverVariable12 = constraintAnchor14.f808;
                                                            }
                                                            int i36 = i2 + 1;
                                                            SolverVariable solverVariable13 = constraintWidget30.f856[i36].f808;
                                                            int r12 = constraintAnchor13.m456();
                                                            int r52 = constraintWidget4.f856[i36].m456();
                                                            if (constraintWidget32 != null) {
                                                                constraintAnchor4 = constraintWidget32.f856[i2];
                                                                solverVariable3 = constraintAnchor4.f808;
                                                                ConstraintAnchor constraintAnchor15 = constraintAnchor4.f812;
                                                                solverVariable2 = constraintAnchor15 != null ? constraintAnchor15.f808 : null;
                                                            } else {
                                                                constraintAnchor4 = constraintWidget.f856[i2];
                                                                solverVariable3 = constraintAnchor4 != null ? constraintAnchor4.f808 : null;
                                                                solverVariable2 = constraintWidget4.f856[i36].f808;
                                                            }
                                                            int r19 = constraintAnchor4 != null ? constraintAnchor4.m456() + r52 : r52;
                                                            int r4 = constraintWidget30.f856[i36].m456() + r12;
                                                            int i37 = z12 ? 8 : 4;
                                                            if (solverVariable11 == null || solverVariable13 == null || solverVariable3 == null || solverVariable2 == null) {
                                                                constraintWidget6 = constraintWidget32;
                                                                constraintWidget5 = constraintWidget30;
                                                                i8 = 8;
                                                            } else {
                                                                constraintWidget6 = constraintWidget32;
                                                                constraintWidget5 = constraintWidget30;
                                                                i8 = 8;
                                                                r37.m5458(solverVariable11, solverVariable13, r4, 0.5f, solverVariable3, solverVariable2, r19, i37);
                                                            }
                                                            constraintWidget31 = constraintWidget6;
                                                        }
                                                        constraintWidget30 = constraintWidget4.f840 != i8 ? constraintWidget4 : constraintWidget5;
                                                        constraintWidget4 = constraintWidget31;
                                                        i34 = 8;
                                                    }
                                                    ConstraintAnchor constraintAnchor16 = constraintWidget3.f856[i2];
                                                    constraintAnchor = constraintWidget20.f856[i2].f812;
                                                    int i38 = i2 + 1;
                                                    constraintAnchor2 = constraintWidget.f856[i38];
                                                    constraintAnchor3 = constraintWidget2.f856[i38].f812;
                                                    if (constraintAnchor != null) {
                                                        if (constraintWidget3 != constraintWidget) {
                                                            r37.m5455(constraintAnchor16.f808, constraintAnchor.f808, constraintAnchor16.m456(), 5);
                                                        } else if (constraintAnchor3 != null) {
                                                            r37.m5458(constraintAnchor16.f808, constraintAnchor.f808, constraintAnchor16.m456(), 0.5f, constraintAnchor2.f808, constraintAnchor3.f808, constraintAnchor2.m456(), 5);
                                                        }
                                                    }
                                                    if (!(constraintAnchor3 == null || constraintWidget3 == constraintWidget)) {
                                                        r37.m5455(constraintAnchor2.f808, constraintAnchor3.f808, -constraintAnchor2.m456(), 5);
                                                    }
                                                }
                                                if (!(!(z2 || z) || constraintWidget3 == null || constraintWidget3 == constraintWidget)) {
                                                    ConstraintAnchor constraintAnchor17 = constraintWidget3.f856[i2];
                                                    int i39 = i2 + 1;
                                                    ConstraintAnchor constraintAnchor18 = constraintWidget.f856[i39];
                                                    ConstraintAnchor constraintAnchor19 = constraintAnchor17.f812;
                                                    SolverVariable solverVariable14 = constraintAnchor19 == null ? constraintAnchor19.f808 : null;
                                                    ConstraintAnchor constraintAnchor20 = constraintAnchor18.f812;
                                                    SolverVariable solverVariable15 = constraintAnchor20 == null ? constraintAnchor20.f808 : null;
                                                    if (constraintWidget2 != constraintWidget) {
                                                        ConstraintAnchor constraintAnchor21 = constraintWidget2.f856[i39].f812;
                                                        if (constraintAnchor21 != null) {
                                                            solverVariable15 = constraintAnchor21.f808;
                                                        } else {
                                                            solverVariable = null;
                                                            if (constraintWidget3 == constraintWidget) {
                                                                ConstraintAnchor[] constraintAnchorArr9 = constraintWidget3.f856;
                                                                constraintAnchor17 = constraintAnchorArr9[i2];
                                                                constraintAnchor18 = constraintAnchorArr9[i39];
                                                            }
                                                            if (!(solverVariable14 == null || solverVariable == null)) {
                                                                r37.m5458(constraintAnchor17.f808, solverVariable14, constraintAnchor17.m456(), 0.5f, solverVariable, constraintAnchor18.f808, constraintWidget.f856[i39].m456(), 5);
                                                            }
                                                        }
                                                    }
                                                    solverVariable = solverVariable15;
                                                    if (constraintWidget3 == constraintWidget) {
                                                    }
                                                    r37.m5458(constraintAnchor17.f808, solverVariable14, constraintAnchor17.m456(), 0.5f, solverVariable, constraintAnchor18.f808, constraintWidget.f856[i39].m456(), 5);
                                                }
                                            } else {
                                                int i40 = r1.f7272;
                                                boolean z13 = i40 > 0 && r1.f7265 == i40;
                                                ConstraintWidget constraintWidget33 = constraintWidget3;
                                                for (ConstraintWidget constraintWidget34 = constraintWidget33; constraintWidget34 != null; constraintWidget34 = constraintWidget7) {
                                                    ConstraintWidget constraintWidget35 = constraintWidget34.f868[i];
                                                    while (true) {
                                                        if (constraintWidget35 == null) {
                                                            break;
                                                        }
                                                        if (constraintWidget35.f840 != 8) {
                                                            break;
                                                        }
                                                        constraintWidget35 = constraintWidget35.f868[i];
                                                    }
                                                    if (constraintWidget35 != null || constraintWidget34 == constraintWidget) {
                                                        ConstraintAnchor constraintAnchor22 = constraintWidget34.f856[i2];
                                                        SolverVariable solverVariable16 = constraintAnchor22.f808;
                                                        ConstraintAnchor constraintAnchor23 = constraintAnchor22.f812;
                                                        SolverVariable solverVariable17 = constraintAnchor23 != null ? constraintAnchor23.f808 : null;
                                                        if (constraintWidget33 != constraintWidget34) {
                                                            solverVariable17 = constraintWidget33.f856[i2 + 1].f808;
                                                        } else if (constraintWidget34 == constraintWidget3 && constraintWidget33 == constraintWidget34) {
                                                            ConstraintAnchor[] constraintAnchorArr10 = constraintWidget20.f856;
                                                            solverVariable17 = constraintAnchorArr10[i2].f812 != null ? constraintAnchorArr10[i2].f812.f808 : null;
                                                        }
                                                        int r13 = constraintAnchor22.m456();
                                                        int i41 = i2 + 1;
                                                        int r42 = constraintWidget34.f856[i41].m456();
                                                        if (constraintWidget35 != null) {
                                                            ConstraintAnchor constraintAnchor24 = constraintWidget35.f856[i2];
                                                            solverVariable4 = constraintAnchor24.f808;
                                                            constraintAnchor5 = constraintAnchor24;
                                                            solverVariable5 = constraintWidget34.f856[i41].f808;
                                                        } else {
                                                            ConstraintAnchor constraintAnchor25 = constraintWidget2.f856[i41].f812;
                                                            if (constraintAnchor25 != null) {
                                                                solverVariable4 = constraintAnchor25.f808;
                                                                constraintAnchor5 = constraintAnchor25;
                                                            } else {
                                                                constraintAnchor5 = constraintAnchor25;
                                                                solverVariable4 = null;
                                                            }
                                                            solverVariable5 = constraintWidget34.f856[i41].f808;
                                                        }
                                                        if (constraintAnchor5 != null) {
                                                            r42 = constraintAnchor5.m456() + r42;
                                                        }
                                                        int i42 = r42;
                                                        if (constraintWidget33 != null) {
                                                            r13 += constraintWidget33.f856[i41].m456();
                                                        }
                                                        if (!(solverVariable16 == null || solverVariable17 == null || solverVariable4 == null || solverVariable5 == null)) {
                                                            if (constraintWidget34 == constraintWidget3) {
                                                                r13 = constraintWidget3.f856[i2].m456();
                                                            }
                                                            if (constraintWidget34 == constraintWidget) {
                                                                i42 = constraintWidget.f856[i41].m456();
                                                            }
                                                            constraintWidget7 = constraintWidget35;
                                                            i9 = i7;
                                                            constraintWidget8 = constraintWidget33;
                                                            constraintWidget9 = constraintWidget34;
                                                            r37.m5458(solverVariable16, solverVariable17, r13, 0.5f, solverVariable4, solverVariable5, i42, z13 ? 8 : 5);
                                                            constraintWidget33 = constraintWidget9.f840 == 8 ? constraintWidget9 : constraintWidget8;
                                                            i7 = i9;
                                                        }
                                                    }
                                                    constraintWidget7 = constraintWidget35;
                                                    constraintWidget8 = constraintWidget33;
                                                    constraintWidget9 = constraintWidget34;
                                                    i9 = i7;
                                                    if (constraintWidget9.f840 == 8) {
                                                    }
                                                    i7 = i9;
                                                }
                                            }
                                        } else {
                                            ConstraintAnchor constraintAnchor26 = constraintWidget20.f856[i2];
                                            constraintWidget2 = constraintWidget21;
                                            int i43 = i2 + 1;
                                            ConstraintAnchor constraintAnchor27 = constraintWidget2.f856[i43];
                                            ConstraintAnchor constraintAnchor28 = constraintAnchor26.f812;
                                            SolverVariable solverVariable18 = constraintAnchor28 != null ? constraintAnchor28.f808 : null;
                                            ConstraintAnchor constraintAnchor29 = constraintAnchor27.f812;
                                            SolverVariable solverVariable19 = constraintAnchor29 != null ? constraintAnchor29.f808 : null;
                                            ConstraintAnchor constraintAnchor30 = constraintWidget22.f856[i2];
                                            ConstraintAnchor constraintAnchor31 = constraintWidget23.f856[i43];
                                            if (solverVariable18 == null || solverVariable19 == null) {
                                                constraintWidget = constraintWidget23;
                                                constraintWidget3 = constraintWidget22;
                                                i5 = i6;
                                                ConstraintAnchor constraintAnchor172 = constraintWidget3.f856[i2];
                                                int i392 = i2 + 1;
                                                ConstraintAnchor constraintAnchor182 = constraintWidget.f856[i392];
                                                ConstraintAnchor constraintAnchor192 = constraintAnchor172.f812;
                                                if (constraintAnchor192 == null) {
                                                }
                                                ConstraintAnchor constraintAnchor202 = constraintAnchor182.f812;
                                                if (constraintAnchor202 == null) {
                                                }
                                                if (constraintWidget2 != constraintWidget) {
                                                }
                                                solverVariable = solverVariable15;
                                                if (constraintWidget3 == constraintWidget) {
                                                }
                                                r37.m5458(constraintAnchor172.f808, solverVariable14, constraintAnchor172.m456(), 0.5f, solverVariable, constraintAnchor182.f808, constraintWidget.f856[i392].m456(), 5);
                                            } else {
                                                if (i == 0) {
                                                    f2 = constraintWidget24.f878;
                                                } else {
                                                    f2 = constraintWidget24.f888;
                                                }
                                                constraintWidget = constraintWidget23;
                                                constraintWidget3 = constraintWidget22;
                                                i7 = i6;
                                                r37.m5458(constraintAnchor30.f808, solverVariable18, constraintAnchor30.m456(), f2, solverVariable19, constraintAnchor31.f808, constraintAnchor31.m456(), 7);
                                            }
                                        }
                                        i5 = i7;
                                        ConstraintAnchor constraintAnchor1722 = constraintWidget3.f856[i2];
                                        int i3922 = i2 + 1;
                                        ConstraintAnchor constraintAnchor1822 = constraintWidget.f856[i3922];
                                        ConstraintAnchor constraintAnchor1922 = constraintAnchor1722.f812;
                                        if (constraintAnchor1922 == null) {
                                        }
                                        ConstraintAnchor constraintAnchor2022 = constraintAnchor1822.f812;
                                        if (constraintAnchor2022 == null) {
                                        }
                                        if (constraintWidget2 != constraintWidget) {
                                        }
                                        solverVariable = solverVariable15;
                                        if (constraintWidget3 == constraintWidget) {
                                        }
                                        r37.m5458(constraintAnchor1722.f808, solverVariable14, constraintAnchor1722.m456(), 0.5f, solverVariable, constraintAnchor1822.f808, constraintWidget.f856[i3922].m456(), 5);
                                    }
                                }
                                if (z3) {
                                    ConstraintAnchor constraintAnchor32 = constraintAnchor11.f812;
                                    if (constraintAnchor32.f813 == r0) {
                                        r37.m5455(constraintAnchor11.f808, constraintAnchor32.f808, -constraintAnchor11.m456(), 4);
                                    }
                                }
                                r37.m5444(constraintAnchor11.f808, constraintWidget21.f856[i30].f812.f808, -constraintAnchor11.m456(), 6);
                                if (z9) {
                                }
                                ArrayList<ConstraintWidget> arrayList42 = r1.f7275;
                                if (r1.f7263) {
                                }
                                ConstraintWidget constraintWidget282 = null;
                                i10 = 0;
                                float f82 = 0.0f;
                                while (i10 < size) {
                                }
                                if (constraintWidget22 != null) {
                                }
                                constraintWidget = constraintWidget23;
                                constraintWidget3 = constraintWidget22;
                                constraintWidget2 = constraintWidget21;
                                i7 = i6;
                                if (z2) {
                                }
                                i5 = i7;
                                int i342 = 8;
                                int i352 = r1.f7272;
                                if (i352 <= 0) {
                                }
                                ConstraintWidget constraintWidget302 = constraintWidget3;
                                constraintWidget4 = constraintWidget302;
                                while (constraintWidget4 != null) {
                                }
                                ConstraintAnchor constraintAnchor162 = constraintWidget3.f856[i2];
                                constraintAnchor = constraintWidget20.f856[i2].f812;
                                int i382 = i2 + 1;
                                constraintAnchor2 = constraintWidget.f856[i382];
                                constraintAnchor3 = constraintWidget2.f856[i382].f812;
                                if (constraintAnchor != null) {
                                }
                                r37.m5455(constraintAnchor2.f808, constraintAnchor3.f808, -constraintAnchor2.m456(), 5);
                                ConstraintAnchor constraintAnchor17222 = constraintWidget3.f856[i2];
                                int i39222 = i2 + 1;
                                ConstraintAnchor constraintAnchor18222 = constraintWidget.f856[i39222];
                                ConstraintAnchor constraintAnchor19222 = constraintAnchor17222.f812;
                                if (constraintAnchor19222 == null) {
                                }
                                ConstraintAnchor constraintAnchor20222 = constraintAnchor18222.f812;
                                if (constraintAnchor20222 == null) {
                                }
                                if (constraintWidget2 != constraintWidget) {
                                }
                                solverVariable = solverVariable15;
                                if (constraintWidget3 == constraintWidget) {
                                }
                                r37.m5458(constraintAnchor17222.f808, solverVariable14, constraintAnchor17222.m456(), 0.5f, solverVariable, constraintAnchor18222.f808, constraintWidget.f856[i39222].m456(), 5);
                            }
                        }
                        if (z9) {
                        }
                        ArrayList<ConstraintWidget> arrayList422 = r1.f7275;
                        if (r1.f7263) {
                        }
                        ConstraintWidget constraintWidget2822 = null;
                        i10 = 0;
                        float f822 = 0.0f;
                        while (i10 < size) {
                        }
                        if (constraintWidget22 != null) {
                        }
                        constraintWidget = constraintWidget23;
                        constraintWidget3 = constraintWidget22;
                        constraintWidget2 = constraintWidget21;
                        i7 = i6;
                        if (z2) {
                        }
                        i5 = i7;
                        int i3422 = 8;
                        int i3522 = r1.f7272;
                        if (i3522 <= 0) {
                        }
                        ConstraintWidget constraintWidget3022 = constraintWidget3;
                        constraintWidget4 = constraintWidget3022;
                        while (constraintWidget4 != null) {
                        }
                        ConstraintAnchor constraintAnchor1622 = constraintWidget3.f856[i2];
                        constraintAnchor = constraintWidget20.f856[i2].f812;
                        int i3822 = i2 + 1;
                        constraintAnchor2 = constraintWidget.f856[i3822];
                        constraintAnchor3 = constraintWidget2.f856[i3822].f812;
                        if (constraintAnchor != null) {
                        }
                        r37.m5455(constraintAnchor2.f808, constraintAnchor3.f808, -constraintAnchor2.m456(), 5);
                        ConstraintAnchor constraintAnchor172222 = constraintWidget3.f856[i2];
                        int i392222 = i2 + 1;
                        ConstraintAnchor constraintAnchor182222 = constraintWidget.f856[i392222];
                        ConstraintAnchor constraintAnchor192222 = constraintAnchor172222.f812;
                        if (constraintAnchor192222 == null) {
                        }
                        ConstraintAnchor constraintAnchor202222 = constraintAnchor182222.f812;
                        if (constraintAnchor202222 == null) {
                        }
                        if (constraintWidget2 != constraintWidget) {
                        }
                        solverVariable = solverVariable15;
                        if (constraintWidget3 == constraintWidget) {
                        }
                        r37.m5458(constraintAnchor172222.f808, solverVariable14, constraintAnchor172222.m456(), 0.5f, solverVariable, constraintAnchor182222.f808, constraintWidget.f856[i392222].m456(), 5);
                    }
                } else {
                    f = f6;
                    z5 = constraintWidget24.f834 == 0;
                    z6 = constraintWidget24.f834 == 1;
                    i6 = i16;
                }
                z = z6;
                z2 = z5;
                z3 = true;
                ConstraintWidget constraintWidget272 = constraintWidget20;
                z4 = false;
                while (!z4) {
                }
                r28 = r14;
                i4 = i3;
                if (constraintWidget23 != null) {
                }
                if (z9) {
                }
                ArrayList<ConstraintWidget> arrayList4222 = r1.f7275;
                if (r1.f7263) {
                }
                ConstraintWidget constraintWidget28222 = null;
                i10 = 0;
                float f8222 = 0.0f;
                while (i10 < size) {
                }
                if (constraintWidget22 != null) {
                }
                constraintWidget = constraintWidget23;
                constraintWidget3 = constraintWidget22;
                constraintWidget2 = constraintWidget21;
                i7 = i6;
                if (z2) {
                }
                i5 = i7;
                int i34222 = 8;
                int i35222 = r1.f7272;
                if (i35222 <= 0) {
                }
                ConstraintWidget constraintWidget30222 = constraintWidget3;
                constraintWidget4 = constraintWidget30222;
                while (constraintWidget4 != null) {
                }
                ConstraintAnchor constraintAnchor16222 = constraintWidget3.f856[i2];
                constraintAnchor = constraintWidget20.f856[i2].f812;
                int i38222 = i2 + 1;
                constraintAnchor2 = constraintWidget.f856[i38222];
                constraintAnchor3 = constraintWidget2.f856[i38222].f812;
                if (constraintAnchor != null) {
                }
                r37.m5455(constraintAnchor2.f808, constraintAnchor3.f808, -constraintAnchor2.m456(), 5);
                ConstraintAnchor constraintAnchor1722222 = constraintWidget3.f856[i2];
                int i3922222 = i2 + 1;
                ConstraintAnchor constraintAnchor1822222 = constraintWidget.f856[i3922222];
                ConstraintAnchor constraintAnchor1922222 = constraintAnchor1722222.f812;
                if (constraintAnchor1922222 == null) {
                }
                ConstraintAnchor constraintAnchor2022222 = constraintAnchor1822222.f812;
                if (constraintAnchor2022222 == null) {
                }
                if (constraintWidget2 != constraintWidget) {
                }
                solverVariable = solverVariable15;
                if (constraintWidget3 == constraintWidget) {
                }
                r37.m5458(constraintAnchor1722222.f808, solverVariable14, constraintAnchor1722222.m456(), 0.5f, solverVariable, constraintAnchor1822222.f808, constraintWidget.f856[i3922222].m456(), 5);
            } else {
                i5 = i16;
                r28 = r14;
                i4 = i3;
            }
            i16 = i5 + 1;
            r0 = r36;
            arrayList3 = arrayList;
            r14 = r28;
            i3 = i4;
            i15 = 2;
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static String m6283(Context context, ComponentName componentName) throws PackageManager.NameNotFoundException {
        String string;
        PackageManager packageManager = context.getPackageManager();
        int i = Build.VERSION.SDK_INT;
        int i2 = 640;
        int i3 = Build.VERSION.SDK_INT;
        if (i3 >= 29) {
            i2 = 269222528;
        } else if (i3 >= 24) {
            i2 = 787072;
        }
        ActivityInfo activityInfo = packageManager.getActivityInfo(componentName, i2);
        int i4 = Build.VERSION.SDK_INT;
        String str = activityInfo.parentActivityName;
        if (str != null) {
            return str;
        }
        if (activityInfo.metaData == null || (string = activityInfo.metaData.getString("android.support.PARENT_ACTIVITY")) == null) {
            return null;
        }
        if (string.charAt(0) != '.') {
            return string;
        }
        return context.getPackageName() + string;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static int m6278(Drawable drawable) {
        if (Build.VERSION.SDK_INT >= 23) {
            return drawable.getLayoutDirection();
        }
        if (!f8180) {
            try {
                f8198 = Drawable.class.getDeclaredMethod("getLayoutDirection", new Class[0]);
                f8198.setAccessible(true);
            } catch (NoSuchMethodException e) {
                Log.i("DrawableCompat", "Failed to retrieve getLayoutDirection() method", e);
            }
            f8180 = true;
        }
        Method method = f8198;
        if (method != null) {
            try {
                return ((Integer) method.invoke(drawable, new Object[0])).intValue();
            } catch (Exception e2) {
                Log.i("DrawableCompat", "Failed to invoke getLayoutDirection() via reflection", e2);
                f8198 = null;
            }
        }
        return 0;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static float[] m6348(float[] fArr, int i, int i2) {
        if (i <= i2) {
            int length = fArr.length;
            if (i < 0 || i > length) {
                throw new ArrayIndexOutOfBoundsException();
            }
            int i3 = i2 - i;
            int min = Math.min(i3, length - i);
            float[] fArr2 = new float[i3];
            System.arraycopy(fArr, i, fArr2, 0, min);
            return fArr2;
        }
        throw new IllegalArgumentException();
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m6346(XmlPullParser xmlPullParser, String str) {
        return xmlPullParser.getAttributeValue(Chip.NAMESPACE_ANDROID, str) != null;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6299(ViewGroup.MarginLayoutParams marginLayoutParams) {
        int i = Build.VERSION.SDK_INT;
        return marginLayoutParams.getMarginEnd();
    }

    /* renamed from: K  reason: contains not printable characters */
    public static Interpolator m6309(float f, float f2) {
        int i = Build.VERSION.SDK_INT;
        return new PathInterpolator(f, f2);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static float m6290(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, float f) {
        if (!m6346(xmlPullParser, str)) {
            return f;
        }
        return typedArray.getFloat(i, f);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static String m6316(View view) {
        try {
            return view.getContext().getResources().getResourceEntryName(view.getId());
        } catch (Exception unused) {
            return "UNKNOWN";
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static ColorStateList m6303(Resources resources, XmlPullParser xmlPullParser, Resources.Theme theme) throws XmlPullParserException, IOException {
        int next;
        AttributeSet asAttributeSet = Xml.asAttributeSet(xmlPullParser);
        do {
            next = xmlPullParser.next();
            if (next == 2) {
                break;
            }
        } while (next != 1);
        if (next == 2) {
            return m6304(resources, xmlPullParser, asAttributeSet, theme);
        }
        throw new XmlPullParserException("No start tag found");
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6333(PopupWindow popupWindow, boolean z) {
        if (Build.VERSION.SDK_INT >= 23) {
            popupWindow.setOverlapAnchor(z);
            return;
        }
        if (!f8197) {
            try {
                f8182 = PopupWindow.class.getDeclaredField("mOverlapAnchor");
                f8182.setAccessible(true);
            } catch (NoSuchFieldException e) {
                Log.i("PopupWindowCompatApi21", "Could not fetch mOverlapAnchor field from PopupWindow", e);
            }
            f8197 = true;
        }
        Field field = f8182;
        if (field != null) {
            try {
                field.set(popupWindow, Boolean.valueOf(z));
            } catch (IllegalAccessException e2) {
                Log.i("PopupWindowCompatApi21", "Could not set overlap anchor field in PopupWindow", e2);
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6300(Object... objArr) {
        int i = Build.VERSION.SDK_INT;
        return Objects.hash(objArr);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static IBinder m6308(Bundle bundle, String str) {
        int i = Build.VERSION.SDK_INT;
        return bundle.getBinder(str);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static ByteBuffer m6318(Context context, CancellationSignal cancellationSignal, Uri uri) {
        try {
            ParcelFileDescriptor openFileDescriptor = context.getContentResolver().openFileDescriptor(uri, "r", cancellationSignal);
            if (openFileDescriptor == null) {
                if (openFileDescriptor != null) {
                    openFileDescriptor.close();
                }
                return null;
            }
            try {
                FileInputStream fileInputStream = new FileInputStream(openFileDescriptor.getFileDescriptor());
                try {
                    FileChannel channel = fileInputStream.getChannel();
                    MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
                    fileInputStream.close();
                    openFileDescriptor.close();
                    return map;
                } catch (Throwable th) {
                    th.addSuppressed(th);
                }
            } catch (Throwable th2) {
                th.addSuppressed(th2);
            }
            throw th;
            throw th;
        } catch (IOException unused) {
            return null;
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r8v16, types: [java.lang.Object[], java.lang.Object] */
    /* JADX WARNING: Unknown variable types count: 1 */
    /* renamed from: K  reason: contains not printable characters */
    public static ColorStateList m6304(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
        int depth;
        TypedArray typedArray;
        String name = xmlPullParser.getName();
        if (name.equals("selector")) {
            int i = 1;
            int depth2 = xmlPullParser.getDepth() + 1;
            int[][] iArr = new int[20][];
            int[] iArr2 = new int[iArr.length];
            int i2 = 0;
            while (true) {
                int next = xmlPullParser.next();
                if (next == i || ((depth = xmlPullParser.getDepth()) < depth2 && next == 3)) {
                    int[] iArr3 = new int[i2];
                    int[][] iArr4 = new int[i2][];
                    System.arraycopy(iArr2, 0, iArr3, 0, i2);
                    System.arraycopy(iArr, 0, iArr4, 0, i2);
                } else {
                    if (next == 2 && depth <= depth2 && xmlPullParser.getName().equals("item")) {
                        int[] iArr5 = R$styleable.ColorStateListItem;
                        if (theme == null) {
                            typedArray = resources.obtainAttributes(attributeSet, iArr5);
                        } else {
                            typedArray = theme.obtainStyledAttributes(attributeSet, iArr5, 0, 0);
                        }
                        int color = typedArray.getColor(R$styleable.ColorStateListItem_android_color, -65281);
                        float f = 1.0f;
                        if (typedArray.hasValue(R$styleable.ColorStateListItem_android_alpha)) {
                            f = typedArray.getFloat(R$styleable.ColorStateListItem_android_alpha, 1.0f);
                        } else if (typedArray.hasValue(R$styleable.ColorStateListItem_alpha)) {
                            f = typedArray.getFloat(R$styleable.ColorStateListItem_alpha, 1.0f);
                        }
                        typedArray.recycle();
                        int attributeCount = attributeSet.getAttributeCount();
                        int[] iArr6 = new int[attributeCount];
                        int i3 = 0;
                        for (int i4 = 0; i4 < attributeCount; i4++) {
                            int attributeNameResource = attributeSet.getAttributeNameResource(i4);
                            if (!(attributeNameResource == 16843173 || attributeNameResource == 16843551 || attributeNameResource == R$attr.alpha)) {
                                int i5 = i3 + 1;
                                if (!attributeSet.getAttributeBooleanValue(i4, false)) {
                                    attributeNameResource = -attributeNameResource;
                                }
                                iArr6[i3] = attributeNameResource;
                                i3 = i5;
                            }
                        }
                        int[] trimStateSet = StateSet.trimStateSet(iArr6, i3);
                        int round = (Math.round(((float) Color.alpha(color)) * f) << 24) | (color & 16777215);
                        int i6 = i2 + 1;
                        if (i6 > iArr2.length) {
                            int[] iArr7 = new int[m6351(i2)];
                            System.arraycopy(iArr2, 0, iArr7, 0, i2);
                            iArr2 = iArr7;
                        }
                        iArr2[i2] = round;
                        if (i6 > iArr.length) {
                            ?? r8 = (Object[]) Array.newInstance(iArr.getClass().getComponentType(), m6351(i2));
                            System.arraycopy(iArr, 0, r8, 0, i2);
                            iArr = r8;
                        }
                        iArr[i2] = trimStateSet;
                        iArr = iArr;
                        i2 = i6;
                    }
                    i = 1;
                }
            }
            int[] iArr32 = new int[i2];
            int[][] iArr42 = new int[i2][];
            System.arraycopy(iArr2, 0, iArr32, 0, i2);
            System.arraycopy(iArr, 0, iArr42, 0, i2);
            return new ColorStateList(iArr42, iArr32);
        }
        throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": invalid color state list tag " + name);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static <T> T m6311(T t) {
        if (t != null) {
            return t;
        }
        throw new NullPointerException();
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6298(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
        if (!m6346(xmlPullParser, str)) {
            return i2;
        }
        return typedArray.getColor(i, i2);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C1708[] m6349(C1708[] r4) {
        if (r4 == null) {
            return null;
        }
        C1708[] r0 = new C1708[r4.length];
        for (int i = 0; i < r4.length; i++) {
            r0[i] = new C1708(r4[i]);
        }
        return r0;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static Drawable m6307(CompoundButton compoundButton) {
        if (Build.VERSION.SDK_INT >= 23) {
            return compoundButton.getButtonDrawable();
        }
        if (!f8181) {
            try {
                f8191 = CompoundButton.class.getDeclaredField("mButtonDrawable");
                f8191.setAccessible(true);
            } catch (NoSuchFieldException e) {
                Log.i("CompoundButtonCompat", "Failed to retrieve mButtonDrawable field", e);
            }
            f8181 = true;
        }
        Field field = f8191;
        if (field != null) {
            try {
                return (Drawable) field.get(compoundButton);
            } catch (IllegalAccessException e2) {
                Log.i("CompoundButtonCompat", "Failed to get button drawable via reflection", e2);
                f8191 = null;
            }
        }
        return null;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static Intent m6301(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        Intent parentActivityIntent = activity.getParentActivityIntent();
        if (parentActivityIntent != null) {
            return parentActivityIntent;
        }
        try {
            String r0 = m6283((Context) activity, activity.getComponentName());
            if (r0 == null) {
                return null;
            }
            ComponentName componentName = new ComponentName(activity, r0);
            try {
                if (m6283((Context) activity, componentName) == null) {
                    return Intent.makeMainActivity(componentName);
                }
                return new Intent().setComponent(componentName);
            } catch (PackageManager.NameNotFoundException unused) {
                Log.e("NavUtils", "getParentActivityIntent: bad parentActivityName '" + r0 + "' in manifest");
                return null;
            }
        } catch (PackageManager.NameNotFoundException e) {
            throw new IllegalArgumentException(e);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6296(Context context, String str) {
        int myPid = Process.myPid();
        int myUid = Process.myUid();
        String packageName = context.getPackageName();
        if (context.checkPermission(str, myPid, myUid) == -1) {
            return -1;
        }
        String permissionToOp = Build.VERSION.SDK_INT >= 23 ? AppOpsManager.permissionToOp(str) : null;
        if (permissionToOp != null) {
            if (packageName == null) {
                String[] packagesForUid = context.getPackageManager().getPackagesForUid(myUid);
                if (packagesForUid == null || packagesForUid.length <= 0) {
                    return -1;
                }
                packageName = packagesForUid[0];
            }
            if ((Build.VERSION.SDK_INT >= 23 ? ((AppOpsManager) context.getSystemService(AppOpsManager.class)).noteProxyOpNoThrow(permissionToOp, packageName) : 1) != 0) {
                return -2;
            }
        }
        return 0;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static <T> T m6312(T t, Object obj) {
        if (t != null) {
            return t;
        }
        throw new NullPointerException(String.valueOf(obj));
    }

    /* renamed from: K  reason: contains not printable characters */
    public static String m6314(Context context, int i) {
        if (i == -1) {
            return "UNKNOWN";
        }
        try {
            return context.getResources().getResourceEntryName(i);
        } catch (Exception unused) {
            return C1293.m3408("?", i);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C1802 m6322(TypedArray typedArray, XmlPullParser xmlPullParser, Resources.Theme theme, String str, int i, int i2) {
        C1802 k;
        if (m6346(xmlPullParser, str)) {
            TypedValue typedValue = new TypedValue();
            typedArray.getValue(i, typedValue);
            int i3 = typedValue.type;
            if (i3 >= 28 && i3 <= 31) {
                return new C1802(null, null, typedValue.data);
            }
            try {
                k = C1802.m4676(typedArray.getResources(), typedArray.getResourceId(i, 0), theme);
            } catch (Exception e) {
                Log.e("ComplexColorCompat", "Failed to inflate ComplexColor.", e);
                k = null;
            }
            if (k != null) {
                return k;
            }
        }
        return new C1802(null, null, i2);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m6347(C1708[] r4, C1708[] r5) {
        if (r4 == null || r5 == null || r4.length != r5.length) {
            return false;
        }
        for (int i = 0; i < r4.length; i++) {
            if (!(r4[i].f6000 == r5[i].f6000 && r4[i].f5999.length == r5[i].f5999.length)) {
                return false;
            }
        }
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6293(int i, int i2) {
        int i3 = Build.VERSION.SDK_INT;
        return Gravity.getAbsoluteGravity(i, i2);
    }

    /* JADX WARNING: Removed duplicated region for block: B:25:0x0047 A[SYNTHETIC, Splitter:B:25:0x0047] */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x0050 A[SYNTHETIC, Splitter:B:31:0x0050] */
    /* renamed from: K  reason: contains not printable characters */
    public static boolean m6344(File file, InputStream inputStream) {
        Throwable th;
        IOException e;
        StrictMode.ThreadPolicy allowThreadDiskWrites = StrictMode.allowThreadDiskWrites();
        FileOutputStream fileOutputStream = null;
        try {
            FileOutputStream fileOutputStream2 = new FileOutputStream(file, false);
            try {
                byte[] bArr = new byte[RecyclerView.AbstractC0269.FLAG_ADAPTER_FULLUPDATE];
                while (true) {
                    int read = inputStream.read(bArr);
                    if (read == -1) {
                        break;
                    }
                    fileOutputStream2.write(bArr, 0, read);
                }
                try {
                    fileOutputStream2.close();
                } catch (IOException unused) {
                }
                StrictMode.setThreadPolicy(allowThreadDiskWrites);
                return true;
            } catch (IOException e2) {
                e = e2;
                fileOutputStream = fileOutputStream2;
                try {
                    Log.e("TypefaceCompatUtil", "Error copying resource contents to temp file: " + e.getMessage());
                    if (fileOutputStream != null) {
                    }
                    StrictMode.setThreadPolicy(allowThreadDiskWrites);
                    return false;
                } catch (Throwable th2) {
                    th = th2;
                    if (fileOutputStream != null) {
                        try {
                            fileOutputStream.close();
                        } catch (IOException unused2) {
                        }
                    }
                    StrictMode.setThreadPolicy(allowThreadDiskWrites);
                    throw th;
                }
            } catch (Throwable th3) {
                th = th3;
                fileOutputStream = fileOutputStream2;
                if (fileOutputStream != null) {
                }
                StrictMode.setThreadPolicy(allowThreadDiskWrites);
                throw th;
            }
        } catch (IOException e3) {
            e = e3;
            Log.e("TypefaceCompatUtil", "Error copying resource contents to temp file: " + e.getMessage());
            if (fileOutputStream != null) {
                try {
                    fileOutputStream.close();
                } catch (IOException unused3) {
                }
            }
            StrictMode.setThreadPolicy(allowThreadDiskWrites);
            return false;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6329(Drawable drawable, ColorStateList colorStateList) {
        int i = Build.VERSION.SDK_INT;
        drawable.setTintList(colorStateList);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6332(PopupWindow popupWindow, int i) {
        if (Build.VERSION.SDK_INT >= 23) {
            popupWindow.setWindowLayoutType(i);
            return;
        }
        if (!f8192) {
            try {
                f8184 = PopupWindow.class.getDeclaredMethod("setWindowLayoutType", Integer.TYPE);
                f8184.setAccessible(true);
            } catch (Exception unused) {
            }
            f8192 = true;
        }
        Method method = f8184;
        if (method != null) {
            try {
                method.invoke(popupWindow, Integer.valueOf(i));
            } catch (Exception unused2) {
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6297(Resources resources, int i, Resources.Theme theme) throws Resources.NotFoundException {
        if (Build.VERSION.SDK_INT >= 23) {
            return resources.getColor(i, theme);
        }
        return resources.getColor(i);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6330(Drawable drawable, PorterDuff.Mode mode) {
        int i = Build.VERSION.SDK_INT;
        drawable.setTintMode(mode);
    }

    /* JADX WARNING: Removed duplicated region for block: B:13:0x0014 A[SYNTHETIC, Splitter:B:13:0x0014] */
    /* renamed from: K  reason: contains not printable characters */
    public static boolean m6343(File file, Resources resources, int i) {
        InputStream inputStream;
        Throwable th;
        try {
            inputStream = resources.openRawResource(i);
            try {
                boolean r0 = m6344(file, inputStream);
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (IOException unused) {
                    }
                }
                return r0;
            } catch (Throwable th2) {
                th = th2;
                if (inputStream != null) {
                }
                throw th;
            }
        } catch (Throwable th3) {
            th = th3;
            inputStream = null;
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException unused2) {
                }
            }
            throw th;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static AbstractC1798 m6321(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
        int next;
        int i;
        int i2;
        int i3;
        int i4;
        int i5;
        do {
            next = xmlPullParser.next();
            if (next == 2) {
                break;
            }
        } while (next != 1);
        if (next == 2) {
            xmlPullParser.require(2, null, "font-family");
            if (xmlPullParser.getName().equals("font-family")) {
                TypedArray obtainAttributes = resources.obtainAttributes(Xml.asAttributeSet(xmlPullParser), R$styleable.FontFamily);
                String string = obtainAttributes.getString(R$styleable.FontFamily_fontProviderAuthority);
                String string2 = obtainAttributes.getString(R$styleable.FontFamily_fontProviderPackage);
                String string3 = obtainAttributes.getString(R$styleable.FontFamily_fontProviderQuery);
                int resourceId = obtainAttributes.getResourceId(R$styleable.FontFamily_fontProviderCerts, 0);
                int integer = obtainAttributes.getInteger(R$styleable.FontFamily_fontProviderFetchStrategy, 1);
                int integer2 = obtainAttributes.getInteger(R$styleable.FontFamily_fontProviderFetchTimeout, 500);
                String string4 = obtainAttributes.getString(R$styleable.FontFamily_fontProviderSystemFontFamily);
                obtainAttributes.recycle();
                if (string == null || string2 == null || string3 == null) {
                    ArrayList arrayList = new ArrayList();
                    while (xmlPullParser.next() != 3) {
                        if (xmlPullParser.getEventType() == 2) {
                            if (xmlPullParser.getName().equals("font")) {
                                TypedArray obtainAttributes2 = resources.obtainAttributes(Xml.asAttributeSet(xmlPullParser), R$styleable.FontFamilyFont);
                                if (obtainAttributes2.hasValue(R$styleable.FontFamilyFont_fontWeight)) {
                                    i = R$styleable.FontFamilyFont_fontWeight;
                                } else {
                                    i = R$styleable.FontFamilyFont_android_fontWeight;
                                }
                                int i6 = obtainAttributes2.getInt(i, com.adjust.sdk.Constants.MINIMAL_ERROR_STATUS_CODE);
                                if (obtainAttributes2.hasValue(R$styleable.FontFamilyFont_fontStyle)) {
                                    i2 = R$styleable.FontFamilyFont_fontStyle;
                                } else {
                                    i2 = R$styleable.FontFamilyFont_android_fontStyle;
                                }
                                boolean z = 1 == obtainAttributes2.getInt(i2, 0);
                                if (obtainAttributes2.hasValue(R$styleable.FontFamilyFont_ttcIndex)) {
                                    i3 = R$styleable.FontFamilyFont_ttcIndex;
                                } else {
                                    i3 = R$styleable.FontFamilyFont_android_ttcIndex;
                                }
                                if (obtainAttributes2.hasValue(R$styleable.FontFamilyFont_fontVariationSettings)) {
                                    i4 = R$styleable.FontFamilyFont_fontVariationSettings;
                                } else {
                                    i4 = R$styleable.FontFamilyFont_android_fontVariationSettings;
                                }
                                String string5 = obtainAttributes2.getString(i4);
                                int i7 = obtainAttributes2.getInt(i3, 0);
                                if (obtainAttributes2.hasValue(R$styleable.FontFamilyFont_font)) {
                                    i5 = R$styleable.FontFamilyFont_font;
                                } else {
                                    i5 = R$styleable.FontFamilyFont_android_font;
                                }
                                int resourceId2 = obtainAttributes2.getResourceId(i5, 0);
                                String string6 = obtainAttributes2.getString(i5);
                                obtainAttributes2.recycle();
                                while (xmlPullParser.next() != 3) {
                                    m6336(xmlPullParser);
                                }
                                arrayList.add(new C1804(string6, i6, z, string5, i7, resourceId2));
                            } else {
                                m6336(xmlPullParser);
                            }
                        }
                    }
                    if (arrayList.isEmpty()) {
                        return null;
                    }
                    return new C1796((C1804[]) arrayList.toArray(new C1804[arrayList.size()]));
                }
                while (xmlPullParser.next() != 3) {
                    m6336(xmlPullParser);
                }
                return new C1797(new C1844(string, string2, string3, m6319(resources, resourceId)), integer, integer2, string4);
            }
            m6336(xmlPullParser);
            return null;
        }
        throw new XmlPullParserException("No start tag found");
    }

    /* renamed from: K  reason: contains not printable characters */
    public static String m6317(MotionLayout motionLayout, int i) {
        if (i == -1) {
            return "UNDEFINED";
        }
        return motionLayout.getContext().getResources().getResourceEntryName(i);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static Intent m6302(Context context, ComponentName componentName) throws PackageManager.NameNotFoundException {
        String r0 = m6283(context, componentName);
        if (r0 == null) {
            return null;
        }
        ComponentName componentName2 = new ComponentName(componentName.getPackageName(), r0);
        if (m6283(context, componentName2) == null) {
            return Intent.makeMainActivity(componentName2);
        }
        return new Intent().setComponent(componentName2);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6292(int i) {
        if (i >= 0) {
            return i;
        }
        throw new IllegalArgumentException();
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6328(Drawable drawable) {
        DrawableContainer.DrawableContainerState drawableContainerState;
        if (Build.VERSION.SDK_INT >= 23) {
            drawable.clearColorFilter();
            return;
        }
        drawable.clearColorFilter();
        if (drawable instanceof InsetDrawable) {
            m6328(((InsetDrawable) drawable).getDrawable());
        } else if (drawable instanceof AbstractC1712) {
            m6328(((C1710) drawable).f6010);
        } else if ((drawable instanceof DrawableContainer) && (drawableContainerState = (DrawableContainer.DrawableContainerState) ((DrawableContainer) drawable).getConstantState()) != null) {
            int childCount = drawableContainerState.getChildCount();
            for (int i = 0; i < childCount; i++) {
                Drawable child = drawableContainerState.getChild(i);
                if (child != null) {
                    m6328(child);
                }
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static String m6315(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i) {
        if (!m6346(xmlPullParser, str)) {
            return null;
        }
        return typedArray.getString(i);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static TypedArray m6305(Resources resources, Resources.Theme theme, AttributeSet attributeSet, int[] iArr) {
        if (theme == null) {
            return resources.obtainAttributes(attributeSet, iArr);
        }
        return theme.obtainStyledAttributes(attributeSet, iArr, 0, 0);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static List<List<byte[]>> m6319(Resources resources, int i) {
        if (i == 0) {
            return Collections.emptyList();
        }
        TypedArray obtainTypedArray = resources.obtainTypedArray(i);
        try {
            if (obtainTypedArray.length() == 0) {
                return Collections.emptyList();
            }
            ArrayList arrayList = new ArrayList();
            int i2 = Build.VERSION.SDK_INT;
            if (obtainTypedArray.getType(0) == 1) {
                for (int i3 = 0; i3 < obtainTypedArray.length(); i3++) {
                    int resourceId = obtainTypedArray.getResourceId(i3, 0);
                    if (resourceId != 0) {
                        arrayList.add(m6320(resources.getStringArray(resourceId)));
                    }
                }
            } else {
                arrayList.add(m6320(resources.getStringArray(i)));
            }
            obtainTypedArray.recycle();
            return arrayList;
        } finally {
            obtainTypedArray.recycle();
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static List<byte[]> m6320(String[] strArr) {
        ArrayList arrayList = new ArrayList();
        for (String str : strArr) {
            arrayList.add(Base64.decode(str, 0));
        }
        return arrayList;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6336(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
        int i = 1;
        while (i > 0) {
            int next = xmlPullParser.next();
            if (next == 2) {
                i++;
            } else if (next == 3) {
                i--;
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m6340(Drawable drawable, int i) {
        if (Build.VERSION.SDK_INT >= 23) {
            return drawable.setLayoutDirection(i);
        }
        if (!f8190) {
            try {
                f8185 = Drawable.class.getDeclaredMethod("setLayoutDirection", Integer.TYPE);
                f8185.setAccessible(true);
            } catch (NoSuchMethodException e) {
                Log.i("DrawableCompat", "Failed to retrieve setLayoutDirection(int) method", e);
            }
            f8190 = true;
        }
        Method method = f8185;
        if (method != null) {
            try {
                method.invoke(drawable, Integer.valueOf(i));
                return true;
            } catch (Exception e2) {
                Log.i("DrawableCompat", "Failed to invoke setLayoutDirection(int) via reflection", e2);
                f8185 = null;
            }
        }
        return false;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C2098 m6324(ArrayList<C2098> arrayList, int i) {
        int size = arrayList.size();
        for (int i2 = 0; i2 < size; i2++) {
            C2098 r2 = arrayList.get(i2);
            if (i == r2.f7244) {
                return r2;
            }
        }
        return null;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6326(Context context, int i, AbstractC1799 r10, Handler handler) throws Resources.NotFoundException {
        if (r10 == null) {
            throw new NullPointerException();
        } else if (context.isRestricted()) {
            r10.callbackFailAsync(-4, handler);
        } else {
            m6306(context, i, new TypedValue(), 0, r10, handler, false, false);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6338(int[] iArr, float[] fArr, int i, int i2) {
        int i3 = iArr[i];
        iArr[i] = iArr[i2];
        iArr[i2] = i3;
        float f = fArr[i];
        fArr[i] = fArr[i2];
        fArr[i2] = f;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C2098 m6323(ConstraintWidget constraintWidget, int i, ArrayList<C2098> arrayList, C2098 r10) {
        int i2;
        int i3;
        int i4;
        if (i == 0) {
            i2 = constraintWidget.f887;
        } else {
            i2 = constraintWidget.f818;
        }
        if (i2 != -1 && (r10 == null || i2 != r10.f7244)) {
            int i5 = 0;
            while (true) {
                if (i5 >= arrayList.size()) {
                    break;
                }
                C2098 r4 = arrayList.get(i5);
                if (r4.f7244 == i2) {
                    if (r10 != null) {
                        r10.m5548(i, r4);
                        arrayList.remove(r10);
                    }
                    r10 = r4;
                } else {
                    i5++;
                }
            }
        } else if (i2 != -1) {
            return r10;
        }
        int i6 = 1;
        if (r10 == null) {
            if (constraintWidget instanceof C2102) {
                C2102 r3 = (C2102) constraintWidget;
                int i7 = 0;
                while (true) {
                    if (i7 >= r3.f7278) {
                        i3 = -1;
                        break;
                    }
                    ConstraintWidget constraintWidget2 = r3.f7279[i7];
                    if (i != 0 || (i4 = constraintWidget2.f887) == -1) {
                        if (i == 1 && (i3 = constraintWidget2.f818) != -1) {
                            break;
                        }
                        i7++;
                    } else {
                        i3 = i4;
                        break;
                    }
                }
                if (i3 != -1) {
                    int i8 = 0;
                    while (true) {
                        if (i8 >= arrayList.size()) {
                            break;
                        }
                        C2098 r32 = arrayList.get(i8);
                        if (r32.f7244 == i3) {
                            r10 = r32;
                            break;
                        }
                        i8++;
                    }
                }
            }
            if (r10 == null) {
                r10 = new C2098(i);
            }
            arrayList.add(r10);
        }
        if (r10.m5550(constraintWidget)) {
            if (constraintWidget instanceof C2083) {
                C2083 r2 = (C2083) constraintWidget;
                ConstraintAnchor constraintAnchor = r2.f7207;
                if (r2.f7203 != 0) {
                    i6 = 0;
                }
                constraintAnchor.m461(i6, arrayList, r10);
            }
            if (i == 0) {
                constraintWidget.f887 = r10.f7244;
                constraintWidget.f820.m461(i, arrayList, r10);
                constraintWidget.f833.m461(i, arrayList, r10);
            } else {
                constraintWidget.f818 = r10.f7244;
                constraintWidget.f885.m461(i, arrayList, r10);
                constraintWidget.f897.m461(i, arrayList, r10);
                constraintWidget.f841.m461(i, arrayList, r10);
            }
            constraintWidget.f821.m461(i, arrayList, r10);
        }
        return r10;
    }

    /* JADX WARNING: Removed duplicated region for block: B:31:0x00b8  */
    /* JADX WARNING: Removed duplicated region for block: B:33:0x00bd A[ADDED_TO_REGION] */
    /* renamed from: K  reason: contains not printable characters */
    public static Typeface m6306(Context context, int i, TypedValue typedValue, int i2, AbstractC1799 r20, Handler handler, boolean z, boolean z2) {
        Resources resources = context.getResources();
        resources.getValue(i, typedValue, true);
        CharSequence charSequence = typedValue.string;
        if (charSequence != null) {
            String charSequence2 = charSequence.toString();
            Typeface typeface = null;
            if (charSequence2.startsWith("res/")) {
                Typeface r0 = C1721.f6036.m5962(C1721.m4426(resources, i, i2));
                if (r0 != null) {
                    if (r20 != null) {
                        r20.callbackSuccessAsync(r0, handler);
                    }
                } else if (!z2) {
                    try {
                        if (charSequence2.toLowerCase().endsWith(".xml")) {
                            AbstractC1798 r2 = m6321((XmlPullParser) resources.getXml(i), resources);
                            if (r2 == null) {
                                Log.e("ResourcesCompat", "Failed to find font-family tag");
                                if (r20 != null) {
                                    r20.callbackFailAsync(-3, handler);
                                }
                            } else {
                                typeface = C1721.m4425(context, r2, resources, i, i2, r20, handler, z);
                            }
                        } else {
                            r0 = C1721.m4423(context, resources, i, charSequence2, i2);
                            if (r20 != null) {
                                if (r0 != null) {
                                    r20.callbackSuccessAsync(r0, handler);
                                } else {
                                    r20.callbackFailAsync(-3, handler);
                                }
                            }
                        }
                    } catch (XmlPullParserException e) {
                        Log.e("ResourcesCompat", "Failed to parse xml resource " + charSequence2, e);
                        if (r20 != null) {
                            r20.callbackFailAsync(-3, handler);
                        }
                        if (typeface == null) {
                        }
                        return typeface;
                    } catch (IOException e2) {
                        Log.e("ResourcesCompat", "Failed to read xml resource " + charSequence2, e2);
                        if (r20 != null) {
                        }
                        if (typeface == null) {
                        }
                        return typeface;
                    }
                }
                typeface = r0;
            } else if (r20 != null) {
                r20.callbackFailAsync(-3, handler);
            }
            if (typeface == null || r20 != null || z2) {
                return typeface;
            }
            StringBuilder r1 = C1293.m3416("Font resource ID #0x");
            r1.append(Integer.toHexString(i));
            r1.append(" could not be retrieved.");
            throw new Resources.NotFoundException(r1.toString());
        }
        StringBuilder r22 = C1293.m3416("Resource \"");
        r22.append(resources.getResourceName(i));
        r22.append("\" (");
        r22.append(Integer.toHexString(i));
        r22.append(") is not a Font: ");
        r22.append(typedValue);
        throw new Resources.NotFoundException(r22.toString());
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m6341(ViewParent viewParent, View view, float f, float f2, boolean z) {
        int i = Build.VERSION.SDK_INT;
        try {
            return viewParent.onNestedFling(view, f, f2, z);
        } catch (AbstractMethodError e) {
            Log.e("ViewParentCompat", "ViewParent " + viewParent + " does not implement interface method onNestedFling", e);
            return false;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6339(int[] iArr, float[][] fArr, int i, int i2) {
        int i3 = iArr[i];
        iArr[i] = iArr[i2];
        iArr[i2] = i3;
        float[] fArr2 = fArr[i];
        fArr[i] = fArr[i2];
        fArr[i2] = fArr2;
    }
}
