导航菜单

页面标题

页面副标题

Releam v2.13.2 - f.java 源代码

正在查看: Releam v2.13.2 应用的 f.java JAVA 源代码文件

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


package a2;

import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.database.Cursor;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.DocumentsContract;
import android.util.Base64;
import android.util.Log;
import android.util.Property;
import android.util.Xml;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.BaseInterpolator;
import androidx.work.impl.WorkDatabase;
import com.google.api.client.http.HttpStatusCodes;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.Closeable;
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.OutputStream;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
import javax.xml.XMLConstants;
import l0.b1;
import l0.h1;
import l0.i1;
import n1.d0;
import org.apache.poi.ss.util.CellUtil;
import org.xmlpull.v1.XmlPullParserException;
import r1.c0;
import s1.a0;
import s1.x;

public abstract class f {

    public static boolean f91f = true;

    public static final b5.e f86a = new b5.e(null);

    public static final t6.e f87b = new t6.e();

    public static final l3.d f88c = new l3.d(1, "account_capability_api");

    public static final l3.d f89d = new l3.d(3, "google_auth_service_token");

    public static final l3.d f90e = new l3.d(2, "google_auth_service_accounts");

    public static final q f92g = new q(1);

    public static w A(Context context, d9.h hVar, File file, boolean z10) {
        String str;
        s9.a.n(context, "context");
        s9.a.n(file, "file");
        String str2 = hVar.f4381q;
        if (str2 != null) {
            String absolutePath = file.getAbsolutePath();
            s9.a.m(absolutePath, "getAbsolutePath(...)");
            str = ia.i.K(absolutePath, str2, XMLConstants.DEFAULT_NS_PREFIX);
        } else {
            str = null;
        }
        if (str != null) {
            return z(context, hVar.c(context), str, z10);
        }
        return null;
    }

    public static String B(String str, List list) {
        String str2;
        s9.a.n(list, "topics");
        Iterator it = list.iterator();
        String str3 = XMLConstants.DEFAULT_NS_PREFIX;
        while (it.hasNext()) {
            d9.i iVar = (d9.i) it.next();
            if (iVar.f4386q.length() + str3.length() > 30) {
                break;
            }
            str3 = a0.w.k(str3, iVar.f4386q);
        }
        if (str3.length() == 0) {
            d9.i iVar2 = (d9.i) q9.m.H(list);
            str3 = (iVar2 == null || (str2 = iVar2.f4386q) == null) ? "data" : ia.j.V(30, str2);
        }
        return str3.concat(str);
    }

    public static long C(File file) {
        s9.a.n(file, "file");
        if (!file.isDirectory()) {
            return file.length();
        }
        File[] listFiles = file.listFiles();
        long j10 = 0;
        if (listFiles == null) {
            return 0L;
        }
        for (File file2 : listFiles) {
            if (file2 != null) {
                j10 = C(file2) + j10;
            }
        }
        return j10;
    }

    public static boolean D() {
        throw new UnsupportedOperationException("Method not decompiled: a2.f.D():boolean");
    }

    public static boolean E(d9.h hVar, File file) {
        String str;
        if (file == null || (str = hVar.f4381q) == null) {
            return false;
        }
        String absolutePath = file.getAbsolutePath();
        s9.a.k(absolutePath);
        return ia.i.u(absolutePath, str);
    }

    public static boolean F(MotionEvent motionEvent, int i10) {
        return (motionEvent.getSource() & i10) == i10;
    }

    public static boolean G(Context context) {
        if (Build.VERSION.SDK_INT >= 24) {
            return h0.m.a(context);
        }
        return true;
    }

    public static final void H(Context context) {
        LinkedHashMap linkedHashMap;
        s9.a.n(context, "context");
        File databasePath = context.getDatabasePath("androidx.work.workdb");
        s9.a.m(databasePath, "context.getDatabasePath(WORK_DATABASE_NAME)");
        if (databasePath.exists()) {
            r1.t.d().a(a0.f8988a, "Migrating WorkDatabase to the no-backup directory");
            File databasePath2 = context.getDatabasePath("androidx.work.workdb");
            s9.a.m(databasePath2, "context.getDatabasePath(WORK_DATABASE_NAME)");
            File file = new File(s1.a.f8987a.a(context), "androidx.work.workdb");
            String[] strArr = a0.f8989b;
            int I = f6.e.I(strArr.length);
            if (I < 16) {
                I = 16;
            }
            LinkedHashMap linkedHashMap2 = new LinkedHashMap(I);
            for (String str : strArr) {
                linkedHashMap2.put(new File(databasePath2.getPath() + str), new File(file.getPath() + str));
            }
            if (linkedHashMap2.isEmpty()) {
                ?? singletonMap = Collections.singletonMap(databasePath2, file);
                s9.a.m(singletonMap, "singletonMap(pair.first, pair.second)");
                linkedHashMap = singletonMap;
            } else {
                LinkedHashMap linkedHashMap3 = new LinkedHashMap(linkedHashMap2);
                linkedHashMap3.put(databasePath2, file);
                linkedHashMap = linkedHashMap3;
            }
            for (Map.Entry entry : linkedHashMap.entrySet()) {
                File file2 = (File) entry.getKey();
                File file3 = (File) entry.getValue();
                if (file2.exists()) {
                    if (file3.exists()) {
                        r1.t.d().g(a0.f8988a, "Over-writing contents of " + file3);
                    }
                    r1.t.d().a(a0.f8988a, file2.renameTo(file3) ? "Migrated " + file2 + "to " + file3 : "Renaming " + file2 + " to " + file3 + " failed");
                }
            }
        }
    }

    public static void I(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 java.io.InputStream J(android.content.Context r4, d9.h r5, java.io.File r6) {
        throw new UnsupportedOperationException("Method not decompiled: a2.f.J(android.content.Context, d9.h, java.io.File):java.io.InputStream");
    }

    public static OutputStream K(Context context, d9.h hVar, File file) {
        s9.a.n(context, "context");
        if (file == null || !E(hVar, file)) {
            return null;
        }
        if (hVar.Z) {
            try {
                return new FileOutputStream(file);
            } catch (Exception unused) {
                return null;
            }
        }
        w A = A(context, hVar, file, false);
        if (A == null) {
            return null;
        }
        try {
            return context.getContentResolver().openOutputStream((Uri) A.W);
        } catch (Exception unused2) {
            return null;
        }
    }

    public static c0.e L(XmlResourceParser xmlResourceParser, Resources resources) {
        int next;
        do {
            next = xmlResourceParser.next();
            if (next == 2) {
                break;
            }
        } while (next != 1);
        if (next != 2) {
            throw new XmlPullParserException("No start tag found");
        }
        xmlResourceParser.require(2, null, "font-family");
        if (xmlResourceParser.getName().equals("font-family")) {
            TypedArray obtainAttributes = resources.obtainAttributes(Xml.asAttributeSet(xmlResourceParser), z.a.f11101b);
            String string = obtainAttributes.getString(0);
            String string2 = obtainAttributes.getString(4);
            String string3 = obtainAttributes.getString(5);
            int resourceId = obtainAttributes.getResourceId(1, 0);
            int integer = obtainAttributes.getInteger(2, 1);
            int integer2 = obtainAttributes.getInteger(3, 500);
            String string4 = obtainAttributes.getString(6);
            obtainAttributes.recycle();
            if (string != null && string2 != null && string3 != null) {
                while (xmlResourceParser.next() != 3) {
                    U(xmlResourceParser);
                }
                return new c0.h(new androidx.appcompat.widget.r(string, string2, string3, P(resources, resourceId)), integer, integer2, string4);
            }
            ArrayList arrayList = new ArrayList();
            while (xmlResourceParser.next() != 3) {
                if (xmlResourceParser.getEventType() == 2) {
                    if (xmlResourceParser.getName().equals(CellUtil.FONT)) {
                        TypedArray obtainAttributes2 = resources.obtainAttributes(Xml.asAttributeSet(xmlResourceParser), z.a.f11102c);
                        int i10 = obtainAttributes2.getInt(obtainAttributes2.hasValue(8) ? 8 : 1, HttpStatusCodes.STATUS_CODE_BAD_REQUEST);
                        boolean z10 = 1 == obtainAttributes2.getInt(obtainAttributes2.hasValue(6) ? 6 : 2, 0);
                        int i11 = obtainAttributes2.hasValue(9) ? 9 : 3;
                        String string5 = obtainAttributes2.getString(obtainAttributes2.hasValue(7) ? 7 : 4);
                        int i12 = obtainAttributes2.getInt(i11, 0);
                        int i13 = obtainAttributes2.hasValue(5) ? 5 : 0;
                        int resourceId2 = obtainAttributes2.getResourceId(i13, 0);
                        String string6 = obtainAttributes2.getString(i13);
                        obtainAttributes2.recycle();
                        while (xmlResourceParser.next() != 3) {
                            U(xmlResourceParser);
                        }
                        arrayList.add(new c0.g(i10, i12, resourceId2, string6, string5, z10));
                    } else {
                        U(xmlResourceParser);
                    }
                }
            }
            if (!arrayList.isEmpty()) {
                return new c0.f((c0.g[]) arrayList.toArray(new c0.g[0]));
            }
        } else {
            U(xmlResourceParser);
        }
        return null;
    }

    public static f2.b M(f2.k kVar) {
        boolean z10;
        long j10;
        long j11;
        long j12;
        long currentTimeMillis = System.currentTimeMillis();
        Map map = kVar.f4620c;
        if (map == null) {
            return null;
        }
        String str = (String) map.get("Date");
        long O = str != null ? O(str) : 0L;
        String str2 = (String) map.get("Cache-Control");
        int i10 = 0;
        if (str2 != null) {
            String[] split = str2.split(",", 0);
            z10 = false;
            j10 = 0;
            j11 = 0;
            while (i10 < split.length) {
                String trim = split[i10].trim();
                if (trim.equals("no-cache") || trim.equals("no-store")) {
                    return null;
                }
                if (trim.startsWith("max-age=")) {
                    try {
                        j10 = Long.parseLong(trim.substring(8));
                    } catch (Exception unused) {
                    }
                } else if (trim.startsWith("stale-while-revalidate=")) {
                    j11 = Long.parseLong(trim.substring(23));
                } else if (trim.equals("must-revalidate") || trim.equals("proxy-revalidate")) {
                    z10 = true;
                }
                i10++;
            }
            i10 = 1;
        } else {
            z10 = false;
            j10 = 0;
            j11 = 0;
        }
        String str3 = (String) map.get("Expires");
        long O2 = str3 != null ? O(str3) : 0L;
        String str4 = (String) map.get("Last-Modified");
        long O3 = str4 != null ? O(str4) : 0L;
        String str5 = (String) map.get("ETag");
        if (i10 != 0) {
            long j13 = (j10 * 1000) + currentTimeMillis;
            if (!z10) {
                Long.signum(j11);
                j13 = (j11 * 1000) + j13;
            }
            j12 = j13;
        } else {
            j12 = (O <= 0 || O2 < O) ? 0L : currentTimeMillis + (O2 - O);
        }
        f2.b bVar = new f2.b();
        bVar.f4605a = str5;
        bVar.f4607c = j12;
        bVar.f4606b = O3;
        bVar.f4608d = map;
        return bVar;
    }

    public static String N(Map map) {
        String str;
        if (map == null || (str = (String) map.get("Content-Type")) == null) {
            return "ISO-8859-1";
        }
        String[] split = str.split(";", 0);
        for (int i10 = 1; i10 < split.length; i10++) {
            String[] split2 = split[i10].trim().split("=", 0);
            if (split2.length == 2 && split2[0].equals("charset")) {
                return split2[1];
            }
        }
        return "ISO-8859-1";
    }

    public static long O(String str) {
        try {
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US);
            simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
            return simpleDateFormat.parse(str).getTime();
        } catch (ParseException e10) {
            if ("0".equals(str) || "-1".equals(str)) {
                f2.v.b("Unable to parse dateStr: %s, falling back to 0", str);
                return 0L;
            }
            Log.e("Volley", f2.v.a("Unable to parse dateStr: %s, falling back to 0", str), e10);
            return 0L;
        }
    }

    public static List P(Resources resources, int i10) {
        if (i10 == 0) {
            return Collections.emptyList();
        }
        TypedArray obtainTypedArray = resources.obtainTypedArray(i10);
        try {
            if (obtainTypedArray.length() == 0) {
                return Collections.emptyList();
            }
            ArrayList arrayList = new ArrayList();
            if (c0.d.a(obtainTypedArray, 0) == 1) {
                for (int i11 = 0; i11 < obtainTypedArray.length(); i11++) {
                    int resourceId = obtainTypedArray.getResourceId(i11, 0);
                    if (resourceId != 0) {
                        String[] stringArray = resources.getStringArray(resourceId);
                        ArrayList arrayList2 = new ArrayList();
                        for (String str : stringArray) {
                            arrayList2.add(Base64.decode(str, 0));
                        }
                        arrayList.add(arrayList2);
                    }
                }
            } else {
                String[] stringArray2 = resources.getStringArray(i10);
                ArrayList arrayList3 = new ArrayList();
                for (String str2 : stringArray2) {
                    arrayList3.add(Base64.decode(str2, 0));
                }
                arrayList.add(arrayList3);
            }
            return arrayList;
        } finally {
            obtainTypedArray.recycle();
        }
    }

    public static void Q(Window window) {
        if (Build.VERSION.SDK_INT >= 30) {
            i1.a(window, false);
        } else {
            h1.a(window, false);
        }
    }

    public static void R(Drawable drawable, int i10) {
        e0.b.g(drawable, i10);
    }

    public static void S(Drawable drawable, ColorStateList colorStateList) {
        e0.b.h(drawable, colorStateList);
    }

    public static void T(Drawable drawable, PorterDuff.Mode mode) {
        e0.b.i(drawable, mode);
    }

    public static void U(XmlResourceParser xmlResourceParser) {
        int i10 = 1;
        while (i10 > 0) {
            int next = xmlResourceParser.next();
            if (next == 2) {
                i10++;
            } else if (next == 3) {
                i10--;
            }
        }
    }

    public static void V(ViewGroup viewGroup, boolean z10) {
        if (Build.VERSION.SDK_INT >= 29) {
            viewGroup.suppressLayout(z10);
        } else if (f91f) {
            try {
                viewGroup.suppressLayout(z10);
            } catch (NoSuchMethodError unused) {
                f91f = false;
            }
        }
    }

    public static void W(InputStream inputStream, OutputStream outputStream) {
        byte[] bArr = new byte[2048];
        while (true) {
            int read = inputStream.read(bArr);
            if (read <= 0) {
                return;
            } else {
                outputStream.write(bArr, 0, read);
            }
        }
    }

    public static void X(android.content.Context r19, j.a r20, c1.d r21, boolean r22) {
        throw new UnsupportedOperationException("Method not decompiled: a2.f.X(android.content.Context, j.a, c1.d, boolean):void");
    }

    public static final void a(WorkDatabase workDatabase, r1.a aVar, x xVar) {
        int i10;
        s9.a.n(aVar, "configuration");
        s9.a.n(xVar, "continuation");
        if (Build.VERSION.SDK_INT < 24) {
            return;
        }
        ArrayList arrayList = new ArrayList(new q9.g(new x[]{xVar}, true));
        int i11 = 0;
        while (!arrayList.isEmpty()) {
            if (arrayList.isEmpty()) {
                throw new NoSuchElementException("List is empty.");
            }
            List list = ((x) arrayList.remove(d7.f.n(arrayList))).f9071h;
            s9.a.m(list, "current.work");
            List list2 = list;
            if ((list2 instanceof Collection) && list2.isEmpty()) {
                i10 = 0;
            } else {
                Iterator it = list2.iterator();
                i10 = 0;
                while (it.hasNext()) {
                    if (((c0) it.next()).f8444b.f122j.a() && (i10 = i10 + 1) < 0) {
                        d7.f.w();
                        throw null;
                    }
                }
            }
            i11 += i10;
        }
        if (i11 == 0) {
            return;
        }
        u v4 = workDatabase.v();
        v4.getClass();
        e1.a0 d8 = e1.a0.d(0, "Select COUNT(*) FROM workspec WHERE LENGTH(content_uri_triggers)<>0 AND state NOT IN (2, 3, 5)");
        e1.x xVar2 = v4.f136a;
        xVar2.b();
        Cursor X = ka.v.X(xVar2, d8);
        try {
            int i12 = X.moveToFirst() ? X.getInt(0) : 0;
            X.close();
            d8.f();
            int i13 = i12 + i11;
            int i14 = aVar.f8434i;
            if (i13 > i14) {
                throw new IllegalArgumentException(r.h.b(a0.w.r("Too many workers with contentUriTriggers are enqueued:\ncontentUriTrigger workers limit: ", i14, ";\nalready enqueued count: ", i12, ";\ncurrent enqueue operation count: "), i11, ".\nTo address this issue you can: \n1. enqueue less workers or batch some of workers with content uri triggers together;\n2. increase limit via Configuration.Builder.setContentUriTriggerWorkersLimit;\nPlease beware that workers with content uri triggers immediately occupy slots in JobScheduler so no updates to content uris are missed."));
            }
        } catch (Throwable th) {
            X.close();
            d8.f();
            throw th;
        }
    }

    public static void b(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (Exception unused) {
            }
        }
    }

    public static List c(ArrayList arrayList, ArrayList arrayList2) {
        if (arrayList == null) {
            return arrayList2;
        }
        if (arrayList2 == null) {
            return arrayList;
        }
        p.b bVar = new p.b(arrayList2.size() + arrayList.size());
        bVar.addAll(arrayList);
        bVar.addAll(arrayList2);
        return new ArrayList(bVar);
    }

    public static boolean d(File[] fileArr, File file, Context context, r7.a aVar) {
        s9.a.n(context, "context");
        if (fileArr != null) {
            if (!(fileArr.length == 0)) {
                b1 V = s9.a.V(fileArr);
                while (V.hasNext()) {
                    File file2 = (File) V.next();
                    if (!file2.exists() || file2.isDirectory()) {
                        return false;
                    }
                }
                if (file.exists() && !n(context, file)) {
                    return false;
                }
                try {
                    return e(new FileOutputStream(file), fileArr, file, aVar);
                } catch (FileNotFoundException | SecurityException unused) {
                }
            }
        }
        return false;
    }

    public static boolean e(OutputStream outputStream, File[] fileArr, File file, r7.a aVar) {
        BufferedInputStream bufferedInputStream;
        ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(outputStream));
        zipOutputStream.setLevel(0);
        BufferedInputStream bufferedInputStream2 = null;
        try {
            int length = fileArr.length;
            int i10 = 0;
            while (true) {
                if (i10 >= length) {
                    break;
                }
                File file2 = fileArr[i10];
                if (!s9.a.c(file2, file)) {
                    zipOutputStream.putNextEntry(new ZipEntry(file2.getName()));
                    try {
                        bufferedInputStream = new BufferedInputStream(new FileInputStream(file2));
                        try {
                            W(bufferedInputStream, zipOutputStream);
                            bufferedInputStream.close();
                            if (aVar != null && aVar.b(1L)) {
                                bufferedInputStream2 = bufferedInputStream;
                                break;
                            }
                            bufferedInputStream2 = bufferedInputStream;
                        } catch (IOException unused) {
                            bufferedInputStream2 = bufferedInputStream;
                            b(zipOutputStream);
                            b(bufferedInputStream2);
                            return false;
                        } catch (Throwable th) {
                            th = th;
                            b(zipOutputStream);
                            b(bufferedInputStream);
                            throw th;
                        }
                    } catch (FileNotFoundException unused2) {
                        b(zipOutputStream);
                        b(bufferedInputStream2);
                        return false;
                    } catch (SecurityException unused3) {
                        b(zipOutputStream);
                        b(bufferedInputStream2);
                        return false;
                    }
                }
                i10++;
            }
            zipOutputStream.finish();
            zipOutputStream.close();
            b(zipOutputStream);
            b(bufferedInputStream2);
            return true;
        } catch (IOException unused4) {
        } catch (Throwable th2) {
            th = th2;
            bufferedInputStream = bufferedInputStream2;
        }
    }

    public static boolean f(File file, File file2) {
        boolean z10 = false;
        if (file == null || file2 == null || !file.exists() || file2.exists() || file.isDirectory() || file2.isDirectory()) {
            return false;
        }
        try {
            try {
                FileChannel channel = new RandomAccessFile(file, "r").getChannel();
                FileChannel channel2 = new RandomAccessFile(file2, "rw").getChannel();
                if (channel != null && channel2 != null) {
                    long size = channel.size();
                    boolean z11 = size == channel2.transferFrom(channel, 0L, size);
                    channel.close();
                    channel2.close();
                    z10 = z11;
                }
            } catch (OutOfMemoryError unused) {
                s9.a.m(file2.getPath(), "getPath(...)");
                return h(file, file2);
            }
        } catch (FileNotFoundException | IOException | SecurityException unused2) {
        }
        if (z10) {
            return true;
        }
        s9.a.m(file2.getPath(), "getPath(...)");
        return h(file, file2);
    }

    public static boolean g(File file, File file2, d9.h hVar, Context context) {
        boolean z10;
        BufferedOutputStream bufferedOutputStream;
        s9.a.n(context, "context");
        if (file == null || file2 == null || !file.exists() || file2.exists() || file.isDirectory() || file2.isDirectory()) {
            return false;
        }
        ?? E = E(hVar, file2);
        boolean E2 = E(hVar, file);
        if (E == 0 && !E2) {
            return false;
        }
        if (E != 0) {
            z10 = hVar.Z;
        } else {
            File absoluteFile = file2.getAbsoluteFile();
            if (absoluteFile != null && absoluteFile.exists()) {
                try {
                    z10 = absoluteFile.canRead();
                } catch (SecurityException unused) {
                }
            }
            z10 = false;
        }
        if (z10) {
            return f(file, file2);
        }
        Closeable closeable = null;
        try {
            try {
                if (E != 0) {
                    BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(file));
                    OutputStream K = K(context, hVar, file2);
                    if (K == null) {
                        return false;
                    }
                    bufferedOutputStream = new BufferedOutputStream(K);
                    E = bufferedInputStream;
                } else {
                    InputStream J = J(context, hVar, file);
                    if (J == null) {
                        return false;
                    }
                    BufferedInputStream bufferedInputStream2 = new BufferedInputStream(J);
                    bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(file2));
                    E = bufferedInputStream2;
                }
                try {
                    W(E, bufferedOutputStream);
                    E.close();
                    bufferedOutputStream.close();
                    b(E);
                    b(bufferedOutputStream);
                    return true;
                } catch (IOException unused2) {
                    b(E);
                    b(bufferedOutputStream);
                    return false;
                } catch (Throwable th) {
                    b(E);
                    b(bufferedOutputStream);
                    throw th;
                }
            } catch (FileNotFoundException unused3) {
                closeable = E;
                b(closeable);
                return false;
            } catch (SecurityException unused4) {
                closeable = E;
                b(closeable);
                return false;
            }
        } catch (FileNotFoundException unused5) {
            b(closeable);
            return false;
        } catch (SecurityException unused6) {
            b(closeable);
            return false;
        }
    }

    public static boolean h(File file, File file2) {
        BufferedInputStream bufferedInputStream;
        BufferedInputStream bufferedInputStream2 = null;
        try {
            bufferedInputStream = new BufferedInputStream(new FileInputStream(file));
        } catch (FileNotFoundException unused) {
        } catch (SecurityException unused2) {
        }
        try {
            BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(file2));
            try {
                W(bufferedInputStream, bufferedOutputStream);
                bufferedInputStream.close();
                bufferedOutputStream.close();
                b(bufferedInputStream);
                b(bufferedOutputStream);
                return true;
            } catch (IOException unused3) {
                b(bufferedInputStream);
                b(bufferedOutputStream);
                return false;
            } catch (Throwable th) {
                b(bufferedInputStream);
                b(bufferedOutputStream);
                throw th;
            }
        } catch (FileNotFoundException unused4) {
            bufferedInputStream2 = bufferedInputStream;
            b(bufferedInputStream2);
            return false;
        } catch (SecurityException unused5) {
            bufferedInputStream2 = bufferedInputStream;
            b(bufferedInputStream2);
            return false;
        }
    }

    public static ObjectAnimator i(View view, n1.c0 c0Var, int i10, int i11, float f10, float f11, float f12, float f13, BaseInterpolator baseInterpolator, n1.w wVar) {
        float f14;
        float f15;
        float translationX = view.getTranslationX();
        float translationY = view.getTranslationY();
        if (((int[]) c0Var.f6862b.getTag(2131297123)) != null) {
            f14 = (r4[0] - i10) + translationX;
            f15 = (r4[1] - i11) + translationY;
        } else {
            f14 = f10;
            f15 = f11;
        }
        int round = Math.round(f14 - translationX) + i10;
        int round2 = Math.round(f15 - translationY) + i11;
        view.setTranslationX(f14);
        view.setTranslationY(f15);
        if (f14 == f12 && f15 == f13) {
            return null;
        }
        ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(view, PropertyValuesHolder.ofFloat((Property<?, Float>) View.TRANSLATION_X, f14, f12), PropertyValuesHolder.ofFloat((Property<?, Float>) View.TRANSLATION_Y, f15, f13));
        d0 d0Var = new d0(view, c0Var.f6862b, round, round2, translationX, translationY);
        wVar.a(d0Var);
        ofPropertyValuesHolder.addListener(d0Var);
        ofPropertyValuesHolder.addPauseListener(d0Var);
        ofPropertyValuesHolder.setInterpolator(baseInterpolator);
        return ofPropertyValuesHolder;
    }

    public static boolean j(Context context, d9.h hVar, File file, boolean z10) {
        if (!E(hVar, file) || !hVar.f()) {
            return false;
        }
        if (z10) {
            return k(file);
        }
        w A = A(context, hVar, file, true);
        return A != null && A.s();
    }

    public static boolean k(File file) {
        return file.exists() ? file.isDirectory() : file.mkdirs();
    }

    public static boolean l(InputStream inputStream, File file, Context context, r7.a aVar, r7.a aVar2) {
        BufferedOutputStream bufferedOutputStream;
        File c10;
        BufferedOutputStream bufferedOutputStream2;
        ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(inputStream));
        BufferedOutputStream bufferedOutputStream3 = null;
        try {
            ZipEntry nextEntry = zipInputStream.getNextEntry();
            boolean z10 = false;
            bufferedOutputStream = null;
            while (true) {
                if (nextEntry == null) {
                    bufferedOutputStream3 = bufferedOutputStream;
                    break;
                }
                if (aVar2 != null) {
                    try {
                        String name = nextEntry.getName();
                        s9.a.m(name, "getName(...)");
                        c10 = aVar2.c(name);
                    } catch (IOException unused) {
                        bufferedOutputStream3 = bufferedOutputStream;
                        b(bufferedOutputStream3);
                        b(zipInputStream);
                        return false;
                    } catch (Throwable th) {
                        th = th;
                        b(bufferedOutputStream);
                        b(zipInputStream);
                        throw th;
                    }
                } else {
                    c10 = null;
                }
                if (c10 == null) {
                    c10 = new File(file, nextEntry.getName());
                }
                if (!c10.exists() || n(context, c10)) {
                    try {
                        bufferedOutputStream2 = new BufferedOutputStream(new FileOutputStream(c10));
                    } catch (FileNotFoundException | SecurityException unused2) {
                        b(bufferedOutputStream);
                        b(zipInputStream);
                        return false;
                    }
                    try {
                        W(zipInputStream, bufferedOutputStream2);
                        bufferedOutputStream2.close();
                        z10 = true;
                        if (aVar != null && aVar.b(c10.length())) {
                            bufferedOutputStream3 = bufferedOutputStream2;
                            break;
                        }
                        bufferedOutputStream = bufferedOutputStream2;
                        nextEntry = zipInputStream.getNextEntry();
                    } catch (IOException unused3) {
                        bufferedOutputStream3 = bufferedOutputStream2;
                        b(bufferedOutputStream3);
                        b(zipInputStream);
                        return false;
                    } catch (Throwable th2) {
                        th = th2;
                        bufferedOutputStream = bufferedOutputStream2;
                        b(bufferedOutputStream);
                        b(zipInputStream);
                        throw th;
                    }
                }
            }
            zipInputStream.closeEntry();
            zipInputStream.close();
            b(bufferedOutputStream3);
            b(zipInputStream);
            return z10;
        } catch (IOException unused4) {
        } catch (Throwable th3) {
            th = th3;
            bufferedOutputStream = bufferedOutputStream3;
        }
    }

    public static boolean m(Context context, d9.h hVar, File file) {
        s9.a.n(context, "context");
        if (file == null || !E(hVar, file)) {
            return false;
        }
        if (!file.exists()) {
            return true;
        }
        w A = A(context, hVar, file, file.isDirectory());
        return A != null ? A.q() : n(context, file);
    }

    public static boolean n(Context context, File file) {
        s9.a.n(context, "context");
        if (file == null) {
            return false;
        }
        if (!file.exists()) {
            return true;
        }
        if (file.isDirectory()) {
            File[] listFiles = file.listFiles();
            if (listFiles != null) {
                boolean z10 = true;
                for (File file2 : listFiles) {
                    if (!n(context, file2)) {
                        z10 = false;
                    }
                }
                if (z10) {
                    if (file.delete()) {
                        return true;
                    }
                }
            }
            return false;
        }
        if (file.delete()) {
            return true;
        }
        return false;
    }

    public static w o(w wVar, String str, boolean z10) {
        Uri uri;
        String[] strArr = (String[]) new ia.d("\\/").a(str).toArray(new String[0]);
        int length = strArr.length;
        for (int i10 = 0; i10 < length; i10++) {
            String obj = ia.i.U(strArr[i10]).toString();
            if (!(obj.length() == 0)) {
                if (i10 == strArr.length - 1) {
                    if (z10) {
                        return wVar.t(obj);
                    }
                    try {
                        uri = DocumentsContract.createDocument(((Context) wVar.V).getContentResolver(), (Uri) wVar.W, "application/zip", obj);
                    } catch (Exception unused) {
                        uri = null;
                    }
                    if (uri != null) {
                        return new w(wVar, (Context) wVar.V, uri);
                    }
                    return null;
                }
                w t10 = wVar.t(obj);
                if (t10 == null) {
                    t10 = wVar.o(obj);
                }
                if (t10 != null) {
                    wVar = t10;
                }
            }
        }
        return wVar;
    }

    public static String p(long j10) {
        float f10 = j10 / 1024.0f;
        float f11 = f10 / 1024.0f;
        if (f11 >= 1.0f) {
            String format = String.format("%.0f Mb", Arrays.copyOf(new Object[]{Float.valueOf(f11)}, 1));
            s9.a.m(format, "format(format, *args)");
            return format;
        }
        Object[] objArr = new Object[1];
        if (f10 < 1.0f) {
            f10 = 1.0f;
        }
        objArr[0] = Float.valueOf(f10);
        String format2 = String.format("%.0f Kb", Arrays.copyOf(objArr, 1));
        s9.a.m(format2, "format(format, *args)");
        return format2;
    }

    public static File q(Context context) {
        File u10 = u(context);
        if (u10 == null) {
            return null;
        }
        n(context, u10);
        if (k(u10)) {
            return u10;
        }
        return null;
    }

    public static File r(String[] strArr, File file) {
        int i10;
        String group;
        s9.a.n(strArr, "existingExportFilesNames");
        int length = strArr.length;
        int i11 = 0;
        int i12 = 0;
        while (true) {
            if (i11 >= length) {
                Calendar calendar = Calendar.getInstance();
                s9.a.l(calendar, "null cannot be cast to non-null type java.util.GregorianCalendar");
                String format = String.format(Locale.getDefault(), "%1$td-%1$tm-%1$tY_%1$tH-%1$tM", Arrays.copyOf(new Object[]{(GregorianCalendar) calendar}, 1));
                s9.a.m(format, "format(locale, format, *args)");
                String format2 = String.format(Locale.getDefault(), "Releam_Backup_%s_v%d.swe", Arrays.copyOf(new Object[]{format, Integer.valueOf(i12 + 1)}, 2));
                s9.a.m(format2, "format(locale, format, *args)");
                return new File(file, format2);
            }
            String str = strArr[i11];
            Integer num = null;
            if (str != null) {
                Pattern compile = Pattern.compile("^Releam_Backup_(\\d{2})-(\\d{2})-(\\d{4})_(\\d{2})-(\\d{2})_v(\\d+?).swe$");
                Matcher matcher = compile != null ? compile.matcher(str) : null;
                if (matcher != null && matcher.find()) {
                    try {
                        group = matcher.group(6);
                    } catch (IllegalStateException | NumberFormatException unused) {
                    }
                    if (group != null) {
                        i10 = Integer.parseInt(group);
                        num = Integer.valueOf(i10);
                    }
                }
                i10 = -1;
                num = Integer.valueOf(i10);
            }
            if (num != null && num.intValue() > i12) {
                i12 = num.intValue();
            }
            i11++;
        }
    }

    public static File s(Context context) {
        s9.a.n(context, "context");
        try {
            File externalFilesDir = context.getExternalFilesDir(null);
            if (externalFilesDir == null) {
                return null;
            }
            File file = new File(externalFilesDir, "Releam_Storage");
            if (k(file)) {
                return file;
            }
            return null;
        } catch (Exception unused) {
            return null;
        }
    }

    public static File t(Context context, d9.h hVar) {
        s9.a.n(context, "context");
        File file = new File(hVar.f4380i, "Releam_Storage");
        if (file.exists() || j(context, hVar, file, true)) {
            return file;
        }
        return null;
    }

    public static File u(Context context) {
        s9.a.n(context, "context");
        try {
            File externalFilesDir = context.getExternalFilesDir(null);
            if (externalFilesDir == null) {
                return null;
            }
            File file = new File(externalFilesDir, "Releam_Storage_Temp");
            if (k(file)) {
                return file;
            }
            return null;
        } catch (Exception unused) {
            return null;
        }
    }

    public static Intent v(Activity activity) {
        Intent a10 = a0.r.a(activity);
        if (a10 != null) {
            return a10;
        }
        try {
            String x10 = x(activity, activity.getComponentName());
            if (x10 == null) {
                return null;
            }
            ComponentName componentName = new ComponentName(activity, x10);
            try {
                return x(activity, componentName) == null ? Intent.makeMainActivity(componentName) : new Intent().setComponent(componentName);
            } catch (PackageManager.NameNotFoundException unused) {
                Log.e("NavUtils", "getParentActivityIntent: bad parentActivityName '" + x10 + "' in manifest");
                return null;
            }
        } catch (PackageManager.NameNotFoundException e10) {
            throw new IllegalArgumentException(e10);
        }
    }

    public static Intent w(Context context, ComponentName componentName) {
        String x10 = x(context, componentName);
        if (x10 == null) {
            return null;
        }
        ComponentName componentName2 = new ComponentName(componentName.getPackageName(), x10);
        return x(context, componentName2) == null ? Intent.makeMainActivity(componentName2) : new Intent().setComponent(componentName2);
    }

    public static String x(Context context, ComponentName componentName) {
        String string;
        PackageManager packageManager = context.getPackageManager();
        int i10 = Build.VERSION.SDK_INT;
        ActivityInfo activityInfo = packageManager.getActivityInfo(componentName, i10 >= 29 ? 269222528 : i10 >= 24 ? 787072 : 640);
        String str = activityInfo.parentActivityName;
        if (str != null) {
            return str;
        }
        Bundle bundle = activityInfo.metaData;
        if (bundle == null || (string = bundle.getString("android.support.PARENT_ACTIVITY")) == null) {
            return null;
        }
        if (string.charAt(0) != '.') {
            return string;
        }
        return context.getPackageName() + string;
    }

    public static ArrayList y(ArrayList arrayList) {
        if (arrayList == null) {
            return null;
        }
        ArrayList arrayList2 = new ArrayList(arrayList.size());
        Iterator it = arrayList.iterator();
        if (!it.hasNext()) {
            return arrayList2;
        }
        a0.w.y(it.next());
        throw null;
    }

    public static w z(Context context, Uri uri, String str, boolean z10) {
        Uri uri2;
        if (uri == null) {
            return null;
        }
        w wVar = new w((w) null, context, DocumentsContract.buildDocumentUriUsingTree(uri, DocumentsContract.getTreeDocumentId(uri)));
        String[] strArr = (String[]) new ia.d("\\/").a(str).toArray(new String[0]);
        int length = strArr.length;
        for (int i10 = 0; i10 < length; i10++) {
            String obj = ia.i.U(strArr[i10]).toString();
            if (!(obj.length() == 0)) {
                w t10 = wVar.t(obj);
                if (t10 == null) {
                    if (i10 < strArr.length - 1 || z10) {
                        t10 = wVar.o(obj);
                    } else {
                        try {
                            uri2 = DocumentsContract.createDocument(((Context) wVar.V).getContentResolver(), (Uri) wVar.W, "application/zip", obj);
                        } catch (Exception unused) {
                            uri2 = null;
                        }
                        t10 = uri2 != null ? new w(wVar, (Context) wVar.V, uri2) : null;
                    }
                }
                if (t10 != null) {
                    wVar = t10;
                }
            }
        }
        return wVar;
    }
}