package defpackage;

import java.io.Closeable;
import java.nio.charset.Charset;

/* JADX INFO: renamed from: ᵱʝ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC4407 implements Closeable {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public static final C2550 f16717;

    static {
        C4903 c4903 = new C4903();
        c4903.m10208(C1054.f4543);
        f16717 = new C2550(null, r1.f4544.length, c4903);
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public void close() {
        AbstractC1701.m4653(mo2194());
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public abstract C4738 mo2193();

    /* JADX INFO: renamed from: ᵟᵹᵙ */
    public abstract InterfaceC2322 mo2194();

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:15:0x0031  */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0039 A[Catch: all -> 0x004c, TRY_ENTER, TryCatch #3 {all -> 0x004c, blocks: (B:3:0x0005, B:5:0x000b, B:7:0x001c, B:9:0x0024, B:19:0x003b, B:16:0x0033, B:18:0x0039), top: B:40:0x0005 }] */
    /* JADX WARN: Removed duplicated region for block: B:36:0x0033 A[EXC_TOP_SPLITTER, SYNTHETIC] */
    /* JADX WARN: Type inference failed for: r7v1, types: [java.lang.Throwable] */
    /* JADX WARN: Type inference failed for: r7v2, types: [java.lang.Throwable] */
    /* JADX WARN: Type inference failed for: r7v8 */
    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final String m9414() {
        Charset charsetForName;
        String str;
        InterfaceC2322 interfaceC2322Mo2194 = mo2194();
        String th = null;
        try {
            C4738 c4738Mo2193 = mo2193();
            if (c4738Mo2193 != null) {
                C4532 c4532 = C4738.f18011;
                String[] strArr = c4738Mo2193.f18013;
                int i = 0;
                int i2 = ˋˀᵧ.ˊᵙᵾᵲ(0, strArr.length - 1, 2);
                if (i2 >= 0) {
                    while (!AbstractC5498.m11135(strArr[i], "charset")) {
                        if (i == i2) {
                            str = null;
                            break;
                        }
                        i += 2;
                    }
                    str = strArr[i + 1];
                    if (str != null) {
                        charsetForName = null;
                        if (charsetForName == null) {
                            charsetForName = AbstractC4490.f17115;
                        }
                        String strMo5345 = interfaceC2322Mo2194.mo5345(AbstractC1190.m3667(interfaceC2322Mo2194, charsetForName));
                        try {
                            interfaceC2322Mo2194.close();
                        } catch (Throwable th2) {
                            th = th2;
                        }
                        String str2 = th;
                        th = strMo5345;
                        th = str2;
                    } else {
                        try {
                            charsetForName = Charset.forName(str);
                        } catch (IllegalArgumentException unused) {
                            charsetForName = null;
                        }
                        if (charsetForName == null) {
                        }
                        String strMo53452 = interfaceC2322Mo2194.mo5345(AbstractC1190.m3667(interfaceC2322Mo2194, charsetForName));
                        interfaceC2322Mo2194.close();
                        String str22 = th;
                        th = strMo53452;
                        th = str22;
                    }
                } else {
                    str = null;
                    if (str != null) {
                    }
                }
            }
        } catch (Throwable th3) {
            th = th3;
            if (interfaceC2322Mo2194 != null) {
                try {
                    interfaceC2322Mo2194.close();
                } catch (Throwable th4) {
                    ᵷˆᵣ.ʽˈˋ((Throwable) th, th4);
                }
            }
        }
        if (th == 0) {
            return th;
        }
        throw th;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public abstract long mo2195();
}
