package com.google.android.gms.internal.ads;

import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public final class b40 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final boolean f9382a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f9383b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f9384c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final int f9385d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final int f9386e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final int f9387f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final int f9388g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final int f9389h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final boolean f9390i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final boolean f9391j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final boolean f9392k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final boolean f9393l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final long f9394m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final long f9395n;

    public b40(String str) {
        long jLongValue;
        long jLongValue2;
        JSONObject jSONObject = null;
        if (str != null) {
            try {
                jSONObject = new JSONObject(str);
            } catch (JSONException unused) {
            }
        }
        this.f9382a = a(jSONObject, "aggressive_media_codec_release", ao.f8911j0);
        this.f9383b = b(jSONObject, "byte_buffer_precache_limit", ao.f8959m);
        this.f9384c = b(jSONObject, "exo_cache_buffer_size", ao.f9126w);
        this.f9385d = b(jSONObject, "exo_connect_timeout_millis", ao.f8894i);
        tn tnVar = ao.f8878h;
        if (jSONObject != null) {
            try {
                jSONObject.getString("exo_player_version");
            } catch (JSONException unused2) {
            }
        }
        this.f9386e = b(jSONObject, "exo_read_timeout_millis", ao.f8910j);
        this.f9387f = b(jSONObject, "load_check_interval_bytes", ao.f8926k);
        this.f9388g = b(jSONObject, "player_precache_limit", ao.f8942l);
        this.f9389h = b(jSONObject, "socket_receive_buffer_size", ao.f8976n);
        this.f9390i = a(jSONObject, "use_cache_data_source", ao.Z4);
        b(jSONObject, "min_retry_count", ao.f8993o);
        this.f9391j = a(jSONObject, "treat_load_exception_as_non_fatal", ao.f9027q);
        this.f9392k = a(jSONObject, "enable_multiple_video_playback", ao.f8996o2);
        this.f9393l = a(jSONObject, "use_range_http_data_source", ao.f9030q2);
        tn tnVar2 = ao.f9047r2;
        if (jSONObject != null) {
            try {
                jLongValue = jSONObject.getLong("range_http_data_source_high_water_mark");
            } catch (JSONException unused3) {
                jLongValue = ((Long) n7.y.f31093e.f31096c.b(tnVar2)).longValue();
            }
        } else {
            jLongValue = ((Long) n7.y.f31093e.f31096c.b(tnVar2)).longValue();
        }
        this.f9394m = jLongValue;
        tn tnVar3 = ao.f9063s2;
        if (jSONObject != null) {
            try {
                jLongValue2 = jSONObject.getLong("range_http_data_source_low_water_mark");
            } catch (JSONException unused4) {
                jLongValue2 = ((Long) n7.y.f31093e.f31096c.b(tnVar3)).longValue();
            }
        } else {
            jLongValue2 = ((Long) n7.y.f31093e.f31096c.b(tnVar3)).longValue();
        }
        this.f9395n = jLongValue2;
    }

    public static final boolean a(JSONObject jSONObject, String str, tn tnVar) {
        boolean zBooleanValue = ((Boolean) n7.y.f31093e.f31096c.b(tnVar)).booleanValue();
        if (jSONObject == null) {
            return zBooleanValue;
        }
        try {
            return jSONObject.getBoolean(str);
        } catch (JSONException unused) {
            return zBooleanValue;
        }
    }

    public static final int b(JSONObject jSONObject, String str, tn tnVar) {
        if (jSONObject != null) {
            try {
                return jSONObject.getInt(str);
            } catch (JSONException unused) {
            }
        }
        return ((Integer) n7.y.f31093e.f31096c.b(tnVar)).intValue();
    }
}
