package defpackage;

import j$.util.Objects;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Locale;

/* renamed from: ᵵᵱᐧʞ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4750 implements InterfaceC0125 {

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public static final Charset f17608 = Charset.forName("UTF-8");

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public C2405 f17609;

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

    public C4750(File file) {
        this.f17610 = file;
    }

    @Override // defpackage.InterfaceC0125
    /* renamed from: ˇʼʤˎ */
    public final void mo1232(long j, String str) {
        File file = this.f17610;
        if (this.f17609 == null) {
            try {
                this.f17609 = new C2405(file);
            } catch (IOException unused) {
                Objects.toString(file);
            }
        }
        if (this.f17609 == null) {
            return;
        }
        try {
            if (str.length() > 16384) {
                str = "...".concat(str.substring(str.length() - 16384));
            }
            this.f17609.m6171(String.format(Locale.US, "%d %s%n", Long.valueOf(j), str.replaceAll("\r", " ").replaceAll("\n", " ")).getBytes(f17608));
            while (!this.f17609.m6170() && this.f17609.m6167() > 65536) {
                this.f17609.m6166();
            }
        } catch (IOException unused2) {
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:4:0x000a  */
    @Override // defpackage.InterfaceC0125
    /* renamed from: ˏᵙ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.String mo1233() {
        /*
            r6 = this;
            java.io.File r0 = r6.f17610
            boolean r1 = r0.exists()
            r2 = 0
            r3 = 0
            if (r1 != 0) goto Lc
        La:
            r6 = r3
            goto L3d
        Lc:
            ᵖᵵ r1 = r6.f17609
            if (r1 != 0) goto L1b
            ᵖᵵ r1 = new ᵖᵵ     // Catch: java.io.IOException -> L18
            r1.<init>(r0)     // Catch: java.io.IOException -> L18
            r6.f17609 = r1     // Catch: java.io.IOException -> L18
            goto L1b
        L18:
            j$.util.Objects.toString(r0)
        L1b:
            ᵖᵵ r0 = r6.f17609
            if (r0 != 0) goto L20
            goto La
        L20:
            int[] r1 = new int[]{r2}
            int r0 = r0.m6167()
            byte[] r0 = new byte[r0]
            ᵖᵵ r6 = r6.f17609     // Catch: java.io.IOException -> L36
            ᵶˉᵹʣ r4 = new ᵶˉᵹʣ     // Catch: java.io.IOException -> L36
            r5 = 14
            r4.<init>(r0, r5, r1)     // Catch: java.io.IOException -> L36
            r6.m6168(r4)     // Catch: java.io.IOException -> L36
        L36:
            ˈᵹ r6 = new ˈᵹ
            r1 = r1[r2]
            r6.<init>(r1, r0)
        L3d:
            if (r6 != 0) goto L41
            r1 = r3
            goto L4a
        L41:
            int r0 = r6.f4805
            byte[] r1 = new byte[r0]
            byte[] r6 = r6.f4804
            java.lang.System.arraycopy(r6, r2, r1, r2, r0)
        L4a:
            if (r1 == 0) goto L54
            java.lang.String r6 = new java.lang.String
            java.nio.charset.Charset r0 = defpackage.C4750.f17608
            r6.<init>(r1, r0)
            return r6
        L54:
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C4750.mo1233():java.lang.String");
    }

    @Override // defpackage.InterfaceC0125
    /* renamed from: ᵥᵯˎ */
    public final void mo1234() {
        ᵕˏᵛ.ˇʼʤˎ(this.f17609);
        this.f17609 = null;
    }
}
