package defpackage;

import j$.util.DesugarCollections;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

/* renamed from: ˇˀᵖ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0933 implements InterfaceC4672, InterfaceC0782 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public int f4219;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public C1113 f4220;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public File f4221;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public volatile C1370 f4222;

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

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final C1101 f4224;

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

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final RunnableC2904 f4226;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public int f4227 = -1;

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

    public C0933(C1101 c1101, RunnableC2904 runnableC2904) {
        this.f4224 = c1101;
        this.f4226 = runnableC2904;
    }

    @Override // defpackage.InterfaceC4672
    public final void cancel() {
        C1370 c1370 = this.f4222;
        if (c1370 != null) {
            c1370.f5643.cancel();
        }
    }

    @Override // defpackage.InterfaceC0782
    /* renamed from: ˎˏʜʾ */
    public final void mo2869(Object obj) {
        this.f4226.mo7092(this.f4225, obj, this.f4222.f5643, 4, this.f4220);
    }

    @Override // defpackage.InterfaceC0782
    /* renamed from: ˏᵙ */
    public final void mo2870(Exception exc) {
        this.f4226.mo7086(this.f4220, exc, this.f4222.f5643, 4);
    }

    @Override // defpackage.InterfaceC4672
    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final boolean mo3178() {
        List list;
        boolean z;
        List list2;
        boolean z2;
        ArrayList arrayListM3501 = this.f4224.m3501();
        if (arrayListM3501.isEmpty()) {
            return false;
        }
        C1101 c1101 = this.f4224;
        C3565 c3565M2233 = c1101.f4726.m2233();
        Class<?> cls = c1101.f4738.getClass();
        Class cls2 = c1101.f4724;
        Class cls3 = c1101.f4736;
        ᵶˉᵹʣ r8 = c3565M2233.f13366;
        C1491 c1491 = (C1491) ((AtomicReference) r8.ᵢˇᵭ).getAndSet(null);
        if (c1491 == null) {
            c1491 = new C1491(cls, cls2, cls3);
        } else {
            c1491.f6008 = cls;
            c1491.f6009 = cls2;
            c1491.f6007 = cls3;
        }
        synchronized (((C1200) r8.ᵿʗᵝʽ)) {
            list = (List) ((C1200) r8.ᵿʗᵝʽ).get(c1491);
        }
        ((AtomicReference) r8.ᵢˇᵭ).set(c1491);
        if (list == null) {
            ArrayList arrayList = new ArrayList();
            ArrayList arrayListM11184 = c3565M2233.f13363.m11184(cls);
            int size = arrayListM11184.size();
            int i = 0;
            while (i < size) {
                Object obj = arrayListM11184.get(i);
                i++;
                ArrayList arrayList2 = c3565M2233.f13361.ᵢˇᵭ((Class) obj, cls2);
                int size2 = arrayList2.size();
                int i2 = 0;
                while (i2 < size2) {
                    Object obj2 = arrayList2.get(i2);
                    i2++;
                    Class cls4 = (Class) obj2;
                    if (!c3565M2233.f13360.m7029(cls4, cls3).isEmpty() && !arrayList.contains(cls4)) {
                        arrayList.add(cls4);
                    }
                }
            }
            z = false;
            c3565M2233.f13366.ᵺʙ(cls, cls2, cls3, DesugarCollections.unmodifiableList(arrayList));
            list2 = arrayList;
        } else {
            z = false;
            list2 = list;
        }
        if (list2.isEmpty()) {
            if (File.class.equals(this.f4224.f4736)) {
                return z;
            }
            StringBuilder sb = new StringBuilder("Failed to find any load path from ");
            sb.append(this.f4224.f4738.getClass());
            Class cls5 = this.f4224.f4736;
            sb.append(" to ");
            sb.append(cls5);
            throw new IllegalStateException(sb.toString());
        }
        while (true) {
            List list3 = this.f4223;
            if (list3 != null && this.f4219 < list3.size()) {
                this.f4222 = null;
                boolean z3 = z;
                while (!z3 && this.f4219 < this.f4223.size()) {
                    List list4 = this.f4223;
                    int i3 = this.f4219;
                    this.f4219 = i3 + 1;
                    InterfaceC0218 interfaceC0218 = (InterfaceC0218) list4.get(i3);
                    File file = this.f4221;
                    C1101 c11012 = this.f4224;
                    this.f4222 = interfaceC0218.mo1497(file, c11012.f4721, c11012.f4725, c11012.f4727);
                    if (this.f4222 != null && this.f4224.m3500(this.f4222.f5643.mo1817()) != null) {
                        this.f4222.f5643.mo5387(this.f4224.f4732, this);
                        z3 = true;
                    }
                }
                return z3;
            }
            int i4 = this.f4227 + 1;
            this.f4227 = i4;
            if (i4 >= list2.size()) {
                int i5 = this.f4228 + 1;
                this.f4228 = i5;
                if (i5 >= arrayListM3501.size()) {
                    return z;
                }
                this.f4227 = z ? 1 : 0;
            }
            InterfaceC4207 interfaceC4207 = (InterfaceC4207) arrayListM3501.get(this.f4228);
            Class cls6 = (Class) list2.get(this.f4227);
            InterfaceC3731 interfaceC3731M3499 = this.f4224.m3499(cls6);
            C1101 c11013 = this.f4224;
            this.f4220 = new C1113(c11013.f4726.f2696, interfaceC4207, c11013.f4730, c11013.f4721, c11013.f4725, interfaceC3731M3499, cls6, c11013.f4727);
            File fileMo6925 = c11013.f4737.m1591().mo6925(this.f4220);
            this.f4221 = fileMo6925;
            if (fileMo6925 != null) {
                this.f4225 = interfaceC4207;
                this.f4223 = this.f4224.f4726.m2233().m8168(fileMo6925);
                z2 = false;
                this.f4219 = 0;
            } else {
                z2 = false;
            }
            z = z2;
        }
    }
}
