package ῲ.ᨨ.ʬ;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.CancellationSignal;
import com.adjust.sdk.Constants;
import java.io.File;
import java.io.InputStream;
import java.util.concurrent.ConcurrentHashMap;
import ῲ.ᨨ.ῲ.ῲ.C1796;
import ῲ.ᨨ.㴹.C1847;
import K.K.K.ʬ.C2369;

/* renamed from: ῲ.ᨨ.ʬ.㳳  reason: contains not printable characters */
/* compiled from: TypefaceCompatBaseImpl */
public class C1719 {
    @SuppressLint({"BanConcurrentHashMap"})

    /* renamed from: K  reason: contains not printable characters */
    public ConcurrentHashMap<Long, C1796> f6031 = new ConcurrentHashMap<>();

    /* renamed from: K  reason: contains not printable characters */
    public Typeface m4415(Context context, CancellationSignal cancellationSignal, C1847[] r3, int i) {
        throw null;
    }

    /* renamed from: K  reason: contains not printable characters */
    public Typeface m4417(Context context, C1796 r2, Resources resources, int i) {
        throw null;
    }

    /* renamed from: K  reason: contains not printable characters */
    public C1847 m4418(C1847[] r11, int i) {
        int i2 = (i & 1) == 0 ? Constants.MINIMAL_ERROR_STATUS_CODE : 700;
        boolean z = (i & 2) != 0;
        C1847 r5 = null;
        int i3 = Integer.MAX_VALUE;
        for (C1847 r7 : r11) {
            int abs = (Math.abs(r7.f6277 - i2) * 2) + (r7.f6281 == z ? 0 : 1);
            if (r5 == null || i3 > abs) {
                r5 = r7;
                i3 = abs;
            }
        }
        return r5;
    }

    /* renamed from: K  reason: contains not printable characters */
    public Typeface m4416(Context context, InputStream inputStream) {
        File r2 = C2369.m6282(context);
        if (r2 == null) {
            return null;
        }
        try {
            if (!C2369.m6344(r2, inputStream)) {
                return null;
            }
            Typeface createFromFile = Typeface.createFromFile(r2.getPath());
            r2.delete();
            return createFromFile;
        } catch (RuntimeException unused) {
            return null;
        } finally {
            r2.delete();
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public Typeface m4414(Context context, Resources resources, int i, String str, int i2) {
        File r1 = C2369.m6282(context);
        if (r1 == null) {
            return null;
        }
        try {
            if (!C2369.m6343(r1, resources, i)) {
                return null;
            }
            Typeface createFromFile = Typeface.createFromFile(r1.getPath());
            r1.delete();
            return createFromFile;
        } catch (RuntimeException unused) {
            return null;
        } finally {
            r1.delete();
        }
    }
}
