package com.ss.android.ugc.aweme.discover.ui;

import X.0CB;
import X.0CH;
import X.2lP;
import X.6Is;
import X.7uw;
import X.7vT;
import X.C0741KFo;
import X.C0742KFp;
import X.C0743KFq;
import X.C0744KFr;
import X.C0865KKi;
import X.C2243Kpe;
import X.FIu;
import X.KRX;
import X.L1H;
import X.M12;
import android.webkit.WebView;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.fe.base.BaseCommonJavaMethod;
import java.lang.ref.WeakReference;
import kotlin.h.b.n;
import org.json.JSONObject;

public final class GetABTest extends BaseCommonJavaMethod implements 6Is {
    public WeakReference<WebView> LIZ;

    static {
        Covode.recordClassIndex(65469);
    }

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

    public GetABTest() {
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public GetABTest(WebView webView, C0865KKi kKi) {
        super(kKi);
        M12.LIZ((Object) kKi);
        this.LIZ = new WeakReference<>(webView);
    }

    public final void handle(JSONObject jSONObject, FIu fIu) {
        WeakReference<WebView> weakReference;
        WebView webView;
        if (!((jSONObject != null && jSONObject.optJSONArray("ab_test_names") != null) || (weakReference = this.LIZ) == null || (webView = (WebView) weakReference.get()) == null)) {
            KRX krx = C2243Kpe.LIZ;
            L1H l1h = new L1H("getABTestParams");
            l1h.LIZIZ = "getABTestParams";
            JSONObject put = new JSONObject().put("from", "crossPlatform");
            n.LIZIZ(webView, "");
            l1h.LIZJ = put.put("url", webView.getUrl()).put("business", 2lP.LIZ.LIZIZ(webView.getUrl())).put("container", "web");
            l1h.LIZ = webView.getUrl();
            l1h.LIZ(0);
            krx.LIZ(webView, l1h.LIZ());
        }
        if (7uw.LIZ.LIZ()) {
            7uw.LIZ.LIZ(jSONObject, new C0743KFq(fIu), new C0741KFo(fIu, jSONObject));
        } else {
            7vT.LIZ.LIZ(jSONObject, new C0744KFr(fIu), new C0742KFp(fIu));
        }
    }
}
