package defpackage;

import java.io.EOFException;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;

/* renamed from: ˁᵝᵗ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0711 extends AbstractC0626 {

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public static final C3120 f3441;

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

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final AbstractC0626 f3444 = AbstractC0626.f3116;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final C4844 f3443 = new C4844(new ᵬᵮˎ(10, this));

    static {
        String str = C3120.f11881;
        f3441 = ˎᵖᵗ.ᵝᵵᵺ("/");
    }

    public C0711(ClassLoader classLoader) {
        this.f3442 = classLoader;
    }

    @Override // defpackage.AbstractC0626
    /* renamed from: ᵥᵯˎ */
    public final C3882 mo1702(C3120 c3120) throws EOFException {
        C3120 c31202 = c3120;
        if (!C4912.m10351(c31202)) {
            ᵨᴵᵺ.ᵸˑ(c31202, "file not found: ");
            return null;
        }
        C3120 c31203 = f3441;
        c31203.getClass();
        C3120 c3120M5264 = AbstractC1865.m5264(c31203, c31202, true);
        C2185 c2185 = c3120M5264.f11882;
        C2185 c21852 = c31203.f11882;
        int iM5263 = AbstractC1865.m5263(c3120M5264);
        C3120 c31204 = iM5263 == -1 ? null : new C3120(c2185.mo5844(0, iM5263));
        int iM52632 = AbstractC1865.m5263(c31203);
        if (!ᵲᵝᵪ.ᵹᵝᵶ(c31204, iM52632 == -1 ? null : new C3120(c21852.mo5844(0, iM52632)))) {
            throw new IllegalArgumentException(("Paths of different roots cannot be relative to each other: " + c3120M5264 + " and " + c31203).toString());
        }
        ArrayList arrayListM7454 = c3120M5264.m7454();
        ArrayList arrayListM74542 = c31203.m7454();
        int iMin = Math.min(arrayListM7454.size(), arrayListM74542.size());
        int i = 0;
        while (i < iMin && ᵲᵝᵪ.ᵹᵝᵶ(arrayListM7454.get(i), arrayListM74542.get(i))) {
            i++;
        }
        if (i == iMin && c2185.mo5840() == c21852.mo5840()) {
            String str = C3120.f11881;
            c3120M5264 = ˎᵖᵗ.ᵝᵵᵺ(".");
        } else {
            if (arrayListM74542.subList(i, arrayListM74542.size()).indexOf(AbstractC1865.f7561) != -1) {
                throw new IllegalArgumentException(("Impossible relative path to resolve: " + c3120M5264 + " and " + c31203).toString());
            }
            if (!ᵲᵝᵪ.ᵹᵝᵶ(c21852, AbstractC1865.f7565)) {
                C0963 c0963 = new C0963();
                C2185 c2185M5262 = AbstractC1865.m5262(c31203);
                if (c2185M5262 == null && (c2185M5262 = AbstractC1865.m5262(c3120M5264)) == null) {
                    c2185M5262 = AbstractC1865.m5261(C3120.f11881);
                }
                int size = arrayListM74542.size();
                for (int i2 = i; i2 < size; i2++) {
                    c0963.m3258(AbstractC1865.f7561);
                    c0963.m3258(c2185M5262);
                }
                int size2 = arrayListM7454.size();
                while (i < size2) {
                    c0963.m3258((C2185) arrayListM7454.get(i));
                    c0963.m3258(c2185M5262);
                    i++;
                }
                c3120M5264 = AbstractC1865.m5265(c0963, false);
            }
        }
        String strM5842 = c3120M5264.f11882.m5842();
        for (C2836 c2836 : (List) this.f3443.getValue()) {
            try {
                return ((AbstractC0626) c2836.f10917).mo1702(((C3120) c2836.f10916).m7455(strM5842));
            } catch (FileNotFoundException unused) {
            }
        }
        ᵨᴵᵺ.ᵸˑ(c31202, "file not found: ");
        return null;
    }
}
