package com.ss.android.ugc.aweme.bullet.business;

import X.C2140Knz;
import X.C2142Ko1;
import X.KDB;
import X.M12;
import X.TSt;
import android.webkit.WebView;
import com.bytedance.covode.number.Covode;
import org.json.JSONObject;

public final class PreRenderWebViewBusiness extends BulletBusinessService$Business {
    public static final C2142Ko1 LIZ = new C2142Ko1((byte) 0);
    public int LIZIZ;
    public String LIZJ;

    static {
        Covode.recordClassIndex(55181);
    }

    public final void LIZ() {
        this.LIZIZ = 0;
        this.LJIIJ.LIZ("webViewDidHide", (JSONObject) null);
    }

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

    public final void LIZ(String str) {
        this.LIZIZ = 2;
        C2140Knz knz = this.LJIIJ;
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("clickFrom", str);
        } catch (Exception e) {
            TSt.LIZ(e);
        }
        knz.LIZ("webViewDidShow", jSONObject);
        this.LIZJ = str;
    }

    public final void LIZ(KDB kdb) {
        if (kdb != null && kdb.LIZIZ != null) {
            int i = kdb.LIZ;
            WebView webView = this.LJIIJ.LIZLLL;
            if (webView != null && i == webView.hashCode()) {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("appearanceState", this.LIZIZ);
                jSONObject.put("code", 1);
                jSONObject.put("preloadType", 1);
                jSONObject.put("clickFrom", this.LIZJ);
                kdb.LIZIZ.LIZ(jSONObject);
            }
        }
    }
}
