package com.ss.android.ugc.aweme.bullet.bridge.framework;

import X.0CB;
import X.0CH;
import X.4UQ;
import X.6Is;
import X.C3657Jcm;
import X.KT7;
import X.M12;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import java.lang.ref.WeakReference;
import kotlin.h.b.n;
import org.json.JSONObject;

public final class RecordParamMethod extends OpenMethod implements 6Is {
    public static final C3657Jcm LIZIZ = new C3657Jcm((byte) 0);

    static {
        Covode.recordClassIndex(55122);
    }

    public final String LIZLLL() {
        return "openRecord";
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        super.onStateChanged(r1, r2);
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public RecordParamMethod(KT7 kt7) {
        super(kt7);
        M12.LIZ(kt7);
    }

    public final void LIZ(JSONObject jSONObject, 4UQ r10) {
        M12.LIZ(jSONObject, r10);
        String string = jSONObject.getString("type");
        n.LIZIZ(string, "");
        if (TextUtils.equals("goods_order_share", string)) {
            new WeakReference(LJ());
            return;
        }
        new JSONObject();
        jSONObject.put("type", "openRecord");
        if (jSONObject.has("args")) {
            JSONObject jSONObject2 = jSONObject.getJSONObject("args");
            n.LIZIZ(jSONObject2, "");
            jSONObject2.put("recordOrigin", "jsBridge");
            if (n.LIZ("challenge", string)) {
                jSONObject2.put("id", jSONObject2.get("challenge_id"));
                jSONObject2.put("recordParam", "challenge");
            } else if (n.LIZ("music", string)) {
                jSONObject2.put("id", jSONObject2.get("music_id"));
                jSONObject2.put("recordParam", "music");
            } else if (n.LIZ("effect", string)) {
                if (jSONObject2.has("effect_id")) {
                    jSONObject2.put("id", jSONObject2.get("effect_id"));
                }
                jSONObject2.put("recordParam", "sticker");
                if (jSONObject2.has("effect_meta_info")) {
                    jSONObject2.put("effect_meta_info", jSONObject2.getJSONObject("effect_meta_info").toString());
                }
                if (jSONObject2.has("effect_image")) {
                    jSONObject2.put("effect_image", jSONObject2.getJSONObject("effect_image").toString());
                }
            } else if (n.LIZ("donation", string)) {
                jSONObject2.put("id", jSONObject2.get("charity_id"));
                jSONObject2.put("recordParam", "donation");
            } else if (n.LIZ("star_atlas", string)) {
                jSONObject2.put("id", jSONObject2.get("star_atlas_id"));
                jSONObject2.put("recordParam", "star_atlas");
                jSONObject2.put("star_atlas_object", jSONObject.getJSONObject("args").toString());
            } else if (n.LIZ("tcm", string)) {
                jSONObject2.put("recordParam", "tcm");
                jSONObject2.put("star_atlas_object", jSONObject.getJSONObject("args").toString());
            }
            jSONObject2.put("group", "1");
        }
        LIZIZ(jSONObject);
    }
}
