导航菜单

页面标题

页面副标题

Premium Loader v1.0 - a.java 源代码

正在查看: Premium Loader v1.0 应用的 a.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package z2;

import android.R;
import android.animation.TimeInterpolator;
import android.app.AppOpsManager;
import android.content.Context;
import android.content.Intent;
import android.content.UriPermission;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PermissionInfo;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.Signature;
import android.content.res.AssetManager;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewParent;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.activity.j;
import androidx.activity.o;
import androidx.appcompat.widget.s;
import androidx.appcompat.widget.s2;
import androidx.appcompat.widget.x;
import androidx.emoji2.text.k;
import androidx.fragment.app.o0;
import androidx.fragment.app.r0;
import androidx.fragment.app.v;
import androidx.fragment.app.w0;
import androidx.fragment.app.y;
import c1.d0;
import com.google.android.material.internal.CheckableImageButton;
import com.google.android.material.textfield.TextInputLayout;
import com.molihuan.pathselector.utils.ReflectTools;
import d.p;
import d.p0;
import d0.g;
import f0.b1;
import f0.i0;
import f0.s0;
import f2.e;
import f2.i;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.MappedByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import k4.j6;
import l2.f;
import l2.u;
import x.l;

public abstract class a implements b1, c3.a {

    public static boolean f4924f = true;

    public static Field f4925g;

    public static boolean f4926h;

    public static final int[] f4927i = {R.attr.theme, premium.loader.R.attr.theme};

    public static final int[] f4928j = {premium.loader.R.attr.materialThemeOverlay};

    public static final int[] f4929k = new int[0];

    public static final Class[] f4930l = new Class[0];

    public static final Object[] f4931m = new Object[0];
    public static final String[] n = new String[0];

    public static final int[] f4932o = new int[0];

    public static final Object[] f4933p = new Object[0];

    public static final String[] f4934q = {"honor"};

    public static final Object[] f4935r = new Object[0];

    public static final r0 f4936s = new r0(0);

    public static final r0 f4937t = new r0(1);

    public a(Object obj) {
    }

    public static void A(Object obj, String str) {
        if (obj != null) {
            return;
        }
        NullPointerException nullPointerException = new NullPointerException(str.concat(" must not be null"));
        Y0(a.class.getName(), nullPointerException);
        throw nullPointerException;
    }

    public static boolean A0(String str) {
        int i5 = Build.VERSION.SDK_INT;
        if (!((i5 >= 30) && str.startsWith(c.f4941b))) {
            if (!((i5 >= 30) && str.startsWith(c.f4942c))) {
                return false;
            }
        }
        return true;
    }

    public static void B(Object obj, String str) {
        if (obj == null) {
            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
            String name = a.class.getName();
            int i5 = 0;
            while (!stackTrace[i5].getClassName().equals(name)) {
                i5++;
            }
            while (stackTrace[i5].getClassName().equals(name)) {
                i5++;
            }
            StackTraceElement stackTraceElement = stackTrace[i5];
            NullPointerException nullPointerException = new NullPointerException("Parameter specified as non-null is null: method " + stackTraceElement.getClassName() + "." + stackTraceElement.getMethodName() + ", parameter " + str);
            Y0(a.class.getName(), nullPointerException);
            throw nullPointerException;
        }
    }

    public static void B0(PackageInfo packageInfo, File file) {
        try {
            DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(new File(file, "profileinstaller_profileWrittenFor_lastUpdateTime.dat")));
            try {
                dataOutputStream.writeLong(packageInfo.lastUpdateTime);
                dataOutputStream.close();
            } finally {
            }
        } catch (IOException unused) {
        }
    }

    public static final void E(XmlResourceParser xmlResourceParser, Throwable th) {
        if (th == null) {
            xmlResourceParser.close();
            return;
        }
        try {
            xmlResourceParser.close();
        } catch (Throwable th2) {
            if (th != th2) {
                q3.c.f4247a.a(th, th2);
            }
        }
    }

    public static final void F(Closeable closeable, Throwable th) {
        if (th == null) {
            closeable.close();
            return;
        }
        try {
            closeable.close();
        } catch (Throwable th2) {
            if (th != th2) {
                q3.c.f4247a.a(th, th2);
            }
        }
    }

    public static String G(File file) {
        if (!file.exists() || file.isDirectory()) {
            return "-1b";
        }
        long length = file.length();
        if (length >= 0) {
            return length < 1024 ? String.format("%.2fB", Double.valueOf(length)) : length < 1048576 ? String.format("%.2fKB", Double.valueOf(length / 1024.0d)) : length < 1073741824 ? String.format("%.2fMB", Double.valueOf(length / 1048576.0d)) : String.format("%.2fGB", Double.valueOf(length / 1.073741824E9d));
        }
        throw new IllegalArgumentException("byteSize shouldn't be less than zero!");
    }

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

    public static final long I(InputStream inputStream, OutputStream outputStream, int i5) {
        byte[] bArr = new byte[i5];
        int read = inputStream.read(bArr);
        long j5 = 0;
        while (read >= 0) {
            outputStream.write(bArr, 0, read);
            j5 += read;
            read = inputStream.read(bArr);
        }
        return j5;
    }

    public static k K(Context context) {
        ProviderInfo providerInfo;
        s sVar;
        boolean z4;
        ApplicationInfo applicationInfo;
        PackageManager packageManager = context.getPackageManager();
        f.g(packageManager, "Package manager required to locate emoji font provider");
        Iterator<ResolveInfo> it = packageManager.queryIntentContentProviders(new Intent("androidx.content.action.LOAD_EMOJI_FONT"), 0).iterator();
        while (true) {
            if (!it.hasNext()) {
                providerInfo = null;
                break;
            }
            providerInfo = it.next().providerInfo;
            if (providerInfo != null && (applicationInfo = providerInfo.applicationInfo) != null) {
                z4 = true;
                if ((applicationInfo.flags & 1) == 1) {
                    if (!z4) {
                        break;
                    }
                }
            }
            z4 = false;
            if (!z4) {
            }
        }
        if (providerInfo != null) {
            try {
                String str = providerInfo.authority;
                String str2 = providerInfo.packageName;
                Signature[] signatureArr = packageManager.getPackageInfo(str2, 64).signatures;
                ArrayList arrayList = new ArrayList();
                for (Signature signature : signatureArr) {
                    arrayList.add(signature.toByteArray());
                }
                sVar = new s(str, str2, "emojicompat-emoji-font", Collections.singletonList(arrayList));
            } catch (PackageManager.NameNotFoundException e5) {
                Log.wtf("emoji2.text.DefaultEmojiConfig", e5);
            }
            if (sVar != null) {
                return null;
            }
            return new k(context, sVar);
        }
        sVar = null;
        if (sVar != null) {
        }
    }

    public static a L(int i5) {
        if (i5 != 0 && i5 == 1) {
            return new f2.d();
        }
        return new i();
    }

    public static x L0(Context context, int i5) {
        x xVar = new x(1);
        XmlResourceParser openXmlResourceParser = context.getAssets().openXmlResourceParser(i5, "AndroidManifest.xml");
        do {
            if (openXmlResourceParser.getEventType() == 2) {
                String name = openXmlResourceParser.getName();
                if (TextUtils.equals("manifest", name)) {
                    xVar.f592a = openXmlResourceParser.getAttributeValue(null, "package");
                }
                if (TextUtils.equals("uses-sdk", name)) {
                    e eVar = new e();
                    openXmlResourceParser.getAttributeIntValue("http://schemas.android.com/apk/res/android", "minSdkVersion", 0);
                    xVar.f593b = eVar;
                }
                if (TextUtils.equals("uses-permission", name) || TextUtils.equals("uses-permission-sdk-23", name) || TextUtils.equals("uses-permission-sdk-m", name)) {
                    l2.b bVar = new l2.b();
                    bVar.f3756a = openXmlResourceParser.getAttributeValue("http://schemas.android.com/apk/res/android", "name");
                    bVar.f3757b = openXmlResourceParser.getAttributeIntValue("http://schemas.android.com/apk/res/android", "maxSdkVersion", Integer.MAX_VALUE);
                    bVar.f3758c = openXmlResourceParser.getAttributeIntValue("http://schemas.android.com/apk/res/android", "usesPermissionFlags", 0);
                    ((List) xVar.f594c).add(bVar);
                }
                if (TextUtils.equals("application", name)) {
                    q1.b bVar2 = new q1.b();
                    bVar2.f4210b = openXmlResourceParser.getAttributeValue("http://schemas.android.com/apk/res/android", "name");
                    bVar2.f4209a = openXmlResourceParser.getAttributeBooleanValue("http://schemas.android.com/apk/res/android", "requestLegacyExternalStorage", false);
                    xVar.f595d = bVar2;
                }
                if (TextUtils.equals("activity", name) || TextUtils.equals("activity-alias", name)) {
                    l2.a aVar = new l2.a();
                    openXmlResourceParser.getAttributeValue("http://schemas.android.com/apk/res/android", "name");
                    aVar.f3755a = openXmlResourceParser.getAttributeBooleanValue("http://schemas.android.com/apk/res/android", "supportsPictureInPicture", false);
                    ((List) xVar.f596e).add(aVar);
                }
                if (TextUtils.equals("service", name)) {
                    l2.c cVar = new l2.c();
                    cVar.f3759a = openXmlResourceParser.getAttributeValue("http://schemas.android.com/apk/res/android", "name");
                    cVar.f3760b = openXmlResourceParser.getAttributeValue("http://schemas.android.com/apk/res/android", "permission");
                    ((List) xVar.f597f).add(cVar);
                }
            }
        } while (openXmlResourceParser.next() != 1);
        openXmlResourceParser.close();
        return xVar;
    }

    public static e M() {
        int i5 = 0;
        return new e(i5, i5);
    }

    public static PorterDuff.Mode N0(int i5, PorterDuff.Mode mode) {
        if (i5 == 3) {
            return PorterDuff.Mode.SRC_OVER;
        }
        if (i5 == 5) {
            return PorterDuff.Mode.SRC_IN;
        }
        if (i5 == 9) {
            return PorterDuff.Mode.SRC_ATOP;
        }
        switch (i5) {
            case 14:
                return PorterDuff.Mode.MULTIPLY;
            case 15:
                return PorterDuff.Mode.SCREEN;
            case 16:
                return PorterDuff.Mode.ADD;
            default:
                return mode;
        }
    }

    public static String O(Uri uri, v vVar) {
        if (vVar == null) {
            throw new NullPointerException("fragment and activity cannot both be null");
        }
        androidx.fragment.app.x xVar = vVar.f1013x;
        y yVar = xVar == null ? null : (y) xVar.f1032u;
        x0("请求权限的原始uri是:" + uri);
        String replace = uri.toString().replace("documents/document/primary", "documents/tree/primary");
        x0("请求权限处理后的uri(为了进行判断是否已经授权)是:" + replace);
        List<UriPermission> persistedUriPermissions = yVar.getContentResolver().getPersistedUriPermissions();
        x0("已经授权的uri集合是:" + persistedUriPermissions);
        for (UriPermission uriPermission : persistedUriPermissions) {
            String uri2 = uriPermission.getUri().toString();
            if (replace.matches(uri2 + "%2F.*") || (replace.equals(uri2) && (uriPermission.isReadPermission() || uriPermission.isWritePermission()))) {
                x0(replace.concat("已经授权"));
                return uri2;
            }
        }
        x0(replace + "未授权");
        return null;
    }

    public static void P(o0 o0Var, int i5, t2.b bVar, String str, boolean z4) {
        o0Var.getClass();
        androidx.fragment.app.a aVar = new androidx.fragment.app.a(o0Var);
        if (bVar == null) {
            x0("fragment is null and Unable to add");
            return;
        }
        if (!bVar.p()) {
            try {
                aVar.e(i5, bVar, str, 1);
            } catch (Exception e5) {
                x0("frameLayoutID may not exist and cannot be added");
                e5.printStackTrace();
            }
        }
        o0 o0Var2 = aVar.f801p;
        if (z4) {
            o0 o0Var3 = bVar.f1012w;
            if (o0Var3 != null && o0Var3 != o0Var2) {
                throw new IllegalStateException("Cannot show Fragment attached to a different FragmentManager. Fragment " + bVar.toString() + " is already attached to a FragmentManager.");
            }
            aVar.b(new w0(5, bVar));
        } else {
            o0 o0Var4 = bVar.f1012w;
            if (o0Var4 != null && o0Var4 != o0Var2) {
                throw new IllegalStateException("Cannot hide Fragment attached to a different FragmentManager. Fragment " + bVar.toString() + " is already attached to a FragmentManager.");
            }
            aVar.b(new w0(4, bVar));
        }
        aVar.d(true);
    }

    public static Intent Q(Context context) {
        Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
        intent.setData(u.h(context));
        if (u.a(context, intent)) {
            return intent;
        }
        Intent intent2 = new Intent("android.settings.APPLICATION_SETTINGS");
        if (u.a(context, intent2)) {
            return intent2;
        }
        Intent intent3 = new Intent("android.settings.MANAGE_APPLICATIONS_SETTINGS");
        return u.a(context, intent3) ? intent3 : new Intent("android.settings.SETTINGS");
    }

    public static q0.b Q0(MappedByteBuffer mappedByteBuffer) {
        Object obj;
        long j5;
        ByteBuffer duplicate = mappedByteBuffer.duplicate();
        p0 p0Var = new p0(duplicate);
        p0Var.F(4);
        int i5 = duplicate.getShort() & 65535;
        if (i5 > 100) {
            throw new IOException("Cannot read metadata.");
        }
        p0Var.F(6);
        int i6 = 0;
        while (true) {
            obj = p0Var.f2091g;
            if (i6 >= i5) {
                j5 = -1;
                break;
            }
            int i7 = ((ByteBuffer) obj).getInt();
            p0Var.F(4);
            j5 = p0Var.E();
            p0Var.F(4);
            if (1835365473 == i7) {
                break;
            }
            i6++;
        }
        if (j5 != -1) {
            p0Var.F((int) (j5 - duplicate.position()));
            p0Var.F(12);
            long E = p0Var.E();
            for (int i8 = 0; i8 < E; i8++) {
                int i9 = ((ByteBuffer) obj).getInt();
                long E2 = p0Var.E();
                p0Var.E();
                if (1164798569 == i9 || 1701669481 == i9) {
                    duplicate.position((int) (E2 + j5));
                    q0.b bVar = new q0.b();
                    duplicate.order(ByteOrder.LITTLE_ENDIAN);
                    bVar.b(duplicate.position() + duplicate.getInt(duplicate.position()), duplicate);
                    return bVar;
                }
            }
        }
        throw new IOException("Cannot read metadata.");
    }

    public static int[] R(g gVar) {
        g[] i5 = gVar.i();
        int[] iArr = {0, 0};
        if (i5 != null) {
            for (g gVar2 : i5) {
                if (gVar2.f()) {
                    iArr[0] = iArr[0] + 1;
                } else {
                    iArr[1] = iArr[1] + 1;
                }
            }
        }
        return iArr;
    }

    public static final byte[] R0(File file) {
        B(file, "<this>");
        FileInputStream fileInputStream = new FileInputStream(file);
        try {
            long length = file.length();
            if (length > 2147483647L) {
                throw new OutOfMemoryError("File " + file + " is too big (" + length + " bytes) to fit in memory.");
            }
            int i5 = (int) length;
            byte[] bArr = new byte[i5];
            int i6 = i5;
            int i7 = 0;
            while (i6 > 0) {
                int read = fileInputStream.read(bArr, i7, i6);
                if (read < 0) {
                    break;
                }
                i6 -= read;
                i7 += read;
            }
            if (i6 > 0) {
                bArr = Arrays.copyOf(bArr, i7);
                A(bArr, "copyOf(this, newSize)");
            } else {
                int read2 = fileInputStream.read();
                if (read2 != -1) {
                    t3.b bVar = new t3.b();
                    bVar.write(read2);
                    I(fileInputStream, bVar, 8192);
                    int size = bVar.size() + i5;
                    if (size < 0) {
                        throw new OutOfMemoryError("File " + file + " is too big to fit in memory.");
                    }
                    byte[] a5 = bVar.a();
                    bArr = Arrays.copyOf(bArr, size);
                    A(bArr, "copyOf(this, newSize)");
                    System.arraycopy(a5, 0, bArr, i5, bVar.size() - 0);
                }
            }
            F(fileInputStream, null);
            return bArr;
        } catch (Throwable th) {
            try {
                throw th;
            } catch (Throwable th2) {
                F(fileInputStream, th);
                throw th2;
            }
        }
    }

    public static int[] S(File file) {
        File[] listFiles = file.listFiles();
        int[] iArr = {0, 0};
        if (listFiles != null) {
            for (File file2 : listFiles) {
                if (file2.isFile()) {
                    iArr[0] = iArr[0] + 1;
                } else {
                    iArr[1] = iArr[1] + 1;
                }
            }
        }
        return iArr;
    }

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

    public static ColorStateList T(Context context, TypedArray typedArray, int i5) {
        int resourceId;
        ColorStateList y4;
        return (!typedArray.hasValue(i5) || (resourceId = typedArray.getResourceId(i5, 0)) == 0 || (y4 = f.y(context, resourceId)) == null) ? typedArray.getColorStateList(i5) : y4;
    }

    public static TypedValue T0(Context context, int i5) {
        TypedValue typedValue = new TypedValue();
        if (context.getTheme().resolveAttribute(i5, typedValue, true)) {
            return typedValue;
        }
        return null;
    }

    public static ColorStateList U(Context context, s2 s2Var, int i5) {
        int i6;
        ColorStateList y4;
        return (!s2Var.l(i5) || (i6 = s2Var.i(i5, 0)) == 0 || (y4 = f.y(context, i6)) == null) ? s2Var.b(i5) : y4;
    }

    public static boolean U0(Context context, int i5, boolean z4) {
        TypedValue T0 = T0(context, i5);
        return (T0 == null || T0.type != 18) ? z4 : T0.data != 0;
    }

    public static int V0(Context context, int i5, int i6) {
        TypedValue T0 = T0(context, i5);
        return (T0 == null || T0.type != 16) ? i6 : T0.data;
    }

    public static Intent W(Intent intent) {
        Intent g02 = g0(intent);
        return g02 != null ? W(g02) : intent;
    }

    public static TimeInterpolator W0(Context context, int i5, Interpolator interpolator) {
        TypedValue typedValue = new TypedValue();
        if (!context.getTheme().resolveAttribute(i5, typedValue, true)) {
            return interpolator;
        }
        if (typedValue.type != 3) {
            throw new IllegalArgumentException("Motion easing theme attribute must be an @interpolator resource for ?attr/motionEasing*Interpolator attributes or a string for ?attr/motionEasing* attributes.");
        }
        String valueOf = String.valueOf(typedValue.string);
        if (!(t0(valueOf, "cubic-bezier") || t0(valueOf, "path"))) {
            return AnimationUtils.loadInterpolator(context, typedValue.resourceId);
        }
        if (!t0(valueOf, "cubic-bezier")) {
            if (t0(valueOf, "path")) {
                return h0.a.c(f.r(valueOf.substring(5, valueOf.length() - 1)));
            }
            throw new IllegalArgumentException("Invalid motion easing type: ".concat(valueOf));
        }
        String[] split = valueOf.substring(13, valueOf.length() - 1).split(",");
        if (split.length == 4) {
            return h0.a.b(b0(split, 0), b0(split, 1), b0(split, 2), b0(split, 3));
        }
        throw new IllegalArgumentException("Motion easing theme attribute must have 4 control points if using bezier curve format; instead got: " + split.length);
    }

    public static int X(Context context, TypedArray typedArray, int i5, int i6) {
        TypedValue typedValue = new TypedValue();
        if (!typedArray.getValue(i5, typedValue) || typedValue.type != 2) {
            return typedArray.getDimensionPixelSize(i5, i6);
        }
        TypedArray obtainStyledAttributes = context.getTheme().obtainStyledAttributes(new int[]{typedValue.data});
        int dimensionPixelSize = obtainStyledAttributes.getDimensionPixelSize(0, i6);
        obtainStyledAttributes.recycle();
        return dimensionPixelSize;
    }

    public static TypedValue X0(int i5, Context context, String str) {
        TypedValue T0 = T0(context, i5);
        if (T0 != null) {
            return T0;
        }
        throw new IllegalArgumentException(String.format("%1$s requires a value for the %2$s attribute to be set in your app theme. You can either set the attribute in your theme or update your theme to inherit from Theme.MaterialComponents (or a descendant).", str, context.getResources().getResourceName(i5)));
    }

    public static Drawable Y(Context context, TypedArray typedArray, int i5) {
        int resourceId;
        Drawable A;
        return (!typedArray.hasValue(i5) || (resourceId = typedArray.getResourceId(i5, 0)) == 0 || (A = f.A(context, resourceId)) == null) ? typedArray.getDrawable(i5) : A;
    }

    public static void Y0(String str, RuntimeException runtimeException) {
        StackTraceElement[] stackTrace = runtimeException.getStackTrace();
        int length = stackTrace.length;
        int i5 = -1;
        for (int i6 = 0; i6 < length; i6++) {
            if (str.equals(stackTrace[i6].getClassName())) {
                i5 = i6;
            }
        }
        runtimeException.setStackTrace((StackTraceElement[]) Arrays.copyOfRange(stackTrace, i5 + 1, length));
    }

    public static Set Z() {
        try {
            Object invoke = Class.forName("android.text.EmojiConsistency").getMethod("getEmojiConsistencySet", new Class[0]).invoke(null, new Object[0]);
            if (invoke == null) {
                return Collections.emptySet();
            }
            Set set = (Set) invoke;
            Iterator it = set.iterator();
            while (it.hasNext()) {
                if (!(it.next() instanceof int[])) {
                    return Collections.emptySet();
                }
            }
            return set;
        } catch (Throwable unused) {
            return Collections.emptySet();
        }
    }

    public static boolean Z0(String str, List list) {
        return list == null || list.size() == 0 || list.contains(str);
    }

    public static final Class a0(a4.b bVar) {
        B(bVar, "<this>");
        Class a5 = ((v3.e) bVar).a();
        if (!a5.isPrimitive()) {
            return a5;
        }
        String name = a5.getName();
        switch (name.hashCode()) {
            case -1325958191:
                if (!name.equals("double")) {
                }
                break;
            case 104431:
                if (!name.equals("int")) {
                }
                break;
            case 3039496:
                if (!name.equals("byte")) {
                }
                break;
            case 3052374:
                if (!name.equals("char")) {
                }
                break;
            case 3327612:
                if (!name.equals("long")) {
                }
                break;
            case 3625364:
                if (!name.equals("void")) {
                }
                break;
            case 64711720:
                if (!name.equals("boolean")) {
                }
                break;
            case 97526364:
                if (!name.equals("float")) {
                }
                break;
            case 109413500:
                if (!name.equals("short")) {
                }
                break;
        }
        return a5;
    }

    public static void a1(CheckableImageButton checkableImageButton, View.OnLongClickListener onLongClickListener) {
        WeakHashMap weakHashMap = s0.f2438a;
        boolean hasOnClickListeners = checkableImageButton.hasOnClickListeners();
        boolean z4 = onLongClickListener != null;
        boolean z5 = hasOnClickListeners || z4;
        checkableImageButton.setFocusable(z5);
        checkableImageButton.setClickable(hasOnClickListeners);
        checkableImageButton.setPressable(hasOnClickListeners);
        checkableImageButton.setLongClickable(z4);
        checkableImageButton.setImportantForAccessibility(z5 ? 1 : 2);
    }

    public static float b0(String[] strArr, int i5) {
        float parseFloat = Float.parseFloat(strArr[i5]);
        if (parseFloat >= 0.0f && parseFloat <= 1.0f) {
            return parseFloat;
        }
        throw new IllegalArgumentException("Motion easing control point value must be between 0 and 1; instead got: " + parseFloat);
    }

    public static void b1(View view, f2.g gVar) {
        x1.a aVar = gVar.f2492f.f2473b;
        if (aVar != null && aVar.f4796a) {
            float f5 = 0.0f;
            for (ViewParent parent = view.getParent(); parent instanceof View; parent = parent.getParent()) {
                WeakHashMap weakHashMap = s0.f2438a;
                f5 += i0.i((View) parent);
            }
            f2.f fVar = gVar.f2492f;
            if (fVar.f2484m != f5) {
                fVar.f2484m = f5;
                gVar.m();
            }
        }
    }

    public static String c0(String str) {
        return "TaskLogger_".concat(str);
    }

    public static Intent d0(Context context) {
        Intent putExtra = new Intent().setAction("miui.intent.action.APP_PERM_EDITOR").putExtra("extra_pkgname", context.getPackageName());
        Intent launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage("com.miui.securitycenter");
        if (!u.a(context, launchIntentForPackage)) {
            launchIntentForPackage = null;
        }
        if (!u.a(context, putExtra)) {
            putExtra = null;
        }
        return u.a(context, launchIntentForPackage) ? k(putExtra, launchIntentForPackage) : putExtra;
    }

    public static Intent e0(Context context) {
        Intent intent = new Intent("android.settings.APP_NOTIFICATION_SETTINGS");
        intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
        return !u.a(context, intent) ? Q(context) : intent;
    }

    public static boolean e1(int[] iArr) {
        boolean z4 = false;
        boolean z5 = false;
        for (int i5 : iArr) {
            if (i5 == 16842910) {
                z4 = true;
            } else if (i5 == 16842908 || i5 == 16842919 || i5 == 16843623) {
                z5 = true;
            }
        }
        return z4 && z5;
    }

    public static String f0(String str) {
        String str2;
        BufferedReader bufferedReader;
        String str3 = "";
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        BufferedReader bufferedReader2 = null;
        try {
            try {
                try {
                    bufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("getprop " + str).getInputStream()), 1024);
                } catch (IOException e5) {
                    e = e5;
                }
            } catch (Throwable th) {
                th = th;
                bufferedReader = bufferedReader2;
            }
        } catch (IOException e6) {
            e6.printStackTrace();
        }
        try {
            str2 = bufferedReader.readLine();
        } catch (IOException e7) {
            e = e7;
            bufferedReader2 = bufferedReader;
            e.printStackTrace();
            if (bufferedReader2 != null) {
                bufferedReader2.close();
            }
            str2 = "";
            if (!TextUtils.isEmpty(str2)) {
            }
        } catch (Throwable th2) {
            th = th2;
            if (bufferedReader != null) {
                try {
                    bufferedReader.close();
                } catch (IOException e8) {
                    e8.printStackTrace();
                }
            }
            throw th;
        }
        if (str2 != null) {
            try {
                bufferedReader.close();
            } catch (IOException e9) {
                e9.printStackTrace();
            }
            if (!TextUtils.isEmpty(str2)) {
                return str2;
            }
            try {
                Properties properties = new Properties();
                properties.load(new FileInputStream(new File(Environment.getRootDirectory(), "build.prop")));
                str3 = properties.getProperty(str, "");
            } catch (FileNotFoundException e10) {
                e10.printStackTrace();
            } catch (IOException e11) {
                e11.printStackTrace();
            }
            TextUtils.isEmpty(str3);
            return str3;
        }
        bufferedReader.close();
        str2 = "";
        if (!TextUtils.isEmpty(str2)) {
        }
    }

    public static boolean f1(f.a aVar, Intent intent) {
        try {
            aVar.b(intent);
            return true;
        } catch (Exception e5) {
            e5.printStackTrace();
            Intent g02 = g0(intent);
            if (g02 == null) {
                return false;
            }
            return f1(aVar, g02);
        }
    }

    public static Intent g0(Intent intent) {
        Object parcelableExtra;
        if (!o0()) {
            return (Intent) intent.getParcelableExtra("sub_intent_key");
        }
        parcelableExtra = intent.getParcelableExtra("sub_intent_key", Intent.class);
        return (Intent) parcelableExtra;
    }

    public static boolean g1(h2.b bVar, Intent intent, int i5) {
        try {
            bVar.a(intent, i5);
            return true;
        } catch (Exception e5) {
            e5.printStackTrace();
            Intent g02 = g0(intent);
            if (g02 == null) {
                return false;
            }
            return g1(bVar, g02, i5);
        }
    }

    public static boolean h1(String str) {
        return str == null || str.trim().isEmpty();
    }

    public static b3.a i0(u2.b bVar) {
        AtomicInteger atomicInteger = b3.a.f1487q;
        int i5 = n3.b.f3897a;
        return new b3.a("XTaskStep-" + b3.a.f1487q.getAndIncrement(), bVar, 2, new e3.b(), true);
    }

    public static void i1(String str) {
        o3.d dVar = new o3.d(j.g("lateinit property ", str, " has not been initialized"));
        Y0(a.class.getName(), dVar);
        throw dVar;
    }

    public static final o3.a j1(Serializable serializable, Object obj) {
        return new o3.a(serializable, obj);
    }

    public static Intent k(Intent intent, Intent intent2) {
        if (intent == null && intent2 != null) {
            return intent2;
        }
        if (intent2 == null) {
            return intent;
        }
        W(intent).putExtra("sub_intent_key", intent2);
        return intent;
    }

    public static final Object[] k1(Collection collection) {
        B(collection, "collection");
        int size = collection.size();
        Object[] objArr = f4935r;
        if (size == 0) {
            return objArr;
        }
        Iterator it = collection.iterator();
        if (!it.hasNext()) {
            return objArr;
        }
        Object[] objArr2 = new Object[size];
        int i5 = 0;
        while (true) {
            int i6 = i5 + 1;
            objArr2[i5] = it.next();
            if (i6 >= objArr2.length) {
                if (!it.hasNext()) {
                    return objArr2;
                }
                int i7 = ((i6 * 3) + 1) >>> 1;
                if (i7 <= i6) {
                    i7 = 2147483645;
                    if (i6 >= 2147483645) {
                        throw new OutOfMemoryError();
                    }
                }
                objArr2 = Arrays.copyOf(objArr2, i7);
                A(objArr2, "copyOf(result, newSize)");
            } else if (!it.hasNext()) {
                Object[] copyOf = Arrays.copyOf(objArr2, i6);
                A(copyOf, "copyOf(result, size)");
                return copyOf;
            }
            i5 = i6;
        }
    }

    public static final Object[] l1(Collection collection, Object[] objArr) {
        Object[] objArr2;
        B(collection, "collection");
        objArr.getClass();
        int size = collection.size();
        int i5 = 0;
        if (size == 0) {
            if (objArr.length <= 0) {
                return objArr;
            }
            objArr[0] = null;
            return objArr;
        }
        Iterator it = collection.iterator();
        if (!it.hasNext()) {
            if (objArr.length <= 0) {
                return objArr;
            }
            objArr[0] = null;
            return objArr;
        }
        if (size <= objArr.length) {
            objArr2 = objArr;
        } else {
            Object newInstance = Array.newInstance(objArr.getClass().getComponentType(), size);
            z(newInstance, "null cannot be cast to non-null type kotlin.Array<kotlin.Any?>");
            objArr2 = (Object[]) newInstance;
        }
        while (true) {
            int i6 = i5 + 1;
            objArr2[i5] = it.next();
            if (i6 >= objArr2.length) {
                if (!it.hasNext()) {
                    return objArr2;
                }
                int i7 = ((i6 * 3) + 1) >>> 1;
                if (i7 <= i6) {
                    i7 = 2147483645;
                    if (i6 >= 2147483645) {
                        throw new OutOfMemoryError();
                    }
                }
                objArr2 = Arrays.copyOf(objArr2, i7);
                A(objArr2, "copyOf(result, newSize)");
            } else if (!it.hasNext()) {
                if (objArr2 == objArr) {
                    objArr[i6] = null;
                    return objArr;
                }
                Object[] copyOf = Arrays.copyOf(objArr2, i6);
                A(copyOf, "copyOf(result, size)");
                return copyOf;
            }
            i5 = i6;
        }
    }

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

    public static boolean m0() {
        return Build.VERSION.SDK_INT >= 29;
    }

    public static void m1(String str) {
        Toast.makeText(ReflectTools.getApplicationByReflect(), str, 0).show();
    }

    public static boolean n0() {
        return Build.VERSION.SDK_INT >= 30;
    }

    public static boolean o(Object obj, Object obj2) {
        return obj == null ? obj2 == null : obj.equals(obj2);
    }

    public static boolean o0() {
        return Build.VERSION.SDK_INT >= 33;
    }

    public static Context o1(Context context, AttributeSet attributeSet, int i5, int i6) {
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, f4928j, i5, i6);
        int resourceId = obtainStyledAttributes.getResourceId(0, 0);
        obtainStyledAttributes.recycle();
        boolean z4 = (context instanceof f.e) && ((f.e) context).f2272a == resourceId;
        if (resourceId == 0 || z4) {
            return context;
        }
        f.e eVar = new f.e(context, resourceId);
        TypedArray obtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, f4927i);
        int resourceId2 = obtainStyledAttributes2.getResourceId(0, 0);
        int resourceId3 = obtainStyledAttributes2.getResourceId(1, 0);
        obtainStyledAttributes2.recycle();
        if (resourceId2 == 0) {
            resourceId2 = resourceId3;
        }
        if (resourceId2 != 0) {
            eVar.getTheme().applyStyle(resourceId2, true);
        }
        return eVar;
    }

    public static final ArrayList p(Object... objArr) {
        return objArr.length == 0 ? new ArrayList() : new ArrayList(new p3.b(objArr));
    }

    public static boolean p0(Context context) {
        return context.getResources().getConfiguration().fontScale >= 1.3f;
    }

    public static final void p1(File file, byte[] bArr) {
        B(file, "<this>");
        B(bArr, "array");
        FileOutputStream fileOutputStream = new FileOutputStream(file);
        try {
            fileOutputStream.write(bArr);
            F(fileOutputStream, null);
        } finally {
        }
    }

    public static int q(int i5, int i6, int[] iArr) {
        int i7 = i5 - 1;
        int i8 = 0;
        while (i8 <= i7) {
            int i9 = (i8 + i7) >>> 1;
            int i10 = iArr[i9];
            if (i10 < i6) {
                i8 = i9 + 1;
            } else {
                if (i10 <= i6) {
                    return i9;
                }
                i7 = i9 - 1;
            }
        }
        return ~i8;
    }

    public static boolean q0(Context context) {
        int i5;
        if (w0(context)) {
            Handler handler = u.f3802a;
            return context.checkSelfPermission("com.android.permission.GET_INSTALLED_APPS") == 0;
        }
        if (!u0()) {
            return true;
        }
        try {
            Class.forName(AppOpsManager.class.getName()).getDeclaredField("OP_GET_INSTALLED_APPS");
        } catch (ClassNotFoundException e5) {
            e5.printStackTrace();
        } catch (NoSuchFieldException e6) {
            e6.printStackTrace();
        }
        if (!v0()) {
            return true;
        }
        Handler handler2 = u.f3802a;
        AppOpsManager appOpsManager = (AppOpsManager) context.getSystemService("appops");
        ApplicationInfo applicationInfo = context.getApplicationInfo();
        String packageName = context.getApplicationContext().getPackageName();
        int i6 = applicationInfo.uid;
        try {
            Class<?> cls = Class.forName(AppOpsManager.class.getName());
            try {
                i5 = ((Integer) cls.getDeclaredField("OP_GET_INSTALLED_APPS").get(Integer.class)).intValue();
            } catch (NoSuchFieldException e7) {
                e7.printStackTrace();
                i5 = 10022;
            }
            Class<?> cls2 = Integer.TYPE;
            if (((Integer) cls.getMethod("checkOpNoThrow", cls2, cls2, String.class).invoke(appOpsManager, Integer.valueOf(i5), Integer.valueOf(i6), packageName)).intValue() != 0) {
                return false;
            }
        } catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | RuntimeException | InvocationTargetException unused) {
        }
        return true;
    }

    public static void q1(Context context, h.a aVar, x0.d dVar, boolean z4) {
        boolean z5;
        FileInputStream fileInputStream;
        int i5;
        x0.c[] cVarArr;
        x0.c[] cVarArr2;
        boolean z6;
        x0.b bVar;
        FileInputStream a5;
        x0.c[] cVarArr3;
        byte[] bArr;
        boolean z7;
        ByteArrayInputStream byteArrayInputStream;
        FileOutputStream fileOutputStream;
        Throwable th;
        byte[] bArr2;
        boolean z8;
        boolean z9;
        boolean z10;
        byte[] bArr3;
        ByteArrayOutputStream byteArrayOutputStream;
        boolean z11;
        Context applicationContext = context.getApplicationContext();
        String packageName = applicationContext.getPackageName();
        ApplicationInfo applicationInfo = applicationContext.getApplicationInfo();
        AssetManager assets = applicationContext.getAssets();
        String name = new File(applicationInfo.sourceDir).getName();
        try {
            PackageInfo packageInfo = context.getPackageManager().getPackageInfo(packageName, 0);
            File filesDir = context.getFilesDir();
            if (!z4) {
                File file = new File(filesDir, "profileinstaller_profileWrittenFor_lastUpdateTime.dat");
                if (file.exists()) {
                    try {
                        DataInputStream dataInputStream = new DataInputStream(new FileInputStream(file));
                        try {
                            long readLong = dataInputStream.readLong();
                            dataInputStream.close();
                            z11 = readLong == packageInfo.lastUpdateTime;
                            if (z11) {
                                dVar.m(2, null);
                            }
                        } finally {
                        }
                    } catch (IOException unused) {
                        z11 = false;
                    }
                } else {
                    z11 = false;
                }
                if (z11) {
                    Log.d("ProfileInstaller", "Skipping profile installation for " + context.getPackageName());
                    x0.k.c(context, false);
                    return;
                }
            }
            Log.d("ProfileInstaller", "Installing profile for " + context.getPackageName());
            int i6 = Build.VERSION.SDK_INT;
            File file2 = new File(new File("/data/misc/profiles/cur/0", packageName), "primary.prof");
            x0.b bVar2 = new x0.b(assets, aVar, dVar, name, file2);
            byte[] bArr4 = bVar2.f4767d;
            if (bArr4 != null) {
                if (!file2.exists()) {
                    try {
                        file2.createNewFile();
                    } catch (IOException unused2) {
                        bVar2.b(4, null);
                    }
                } else if (!file2.canWrite()) {
                    bVar2.b(4, null);
                }
                bVar2.f4770g = true;
                z5 = true;
                if (z5) {
                    z8 = true;
                    z9 = false;
                } else {
                    AssetManager assetManager = bVar2.f4764a;
                    ?? r5 = bVar2.f4766c;
                    if (!bVar2.f4770g) {
                        throw new IllegalStateException("This device doesn't support aot. Did you call deviceSupportsAotProfile()?");
                    }
                    byte[] bArr5 = j6.f3305v;
                    if (bArr4 != null) {
                        try {
                            try {
                                fileInputStream = bVar2.a(assetManager, "dexopt/baseline.prof");
                            } catch (FileNotFoundException e5) {
                                r5.m(6, e5);
                                fileInputStream = null;
                                if (fileInputStream != null) {
                                }
                                cVarArr2 = bVar2.f4771h;
                                if (cVarArr2 != null) {
                                }
                                x0.d dVar2 = bVar2.f4766c;
                                cVarArr3 = bVar2.f4771h;
                                if (cVarArr3 != null) {
                                }
                                bArr = bVar2.f4772i;
                                if (bArr == null) {
                                }
                                z9 = false;
                                z8 = z10;
                                if (z9) {
                                }
                                x0.k.c(context, (z9 || !z4) ? false : z8);
                            } catch (IOException e6) {
                                r5.m(7, e6);
                                fileInputStream = null;
                                if (fileInputStream != null) {
                                }
                                cVarArr2 = bVar2.f4771h;
                                if (cVarArr2 != null) {
                                }
                                x0.d dVar22 = bVar2.f4766c;
                                cVarArr3 = bVar2.f4771h;
                                if (cVarArr3 != null) {
                                }
                                bArr = bVar2.f4772i;
                                if (bArr == null) {
                                }
                                z9 = false;
                                z8 = z10;
                                if (z9) {
                                }
                                x0.k.c(context, (z9 || !z4) ? false : z8);
                            }
                            if (fileInputStream != null) {
                                try {
                                } catch (IOException e7) {
                                    i5 = 7;
                                    r5.m(7, e7);
                                    try {
                                        fileInputStream.close();
                                    } catch (IOException e8) {
                                        r5.m(i5, e8);
                                    }
                                    cVarArr = null;
                                    bVar2.f4771h = cVarArr;
                                    cVarArr2 = bVar2.f4771h;
                                    if (cVarArr2 != null) {
                                    }
                                    x0.d dVar222 = bVar2.f4766c;
                                    cVarArr3 = bVar2.f4771h;
                                    if (cVarArr3 != null) {
                                        if (bVar2.f4770g) {
                                        }
                                    }
                                    bArr = bVar2.f4772i;
                                    if (bArr == null) {
                                    }
                                    z9 = false;
                                    z8 = z10;
                                    if (z9) {
                                    }
                                    x0.k.c(context, (z9 || !z4) ? false : z8);
                                } catch (IllegalStateException e9) {
                                    r5.m(8, e9);
                                    i5 = 7;
                                    fileInputStream.close();
                                    cVarArr = null;
                                    bVar2.f4771h = cVarArr;
                                    cVarArr2 = bVar2.f4771h;
                                    if (cVarArr2 != null) {
                                    }
                                    x0.d dVar2222 = bVar2.f4766c;
                                    cVarArr3 = bVar2.f4771h;
                                    if (cVarArr3 != null) {
                                    }
                                    bArr = bVar2.f4772i;
                                    if (bArr == null) {
                                    }
                                    z9 = false;
                                    z8 = z10;
                                    if (z9) {
                                    }
                                    x0.k.c(context, (z9 || !z4) ? false : z8);
                                }
                                if (!Arrays.equals(bArr5, j6.y(fileInputStream, 4))) {
                                    throw new IllegalStateException("Invalid magic");
                                }
                                cVarArr = j6.E(fileInputStream, j6.y(fileInputStream, 4), bVar2.f4769f);
                                try {
                                    fileInputStream.close();
                                } catch (IOException e10) {
                                    r5.m(7, e10);
                                }
                                bVar2.f4771h = cVarArr;
                            }
                            cVarArr2 = bVar2.f4771h;
                            if (cVarArr2 != null) {
                                int i7 = Build.VERSION.SDK_INT;
                                if (i7 <= 34) {
                                    switch (i7) {
                                        case 31:
                                        case 32:
                                        case 33:
                                        case 34:
                                            z6 = true;
                                            break;
                                    }
                                    if (z6) {
                                        try {
                                            a5 = bVar2.a(assetManager, "dexopt/baseline.profm");
                                        } catch (FileNotFoundException e11) {
                                            r5.m(9, e11);
                                        } catch (IOException e12) {
                                            r5.m(7, e12);
                                        } catch (IllegalStateException e13) {
                                            bVar2.f4771h = null;
                                            r5.m(8, e13);
                                        }
                                        if (a5 != null) {
                                            try {
                                                if (!Arrays.equals(j6.f3306w, j6.y(a5, 4))) {
                                                    throw new IllegalStateException("Invalid magic");
                                                }
                                                bVar2.f4771h = j6.B(a5, j6.y(a5, 4), bArr4, cVarArr2);
                                                a5.close();
                                                bVar = bVar2;
                                                if (bVar != null) {
                                                    bVar2 = bVar;
                                                }
                                            } finally {
                                            }
                                        } else {
                                            if (a5 != null) {
                                                a5.close();
                                            }
                                            bVar = null;
                                            if (bVar != null) {
                                            }
                                        }
                                    }
                                }
                                z6 = false;
                                if (z6) {
                                }
                            }
                        } finally {
                        }
                    }
                    x0.d dVar22222 = bVar2.f4766c;
                    cVarArr3 = bVar2.f4771h;
                    if (cVarArr3 != null && (bArr3 = bVar2.f4767d) != null) {
                        if (bVar2.f4770g) {
                            throw new IllegalStateException("This device doesn't support aot. Did you call deviceSupportsAotProfile()?");
                        }
                        try {
                            byteArrayOutputStream = new ByteArrayOutputStream();
                            try {
                                byteArrayOutputStream.write(bArr5);
                                byteArrayOutputStream.write(bArr3);
                            } finally {
                            }
                        } catch (IOException e14) {
                            dVar22222.m(7, e14);
                        } catch (IllegalStateException e15) {
                            dVar22222.m(8, e15);
                        }
                        if (j6.R(byteArrayOutputStream, bArr3, cVarArr3)) {
                            bVar2.f4772i = byteArrayOutputStream.toByteArray();
                            byteArrayOutputStream.close();
                            bVar2.f4771h = null;
                        } else {
                            dVar22222.m(5, null);
                            bVar2.f4771h = null;
                            byteArrayOutputStream.close();
                        }
                    }
                    bArr = bVar2.f4772i;
                    if (bArr == null) {
                        z10 = true;
                    } else {
                        try {
                            if (!bVar2.f4770g) {
                                throw new IllegalStateException("This device doesn't support aot. Did you call deviceSupportsAotProfile()?");
                            }
                            try {
                                try {
                                    byteArrayInputStream = new ByteArrayInputStream(bArr);
                                    try {
                                        fileOutputStream = new FileOutputStream(bVar2.f4768e);
                                    } catch (Throwable th2) {
                                        th = th2;
                                    }
                                    try {
                                        try {
                                            bArr2 = new byte[512];
                                        } catch (Throwable th3) {
                                            th = th3;
                                        }
                                    } catch (Throwable th4) {
                                        th = th4;
                                        Throwable th5 = th;
                                        try {
                                            byteArrayInputStream.close();
                                            throw th5;
                                        } catch (Throwable th6) {
                                            th5.addSuppressed(th6);
                                            throw th5;
                                        }
                                    }
                                } catch (FileNotFoundException e16) {
                                    e = e16;
                                    bVar2.b(6, e);
                                    z7 = r5;
                                    z9 = false;
                                    z8 = z10;
                                    if (z9) {
                                    }
                                    x0.k.c(context, (z9 || !z4) ? false : z8);
                                } catch (IOException e17) {
                                    e = e17;
                                    bVar2.b(7, e);
                                    z7 = r5;
                                    z9 = false;
                                    z8 = z10;
                                    if (z9) {
                                    }
                                    x0.k.c(context, (z9 || !z4) ? false : z8);
                                }
                            } catch (FileNotFoundException e18) {
                                e = e18;
                                r5 = 1;
                                bVar2.b(6, e);
                                z7 = r5;
                                z9 = false;
                                z8 = z10;
                                if (z9) {
                                }
                                x0.k.c(context, (z9 || !z4) ? false : z8);
                            } catch (IOException e19) {
                                e = e19;
                                r5 = 1;
                                bVar2.b(7, e);
                                z7 = r5;
                                z9 = false;
                                z8 = z10;
                                if (z9) {
                                }
                                x0.k.c(context, (z9 || !z4) ? false : z8);
                            }
                            while (true) {
                                int read = byteArrayInputStream.read(bArr2);
                                if (read > 0) {
                                    try {
                                        fileOutputStream.write(bArr2, 0, read);
                                    } catch (Throwable th7) {
                                        th = th7;
                                        try {
                                            fileOutputStream.close();
                                            throw th;
                                        } catch (Throwable th8) {
                                            th.addSuppressed(th8);
                                            throw th;
                                        }
                                    }
                                } else {
                                    z8 = true;
                                    try {
                                        bVar2.b(1, null);
                                        fileOutputStream.close();
                                        byteArrayInputStream.close();
                                        bVar2.f4772i = null;
                                        bVar2.f4771h = null;
                                        z9 = true;
                                        if (z9) {
                                            B0(packageInfo, filesDir);
                                        }
                                    } catch (Throwable th9) {
                                        th = th9;
                                        th = th;
                                        fileOutputStream.close();
                                        throw th;
                                    }
                                }
                            }
                        } finally {
                            bVar2.f4772i = null;
                            bVar2.f4771h = false ? 1 : 0;
                        }
                    }
                    z9 = false;
                    z8 = z10;
                    if (z9) {
                    }
                }
                x0.k.c(context, (z9 || !z4) ? false : z8);
            }
            bVar2.b(3, Integer.valueOf(i6));
            z5 = false;
            if (z5) {
            }
            x0.k.c(context, (z9 || !z4) ? false : z8);
        } catch (PackageManager.NameNotFoundException e20) {
            dVar.m(7, e20);
            x0.k.c(context, false);
        }
    }

    public static int r(long[] jArr, int i5, long j5) {
        int i6 = i5 - 1;
        int i7 = 0;
        while (i7 <= i6) {
            int i8 = (i7 + i6) >>> 1;
            long j6 = jArr[i8];
            if (j6 < j5) {
                i7 = i8 + 1;
            } else {
                if (j6 <= j5) {
                    return i8;
                }
                i6 = i8 - 1;
            }
        }
        return ~i7;
    }

    public static boolean r0() {
        if (!m0()) {
            return false;
        }
        try {
            Class<?> cls = Class.forName("com.huawei.system.BuildEx");
            return "Harmony".equalsIgnoreCase(String.valueOf(cls.getMethod("getOsBrand", new Class[0]).invoke(cls, new Object[0])));
        } catch (Throwable th) {
            th.printStackTrace();
            return false;
        }
    }

    public static boolean s0(View view) {
        WeakHashMap weakHashMap = s0.f2438a;
        return view.getLayoutDirection() == 1;
    }

    public static boolean t0(String str, String str2) {
        return str.startsWith(str2.concat("(")) && str.endsWith(")");
    }

    public static boolean u0() {
        return !TextUtils.isEmpty(f0("ro.miui.ui.version.name"));
    }

    public static boolean v0() {
        try {
            Class<?> cls = Class.forName("android.os.SystemProperties");
            String valueOf = String.valueOf(cls.getMethod("get", String.class, String.class).invoke(cls, "ro.miui.cts", ""));
            Method method = cls.getMethod("getBoolean", String.class, Boolean.TYPE);
            Object[] objArr = new Object[2];
            objArr[0] = "persist.sys.miui_optimization";
            objArr[1] = Boolean.valueOf("1".equals(valueOf) ? false : true);
            return Boolean.parseBoolean(String.valueOf(method.invoke(cls, objArr)));
        } catch (ClassNotFoundException e5) {
            e5.printStackTrace();
            return true;
        } catch (IllegalAccessException e6) {
            e6.printStackTrace();
            return true;
        } catch (NoSuchMethodException e7) {
            e7.printStackTrace();
            return true;
        } catch (InvocationTargetException e8) {
            e8.printStackTrace();
            return true;
        }
    }

    public static boolean w0(Context context) {
        try {
            PermissionInfo permissionInfo = context.getPackageManager().getPermissionInfo("com.android.permission.GET_INSTALLED_APPS", 0);
            if (permissionInfo != null) {
                return permissionInfo.getProtection() == 1;
            }
        } catch (PackageManager.NameNotFoundException e5) {
            e5.printStackTrace();
        }
        try {
            return Settings.Secure.getInt(context.getContentResolver(), "oem_installed_apps_runtime_permission_enable") == 1;
        } catch (Settings.SettingNotFoundException e6) {
            e6.printStackTrace();
            return false;
        }
    }

    public static void x(List list, String str, int i5) {
        l2.b bVar;
        String str2;
        Iterator it = list.iterator();
        while (true) {
            if (!it.hasNext()) {
                bVar = null;
                break;
            } else {
                bVar = (l2.b) it.next();
                if (TextUtils.equals(bVar.f3756a, str)) {
                    break;
                }
            }
        }
        if (bVar == null) {
            throw new IllegalStateException(j.g("Please register permissions in the AndroidManifest.xml file <uses-permission android:name=\"", str, "\" />"));
        }
        int i6 = bVar.f3757b;
        if (i6 < i5) {
            StringBuilder sb = new StringBuilder("The AndroidManifest.xml file <uses-permission android:name=\"");
            sb.append(str);
            sb.append("\" android:maxSdkVersion=\"");
            sb.append(i6);
            sb.append("\" /> does not meet the requirements, ");
            if (i5 != Integer.MAX_VALUE) {
                str2 = "the minimum requirement for maxSdkVersion is " + i5;
            } else {
                str2 = "please delete the android:maxSdkVersion=\"" + i6 + "\" attribute";
            }
            sb.append(str2);
            throw new IllegalArgumentException(sb.toString());
        }
    }

    public static void x0(String str) {
        Log.e("PathSelector", str);
    }

    public static void y(Object obj) {
        if (obj != null) {
            return;
        }
        NullPointerException nullPointerException = new NullPointerException();
        Y0(a.class.getName(), nullPointerException);
        throw nullPointerException;
    }

    public static final int y0(int i5) {
        if (i5 < 0) {
            return i5;
        }
        if (i5 < 3) {
            return i5 + 1;
        }
        if (i5 < 1073741824) {
            return (int) ((i5 / 0.75f) + 1.0f);
        }
        return Integer.MAX_VALUE;
    }

    public static void z(Object obj, String str) {
        if (obj != null) {
            return;
        }
        NullPointerException nullPointerException = new NullPointerException(str);
        Y0(a.class.getName(), nullPointerException);
        throw nullPointerException;
    }

    public static Typeface z0(Configuration configuration, Typeface typeface) {
        int i5;
        int i6;
        int i7;
        if (Build.VERSION.SDK_INT < 31) {
            return null;
        }
        i5 = configuration.fontWeightAdjustment;
        if (i5 == Integer.MAX_VALUE) {
            return null;
        }
        i6 = configuration.fontWeightAdjustment;
        if (i6 == 0 || typeface == null) {
            return null;
        }
        int weight = typeface.getWeight();
        i7 = configuration.fontWeightAdjustment;
        return Typeface.create(typeface, f.k(i7 + weight, 1, 1000), typeface.isItalic());
    }

    public abstract int C(View view, int i5);

    public abstract View C0(int i5);

    public abstract int D(View view, int i5);

    public abstract void D0(int i5);

    public abstract void E0(Typeface typeface);

    public abstract void F0(Typeface typeface, boolean z4);

    public abstract boolean G0();

    public void H0(View view, int i5) {
    }

    public abstract void I0(int i5);

    public abstract void J0(View view, int i5, int i6);

    public abstract void K0(View view, float f5, float f6);

    public abstract Object M0(Intent intent, int i5);

    public abstract Intent N(o oVar, Intent intent);

    public abstract void O0(m.f fVar, m.f fVar2);

    public abstract void P0(m.f fVar, Thread thread);

    public abstract void V(float f5, float f6, f2.v vVar);

    @Override
    public void a() {
    }

    @Override
    public void c() {
    }

    public void c1(View view, float f5) {
        if (f4924f) {
            try {
                d0.b(view, f5);
                return;
            } catch (NoSuchMethodError unused) {
                f4924f = false;
            }
        }
        view.setAlpha(f5);
    }

    public void d1(View view, int i5) {
        if (!f4926h) {
            try {
                Field declaredField = View.class.getDeclaredField("mViewFlags");
                f4925g = declaredField;
                declaredField.setAccessible(true);
            } catch (NoSuchFieldException unused) {
                Log.i("ViewUtilsApi19", "fetchViewFlagsField: ");
            }
            f4926h = true;
        }
        Field field = f4925g;
        if (field != null) {
            try {
                f4925g.setInt(view, i5 | (field.getInt(view) & (-13)));
            } catch (IllegalAccessException unused2) {
            }
        }
    }

    @Override
    public boolean e() {
        return true;
    }

    @Override
    public void g() {
    }

    public androidx.fragment.app.o h0(o oVar, Intent intent) {
        B(oVar, "context");
        return null;
    }

    @Override
    public void i() {
    }

    public float j0(View view) {
        if (f4924f) {
            try {
                return d0.a(view);
            } catch (NoSuchMethodError unused) {
                f4924f = false;
            }
        }
        return view.getAlpha();
    }

    public int k0(View view) {
        return 0;
    }

    @Override
    public void l() {
    }

    public int l0() {
        return 0;
    }

    public abstract boolean n1(View view, int i5);

    public void s(int i5) {
        new Handler(Looper.getMainLooper()).post(new l(i5, 0, this));
    }

    public void t(Typeface typeface) {
        new Handler(Looper.getMainLooper()).post(new p(this, 1, typeface));
    }

    public abstract boolean u(m.g gVar, m.c cVar);

    public abstract boolean v(m.g gVar, Object obj, Object obj2);

    public abstract boolean w(m.g gVar, m.f fVar, m.f fVar2);
}