package o;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
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.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import com.google.android.gms.common.R;
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.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicMarkableReference;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class U7 implements InterfaceC0217Ij {
    public final /* synthetic */ int l;
    public final Object m;
    public Object n;

    /* renamed from: o, reason: collision with root package name */
    public Object f352o;
    public Object p;
    public Object q;
    public Object r;

    public U7(ZF zf, String str, LE le, AbstractC0752ap abstractC0752ap, Map map) {
        this.l = 3;
        this.m = zf;
        this.n = str;
        this.f352o = le;
        this.p = abstractC0752ap;
        this.q = map;
    }

    public static C2154pb h(C2154pb c2154pb, C1390hY c1390hY, Zf0 zf0, Map map) {
        Map mapUnmodifiableMap;
        Map mapUnmodifiableMap2;
        Map mapUnmodifiableMap3;
        C2059ob c2059obA = c2154pb.a();
        String strD = ((InterfaceC0646Yx) c1390hY.n).d();
        if (strD != null) {
            c2059obA.e = new C0053Cb(strD);
        } else {
            Log.isLoggable("FirebaseCrashlytics", 2);
        }
        C0949cs c0949cs = (C0949cs) zf0.d;
        if (map.isEmpty()) {
            XJ xj = (XJ) ((AtomicMarkableReference) c0949cs.b).getReference();
            synchronized (xj) {
                mapUnmodifiableMap2 = Collections.unmodifiableMap(new HashMap(xj.a));
            }
        } else {
            XJ xj2 = (XJ) ((AtomicMarkableReference) c0949cs.b).getReference();
            synchronized (xj2) {
                mapUnmodifiableMap = Collections.unmodifiableMap(new HashMap(xj2.a));
            }
            HashMap map2 = new HashMap(mapUnmodifiableMap);
            for (Map.Entry entry : map.entrySet()) {
                String strA = XJ.a(1024, (String) entry.getKey());
                if (map2.size() < 64 || map2.containsKey(strA)) {
                    map2.put(strA, XJ.a(1024, (String) entry.getValue()));
                }
            }
            mapUnmodifiableMap2 = Collections.unmodifiableMap(map2);
        }
        List listR = r(mapUnmodifiableMap2);
        XJ xj3 = (XJ) ((AtomicMarkableReference) ((C0949cs) zf0.e).b).getReference();
        synchronized (xj3) {
            mapUnmodifiableMap3 = Collections.unmodifiableMap(new HashMap(xj3.a));
        }
        List listR2 = r(mapUnmodifiableMap3);
        if (!listR.isEmpty() || !listR2.isEmpty()) {
            C2249qb c2249qb = (C2249qb) c2154pb.c;
            c2059obA.c = new C2249qb(c2249qb.a, listR, listR2, c2249qb.d, c2249qb.e, c2249qb.f, c2249qb.g);
        }
        return c2059obA.a();
    }

    public static AbstractC2275qo i(C2154pb c2154pb, Zf0 zf0) {
        List listUnmodifiableList;
        C1257g30 c1257g30 = (C1257g30) zf0.f;
        synchronized (c1257g30) {
            listUnmodifiableList = Collections.unmodifiableList(new ArrayList(c1257g30.a));
        }
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < listUnmodifiableList.size(); i++) {
            AbstractC1161f30 abstractC1161f30 = (AbstractC1161f30) listUnmodifiableList.get(i);
            abstractC1161f30.getClass();
            C0079Db c0079Db = new C0079Db();
            C1300gc c1300gc = (C1300gc) abstractC1161f30;
            String str = c1300gc.e;
            if (str == null) {
                throw new NullPointerException("Null variantId");
            }
            String str2 = c1300gc.b;
            if (str2 == null) {
                throw new NullPointerException("Null rolloutId");
            }
            c0079Db.a = new C0131Fb(str2, str);
            String str3 = c1300gc.c;
            if (str3 == null) {
                throw new NullPointerException("Null parameterKey");
            }
            c0079Db.b = str3;
            String str4 = c1300gc.d;
            if (str4 == null) {
                throw new NullPointerException("Null parameterValue");
            }
            c0079Db.c = str4;
            c0079Db.d = c1300gc.f;
            c0079Db.e = (byte) (c0079Db.e | 1);
            arrayList.add(c0079Db.a());
        }
        if (arrayList.isEmpty()) {
            return c2154pb;
        }
        C2059ob c2059obA = c2154pb.a();
        c2059obA.f = new C0157Gb(arrayList);
        return c2059obA.a();
    }

    public static boolean j(int[] iArr, int i) {
        for (int i2 : iArr) {
            if (i2 == i) {
                return true;
            }
        }
        return false;
    }

    public static String l(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;
        }
    }

    public static U7 m(Context context, C2227qG c2227qG, C1533iy c1533iy, N8 n8, C1390hY c1390hY, Zf0 zf0, C3031ym0 c3031ym0, C0598Xb c0598Xb, C3031ym0 c3031ym02, C0221In c0221In, C3126zm0 c3126zm0) {
        C2749vo c2749vo = new C2749vo(context, c2227qG, n8, c3031ym0, c0598Xb);
        C2939xo c2939xo = new C2939xo(c1533iy, c0598Xb, c0221In);
        C2844wo c2844wo = C0067Cp.b;
        Ug0.b(context);
        return new U7(c2749vo, c2939xo, new C0067Cp(new C1541j20(Ug0.a().c(new C0187Hf(C0067Cp.c, C0067Cp.d)).a("FIREBASE_CRASHLYTICS_REPORT", new C0618Xv("json"), C0067Cp.e), c0598Xb.b(), c3031ym02)), c1390hY, zf0, c2227qG, c3126zm0);
    }

    public static ColorStateList n(Context context, int i) {
        int iC = AbstractC1498if0.c(context, R.attr.colorControlHighlight);
        int iB = AbstractC1498if0.b(context, R.attr.colorButtonNormal);
        int[] iArr = AbstractC1498if0.b;
        int[] iArr2 = AbstractC1498if0.d;
        int iB2 = AbstractC0501Ti.b(iC, i);
        return new ColorStateList(new int[][]{iArr, iArr2, AbstractC1498if0.c, AbstractC1498if0.f}, new int[]{iB, iB2, AbstractC0501Ti.b(iC, i), i});
    }

    public static LayerDrawable q(C2680v20 c2680v20, Context context, int i) throws Resources.NotFoundException {
        BitmapDrawable bitmapDrawable;
        BitmapDrawable bitmapDrawable2;
        BitmapDrawable bitmapDrawable3;
        int dimensionPixelSize = context.getResources().getDimensionPixelSize(i);
        Drawable drawableC = c2680v20.c(context, R.drawable.abc_star_black_48dp);
        Drawable drawableC2 = c2680v20.c(context, R.drawable.abc_star_half_black_48dp);
        if ((drawableC instanceof BitmapDrawable) && drawableC.getIntrinsicWidth() == dimensionPixelSize && drawableC.getIntrinsicHeight() == dimensionPixelSize) {
            bitmapDrawable = (BitmapDrawable) drawableC;
            bitmapDrawable2 = new BitmapDrawable(bitmapDrawable.getBitmap());
        } else {
            Bitmap bitmapCreateBitmap = Bitmap.createBitmap(dimensionPixelSize, dimensionPixelSize, Bitmap.Config.ARGB_8888);
            Canvas canvas = new Canvas(bitmapCreateBitmap);
            drawableC.setBounds(0, 0, dimensionPixelSize, dimensionPixelSize);
            drawableC.draw(canvas);
            bitmapDrawable = new BitmapDrawable(bitmapCreateBitmap);
            bitmapDrawable2 = new BitmapDrawable(bitmapCreateBitmap);
        }
        bitmapDrawable2.setTileModeX(Shader.TileMode.REPEAT);
        if ((drawableC2 instanceof BitmapDrawable) && drawableC2.getIntrinsicWidth() == dimensionPixelSize && drawableC2.getIntrinsicHeight() == dimensionPixelSize) {
            bitmapDrawable3 = (BitmapDrawable) drawableC2;
        } else {
            Bitmap bitmapCreateBitmap2 = Bitmap.createBitmap(dimensionPixelSize, dimensionPixelSize, Bitmap.Config.ARGB_8888);
            Canvas canvas2 = new Canvas(bitmapCreateBitmap2);
            drawableC2.setBounds(0, 0, dimensionPixelSize, dimensionPixelSize);
            drawableC2.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;
    }

    public static List r(Map map) {
        ArrayList arrayList = new ArrayList();
        arrayList.ensureCapacity(map.size());
        for (Map.Entry entry : map.entrySet()) {
            String str = (String) entry.getKey();
            if (str == null) {
                throw new NullPointerException("Null key");
            }
            String str2 = (String) entry.getValue();
            if (str2 == null) {
                throw new NullPointerException("Null value");
            }
            arrayList.add(new C1202fb(str, str2));
        }
        Collections.sort(arrayList, new C0347Nk(9));
        return Collections.unmodifiableList(arrayList);
    }

    public static void w(Drawable drawable, int i, PorterDuff.Mode mode) {
        Drawable drawableMutate = drawable.mutate();
        if (mode == null) {
            mode = V7.b;
        }
        drawableMutate.setColorFilter(V7.c(i, mode));
    }

    @Override // o.InterfaceC0217Ij
    public Object a(Class cls) {
        if (!((Set) this.m).contains(JZ.a(cls))) {
            throw new C2170pj("Attempting to request an undeclared dependency " + cls + ".");
        }
        Object objA = ((InterfaceC0217Ij) this.r).a(cls);
        if (!cls.equals(GZ.class)) {
            return objA;
        }
        return new E20();
    }

    @Override // o.InterfaceC0217Ij
    public DZ b(JZ jz) {
        if (((Set) this.q).contains(jz)) {
            return ((InterfaceC0217Ij) this.r).b(jz);
        }
        throw new C2170pj("Attempting to request an undeclared dependency Provider<Set<" + jz + ">>.");
    }

    @Override // o.InterfaceC0217Ij
    public Set c(JZ jz) {
        if (((Set) this.p).contains(jz)) {
            return ((InterfaceC0217Ij) this.r).c(jz);
        }
        throw new C2170pj("Attempting to request an undeclared dependency Set<" + jz + ">.");
    }

    @Override // o.InterfaceC0217Ij
    public DZ d(JZ jz) {
        if (((Set) this.n).contains(jz)) {
            return ((InterfaceC0217Ij) this.r).d(jz);
        }
        throw new C2170pj("Attempting to request an undeclared dependency Provider<" + jz + ">.");
    }

    @Override // o.InterfaceC0217Ij
    public Object e(JZ jz) {
        if (((Set) this.m).contains(jz)) {
            return ((InterfaceC0217Ij) this.r).e(jz);
        }
        throw new C2170pj("Attempting to request an undeclared dependency " + jz + ".");
    }

    @Override // o.InterfaceC0217Ij
    public DZ f(Class cls) {
        return d(JZ.a(cls));
    }

    @Override // o.InterfaceC0217Ij
    public LU g(JZ jz) {
        if (((Set) this.f352o).contains(jz)) {
            return ((InterfaceC0217Ij) this.r).g(jz);
        }
        throw new C2170pj("Attempting to request an undeclared dependency Deferred<" + jz + ">.");
    }

    public C0239Jf k() {
        C0239Jf c0239Jf = (C0239Jf) this.r;
        if (c0239Jf != null) {
            return c0239Jf;
        }
        C0239Jf c0239Jf2 = C0239Jf.n;
        C0239Jf c0239JfA = AbstractC2001nt0.A((LE) this.f352o);
        this.r = c0239JfA;
        return c0239JfA;
    }

    public Hw0 o(Hw0 hw0) {
        return hw0.k(new V8(1), new C0387Oy(6, this));
    }

    public LU p(Class cls) {
        return g(JZ.a(cls));
    }

    public ColorStateList s(Context context, int i) {
        if (i == R.drawable.abc_edit_text_material) {
            return Co0.z(context, R.color.abc_tint_edittext);
        }
        if (i == R.drawable.abc_switch_track_mtrl_alpha) {
            return Co0.z(context, R.color.abc_tint_switch_track);
        }
        if (i != R.drawable.abc_switch_thumb_material) {
            if (i == R.drawable.abc_btn_default_mtrl_shape) {
                return n(context, AbstractC1498if0.c(context, R.attr.colorButtonNormal));
            }
            if (i == R.drawable.abc_btn_borderless_material) {
                return n(context, 0);
            }
            if (i == R.drawable.abc_btn_colored_material) {
                return n(context, AbstractC1498if0.c(context, R.attr.colorAccent));
            }
            if (i == R.drawable.abc_spinner_mtrl_am_alpha || i == R.drawable.abc_spinner_textfield_background_material) {
                return Co0.z(context, R.color.abc_tint_spinner);
            }
            if (j((int[]) this.n, i)) {
                return AbstractC1498if0.d(context, R.attr.colorControlNormal);
            }
            if (j((int[]) this.q, i)) {
                return Co0.z(context, R.color.abc_tint_default);
            }
            if (j((int[]) this.r, i)) {
                return Co0.z(context, R.color.abc_tint_btn_checkable);
            }
            if (i == R.drawable.abc_seekbar_thumb_material) {
                return Co0.z(context, R.color.abc_tint_seek_thumb);
            }
            return null;
        }
        int[][] iArr = new int[3][];
        int[] iArr2 = new int[3];
        ColorStateList colorStateListD = AbstractC1498if0.d(context, R.attr.colorSwitchThumbNormal);
        if (colorStateListD == null || !colorStateListD.isStateful()) {
            iArr[0] = AbstractC1498if0.b;
            iArr2[0] = AbstractC1498if0.b(context, R.attr.colorSwitchThumbNormal);
            iArr[1] = AbstractC1498if0.e;
            iArr2[1] = AbstractC1498if0.c(context, R.attr.colorControlActivated);
            iArr[2] = AbstractC1498if0.f;
            iArr2[2] = AbstractC1498if0.c(context, R.attr.colorSwitchThumbNormal);
        } else {
            int[] iArr3 = AbstractC1498if0.b;
            iArr[0] = iArr3;
            iArr2[0] = colorStateListD.getColorForState(iArr3, 0);
            iArr[1] = AbstractC1498if0.e;
            iArr2[1] = AbstractC1498if0.c(context, R.attr.colorControlActivated);
            iArr[2] = AbstractC1498if0.f;
            iArr2[2] = colorStateListD.getDefaultColor();
        }
        return new ColorStateList(iArr, iArr2);
    }

    public Q1 t() {
        Q1 q1 = new Q1(false);
        q1.q = new LinkedHashMap();
        q1.f292o = (ZF) this.m;
        q1.m = (String) this.n;
        q1.p = (AbstractC0752ap) this.p;
        Map map = (Map) this.q;
        q1.q = map.isEmpty() ? new LinkedHashMap() : new LinkedHashMap(map);
        q1.n = ((LE) this.f352o).c();
        return q1;
    }

    public String toString() {
        switch (this.l) {
            case 3:
                Map map = (Map) this.q;
                StringBuilder sb = new StringBuilder("Request{method=");
                sb.append((String) this.n);
                sb.append(", url=");
                sb.append((ZF) this.m);
                LE le = (LE) this.f352o;
                if (le.size() != 0) {
                    sb.append(", headers=[");
                    int i = 0;
                    for (Object obj : le) {
                        int i2 = i + 1;
                        if (i < 0) {
                            AbstractC0008Ai.V();
                            throw null;
                        }
                        C3001yV c3001yV = (C3001yV) obj;
                        String str = (String) c3001yV.l;
                        String str2 = (String) c3001yV.m;
                        if (i > 0) {
                            sb.append(", ");
                        }
                        sb.append(str);
                        sb.append(':');
                        sb.append(str2);
                        i = i2;
                    }
                    sb.append(']');
                }
                if (!map.isEmpty()) {
                    sb.append(", tags=");
                    sb.append(map);
                }
                sb.append('}');
                return sb.toString();
            default:
                return super.toString();
        }
    }

    public Hw0 u(Executor executor, String str) {
        C0820bb c0820bb;
        Qc0 qc0;
        ArrayList arrayListB = ((C2939xo) this.n).b();
        ArrayList arrayList = new ArrayList();
        int size = arrayListB.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayListB.get(i);
            i++;
            File file = (File) obj;
            try {
                C2844wo c2844wo = C2939xo.g;
                String strE = C2939xo.e(file);
                c2844wo.getClass();
                arrayList.add(new C0820bb(C2844wo.i(strE), 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++;
            C0820bb c0820bb2 = (C0820bb) obj2;
            if (str == null || str.equals(c0820bb2.b)) {
                C0067Cp c0067Cp = (C0067Cp) this.f352o;
                C0724ab c0724ab = c0820bb2.a;
                if (c0724ab.f == null || c0724ab.g == null) {
                    C0154Fy c0154FyB = ((C2227qG) this.r).b(true);
                    C0724ab c0724ab2 = c0820bb2.a;
                    String str2 = c0154FyB.a;
                    C0649Za c0649ZaA = c0724ab2.a();
                    c0649ZaA.e = str2;
                    C0724ab c0724abA = c0649ZaA.a();
                    String str3 = c0154FyB.b;
                    C0649Za c0649ZaA2 = c0724abA.a();
                    c0649ZaA2.f = str3;
                    c0820bb = new C0820bb(c0649ZaA2.a(), c0820bb2.b, c0820bb2.c);
                } else {
                    c0820bb = c0820bb2;
                }
                boolean z = str != null;
                C1541j20 c1541j20 = c0067Cp.a;
                synchronized (c1541j20.f) {
                    try {
                        Qc0 qc02 = new Qc0();
                        if (z) {
                            ((AtomicInteger) c1541j20.i.m).getAndIncrement();
                            if (c1541j20.f.size() < c1541j20.e) {
                                Log.isLoggable("FirebaseCrashlytics", 3);
                                c1541j20.f.size();
                                Log.isLoggable("FirebaseCrashlytics", 3);
                                qc0 = qc02;
                                c1541j20.g.execute(new RunnableC0245Jl(c1541j20, c0820bb, qc02, 1, false));
                                Log.isLoggable("FirebaseCrashlytics", 3);
                                qc0.d(c0820bb);
                            } else {
                                qc0 = qc02;
                                c1541j20.a();
                                Log.isLoggable("FirebaseCrashlytics", 3);
                                ((AtomicInteger) c1541j20.i.n).getAndIncrement();
                                qc0.d(c0820bb);
                            }
                        } else {
                            qc0 = qc02;
                            c1541j20.b(c0820bb, qc0);
                        }
                    } finally {
                    }
                }
                arrayList2.add(qc0.a.k(executor, new G1(12, this)));
            }
        }
        return AbstractC0752ap.j0(arrayList2);
    }

    public void v(String str, String str2, Bundle bundle) {
        int i;
        String str3;
        String strEncodeToString;
        boolean zE;
        int i2;
        PackageInfo packageInfo;
        bundle.putString("scope", str2);
        bundle.putString("sender", str);
        bundle.putString("subtype", str);
        C0076Cy c0076Cy = (C0076Cy) this.m;
        c0076Cy.a();
        bundle.putString("gmp_app_id", c0076Cy.c.b);
        C2805wP c2805wP = (C2805wP) this.n;
        synchronized (c2805wP) {
            try {
                if (c2805wP.a == 0) {
                    try {
                        packageInfo = ((Context) c2805wP.c).getPackageManager().getPackageInfo("com.google.android.gms", 0);
                    } catch (PackageManager.NameNotFoundException e) {
                        e.toString();
                        packageInfo = null;
                    }
                    if (packageInfo != null) {
                        c2805wP.a = packageInfo.versionCode;
                    }
                }
                i = c2805wP.a;
            } finally {
            }
        }
        bundle.putString("gmsv", Integer.toString(i));
        bundle.putString("osv", Integer.toString(Build.VERSION.SDK_INT));
        bundle.putString("app_ver", ((C2805wP) this.n).b());
        C2805wP c2805wP2 = (C2805wP) this.n;
        synchronized (c2805wP2) {
            try {
                if (((String) c2805wP2.e) == null) {
                    c2805wP2.e();
                }
                str3 = (String) c2805wP2.e;
            } finally {
            }
        }
        bundle.putString("app_ver_name", str3);
        C0076Cy c0076Cy2 = (C0076Cy) this.m;
        c0076Cy2.a();
        try {
            strEncodeToString = Base64.encodeToString(MessageDigest.getInstance("SHA-1").digest(c0076Cy2.b.getBytes()), 11);
        } catch (NoSuchAlgorithmException unused) {
            strEncodeToString = "[HASH-ERROR]";
        }
        bundle.putString("firebase-app-name-hash", strEncodeToString);
        try {
            String str4 = ((C0546Vb) AbstractC0752ap.p(((C0232Iy) ((InterfaceC0258Jy) this.r)).d())).a;
            if (!TextUtils.isEmpty(str4)) {
                bundle.putString("Goog-Firebase-Installations-Auth", str4);
            }
        } catch (InterruptedException | ExecutionException unused2) {
        }
        bundle.putString("appid", (String) AbstractC0752ap.p(((C0232Iy) ((InterfaceC0258Jy) this.r)).c()));
        bundle.putString("cliv", "fcm-25.0.1");
        OE oe = (OE) ((DZ) this.q).get();
        C0224Iq c0224Iq = (C0224Iq) ((DZ) this.p).get();
        if (oe == null || c0224Iq == null) {
            return;
        }
        C0945cq c0945cq = (C0945cq) oe;
        synchronized (c0945cq) {
            long jCurrentTimeMillis = System.currentTimeMillis();
            PE pe = (PE) c0945cq.a.get();
            synchronized (pe) {
                zE = pe.e(jCurrentTimeMillis);
            }
            if (zE) {
                synchronized (pe) {
                    pe.a.a(new C1590je(6, pe, pe.b(System.currentTimeMillis())));
                }
                i2 = 3;
            } else {
                i2 = 1;
            }
        }
        if (i2 != 1) {
            bundle.putString("Firebase-Client-Log-Type", Integer.toString(AbstractC2462sn.w(i2)));
            bundle.putString("Firebase-Client", c0224Iq.a());
        }
    }

    public Hw0 x(String str, String str2, Bundle bundle) {
        int i;
        try {
            v(str, str2, bundle);
            B30 b30 = (B30) this.f352o;
            ExecutorC0614Xr executorC0614Xr = ExecutorC0614Xr.f416o;
            C3111zf c3111zf = b30.c;
            if (c3111zf.u() < 12000000) {
                return c3111zf.v() != 0 ? b30.a(bundle).d(executorC0614Xr, new C3040yr(17, b30, bundle)) : AbstractC0752ap.I(new IOException("MISSING_INSTANCEID_SERVICE"));
            }
            Ew0 ew0L = Ew0.l(b30.b);
            synchronized (ew0L) {
                i = ew0L.a;
                ew0L.a = i + 1;
            }
            return ew0L.m(new jw0(i, 1, bundle, 1)).k(executorC0614Xr, C0669Zu.d0);
        } catch (InterruptedException | ExecutionException e) {
            return AbstractC0752ap.I(e);
        }
    }

    public U7(C2549tj c2549tj, InterfaceC0217Ij interfaceC0217Ij) {
        this.l = 4;
        HashSet hashSet = new HashSet();
        HashSet hashSet2 = new HashSet();
        HashSet hashSet3 = new HashSet();
        HashSet hashSet4 = new HashSet();
        HashSet hashSet5 = new HashSet();
        Set<C2660ur> set = c2549tj.c;
        Set set2 = c2549tj.g;
        for (C2660ur c2660ur : set) {
            int i = c2660ur.c;
            int i2 = c2660ur.b;
            boolean z = i == 0;
            JZ jz = c2660ur.a;
            if (z) {
                if (i2 == 2) {
                    hashSet4.add(jz);
                } else {
                    hashSet.add(jz);
                }
            } else if (i == 2) {
                hashSet3.add(jz);
            } else if (i2 == 2) {
                hashSet5.add(jz);
            } else {
                hashSet2.add(jz);
            }
        }
        if (!set2.isEmpty()) {
            hashSet.add(JZ.a(GZ.class));
        }
        this.m = Collections.unmodifiableSet(hashSet);
        this.n = Collections.unmodifiableSet(hashSet2);
        this.f352o = Collections.unmodifiableSet(hashSet3);
        this.p = Collections.unmodifiableSet(hashSet4);
        this.q = Collections.unmodifiableSet(hashSet5);
        this.r = interfaceC0217Ij;
    }

    public U7() {
        this.l = 0;
        this.m = new int[]{R.drawable.abc_textfield_search_default_mtrl_alpha, R.drawable.abc_textfield_default_mtrl_alpha, R.drawable.abc_ab_share_pack_mtrl_alpha};
        this.n = new int[]{R.drawable.abc_ic_commit_search_api_mtrl_alpha, R.drawable.abc_seekbar_tick_mark_material, R.drawable.abc_ic_menu_share_mtrl_alpha, R.drawable.abc_ic_menu_copy_mtrl_am_alpha, R.drawable.abc_ic_menu_cut_mtrl_alpha, R.drawable.abc_ic_menu_selectall_mtrl_alpha, R.drawable.abc_ic_menu_paste_mtrl_am_alpha};
        this.f352o = new int[]{R.drawable.abc_textfield_activated_mtrl_alpha, R.drawable.abc_textfield_search_activated_mtrl_alpha, R.drawable.abc_cab_background_top_mtrl_alpha, R.drawable.abc_text_cursor_material, R.drawable.abc_text_select_handle_left_mtrl, R.drawable.abc_text_select_handle_middle_mtrl, R.drawable.abc_text_select_handle_right_mtrl};
        this.p = new int[]{R.drawable.abc_popup_background_mtrl_mult, R.drawable.abc_cab_background_internal_bg, R.drawable.abc_menu_hardkey_panel_mtrl_mult};
        this.q = new int[]{R.drawable.abc_tab_indicator_material, R.drawable.abc_textfield_search_material};
        this.r = new int[]{R.drawable.abc_btn_check_material, R.drawable.abc_btn_radio_material, R.drawable.abc_btn_check_material_anim, R.drawable.abc_btn_radio_material_anim};
    }

    public U7(C2749vo c2749vo, C2939xo c2939xo, C0067Cp c0067Cp, C1390hY c1390hY, Zf0 zf0, C2227qG c2227qG, C3126zm0 c3126zm0) {
        this.l = 5;
        this.m = c2749vo;
        this.n = c2939xo;
        this.f352o = c0067Cp;
        this.p = c1390hY;
        this.q = zf0;
        this.r = c2227qG;
    }

    public U7(C0076Cy c0076Cy, C2805wP c2805wP, DZ dz, DZ dz2, InterfaceC0258Jy interfaceC0258Jy) {
        this.l = 1;
        c0076Cy.a();
        B30 b30 = new B30(c0076Cy.a);
        this.m = c0076Cy;
        this.n = c2805wP;
        this.f352o = b30;
        this.p = dz;
        this.q = dz2;
        this.r = interfaceC0258Jy;
    }

    public U7(Uc0 uc0) {
        this.l = 2;
        this.m = uc0;
        this.r = CF.a;
    }
}
