package com.bytedance.sdk.openadsdk.core.settings;

import android.text.TextUtils;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class NjR {
    public static final NjR YFl = new NjR("");
    private final HashMap<String, YFl> Sg = new HashMap<>();

    public NjR(String str) {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        try {
            JSONArray jSONArray = new JSONArray(str);
            for (int i = 0; i < jSONArray.length(); i++) {
                JSONObject optJSONObject = jSONArray.optJSONObject(i);
                if (optJSONObject != null) {
                    YFl yFl = new YFl(optJSONObject);
                    this.Sg.put(yFl.YFl, yFl);
                }
            }
        } catch (JSONException e) {
            com.bytedance.sdk.component.utils.YoT.YFl("MediationInitConfigs", e.getMessage());
        }
    }

    /* loaded from: classes2.dex */
    public static class YFl {
        public int AlY;
        public String Sg;
        public final String YFl;
        public int tN;
        public String wN;

        public YFl(JSONObject jSONObject) {
            this.YFl = jSONObject.optString("name");
            this.Sg = jSONObject.optString("app_id");
            this.tN = jSONObject.optInt("init_thread", 2);
            this.AlY = jSONObject.optInt("request_after_init", 2);
            this.wN = jSONObject.optString("class_name");
        }
    }
}
