package X; import android.os.Bundle; import android.text.TextUtils; import com.bytedance.android.live.base.model.user.User; import com.bytedance.android.live.share.IShareService; import com.bytedance.android.livesdk.model.Hashtag; import com.bytedance.android.livesdk.model.UserAttr; import com.bytedance.android.livesdkapi.depend.model.live.Room; import com.bytedance.android.livesdkapi.host.IHostApp; import com.bytedance.android.livesdkapi.host.IHostShare; import com.bytedance.covode.number.Covode; import com.bytedance.ies.sdk.datachannel.DataChannel; import com.ss.android.ugc.effectmanager.common.utils.MD5Utils; import java.util.Collections; import java.util.HashMap; import java.util.Map; import kotlin.g.b.m; public final class C4M { public static final C4M LIZ = new C4M(); static { Covode.recordClassIndex(7906); } public static final CSZ LIZ(Room room, DataChannel dataChannel, String str, String str2, Map<String, String> map) { UserAttr userAttr; C21090sc.LIZ(room, dataChannel, str2); AbstractC31784Ce5 LIZIZ = C30146Bsl.LIZ().LIZIZ(); CSZ LIZ2 = C31323CSa.LIZ(room); if (!TextUtils.isEmpty(str)) { LIZ2.LJIIJJI = str; } m.LIZIZ(LIZIZ, ""); LIZ2.LIZLLL = LIZIZ.LIZJ(); LIZ2.LJIJJLI = room.getId(); LIZ2.LJIL = room.getOwnerUserId(); LIZ2.LJIJI = C30356Bw9.LIZ.LJIIJ(); LIZ2.LJJIIZ = C30356Bw9.LIZ.LIZ(); LIZ2.LJJIIZI = C30356Bw9.LIZ.LIZLLL(); LIZ2.LJJIJ = str2; User user = (User) dataChannel.LIZIZ(C30545BzC.class); boolean z = (user == null || (userAttr = user.getUserAttr()) == null || !userAttr.LIZIZ) ? false : true; boolean LIZ3 = m.LIZ(dataChannel.LIZIZ(C30024Bqn.class), (Object) true); LIZ2.LJIILIIL = LIZ3 ? room.getAnchorShareText() : room.getUserShareText(); LIZ2.LJIILLIIL = LIZ3; LIZ2.LJIIZILJ = z; LIZ2.LJIJ = EnumC31314CRr.SHARE.isRedDotShowing(dataChannel); LIZ2.LJJII = map; LIZ2.LJIJJ = (String) dataChannel.LIZIZ(C35054Dpj.class); m.LIZIZ(LIZ2, ""); return LIZ2; } private final String LIZ(Bundle bundle) { String string = bundle != null ? bundle.getString(((IHostShare) C524124w.LIZ(IHostShare.class)).getBundleKey(3)) : null; return TextUtils.equals(string, "top_supporters") ? "top_supporters" : TextUtils.equals(string, "recently_shared") ? "recently_shared" : "none"; } public static final String LIZ(User user) { if (user == null) { return ""; } AbstractC524424z LIZ2 = C524124w.LIZ(IHostApp.class); m.LIZIZ(LIZ2, ""); return "www.tiktok.com/@" + C32548CqP.LIZIZ(user) + "/live?source=" + (((IHostApp) LIZ2).isInMusicallyRegion() ? "h5_m" : "h5_t") + "&_r=1"; } public static final void LIZ(Room room, DataChannel dataChannel, AnonymousClass0CH r9, String str, String str2, Bundle bundle) { String string; C21090sc.LIZ(room, dataChannel, r9, str); String str3 = ""; if (!(bundle == null || (string = bundle.getString("shareIdList", str3)) == null)) { str3 = string; } ((AnonymousClass7Z6) ((IShareService) C524124w.LIZ(IShareService.class)).sendShare(room.getId(), str, 1, str2, str3).LIZ(C186417Ug.LIZ(r9))).LIZ(new C4F(room, dataChannel), C30726C5b.LIZ); } public static final void LIZ(Room room, DataChannel dataChannel, String str) { C21090sc.LIZ(room, dataChannel, str); if (C29646Bkh.LIZ(dataChannel) && room.author() != null && !TextUtils.equals(str, "chat_merge")) { HashMap hashMap = new HashMap(); AbstractC33376D8z author = room.author(); m.LIZIZ(author, ""); hashMap.put("anchor_id", String.valueOf(author.getId())); hashMap.put("room_id", String.valueOf(room.getId())); C29646Bkh.LIZIZ.LIZ("live_ad", "live_share", null, hashMap); } } public static final void LIZ(Room room, DataChannel dataChannel, String str, String str2, Bundle bundle, String str3, Map<String, String> map, C31323CSa cSa) { String str4; String str5; Long l; C21090sc.LIZ(room, dataChannel, str, str2, str3, cSa); String mD5String = MD5Utils.getMD5String("share_success" + System.currentTimeMillis()); String string = bundle != null ? bundle.getString("shareIdList", "") : ""; int i2 = bundle != null ? bundle.getInt(((IHostShare) C524124w.LIZ(IHostShare.class)).getBundleKey(2)) : 0; int i3 = bundle != null ? bundle.getInt(((IHostShare) C524124w.LIZ(IHostShare.class)).getBundleKey(1)) : 0; boolean LIZ2 = m.LIZ(dataChannel.LIZIZ(C30024Bqn.class), (Object) true); String str6 = "portrait"; String str7 = "anchor"; String str8 = "room_orientation"; if (LIZ2) { Hashtag hashtag = (Hashtag) dataChannel.LIZIZ(C30507Bya.class); if (hashtag == null || (str4 = hashtag.title) == null) { str4 = ""; } Hashtag hashtag2 = (Hashtag) dataChannel.LIZIZ(C30507Bya.class); if (hashtag2 == null || (l = hashtag2.id) == null || (str5 = String.valueOf(l.longValue())) == null) { str5 = ""; } HashMap hashMap = new HashMap(); String LIZ3 = LIZ.LIZ(bundle); if (m.LIZ((Object) LIZ3, (Object) "top_supporters")) { hashMap.put("top_supporters_cnt", String.valueOf(Collections.unmodifiableList(cSa.LJJIL).size())); } if (m.LIZ((Object) LIZ3, (Object) "recently_shared")) { hashMap.put("recently_shared_cnt", String.valueOf(Collections.unmodifiableList(cSa.LJJIZ).size())); } C31425CVy LIZ4 = C31425CVy.LIZLLL.LIZ("share").LIZ(dataChannel).LIZ(new C30388Bwf(dataChannel, "user_live_share")).LIZ("request_page", str3).LIZ("is_create_group_chat", i2).LIZ("friends_shared_cnt", i3).LIZ("batch_share_type", LIZ3); EnumC30833C9e streamType = room.getStreamType(); m.LIZIZ(streamType, ""); C31425CVy LIZ5 = LIZ4.LIZ("live_type", C30529Byw.LIZ(streamType)).LIZ("share_platform", str).LIZ("user_type", str7).LIZ("bind_id", mD5String); if (!C33241D3u.LJFF()) { str6 = "landscape"; } C31425CVy LIZ6 = LIZ5.LIZ(str8, str6).LIZ("hashtag_type", str4).LIZ("hash_id", str5).LIZ("initiator", str7); Integer num = (Integer) dataChannel.LIZIZ(C30109BsA.class); LIZ6.LIZ("share_num", num != null ? num.intValue() : 0).LIZ((Map<String, String>) hashMap).LIZJ(); } else { HashMap hashMap2 = new HashMap(); hashMap2.put("share_platform", str); hashMap2.put("share_type", str2); if (!LIZ2) { str7 = "user"; } hashMap2.put("user_type", str7); hashMap2.put("request_page", str3); m.LIZIZ(mD5String, ""); hashMap2.put("bind_id", mD5String); C30258BuZ LIZ7 = C30258BuZ.LIZ(); m.LIZIZ(LIZ7, ""); if (!AnonymousClass0NL.LIZ(LIZ7.LJ())) { C30258BuZ LIZ8 = C30258BuZ.LIZ(); m.LIZIZ(LIZ8, ""); String LJ = LIZ8.LJ(); m.LIZIZ(LJ, ""); hashMap2.put("enter_live_method", LJ); } if (TextUtils.equals(C30356Bw9.LIZ.LJI(), "click_push_live_cd_user")) { hashMap2.put("is_subscribe", "1"); } else { hashMap2.put("is_subscribe", "0"); } if (C33241D3u.LJFF()) { str8 = str8; hashMap2.put(str8, str6); } else { hashMap2.put(str8, "landscape"); } if (!m.LIZ(dataChannel.LIZIZ(C35014Dp5.class), (Object) true)) { str6 = "landscape"; } C31425CVy LIZ9 = C31425CVy.LIZLLL.LIZ("livesdk_share").LIZ(dataChannel).LIZ(new C30388Bwf(dataChannel, "user_live_share")).LIZ("is_create_group_chat", i2).LIZ("friends_shared_cnt", i3).LIZ("batch_share_type", LIZ.LIZ(bundle)).LIZ(str8, str6).LIZ(map).LIZ((Map<String, String>) hashMap2); Integer num2 = (Integer) dataChannel.LIZIZ(C30109BsA.class); LIZ9.LIZ("share_num", num2 != null ? num2.intValue() : 0).LIZJ(); } C31425CVy.LIZLLL.LIZ("share_info").LIZ("bind_id", mD5String).LIZ("to_user_id", string).LIZJ(); C3Z.LIZ.LIZ(str2, room); } }