package defpackage;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/* renamed from: ᵲː, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4488 extends AbstractC3471 {

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

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public char[] f16739;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final /* synthetic */ int f16740 = 1;

    public /* synthetic */ C4488(C4348 c4348, ᵬˆˀᵣ r3, C3718 c3718) {
        super(c4348, r3, c3718);
    }

    public C4488(C4348 c4348, char[] cArr, ᵬˆˀᵣ r4, C3718 c3718) {
        super(c4348, r4, c3718);
        this.f16739 = cArr;
    }

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public C2219 m9564(C2723 c2723) {
        ArrayList arrayList;
        C4348 c4348 = this.f13013;
        this.f16738 = ᵭʝʜ.ᵹᵝᵶ(c4348);
        C2877 c2877 = c4348.f16273;
        C1451 c1451 = (c2877 == null || (arrayList = c2877.f11143) == null || arrayList.size() == 0) ? null : (C1451) c4348.f16273.f11143.get(0);
        if (c1451 != null) {
            this.f16738.mo4630(c1451);
        }
        return new C2219(this.f16738, this.f16739, c2723);
    }

    /* JADX WARN: Finally extract failed */
    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final void m9565(ᵢˇᵭ r13, C3944 c3944) throws IOException {
        AbstractC1618 abstractC1618;
        List listSingletonList;
        int i = this.f16740;
        int i2 = 0;
        C4348 c4348 = this.f13013;
        switch (i) {
            case 0:
                C3798 c3798 = (C3798) r13;
                C2723 c2723 = (C2723) ((ᵢˇᵭ) c3798).ᵧᵾˀˈ;
                int i3 = 0;
                try {
                    C2219 c2219M9564 = m9564(c2723);
                    try {
                        ArrayList arrayList = c4348.f16273.f11143;
                        int size = arrayList.size();
                        while (i3 < size) {
                            int i4 = i3 + 1;
                            C1451 c1451 = (C1451) arrayList.get(i3);
                            if (c1451.f4041.startsWith("__MACOSX")) {
                                c3944.m8729(c1451.f4034);
                            } else {
                                this.f16738.mo4630(c1451);
                                m7904(c2219M9564, c1451, c3798.f14172, null, c3944, new byte[c2723.f10553]);
                                ᵧᵾˀˈ();
                            }
                            i3 = i4;
                        }
                        c2219M9564.close();
                        AbstractC1618 abstractC16182 = this.f16738;
                        if (abstractC16182 != null) {
                            abstractC16182.close();
                            return;
                        }
                        return;
                    } catch (Throwable th) {
                        try {
                            c2219M9564.close();
                            throw th;
                        } catch (Throwable th2) {
                            th.addSuppressed(th2);
                            throw th;
                        }
                    }
                } finally {
                    abstractC1618 = this.f16738;
                    if (abstractC1618 != null) {
                        abstractC1618.close();
                    }
                }
            default:
                C1497 c1497 = (C1497) r13;
                String str = c1497.f6027;
                C2723 c27232 = (C2723) ((ᵢˇᵭ) c1497).ᵧᵾˀˈ;
                if (AbstractC4618.m9807(str)) {
                    ArrayList arrayList2 = c4348.f16273.f11143;
                    ArrayList arrayList3 = new ArrayList();
                    int size2 = arrayList2.size();
                    while (i2 < size2) {
                        Object obj = arrayList2.get(i2);
                        i2++;
                        C1451 c14512 = (C1451) obj;
                        if (c14512.f4041.startsWith(str)) {
                            arrayList3.add(c14512);
                        }
                    }
                    listSingletonList = arrayList3;
                } else {
                    C1451 c14513 = ˉᵜˆ.ᵳٴᵶ(c4348, str);
                    if (c14513 != null) {
                        listSingletonList = Collections.singletonList(c14513);
                    } else {
                        C0190.m1425(AbstractC4486.m9550("No file found with name ", str, " in zip file"));
                        listSingletonList = null;
                    }
                }
                try {
                    this.f16738 = ᵭʝʜ.ᵹᵝᵶ(c4348);
                    List<C1451> list = listSingletonList;
                    C2219 c2219 = new C2219(this.f16738, this.f16739, c27232);
                    try {
                        byte[] bArr = new byte[c27232.f10553];
                        for (C1451 c14514 : list) {
                            this.f16738.mo4630(c14514);
                            String strReplaceFirst = c1497.f6026;
                            if (ᵙᵛᵯ.ᵢˇᵭ(strReplaceFirst) && AbstractC4618.m9807(str)) {
                                strReplaceFirst = c14514.f4041.replaceFirst(str, strReplaceFirst.concat(strReplaceFirst.endsWith("/") ? "" : "/"));
                            }
                            m7904(c2219, c14514, c1497.f6025, strReplaceFirst, c3944, bArr);
                        }
                        c2219.close();
                        if (abstractC1618 != null) {
                            return;
                        } else {
                            return;
                        }
                    } finally {
                    }
                } finally {
                    AbstractC1618 abstractC16183 = this.f16738;
                    if (abstractC16183 != null) {
                        abstractC16183.close();
                    }
                }
        }
    }
}
