package p037.p065.p070;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Handler;
import android.util.Log;
import p037.p057.C1722;
import p037.p065.p068.p069.AbstractC1858;
import p037.p065.p068.p069.C1854;
import p037.p065.p068.p069.C1856;
import p037.p065.p068.p069.InterfaceC1853;
import p037.p065.p075.C1884;

/* JADX INFO: renamed from: މ.ރ.ބ.ށ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@SuppressLint({"NewApi"})
public class C1865 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static final C1871 f6258;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static final C1722<String, Typeface> f6259;

    /* JADX WARN: Removed duplicated region for block: B:22:0x0046  */
    static {
        int i = Build.VERSION.SDK_INT;
        if (i >= 29) {
            f6258 = new C1870();
        } else if (i >= 28) {
            f6258 = new C1869();
        } else if (i >= 26) {
            f6258 = new C1868();
        } else if (i < 24) {
            f6258 = new C1866();
        } else {
            if (C1867.f6267 == null) {
                Log.w("TypefaceCompatApi24Impl", "Unable to collect necessary private methods.Fallback to legacy implementation.");
            }
            if (C1867.f6267 != null) {
                f6258 = new C1867();
            }
        }
        f6259 = new C1722<>(16);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static Typeface m3671(Context context, Resources resources, int i, String str, int i2) {
        Typeface typefaceMo3682 = f6258.mo3682(context, resources, i, str, i2);
        if (typefaceMo3682 != null) {
            f6259.m3372(m3674(resources, i, i2), typefaceMo3682);
        }
        return typefaceMo3682;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static Typeface m3672(Context context, Typeface typeface, int i) {
        if (context != null) {
            return Typeface.create(typeface, i);
        }
        throw new IllegalArgumentException("Context cannot be null");
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static Typeface m3673(Context context, InterfaceC1853 interfaceC1853, Resources resources, int i, int i2, AbstractC1858 abstractC1858, Handler handler, boolean z) {
        Typeface typefaceMo3678;
        if (interfaceC1853 instanceof C1856) {
            C1856 c1856 = (C1856) interfaceC1853;
            boolean z2 = false;
            if (!z ? abstractC1858 == null : c1856.f6241 == 0) {
                z2 = true;
            }
            typefaceMo3678 = C1884.m3704(context, c1856.f6239, abstractC1858, handler, z2, z ? c1856.f6240 : -1, i2);
        } else {
            typefaceMo3678 = f6258.mo3678(context, (C1854) interfaceC1853, resources, i2);
            if (abstractC1858 != null) {
                if (typefaceMo3678 != null) {
                    abstractC1858.m3663(typefaceMo3678, handler);
                } else {
                    abstractC1858.m3662(-3, handler);
                }
            }
        }
        if (typefaceMo3678 != null) {
            f6259.m3372(m3674(resources, i, i2), typefaceMo3678);
        }
        return typefaceMo3678;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static String m3674(Resources resources, int i, int i2) {
        return resources.getResourcePackageName(i) + "-" + i + "-" + i2;
    }
}
