package defpackage;

import android.accounts.Account;
import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.net.Uri;
import android.os.Build;
import android.util.Log;
import ar.tvplayer.tv.R;
import com.google.common.util.concurrent.ListenableFuture;
import j$.util.DesugarCollections;
import j$.util.Objects;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.security.InvalidAlgorithmParameterException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicMarkableReference;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Pattern;

/* renamed from: ᵤᵭᵹ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3460 implements InterfaceC0935 {

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public Object f12986;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public Object f12987;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public Object f12988;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public Object f12989;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public Object f12990;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public Object f12991;

    public C3460(int i) {
        switch (i) {
            case 3:
                this.f12991 = new AtomicBoolean(false);
                this.f12990 = new CountDownLatch(1);
                this.f12987 = "PublicSuffixDatabase.list";
                break;
            default:
                this.f12987 = new int[]{R.drawable._11_res_0x7f08007d, R.drawable._11_res_0x7f08007b, R.drawable._11_res_0x7f080031};
                this.f12991 = new int[]{R.drawable._11_res_0x7f080049, R.drawable._11_res_0x7f08006c, R.drawable._11_res_0x7f080050, R.drawable._11_res_0x7f08004b, R.drawable._11_res_0x7f08004c, R.drawable._11_res_0x7f08004f, R.drawable._11_res_0x7f08004e};
                this.f12990 = new int[]{R.drawable._11_res_0x7f08007a, R.drawable._11_res_0x7f08007c, R.drawable._11_res_0x7f080042, R.drawable._11_res_0x7f080076, R.drawable._11_res_0x7f080077, R.drawable._11_res_0x7f080078, R.drawable._11_res_0x7f080079};
                this.f12988 = new int[]{R.drawable._11_res_0x7f080062, R.drawable._11_res_0x7f080040, R.drawable._11_res_0x7f080061};
                this.f12986 = new int[]{R.drawable._11_res_0x7f080074, R.drawable._11_res_0x7f08007e};
                this.f12989 = new int[]{R.drawable._11_res_0x7f080034, R.drawable._11_res_0x7f08003a, R.drawable._11_res_0x7f080035, R.drawable._11_res_0x7f08003b};
                break;
        }
    }

    public /* synthetic */ C3460(Context context) {
        this.f12991 = "files";
        this.f12990 = "common";
        this.f12988 = AbstractC0100.f1367;
        this.f12986 = "";
        this.f12989 = AbstractC2692.m6701();
        ˁـᵛ.ˑᵝﹳᵜ(context != null, "Context cannot be null", new Object[0]);
        this.f12987 = context.getPackageName();
    }

    public /* synthetic */ C3460(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6) {
        this.f12987 = obj;
        this.f12991 = obj2;
        this.f12990 = obj3;
        this.f12988 = obj4;
        this.f12986 = obj5;
        this.f12989 = obj6;
    }

    public C3460(String str, String str2, Set set) {
        Set setUnmodifiableSet = set == null ? Collections.EMPTY_SET : DesugarCollections.unmodifiableSet(set);
        this.f12991 = setUnmodifiableSet;
        Map map = Collections.EMPTY_MAP;
        this.f12987 = str;
        this.f12988 = str2;
        this.f12986 = C0930.f4217;
        HashSet hashSet = new HashSet(setUnmodifiableSet);
        Iterator it = map.values().iterator();
        if (!it.hasNext()) {
            this.f12990 = DesugarCollections.unmodifiableSet(hashSet);
        } else {
            it.next().getClass();
            C0910.m3050();
            throw null;
        }
    }

    public C3460(InterfaceC4607 interfaceC4607) {
        this.f12991 = new AtomicLong(-9223372034707292160L);
        this.f12990 = new AtomicReference(null);
        this.f12988 = new AtomicReference(null);
        EnumC2524 enumC2524 = EnumC2524.f9848;
        this.f12986 = new ExecutorC5302(enumC2524);
        C5202 c5202 = new C5202();
        this.f12989 = c5202;
        RunnableC1011 runnableC1011 = new RunnableC1011();
        runnableC1011.f4447 = interfaceC4607;
        runnableC1011.f4449 = enumC2524;
        this.f12987 = runnableC1011;
        c5202.mo833(runnableC1011, enumC2524);
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public static List m7864(Map map) {
        ArrayList arrayList = new ArrayList();
        arrayList.ensureCapacity(map.size());
        for (Map.Entry entry : map.entrySet()) {
            String str = (String) entry.getKey();
            if (str == null) {
                C1260.m3813("Null key");
                return null;
            }
            String str2 = (String) entry.getValue();
            if (str2 == null) {
                C1260.m3813("Null value");
                return null;
            }
            arrayList.add(new C1060(str, str2));
        }
        Collections.sort(arrayList, new C2360(18));
        return DesugarCollections.unmodifiableList(arrayList);
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public static C3460 m7865(Context context, C0045 c0045, ʿˁ r8, C1696 c1696, C2720 c2720, C2549 c2549, ᵶˉᵹʣ r12, C0975 c0975, ᵶˉᵹʣ r14, C5288 c5288, ʽᵡ r16) {
        C4918 c4918 = new C4918(context, c0045, c1696, r12, c0975);
        C0322 c0322 = new C0322(r8, c0975, c5288);
        C0741 c0741 = C2505.f9773;
        C2210.m5873(context);
        C2505 c2505 = new C2505(new C5154(C2210.m5872().m5874(new C2444(C2505.f9772, C2505.f9774)).m8235("FIREBASE_CRASHLYTICS_REPORT", new C1928("json"), C2505.f9771), c0975.m3323(), r14));
        C3460 c3460 = new C3460();
        c3460.f12987 = c4918;
        c3460.f12991 = c0322;
        c3460.f12990 = c2505;
        c3460.f12988 = c2720;
        c3460.f12986 = c2549;
        c3460.f12989 = c0045;
        return c3460;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public static String m7866(InputStream inputStream) throws IOException {
        BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
        try {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            try {
                byte[] bArr = new byte[8192];
                while (true) {
                    int i = bufferedInputStream.read(bArr);
                    if (i == -1) {
                        String string = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name());
                        byteArrayOutputStream.close();
                        bufferedInputStream.close();
                        return string;
                    }
                    byteArrayOutputStream.write(bArr, 0, i);
                }
            } finally {
            }
        } catch (Throwable th) {
            try {
                bufferedInputStream.close();
            } catch (Throwable th2) {
                th.addSuppressed(th2);
            }
            throw th;
        }
    }

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public static void m7867(Drawable drawable, int i, PorterDuff.Mode mode) {
        PorterDuffColorFilter porterDuffColorFilterM5494;
        Drawable drawableMutate = drawable.mutate();
        if (mode == null) {
            mode = C3159.f11990;
        }
        PorterDuff.Mode mode2 = C3159.f11990;
        synchronized (C3159.class) {
            porterDuffColorFilterM5494 = C1985.m5494(i, mode);
        }
        drawableMutate.setColorFilter(porterDuffColorFilterM5494);
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public static ColorStateList m7868(Context context, int i) {
        int iM7607 = AbstractC3247.m7607(context, R.attr._11_res_0x7f04013c);
        return new ColorStateList(new int[][]{AbstractC3247.f12238, AbstractC3247.f12239, AbstractC3247.f12236, AbstractC3247.f12235}, new int[]{AbstractC3247.m7609(context, R.attr._11_res_0x7f040137), AbstractC1814.m5136(iM7607, i), AbstractC1814.m5136(iM7607, i), i});
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static C1169 m7869(C1169 c1169, C2720 c2720, C2549 c2549, Map map) {
        Map mapUnmodifiableMap;
        C3061 c3061M3671 = c1169.m3671();
        String strMo1233 = ((InterfaceC0125) c2720.f10550).mo1233();
        if (strMo1233 != null) {
            c3061M3671.f11712 = new C3464(strMo1233);
        } else {
            Log.isLoggable("FirebaseCrashlytics", 2);
        }
        boolean zIsEmpty = map.isEmpty();
        C4699 c4699 = (C4699) c2549.f9934;
        if (zIsEmpty) {
            mapUnmodifiableMap = ((C5158) ((AtomicMarkableReference) c4699.f17372).getReference()).m10637();
        } else {
            HashMap map2 = new HashMap(((C5158) ((AtomicMarkableReference) c4699.f17372).getReference()).m10637());
            for (Map.Entry entry : map.entrySet()) {
                String strM10635 = C5158.m10635(1024, (String) entry.getKey());
                if (map2.size() < 64 || map2.containsKey(strM10635)) {
                    map2.put(strM10635, C5158.m10635(1024, (String) entry.getValue()));
                }
            }
            mapUnmodifiableMap = DesugarCollections.unmodifiableMap(map2);
        }
        List listM7864 = m7864(mapUnmodifiableMap);
        List listM78642 = m7864(((C5158) ((AtomicMarkableReference) ((C4699) c2549.f9932).f17372).getReference()).m10637());
        if (!listM7864.isEmpty() || !listM78642.isEmpty()) {
            C2498 c2498 = (C2498) c1169.f4968;
            c3061M3671.f11715 = new C2498(c2498.f9752, listM7864, listM78642, c2498.f9754, c2498.f9748, c2498.f9750, c2498.f9749);
        }
        return c3061M3671.m7387();
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public static boolean m7870(C2477 c2477, Object obj, boolean z, int i, int i2, int i3) {
        Object obj2 = c2477.f9683;
        int i4 = c2477.f9684;
        if (!obj2.equals(obj)) {
            return false;
        }
        if (z && i4 == i && c2477.f9682 == i2) {
            return true;
        }
        return !z && i4 == -1 && c2477.f9681 == i3;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public static AbstractC4754 m7871(C1169 c1169, C2549 c2549) {
        List listM8525 = ((C3877) c2549.f9930).m8525();
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < listM8525.size(); i++) {
            AbstractC2668 abstractC2668 = (AbstractC2668) listM8525.get(i);
            abstractC2668.getClass();
            C3409 c3409 = new C3409();
            C0796 c0796 = (C0796) abstractC2668;
            String str = c0796.f3713;
            if (str == null) {
                C1260.m3813("Null variantId");
                return null;
            }
            String str2 = c0796.f3716;
            if (str2 == null) {
                C1260.m3813("Null rolloutId");
                return null;
            }
            c3409.f12697 = new C4531(str2, str);
            String str3 = c0796.f3715;
            if (str3 == null) {
                C1260.m3813("Null parameterKey");
                return null;
            }
            c3409.f12698 = str3;
            c3409.f12696 = c0796.f3717;
            c3409.f12699 = c0796.f3714;
            c3409.f12695 = (byte) (c3409.f12695 | 1);
            arrayList.add(c3409.m7772());
        }
        if (arrayList.isEmpty()) {
            return c1169;
        }
        C3061 c3061M3671 = c1169.m3671();
        c3061M3671.f11714 = new C3432(arrayList);
        return c3061M3671.m7387();
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public static C2477 m7872(InterfaceC0304 interfaceC0304, AbstractC2692 abstractC2692, C2477 c2477, C4479 c4479) {
        C3916 c3916 = (C3916) interfaceC0304;
        AbstractC0488 abstractC0488M8641 = c3916.m8641();
        int iM8652 = c3916.m8652();
        Object objMo2116 = abstractC0488M8641.m2115() ? null : abstractC0488M8641.mo2116(iM8652);
        int iM9529 = (c3916.m8632() || abstractC0488M8641.m2115()) ? -1 : abstractC0488M8641.mo2118(iM8652, c4479, false).m9529(AbstractC3558.m8133(c3916.m8615()) - c4479.f16705);
        for (int i = 0; i < abstractC2692.size(); i++) {
            C2477 c24772 = (C2477) abstractC2692.get(i);
            if (m7870(c24772, objMo2116, c3916.m8632(), c3916.m8653(), c3916.m8628(), iM9529)) {
                return c24772;
            }
        }
        if (abstractC2692.isEmpty() && c2477 != null && m7870(c2477, objMo2116, c3916.m8632(), c3916.m8653(), c3916.m8628(), iM9529)) {
            return c2477;
        }
        return null;
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public static LayerDrawable m7873(C1985 c1985, Context context, int i) throws Resources.NotFoundException {
        BitmapDrawable bitmapDrawable;
        BitmapDrawable bitmapDrawable2;
        BitmapDrawable bitmapDrawable3;
        int dimensionPixelSize = context.getResources().getDimensionPixelSize(i);
        Drawable drawableM5499 = c1985.m5499(context, R.drawable._11_res_0x7f080070);
        Drawable drawableM54992 = c1985.m5499(context, R.drawable._11_res_0x7f080071);
        if ((drawableM5499 instanceof BitmapDrawable) && drawableM5499.getIntrinsicWidth() == dimensionPixelSize && drawableM5499.getIntrinsicHeight() == dimensionPixelSize) {
            bitmapDrawable = (BitmapDrawable) drawableM5499;
            bitmapDrawable2 = new BitmapDrawable(bitmapDrawable.getBitmap());
        } else {
            Bitmap bitmapCreateBitmap = Bitmap.createBitmap(dimensionPixelSize, dimensionPixelSize, Bitmap.Config.ARGB_8888);
            Canvas canvas = new Canvas(bitmapCreateBitmap);
            drawableM5499.setBounds(0, 0, dimensionPixelSize, dimensionPixelSize);
            drawableM5499.draw(canvas);
            bitmapDrawable = new BitmapDrawable(bitmapCreateBitmap);
            bitmapDrawable2 = new BitmapDrawable(bitmapCreateBitmap);
        }
        bitmapDrawable2.setTileModeX(Shader.TileMode.REPEAT);
        if ((drawableM54992 instanceof BitmapDrawable) && drawableM54992.getIntrinsicWidth() == dimensionPixelSize && drawableM54992.getIntrinsicHeight() == dimensionPixelSize) {
            bitmapDrawable3 = (BitmapDrawable) drawableM54992;
        } else {
            Bitmap bitmapCreateBitmap2 = Bitmap.createBitmap(dimensionPixelSize, dimensionPixelSize, Bitmap.Config.ARGB_8888);
            Canvas canvas2 = new Canvas(bitmapCreateBitmap2);
            drawableM54992.setBounds(0, 0, dimensionPixelSize, dimensionPixelSize);
            drawableM54992.draw(canvas2);
            bitmapDrawable3 = new BitmapDrawable(bitmapCreateBitmap2);
        }
        LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{bitmapDrawable, bitmapDrawable3, bitmapDrawable2});
        layerDrawable.setId(0, android.R.id.background);
        layerDrawable.setId(1, android.R.id.secondaryProgress);
        layerDrawable.setId(2, android.R.id.progress);
        return layerDrawable;
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public static C3460 m7874(String str, AbstractC2202 abstractC2202, EnumC3069 enumC3069, EnumC0894 enumC0894, Integer num) throws GeneralSecurityException {
        if (enumC0894 == EnumC0894.f4061) {
            if (num != null) {
                C0910.m3048("Keys with output prefix type raw should not have an id requirement.");
                return null;
            }
        } else if (num == null) {
            C0910.m3048("Keys with output prefix type different from raw should have an id requirement.");
            return null;
        }
        return new C3460(str, AbstractC1067.m3456(str), abstractC2202, enumC3069, enumC0894, num);
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public static boolean m7875(int[] iArr, int i) {
        for (int i2 : iArr) {
            if (i2 == i) {
                return true;
            }
        }
        return false;
    }

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public AbstractC3606 m7876(int i) {
        EnumC2524 enumC2524;
        AtomicLong atomicLong = (AtomicLong) this.f12991;
        if (((int) (atomicLong.get() >>> 32)) > i) {
            C5027 c5027 = C5027.f18792;
            return c5027 != null ? c5027 : new C5027();
        }
        C4105 c4105 = new C4105(i);
        while (true) {
            AtomicReference atomicReference = (AtomicReference) this.f12990;
            C4105 c41052 = (C4105) atomicReference.get();
            if (c41052 != null && c41052.f15338 > i) {
                C5027 c50272 = C5027.f18792;
                return c50272 != null ? c50272 : new C5027();
            }
            while (!atomicReference.compareAndSet(c41052, c4105)) {
                if (atomicReference.get() != c41052) {
                    break;
                }
            }
            if (((int) (atomicLong.get() >>> 32)) > i) {
                c4105.cancel(true);
                while (!atomicReference.compareAndSet(c4105, null) && atomicReference.get() == c4105) {
                }
                return c4105;
            }
            RunnableC1011 runnableC1011 = (RunnableC1011) this.f12987;
            InterfaceC4607 interfaceC4607 = (InterfaceC4607) runnableC1011.f4447;
            if (interfaceC4607 == null || (enumC2524 = (EnumC2524) runnableC1011.f4449) == null) {
                c4105.m8219((C5202) this.f12989);
                return c4105;
            }
            C0553 c0553M9619 = AbstractC4530.m9619(interfaceC4607);
            RunnableFutureC0031 runnableFutureC0031 = new RunnableFutureC0031();
            runnableFutureC0031.f1156 = new C0311(runnableFutureC0031, c0553M9619);
            enumC2524.execute(runnableFutureC0031);
            c4105.m8219(runnableFutureC0031);
            return c4105;
        }
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public C1296 m7877() throws GeneralSecurityException {
        if (((Integer) this.f12989) == null) {
            C0910.m3048("AES key size is not set");
            return null;
        }
        if (((Integer) this.f12987) == null) {
            C0910.m3048("HMAC key size is not set");
            return null;
        }
        if (((Integer) this.f12991) == null) {
            C0910.m3048("iv size is not set");
            return null;
        }
        Integer num = (Integer) this.f12990;
        if (num == null) {
            C0910.m3048("tag size is not set");
            return null;
        }
        if (((C0434) this.f12988) == null) {
            C0910.m3048("hash type is not set");
            return null;
        }
        if (((C5217) this.f12986) == null) {
            C0910.m3048("variant is not set");
            return null;
        }
        int iIntValue = num.intValue();
        C0434 c0434 = (C0434) this.f12988;
        if (c0434 == C0434.f2464) {
            if (iIntValue > 20) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 20 bytes for SHA1", num));
            }
        } else if (c0434 == C0434.f2463) {
            if (iIntValue > 28) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 28 bytes for SHA224", num));
            }
        } else if (c0434 == C0434.f2458) {
            if (iIntValue > 32) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 32 bytes for SHA256", num));
            }
        } else if (c0434 == C0434.f2457) {
            if (iIntValue > 48) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 48 bytes for SHA384", num));
            }
        } else {
            if (c0434 != C0434.f2448) {
                C0910.m3048("unknown hash type; must be SHA1, SHA224, SHA256, SHA384 or SHA512");
                return null;
            }
            if (iIntValue > 64) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 64 bytes for SHA512", num));
            }
        }
        return new C1296(((Integer) this.f12989).intValue(), ((Integer) this.f12987).intValue(), ((Integer) this.f12991).intValue(), ((Integer) this.f12990).intValue(), (C5217) this.f12986, (C0434) this.f12988);
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public void m7878() {
        try {
            C2753 c2753 = new C2753(m7888());
            try {
                C2185 c2185Mo3272 = c2753.mo3272(c2753.readInt());
                C2185 c2185Mo32722 = c2753.mo3272(c2753.readInt());
                c2753.close();
                synchronized (this) {
                    this.f12988 = c2185Mo3272;
                    this.f12986 = c2185Mo32722;
                }
            } finally {
            }
        } finally {
            ((CountDownLatch) this.f12990).countDown();
        }
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public void m7879(C4782 c4782, C2477 c2477, AbstractC0488 abstractC0488) {
        if (c2477 == null) {
            return;
        }
        if (abstractC0488.mo2125(c2477.f9683) != -1) {
            c4782.m10104(c2477, abstractC0488);
            return;
        }
        AbstractC0488 abstractC04882 = (AbstractC0488) ((C2172) this.f12990).get(c2477);
        if (abstractC04882 != null) {
            c4782.m10104(c2477, abstractC04882);
        }
    }

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public void m7880(int i) throws InvalidAlgorithmParameterException {
        if (i < 16) {
            throw new InvalidAlgorithmParameterException(String.format("Invalid key size in bytes %d; HMAC key must be at least 16 bytes", Integer.valueOf(i)));
        }
        this.f12987 = Integer.valueOf(i);
    }

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public C3921 m7881(String str, Executor executor) {
        C4759 c4759;
        C1353 c1353;
        ArrayList arrayListM1728 = ((C0322) this.f12991).m1728();
        ArrayList arrayList = new ArrayList();
        int size = arrayListM1728.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayListM1728.get(i);
            i++;
            File file = (File) obj;
            try {
                C0741 c0741 = C0322.f1988;
                String strM1724 = C0322.m1724(file);
                c0741.getClass();
                arrayList.add(new C4759(C0741.m2799(strM1724), file.getName(), file));
            } catch (IOException unused) {
                Objects.toString(file);
                file.delete();
            }
        }
        ArrayList arrayList2 = new ArrayList();
        int size2 = arrayList.size();
        int i2 = 0;
        while (i2 < size2) {
            Object obj2 = arrayList.get(i2);
            i2++;
            C4759 c47592 = (C4759) obj2;
            if (str == null || str.equals(c47592.f17677)) {
                C2505 c2505 = (C2505) this.f12990;
                C3556 c3556 = c47592.f17676;
                if (c3556.f13312 == null || c3556.f13311 == null) {
                    C3157 c3157M1087 = ((C0045) this.f12989).m1087(true);
                    C3556 c35562 = c47592.f17676;
                    String str2 = c3157M1087.f11984;
                    C1170 c1170M8098 = c35562.m8098();
                    c1170M8098.f4972 = str2;
                    C3556 c3556M3672 = c1170M8098.m3672();
                    String str3 = c3157M1087.f11985;
                    C1170 c1170M80982 = c3556M3672.m8098();
                    c1170M80982.f4975 = str3;
                    c4759 = new C4759(c1170M80982.m3672(), c47592.f17677, c47592.f17675);
                } else {
                    c4759 = c47592;
                }
                boolean z = str != null;
                C5154 c5154 = c2505.f9775;
                synchronized (c5154.f19190) {
                    try {
                        C1353 c13532 = new C1353();
                        if (z) {
                            ((AtomicInteger) c5154.f19192.ᵢˇᵭ).getAndIncrement();
                            if (c5154.f19190.size() < c5154.f19188) {
                                Log.isLoggable("FirebaseCrashlytics", 3);
                                c5154.f19190.size();
                                Log.isLoggable("FirebaseCrashlytics", 3);
                                c1353 = c13532;
                                c5154.f19189.execute(new ᵗʞˑᵾ(3, c5154, c4759, c13532, false));
                                Log.isLoggable("FirebaseCrashlytics", 3);
                                c1353.m4193(c4759);
                            } else {
                                c1353 = c13532;
                                c5154.m10633();
                                Log.isLoggable("FirebaseCrashlytics", 3);
                                ((AtomicInteger) c5154.f19192.ᵿʗᵝʽ).getAndIncrement();
                                c1353.m4193(c4759);
                            }
                        } else {
                            c1353 = c13532;
                            c5154.m10634(c4759, c1353);
                        }
                    } finally {
                    }
                }
                arrayList2.add(c1353.f5582.m8718(executor, new ᵨᴵᵺ(this)));
            }
        }
        return ʼٴ.ˆᵴᵜˏ(arrayList2);
    }

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public Uri m7882() {
        String strM8592;
        String str = (String) this.f12991;
        String str2 = (String) this.f12990;
        Account account = AbstractC1846.f7463;
        Account account2 = (Account) this.f12988;
        ˁـᵛ.ˑᵝﹳᵜ(account2.type.indexOf(58) == -1, "Account type contains ':'.", new Object[0]);
        ˁـᵛ.ˑᵝﹳᵜ(account2.type.indexOf(47) == -1, "Account type contains '/'.", new Object[0]);
        ˁـᵛ.ˑᵝﹳᵜ(account2.name.indexOf(47) == -1, "Account name contains '/'.", new Object[0]);
        if (AbstractC1846.f7463.equals(account2)) {
            strM8592 = "shared";
        } else {
            String str3 = account2.type;
            String str4 = account2.name;
            strM8592 = AbstractC3915.m8592(new StringBuilder(String.valueOf(str3).length() + 1 + String.valueOf(str4).length()), str3, ":", str4);
        }
        String str5 = (String) this.f12986;
        StringBuilder sb = new StringBuilder(strM8592.length() + str2.length() + str.length() + 2 + 1 + 1 + String.valueOf(str5).length());
        AbstractC4486.m9560(sb, "/", str, "/", str2);
        sb.append("/");
        sb.append(strM8592);
        sb.append("/");
        sb.append(str5);
        String string = sb.toString();
        C4471 c4471M9892 = ((C4704) this.f12989).m9892();
        Pattern pattern = AbstractC2098.f8306;
        return new Uri.Builder().scheme("android").authority((String) this.f12987).path(string).encodedFragment(c4471M9892.isEmpty() ? null : "transform=".concat(new C0204("+").m1479(c4471M9892))).build();
    }

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public void m7883(AbstractC0488 abstractC0488) {
        AbstractC2692 abstractC2692;
        C4782 c4782M4455 = AbstractC1530.m4455();
        if (((AbstractC2692) this.f12991).isEmpty()) {
            m7879(c4782M4455, (C2477) this.f12986, abstractC0488);
            if (!Objects.equals((C2477) this.f12989, (C2477) this.f12986)) {
                m7879(c4782M4455, (C2477) this.f12989, abstractC0488);
            }
            if (!Objects.equals((C2477) this.f12988, (C2477) this.f12986) && !Objects.equals((C2477) this.f12988, (C2477) this.f12989)) {
                m7879(c4782M4455, (C2477) this.f12988, abstractC0488);
            }
        } else {
            int i = 0;
            while (true) {
                int size = ((AbstractC2692) this.f12991).size();
                abstractC2692 = (AbstractC2692) this.f12991;
                if (i >= size) {
                    break;
                }
                m7879(c4782M4455, (C2477) abstractC2692.get(i), abstractC0488);
                i++;
            }
            if (!abstractC2692.contains((C2477) this.f12988)) {
                m7879(c4782M4455, (C2477) this.f12988, abstractC0488);
            }
        }
        this.f12990 = c4782M4455.m10079(true);
    }

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public void m7884(String str) {
        if (str.startsWith("/")) {
            str = str.substring(1);
        }
        Pattern pattern = AbstractC0100.f1366;
        this.f12986 = str;
    }

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public void m7885(int i) throws GeneralSecurityException {
        if (i < 10) {
            throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; must be at least 10 bytes", Integer.valueOf(i)));
        }
        this.f12990 = Integer.valueOf(i);
    }

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public void m7886(int i) throws GeneralSecurityException {
        if (i < 12 || i > 16) {
            throw new GeneralSecurityException(String.format("Invalid IV size in bytes %d; IV size must be between 12 and 16 bytes", Integer.valueOf(i)));
        }
        this.f12991 = Integer.valueOf(i);
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public ColorStateList m7887(Context context, int i) {
        if (i == R.drawable._11_res_0x7f080045) {
            return AbstractC5363.m10989(context, R.color._11_res_0x7f060015);
        }
        if (i == R.drawable._11_res_0x7f080073) {
            return AbstractC5363.m10989(context, R.color._11_res_0x7f060018);
        }
        if (i != R.drawable._11_res_0x7f080072) {
            if (i == R.drawable._11_res_0x7f080039) {
                return m7868(context, AbstractC3247.m7607(context, R.attr._11_res_0x7f040137));
            }
            if (i == R.drawable._11_res_0x7f080033) {
                return m7868(context, 0);
            }
            if (i == R.drawable._11_res_0x7f080038) {
                return m7868(context, AbstractC3247.m7607(context, R.attr._11_res_0x7f040130));
            }
            if (i == R.drawable._11_res_0x7f08006e || i == R.drawable._11_res_0x7f08006f) {
                return AbstractC5363.m10989(context, R.color._11_res_0x7f060017);
            }
            if (m7875((int[]) this.f12991, i)) {
                return AbstractC3247.m7610(context, R.attr._11_res_0x7f04013d);
            }
            if (m7875((int[]) this.f12986, i)) {
                return AbstractC5363.m10989(context, R.color._11_res_0x7f060014);
            }
            if (m7875((int[]) this.f12989, i)) {
                return AbstractC5363.m10989(context, R.color._11_res_0x7f060013);
            }
            if (i == R.drawable._11_res_0x7f08006b) {
                return AbstractC5363.m10989(context, R.color._11_res_0x7f060016);
            }
            return null;
        }
        int[][] iArr = new int[3][];
        int[] iArr2 = new int[3];
        ColorStateList colorStateListM7610 = AbstractC3247.m7610(context, R.attr._11_res_0x7f04017c);
        if (colorStateListM7610 == null || !colorStateListM7610.isStateful()) {
            iArr[0] = AbstractC3247.f12238;
            iArr2[0] = AbstractC3247.m7609(context, R.attr._11_res_0x7f04017c);
            iArr[1] = AbstractC3247.f12233;
            iArr2[1] = AbstractC3247.m7607(context, R.attr._11_res_0x7f04013b);
            iArr[2] = AbstractC3247.f12235;
            iArr2[2] = AbstractC3247.m7607(context, R.attr._11_res_0x7f04017c);
        } else {
            int[] iArr3 = AbstractC3247.f12238;
            iArr[0] = iArr3;
            iArr2[0] = colorStateListM7610.getColorForState(iArr3, 0);
            iArr[1] = AbstractC3247.f12233;
            iArr2[1] = AbstractC3247.m7607(context, R.attr._11_res_0x7f04013b);
            iArr[2] = AbstractC3247.f12235;
            iArr2[2] = colorStateListM7610.getDefaultColor();
        }
        return new ColorStateList(iArr, iArr2);
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public C0844 m7888() throws IOException {
        AbstractC0761 abstractC0761 = AbstractC0761.f3627;
        Object obj = AbstractC0761.f3627;
        InterfaceC1567 interfaceC1567 = obj != null ? (InterfaceC1567) obj : null;
        Context contextMo4537 = interfaceC1567 != null ? interfaceC1567.mo4537() : null;
        AssetManager assets = contextMo4537 != null ? contextMo4537.getAssets() : null;
        if (assets != null) {
            return new C0844(assets.open((String) this.f12987), new C3948());
        }
        if (Build.FINGERPRINT == null) {
            C0910.m3045("Platform applicationContext not initialized. Possibly running Android unit test without Robolectric. Android tests should run with Robolectric and call OkHttp.initialize before test");
            return null;
        }
        C0910.m3045("Platform applicationContext not initialized. Startup Initializer possibly disabled, call OkHttp.initialize before test.");
        return null;
    }

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public void m7889(int i) throws InvalidAlgorithmParameterException {
        if (i != 16 && i != 24 && i != 32) {
            throw new InvalidAlgorithmParameterException(String.format("Invalid key size %d; only 16-byte, 24-byte and 32-byte AES keys are supported", Integer.valueOf(i)));
        }
        this.f12989 = Integer.valueOf(i);
    }

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public void m7890(String str) {
        ˁـᵛ.ˑᵝﹳᵜ(AbstractC0100.f1366.matcher(str).matches(), "Module must match [a-z]+(_[a-z]+)*: %s", new Object[]{str});
        ˁـᵛ.ˑᵝﹳᵜ(!AbstractC0100.f1365.contains(str), "Module name is reserved and cannot be used: %s", new Object[]{str});
        this.f12990 = str;
    }

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public AbstractC3606 m7891() {
        AtomicLong atomicLong;
        long j;
        final int i;
        ListenableFuture listenableFutureM6768;
        Executor executor = EnumC2524.f9848;
        C5202 c5202 = (C5202) this.f12989;
        if (c5202.isDone()) {
            return c5202;
        }
        do {
            atomicLong = (AtomicLong) this.f12991;
            j = atomicLong.get();
            i = (int) (j >>> 32);
        } while (!atomicLong.compareAndSet(j, ((((int) j) + 1) & 4294967295L) | (i << 32)));
        AtomicReference atomicReference = (AtomicReference) this.f12988;
        C5202 c52022 = new C5202();
        ListenableFuture listenableFuture = (ListenableFuture) atomicReference.getAndSet(c52022);
        if (listenableFuture == null) {
            C0553 c0553M9619 = AbstractC4530.m9619(new C2124(i, 15, this));
            RunnableFutureC0031 runnableFutureC0031 = new RunnableFutureC0031();
            runnableFutureC0031.f1156 = new C0311(runnableFutureC0031, c0553M9619);
            executor.execute(runnableFutureC0031);
            listenableFutureM6768 = runnableFutureC0031;
        } else {
            listenableFutureM6768 = AbstractC2725.m6768(listenableFuture, Throwable.class, AbstractC4530.m9620(new InterfaceC1293() { // from class: ᵱˈᵰˊ
                @Override // defpackage.InterfaceC1293
                public final /* synthetic */ ListenableFuture apply(Object obj) {
                    return this.f16454.m7876(i);
                }
            }), (ExecutorC5302) this.f12986);
        }
        c52022.m8219(listenableFutureM6768);
        C5239 c5239 = new C5239(this, i);
        c52022.mo833(new ᵗʞˑᵾ(this, c52022, c5239, 18), executor);
        return c5239;
    }
}
