package defpackage;

import android.os.Build;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.attribute.FileAttribute;
import java.util.Collections;

/* renamed from: ˋˏ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C1476 {
    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static C5293 m4384(InterfaceC3338 interfaceC3338, ˊʘ r8, C3611 c3611, InterfaceC4622 interfaceC4622) {
        C3035 c3035 = C3035.f11677;
        try {
            System.loadLibrary("datastore_shared_counter");
            return new C5293(new C4383(interfaceC3338, new C5227(2, c3611), interfaceC4622), Collections.singletonList(new ᵣᵽᵮ(c3035, (InterfaceC4943) null, 18)), r8, c3611);
        } catch (SecurityException | UnsatisfiedLinkError unused) {
            return new C5293(new C4383(interfaceC3338, interfaceC4622), Collections.singletonList(new ᵣᵽᵮ(c3035, (InterfaceC4943) null, 18)), r8, c3611);
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public static void m4385(File file) throws IOException {
        File parentFile = file.getParentFile();
        if (parentFile == null) {
            return;
        }
        if (parentFile.exists() && !parentFile.isDirectory() && ᵲᵝᵪ.ᵹᵝᵶ(parentFile.getName(), "firebaseSessions") && !parentFile.delete()) {
            C1260.m3812(parentFile, "Failed to delete conflicting file: ");
            return;
        }
        if (parentFile.isDirectory()) {
            return;
        }
        if (Build.VERSION.SDK_INT < 26) {
            if (parentFile.mkdirs() || parentFile.isDirectory()) {
                return;
            }
            C1260.m3812(parentFile, "Failed to create directory: ");
            return;
        }
        try {
            Files.createDirectories(parentFile.toPath(), new FileAttribute[0]);
        } catch (Exception e) {
            throw new IOException("Failed to create directory: " + parentFile, e);
        }
    }
}
