package defpackage;

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

/* JADX INFO: renamed from: ᵚᵼᵨʖ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2756 extends AbstractC2521 {

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final /* synthetic */ int f10611 = 1;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public char[] f10612;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public AbstractC0577 f10613;

    public /* synthetic */ C2756(C1411 c1411, ᵤᵮᵨ r3, C1014 c1014) {
        super(c1411, r3, c1014);
    }

    public C2756(C1411 c1411, char[] cArr, ᵤᵮᵨ r4, C1014 c1014) {
        super(c1411, r4, c1014);
        this.f10612 = cArr;
    }

    /* JADX WARN: Finally extract failed */
    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public final void m6666(ᵜᵪʾ r13, C3442 c3442) throws IOException {
        AbstractC0577 abstractC0577;
        List listSingletonList;
        int i = this.f10611;
        int i2 = 0;
        C1411 c1411 = this.f9734;
        switch (i) {
            case 0:
                C5275 c5275 = (C5275) r13;
                C3185 c3185 = (C3185) ((ᵜᵪʾ) c5275).ˌᴵ;
                int i3 = 0;
                try {
                    C5555 c5555M6667 = m6667(c3185);
                    try {
                        ArrayList arrayList = c1411.f5822.f1746;
                        int size = arrayList.size();
                        while (i3 < size) {
                            int i4 = i3 + 1;
                            C1543 c1543 = (C1543) arrayList.get(i3);
                            if (c1543.f15143.startsWith("__MACOSX")) {
                                c3442.m7858(c1543.f15148);
                            } else {
                                this.f10613.mo2196(c1543);
                                m6238(c5555M6667, c1543, c5275.f19924, null, c3442, new byte[c3185.f12092]);
                                ˌᴵ();
                            }
                            i3 = i4;
                        }
                        c5555M6667.close();
                        AbstractC0577 abstractC05772 = this.f10613;
                        if (abstractC05772 != null) {
                            abstractC05772.close();
                            return;
                        }
                        return;
                    } catch (Throwable th) {
                        try {
                            c5555M6667.close();
                            throw th;
                        } catch (Throwable th2) {
                            th.addSuppressed(th2);
                            throw th;
                        }
                    }
                } finally {
                    abstractC0577 = this.f10613;
                    if (abstractC0577 != null) {
                        abstractC0577.close();
                    }
                }
            default:
                C3074 c3074 = (C3074) r13;
                String str = c3074.f11753;
                C3185 c31852 = (C3185) ((ᵜᵪʾ) c3074).ˌᴵ;
                if (ˁᵨᵦ.ᵟᵹᵙ(str)) {
                    ArrayList arrayList2 = c1411.f5822.f1746;
                    ArrayList arrayList3 = new ArrayList();
                    int size2 = arrayList2.size();
                    while (i2 < size2) {
                        Object obj = arrayList2.get(i2);
                        i2++;
                        C1543 c15432 = (C1543) obj;
                        if (c15432.f15143.startsWith(str)) {
                            arrayList3.add(c15432);
                        }
                    }
                    listSingletonList = arrayList3;
                } else {
                    C1543 c15433 = ᵬʕˎʽ.ᵪᵹᵥᵻ(c1411, str);
                    if (c15433 != null) {
                        listSingletonList = Collections.singletonList(c15433);
                    } else {
                        C4468.m9508(AbstractC3589.m8117("No file found with name ", str, " in zip file"));
                        listSingletonList = null;
                    }
                }
                try {
                    this.f10613 = ˋˀᵧ.ᵱᵽʡᵚ(c1411);
                    List<C1543> list = listSingletonList;
                    C5555 c5555 = new C5555(this.f10613, this.f10612, c31852);
                    try {
                        byte[] bArr = new byte[c31852.f12092];
                        for (C1543 c15434 : list) {
                            this.f10613.mo2196(c15434);
                            String strReplaceFirst = c3074.f11755;
                            if (ᵺᵘ.ᵸˆˁ(strReplaceFirst) && ˁᵨᵦ.ᵟᵹᵙ(str)) {
                                strReplaceFirst = c15434.f15143.replaceFirst(str, strReplaceFirst.concat(strReplaceFirst.endsWith("/") ? "" : "/"));
                            }
                            m6238(c5555, c15434, c3074.f11754, strReplaceFirst, c3442, bArr);
                            break;
                        }
                        c5555.close();
                        if (abstractC0577 != null) {
                            return;
                        } else {
                            return;
                        }
                    } finally {
                    }
                } finally {
                    AbstractC0577 abstractC05773 = this.f10613;
                    if (abstractC05773 != null) {
                        abstractC05773.close();
                    }
                }
        }
    }

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public C5555 m6667(C3185 c3185) {
        ArrayList arrayList;
        C1411 c1411 = this.f9734;
        this.f10613 = ˋˀᵧ.ᵱᵽʡᵚ(c1411);
        C0233 c0233 = c1411.f5822;
        C1543 c1543 = (c0233 == null || (arrayList = c0233.f1746) == null || arrayList.size() == 0) ? null : (C1543) c1411.f5822.f1746.get(0);
        if (c1543 != null) {
            this.f10613.mo2196(c1543);
        }
        return new C5555(this.f10613, this.f10612, c3185);
    }
}
