package o;

import android.text.TextUtils;
import java.io.IOException;
import java.util.Iterator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Hy, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final /* synthetic */ class RunnableC0206Hy implements Runnable {
    public final /* synthetic */ int l;
    public final /* synthetic */ C0232Iy m;

    public /* synthetic */ RunnableC0206Hy(C0232Iy c0232Iy, int i) {
        this.l = i;
        this.m = c0232Iy;
    }

    /* JADX WARN: Finally extract failed */
    @Override // java.lang.Runnable
    public final void run() {
        C1108ec c1108ecQ;
        C1108ec c1108ecG;
        switch (this.l) {
            case 0:
                this.m.a();
                return;
            case 1:
                this.m.a();
                return;
            default:
                C0232Iy c0232Iy = this.m;
                Object obj = C0232Iy.m;
                synchronized (obj) {
                    try {
                        C0076Cy c0076Cy = c0232Iy.a;
                        c0076Cy.a();
                        C1390hY c1390hYC = C1390hY.c(c0076Cy.a);
                        try {
                            c1108ecQ = c0232Iy.c.q();
                            if (c1390hYC != null) {
                                c1390hYC.A();
                            }
                        } catch (Throwable th) {
                            if (c1390hYC != null) {
                                c1390hYC.A();
                            }
                            throw th;
                        }
                    } finally {
                    }
                }
                try {
                    int i = c1108ecQ.b;
                    if (i == 5) {
                        c1108ecG = c0232Iy.g(c1108ecQ);
                    } else {
                        if (i == 3) {
                            c1108ecG = c0232Iy.g(c1108ecQ);
                        } else if (!c0232Iy.d.a(c1108ecQ)) {
                            return;
                        } else {
                            c1108ecG = c0232Iy.b(c1108ecQ);
                        }
                    }
                    synchronized (obj) {
                        try {
                            C0076Cy c0076Cy2 = c0232Iy.a;
                            c0076Cy2.a();
                            C1390hY c1390hYC2 = C1390hY.c(c0076Cy2.a);
                            try {
                                c0232Iy.c.n(c1108ecG);
                                if (c1390hYC2 != null) {
                                    c1390hYC2.A();
                                }
                            } catch (Throwable th2) {
                                if (c1390hYC2 != null) {
                                    c1390hYC2.A();
                                }
                                throw th2;
                            }
                        } finally {
                        }
                    }
                    synchronized (c0232Iy) {
                        try {
                            if (c0232Iy.k.size() != 0 && !TextUtils.equals(c1108ecQ.a, c1108ecG.a)) {
                                Iterator it = c0232Iy.k.iterator();
                                if (it.hasNext()) {
                                    if (it.next() != null) {
                                        throw new ClassCastException();
                                    }
                                    throw null;
                                }
                            }
                        } finally {
                        }
                    }
                    if (c1108ecG.b == 4) {
                        String str = c1108ecG.a;
                        synchronized (c0232Iy) {
                            c0232Iy.j = str;
                        }
                    }
                    int i2 = c1108ecG.b;
                    if (i2 == 5) {
                        c0232Iy.h(new C0284Ky());
                        return;
                    } else if (i2 == 2 || i2 == 1) {
                        c0232Iy.h(new IOException("Installation ID could not be validated with the Firebase servers (maybe it was deleted). Firebase Installations will need to create a new Installation ID and auth token. Please retry your last request."));
                        return;
                    } else {
                        c0232Iy.i(c1108ecG);
                        return;
                    }
                } catch (C0284Ky e) {
                    c0232Iy.h(e);
                    return;
                }
        }
    }
}
