TikTok.apk(点击下载) / PreviewShareWidget.java


package com.bytedance.android.livesdk.broadcast.preview.widget.share;

import X.AbstractC31784Ce5;
import X.AbstractC32851Rq;
import X.AbstractC33376D8z;
import X.ActivityC31021Kp;
import X.AnonymousClass0CA;
import X.AnonymousClass0CH;
import X.C21090sc;
import X.C30118BsJ;
import X.C30146Bsl;
import X.C30356Bw9;
import X.C30388Bwf;
import X.C30480By9;
import X.C30551BzI;
import X.C30699C4a;
import X.C31425CVy;
import X.C31482CYd;
import X.C32548CqP;
import X.C4N;
import X.C4O;
import X.CSZ;
import android.view.View;
import com.bytedance.android.live.base.model.user.User;
import com.bytedance.android.livesdk.broadcast.preview.base.PreviewToolBaseWidget;
import com.bytedance.covode.number.Covode;
import com.zhiliaoapp.musically.R;
import java.util.HashMap;
import kotlin.g.b.m;

public final class PreviewShareWidget extends PreviewToolBaseWidget implements AbstractC32851Rq {
    public final int LIZIZ = R.string.ibn;
    public final int LIZJ = R.drawable.c64;
    public final User LIZLLL;

    static {
        Covode.recordClassIndex(9596);
    }

    public PreviewShareWidget(User user) {
        this.LIZLLL = user;
    }

    @Override // com.bytedance.android.livesdk.broadcast.preview.base.PreviewToolBaseWidget
    public final int LIZ() {
        return this.LIZIZ;
    }

    @Override // com.bytedance.android.livesdk.broadcast.preview.base.PreviewToolBaseWidget
    public final void LIZ(View view) {
        C21090sc.LIZ(view);
        AbstractC31784Ce5 LIZIZ2 = C30146Bsl.LIZ().LIZIZ();
        m.LIZIZ(LIZIZ2, "");
        AbstractC33376D8z LIZ = LIZIZ2.LIZ();
        User user = LIZ instanceof User ? (User) LIZ : this.LIZLLL;
        if (user != null && this.context != null) {
            if (user.getSecret() == 1) {
                C30118BsJ.LJJI().report(C31482CYd.LIZ(this.context), new C30480By9(0, user.getId(), user.getId(), user.getSecUid(), "start_broadcast", C30356Bw9.LIZ.LIZ(), C30356Bw9.LIZ.LIZLLL(), C30356Bw9.LIZ.LJ(), "report_anchor", C30356Bw9.LIZ.LJIIJ(), new C30388Bwf(this.dataChannel, "user_live_duration")));
            } else if (C4O.LIZ != null) {
                HashMap hashMap = new HashMap();
                StringBuilder sb = new StringBuilder("www.tiktok.com/@" + C32548CqP.LIZIZ(LIZIZ2.LIZIZ()) + "/live?prepare=1&source=" + (C30118BsJ.LJFF().isInMusicallyRegion() ? "h5_m" : "h5_t") + "&_r=1");
                C31425CVy.LIZLLL.LIZ("anchor_share_click").LIZ(this.dataChannel).LIZ("request_page", "live_take").LIZ("anchor_id", String.valueOf(LIZIZ2.LIZJ())).LIZJ();
                CSZ csz = new CSZ(C30699C4a.LIZ.LIZ(), (byte) 0);
                csz.LIZIZ = -1;
                C4N c4n = C4O.LIZ;
                ActivityC31021Kp LIZ2 = C31482CYd.LIZ(this.context);
                csz.LIZLLL = LIZIZ2.LIZJ();
                csz.LJIILLIIL = true;
                csz.LJIIJJI = sb.toString();
                csz.LJJII = hashMap;
                c4n.LIZ(LIZ2, csz.LIZ(), new C30551BzI(this, LIZIZ2));
            }
        }
    }

    @Override // com.bytedance.android.livesdk.broadcast.preview.base.PreviewToolBaseWidget
    public final int LIZIZ() {
        return this.LIZJ;
    }

    @Override // com.bytedance.ies.sdk.widgets.LiveWidget, X.AbstractC264012v, com.bytedance.android.widget.Widget, com.bytedance.android.livesdk.broadcast.preview.base.PreviewToolBaseWidget
    public final void onStateChanged(AnonymousClass0CH r1, AnonymousClass0CA r2) {
        super.onStateChanged(r1, r2);
    }

    @Override // com.bytedance.android.widget.Widget
    public final void show() {
        User user = this.LIZLLL;
        if (user != null && user.getSecret() != 1) {
            super.show();
        }
    }
}