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

import X.0CB;
import X.0CH;
import X.2lP;
import X.4UQ;
import X.6Is;
import X.7uw;
import X.7vT;
import X.C0737KFk;
import X.C0738KFl;
import X.C0739KFm;
import X.C0740KFn;
import X.C2243Kpe;
import X.KRX;
import X.KT7;
import X.L1E;
import X.L1H;
import X.L1I;
import X.M12;
import X.QoR;
import android.view.View;
import android.webkit.WebView;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.bullet.bridge.BaseBridgeMethod;
import kotlin.h.b.n;
import org.json.JSONObject;

public final class GetAbTestMethod extends BaseBridgeMethod implements 6Is {
    public final String LIZIZ = "getABTestParams";

    static {
        Covode.recordClassIndex(55004);
    }

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

    public final String LIZLLL() {
        return this.LIZIZ;
    }

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

    public final void LIZ(JSONObject jSONObject, 4UQ r12) {
        M12.LIZ((Object) jSONObject, (Object) r12);
        if (jSONObject.optJSONArray("ab_test_names") == null) {
            View view = (View) this.LIZ.LIZJ(View.class);
            if (view == null && (view = (View) this.LIZ.LIZJ(WebView.class)) == null) {
                view = (View) this.LIZ.LIZJ(QoR.class);
            }
            if (view instanceof QoR) {
                L1E l1e = L1E.LJIIIZ;
                QoR qoR = (QoR) view;
                L1H l1h = new L1H(this.LIZIZ);
                l1h.LIZIZ = this.LIZIZ;
                l1h.LIZ = qoR.getTemplateUrl();
                l1h.LIZJ = new JSONObject().put("from", "bullet").put("url", qoR.getTemplateUrl()).put("business", 2lP.LIZ.LIZIZ(qoR.getTemplateUrl())).put("container", "lynx");
                l1h.LIZ(0);
                L1I LIZ = l1h.LIZ();
                n.LIZIZ(LIZ, "");
                l1e.LIZ(qoR, LIZ);
            } else if (view instanceof WebView) {
                KRX krx = C2243Kpe.LIZ;
                WebView webView = (WebView) view;
                L1H l1h2 = new L1H(this.LIZIZ);
                l1h2.LIZIZ = this.LIZIZ;
                l1h2.LIZ = webView.getUrl();
                l1h2.LIZJ = new JSONObject().put("from", "bullet").put("url", webView.getUrl()).put("business", 2lP.LIZ.LIZIZ(webView.getUrl())).put("container", "web");
                l1h2.LIZ(0);
                krx.LIZ(webView, l1h2.LIZ());
            }
        }
        if (7uw.LIZ.LIZ()) {
            7uw.LIZ.LIZ(jSONObject, new C0737KFk(r12), new C0740KFn(r12, jSONObject));
        } else {
            7vT.LIZ.LIZ(jSONObject, new C0738KFl(r12), new C0739KFm(r12));
        }
    }
}
