package com.bytedance.sdk.component.utils;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Configuration;
import java.util.Locale;

/* JADX INFO: loaded from: classes.dex */
public class duv {

    @SuppressLint({"StaticFieldLeak"})
    private static Context fm;

    public static void fm(Context context, String str, String str2) {
        if (str == null) {
            str = "";
        }
        if (str2 == null) {
            str2 = "";
        }
        try {
            fm = context.createConfigurationContext(ro(context, str, str2));
        } catch (Throwable th) {
            th.getMessage();
        }
        maa.fm(fm);
    }

    private static Configuration ro(Context context, String str, String str2) {
        Configuration configuration = new Configuration(context.getResources().getConfiguration());
        configuration.setLocale(new Locale(str, str2));
        return configuration;
    }
}
