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

import X.0CB;
import X.0CH;
import X.0Gf;
import X.0Gp;
import X.36a;
import X.3g1;
import X.46i;
import X.4UQ;
import X.6Is;
import X.C6355HyG;
import X.C6358HyJ;
import X.C6360HyL;
import X.DhS;
import X.KT7;
import X.M12;
import android.app.Activity;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.api.AnchorAutoSelectionService;
import com.ss.android.ugc.aweme.bullet.bridge.BaseBridgeMethod;
import kotlin.h.b.n;
import org.json.JSONException;
import org.json.JSONObject;

public final class ShareOpenPlatformMethod extends BaseBridgeMethod implements 6Is {
    public static final C6360HyL LJ = new C6360HyL((byte) 0);
    public String LIZIZ;
    public String LIZJ;
    public String LIZLLL;

    static {
        Covode.recordClassIndex(55061);
    }

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

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

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

    public final void LIZIZ(JSONObject jSONObject) {
        int i = jSONObject.getInt("action_type");
        String string = jSONObject.getString("anchor_source_type");
        String string2 = jSONObject.getString("extra");
        if (i == 1 && 36a.LIZ(string)) {
            0Gp LIZ = AnchorAutoSelectionService.LIZ.LIZ(this.LIZLLL, string2, string, 4, (String) null);
            LIZ.LIZ(new C6355HyG(this, LIZ, string2), 0Gp.LIZIZ, (0Gf) null);
        }
    }

    public final void LIZ(JSONObject jSONObject, 4UQ r4) {
        M12.LIZ(jSONObject, r4);
        try {
            this.LIZLLL = jSONObject.getString("client_key");
        } catch (JSONException unused) {
        }
        try {
            this.LIZIZ = jSONObject.getString("enter_from");
            this.LIZJ = jSONObject.getString("enter_method");
        } catch (JSONException unused2) {
        }
        IAccountUserService LJFF = 46i.LJFF();
        n.LIZIZ(LJFF, "");
        if (!LJFF.isLogin()) {
            Activity LIZ = DhS.LIZ.LIZ(LJ());
            if (LIZ != null) {
                3g1 r1 = new 3g1();
                r1.LIZ = LIZ;
                r1.LIZIZ = this.LIZIZ;
                r1.LIZJ = this.LIZJ;
                r1.LJ = new C6358HyJ(this, jSONObject);
                46i.LIZIZ().showLoginAndRegisterView(r1.LIZ());
                return;
            }
            return;
        }
        LIZIZ(jSONObject);
    }
}
