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

import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class GA {
    private final int AlY;
    private final int Sg;
    private final int YFl;
    private final int tN;

    public boolean AlY() {
        return this.AlY == 1;
    }

    public int Sg() {
        int i = this.Sg;
        if (i < 0 || i > 100) {
            return 0;
        }
        return i;
    }

    public int YFl() {
        return this.YFl;
    }

    public int tN() {
        int i = this.tN;
        if (i < 0 || i > 100) {
            return 0;
        }
        return i;
    }

    public GA(JSONObject jSONObject) {
        this.YFl = jSONObject.optInt("auto_click", 0);
        this.Sg = jSONObject.optInt("close_jump_probability", 0);
        this.tN = jSONObject.optInt("skip_jump_probability", 0);
        this.AlY = jSONObject.optInt("hidden_bar", 0);
    }

    public JSONObject wN() {
        try {
            JSONObject jSONObject = new JSONObject();
            int i = this.YFl;
            if (i == 1) {
                jSONObject.put("auto_click", i);
            }
            int i2 = this.Sg;
            if (i2 > 0 && i2 <= 100) {
                jSONObject.put("close_jump_probability", i2);
            }
            int i3 = this.tN;
            if (i3 > 0 && i3 <= 100) {
                jSONObject.put("skip_jump_probability", i3);
            }
            if (this.AlY == 1) {
                jSONObject.put("hidden_bar", 1);
            }
            return jSONObject;
        } catch (JSONException unused) {
            return null;
        }
    }

    public static boolean YFl(Wwa wwa) {
        if (wwa == null || !wwa.yn() || wwa.EAq() == null) {
            return false;
        }
        return wwa.EAq().AlY();
    }
}
