package defpackage;

import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.text.TextUtils;
import ar.tvplayer.tv.R;
import java.util.Locale;

/* JADX INFO: renamed from: ʽʒ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC0047 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static Locale f1205;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static final C4053 f1206 = new C4053(0);

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static String m1030(Context context, int i) {
        Resources resources = context.getResources();
        String strM1033 = m1033(context);
        if (i == 1) {
            return resources.getString(R.string.h, strM1033);
        }
        if (i == 2) {
            return ᵘᵞʿⁱ.ᵶˇᵱ(context) ? resources.getString(R.string.h) : resources.getString(R.string.h, strM1033);
        }
        if (i == 3) {
            return resources.getString(R.string.h, strM1033);
        }
        if (i == 5) {
            return m1034(context, "common_google_play_services_invalid_account_text", strM1033);
        }
        if (i == 7) {
            return m1034(context, "common_google_play_services_network_error_text", strM1033);
        }
        if (i == 9) {
            return resources.getString(R.string.h, strM1033);
        }
        if (i == 20) {
            return m1034(context, "common_google_play_services_restricted_profile_text", strM1033);
        }
        switch (i) {
            case 16:
                return m1034(context, "common_google_play_services_api_unavailable_text", strM1033);
            case 17:
                return m1034(context, "common_google_play_services_sign_in_failed_text", strM1033);
            case 18:
                return resources.getString(R.string.h, strM1033);
            default:
                return resources.getString(R.string.h, strM1033);
        }
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public static String m1031(Context context, int i) {
        Resources resources = context.getResources();
        if (i == 1) {
            return resources.getString(R.string.h);
        }
        if (i == 2) {
            return resources.getString(R.string.h);
        }
        if (i == 3) {
            return resources.getString(R.string.h);
        }
        if (i == 5) {
            return m1032(context, "common_google_play_services_invalid_account_title");
        }
        if (i == 7) {
            return m1032(context, "common_google_play_services_network_error_title");
        }
        if (i == 17) {
            return m1032(context, "common_google_play_services_sign_in_failed_title");
        }
        if (i != 20) {
            return null;
        }
        return m1032(context, "common_google_play_services_restricted_profile_title");
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public static String m1032(Context context, String str) {
        Resources resourcesForApplication;
        C4053 c4053 = f1206;
        synchronized (c4053) {
            try {
                Configuration configuration = context.getResources().getConfiguration();
                Locale locale = (Build.VERSION.SDK_INT >= 24 ? new C2343(new C3535(AbstractC3619.m8169(configuration))) : C2343.m6022(configuration.locale)).f9204.get(0);
                if (!locale.equals(f1205)) {
                    c4053.clear();
                    f1205 = locale;
                }
                String str2 = (String) c4053.get(str);
                if (str2 != null) {
                    return str2;
                }
                int i = AbstractC3932.f15022;
                try {
                    resourcesForApplication = context.getPackageManager().getResourcesForApplication("com.google.android.gms");
                } catch (PackageManager.NameNotFoundException unused) {
                    resourcesForApplication = null;
                }
                if (resourcesForApplication != null) {
                    int identifier = resourcesForApplication.getIdentifier(str, "string", "com.google.android.gms");
                    if (identifier != 0) {
                        String string = resourcesForApplication.getString(identifier);
                        if (!TextUtils.isEmpty(string)) {
                            f1206.put(str, string);
                            return string;
                        }
                    }
                }
                return null;
            } finally {
            }
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static String m1033(Context context) {
        String packageName = context.getPackageName();
        try {
            Context context2 = C1593.m4436(context).f16324;
            return context2.getPackageManager().getApplicationLabel(context2.getPackageManager().getApplicationInfo(packageName, 0)).toString();
        } catch (PackageManager.NameNotFoundException | NullPointerException unused) {
            String str = context.getApplicationInfo().name;
            return TextUtils.isEmpty(str) ? packageName : str;
        }
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public static String m1034(Context context, String str, String str2) {
        Resources resources = context.getResources();
        String strM1032 = m1032(context, str);
        if (strM1032 == null) {
            strM1032 = resources.getString(R.string.h);
        }
        return String.format(resources.getConfiguration().locale, strM1032, str2);
    }
}
