package com.ss.android.ugc.aweme.share;

import X.0Gp;
import X.2Oi;
import X.2UX;
import X.2YM;
import X.2dc;
import X.2fU;
import X.2kf;
import X.2nK;
import X.2sK;
import X.36a;
import X.3P1;
import X.3i8;
import X.46i;
import X.4B5;
import X.4f5;
import X.4f7;
import X.4f9;
import X.4fF;
import X.4gH;
import X.4gL;
import X.4hF;
import X.4i1;
import X.4iV;
import X.4j1;
import X.4j5;
import X.4kC;
import X.4kD;
import X.4kJ;
import X.4kK;
import X.4kV;
import X.4ka;
import X.4kv;
import X.4mK;
import X.4mZ;
import X.4nz;
import X.4pw;
import X.4px;
import X.4qA;
import X.4rR;
import X.4rS;
import X.4rY;
import X.4re;
import X.4rh;
import X.4ri;
import X.4rj;
import X.4rk;
import X.4rp;
import X.4s9;
import X.4sI;
import X.4sJ;
import X.4sL;
import X.4ur;
import X.4wQ;
import X.6J4;
import X.6iy;
import X.8bl;
import X.9EH;
import X.9HM;
import X.9Y3;
import X.9tq;
import X.9tr;
import X.Aqv;
import X.B9N;
import X.BPA;
import X.BPv;
import X.BPw;
import X.BY7;
import X.BY8;
import X.BY9;
import X.BYA;
import X.C2178Iu1;
import X.C2201IuO;
import X.C2348Iwl;
import X.C2349Iwm;
import X.C2352Iwp;
import X.C2395IxW;
import X.C2400Ixb;
import X.C2403Ixe;
import X.C2404Ixf;
import X.C2546Izx;
import X.C3118JLx;
import X.C3153JNg;
import X.C3154JNh;
import X.C3156JNj;
import X.C3218JPt;
import X.C3219JPu;
import X.C3220JPv;
import X.C3221JPw;
import X.C3223JPy;
import X.C3224JPz;
import X.COa;
import X.Cci;
import X.CwZ;
import X.Cwu;
import X.ESC;
import X.EcY;
import X.EcZ;
import X.Eei;
import X.Ef0;
import X.Ele;
import X.Elf;
import X.Etp;
import X.F7C;
import X.FEI;
import X.FEJ;
import X.FFa;
import X.FFh;
import X.FPc;
import X.FWk;
import X.GgT;
import X.GgV;
import X.Hml;
import X.Hmm;
import X.Hmn;
import X.Hmo;
import X.J7F;
import X.J7L;
import X.J7M;
import X.JPK;
import X.JQ0;
import X.JQ3;
import X.JQ6;
import X.JQ9;
import X.JQE;
import X.JQG;
import X.JQI;
import X.JQW;
import X.JR7;
import X.JS5;
import X.JT4;
import X.JTQ;
import X.K0c;
import X.KGj;
import X.LWw;
import X.LeS;
import X.Lea;
import X.Lel;
import X.Lnj;
import X.Lwa;
import X.M12;
import X.OCa;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Window;
import android.view.WindowManager;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.ies.abmock.SettingsManager;
import com.bytedance.router.SmartRouter;
import com.bytedance.tux.sheet.sheet.TuxSheet;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.app.SharePrefCache;
import com.ss.android.ugc.aweme.awemeservice.AwemeService;
import com.ss.android.ugc.aweme.base.model.UrlModel;
import com.ss.android.ugc.aweme.base.share.ShareInfo;
import com.ss.android.ugc.aweme.comment.model.Comment;
import com.ss.android.ugc.aweme.comment.model.CommentShareInfo;
import com.ss.android.ugc.aweme.discover.model.Challenge;
import com.ss.android.ugc.aweme.feed.model.ACLCommonShare;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.AwemeACLShare;
import com.ss.android.ugc.aweme.feed.model.AwemeRawAd;
import com.ss.android.ugc.aweme.feed.model.Video;
import com.ss.android.ugc.aweme.framework.services.IUserService;
import com.ss.android.ugc.aweme.im.message.template.card.ImageCardTemplate;
import com.ss.android.ugc.aweme.im.message.template.card.imagecard.ImageCardTitleBar;
import com.ss.android.ugc.aweme.im.message.template.component.ActionLinkComponent;
import com.ss.android.ugc.aweme.im.message.template.component.ActionLinkType;
import com.ss.android.ugc.aweme.im.message.template.component.BaseRequestComponent;
import com.ss.android.ugc.aweme.im.message.template.component.BaseResponseComponent;
import com.ss.android.ugc.aweme.im.message.template.component.ImageComponent;
import com.ss.android.ugc.aweme.im.message.template.component.PreviewHintComponent;
import com.ss.android.ugc.aweme.im.message.template.component.QueryDataComponent;
import com.ss.android.ugc.aweme.im.message.template.component.TextComponent;
import com.ss.android.ugc.aweme.im.message.template.component.VideoCoverComponent;
import com.ss.android.ugc.aweme.im.message.template.component.VideoCoverType;
import com.ss.android.ugc.aweme.im.message.template.service.SendMessageEventParcel;
import com.ss.android.ugc.aweme.im.message.template.service.SendMessageTemplateTask;
import com.ss.android.ugc.aweme.im.sdk.chat.data.model.BaseContent;
import com.ss.android.ugc.aweme.im.sdk.u16.controller.IMUnder16ProxyImpl;
import com.ss.android.ugc.aweme.im.service.IIMUnder16Proxy;
import com.ss.android.ugc.aweme.im.service.model.IMContact;
import com.ss.android.ugc.aweme.live.ILiveOuterService;
import com.ss.android.ugc.aweme.live.LiveOuterService;
import com.ss.android.ugc.aweme.music.model.Music;
import com.ss.android.ugc.aweme.profile.model.GeneralPermission;
import com.ss.android.ugc.aweme.profile.model.User;
import com.ss.android.ugc.aweme.qna.services.QnaService;
import com.ss.android.ugc.aweme.services.BaseUserService;
import com.ss.android.ugc.aweme.services.function.FunctionSupportService;
import com.ss.android.ugc.aweme.services.function.IFunctionKey;
import com.ss.android.ugc.aweme.share.improve.pkg.AwemeSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.ChallengeSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.CommentSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.LinkDefaultSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.LiveSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.LiveSubscribeSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.MixVideosSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.MusicSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.PlaylistSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.PoiSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.ProductSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.QnASharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.StickerSharePackage;
import com.ss.android.ugc.aweme.share.improve.pkg.UserSharePackage;
import com.ss.android.ugc.aweme.share.qrcode.UserQRCodeActivity;
import com.ss.android.ugc.aweme.sharer.ui.SharePackage;
import com.ss.android.ugc.aweme.shortvideo.publish.CreateAwemeResponse;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import kotlin.h.b.n;

public final class ShareServiceImpl implements ShareService {
    public static final JQ9 LIZ = new JQ9((byte) 0);

    static {
        Covode.recordClassIndex(106898);
    }

    public final Ele LIZJ() {
        return EcZ.LIZJ;
    }

    public final Elf LIZLLL() {
        return EcY.LIZJ;
    }

    public final Dialog LIZ(Activity activity, Fragment fragment, Aweme aweme, boolean z, 2YM<Etp> r18, Bundle bundle) {
        int i;
        WindowManager.LayoutParams attributes;
        Fragment fragment2 = fragment;
        Activity activity2 = activity;
        Aweme aweme2 = aweme;
        Bundle bundle2 = bundle;
        2YM<Etp> r11 = r18;
        M12.LIZ(activity2, fragment2, aweme2, r11, bundle2);
        4re r6 = new 4re(activity2, fragment2, aweme2, z, r11, bundle2);
        if (!r6.LIZIZ(r6.LJIILLIIL)) {
            return null;
        }
        JPK jpk = AwemeSharePackage.LIZJ;
        Aweme aweme3 = r6.LJIILLIIL;
        Activity activity3 = r6.LJIILL;
        int i2 = r6.LIZ;
        String str = r6.LIZIZ;
        n.LIZIZ(str, "");
        String str2 = r6.LIZJ;
        n.LIZIZ(str2, "");
        AwemeSharePackage LIZ2 = jpk.LIZ(aweme3, activity3, i2, str, str2);
        LIZ2.LJIILJJIL.putAll(r6.LJIJ);
        LIZ2.LJIILJJIL.putString("enter_method", "icon");
        LIZ2.LJIILJJIL.putBoolean("is_video_only", r6.LJIILJJIL);
        boolean z2 = 4kD.LIZ.LIZ() || 4rh.LIZ.LIZ(r6.LJIILJJIL);
        4rS r2 = new 4rS();
        r2.LIZ(LIZ2);
        JQ3.LIZ(r2, z2);
        r6.LIZ(LIZ2, r2, z2);
        if (!r6.LIZ(r6.LJIILLIIL) || !r6.LIZ() || r6.LJIILL.isFinishing()) {
            return null;
        }
        LIZ2.LJIILJJIL.putString("author_id", 4wQ.LIZ(r6.LJIILLIIL));
        LIZ2.LJIILJJIL.putString("enter_from", r6.LIZIZ);
        LIZ2.LJIILJJIL.putString("content_type", 4wQ.LJI(r6.LJIILLIIL));
        JS5.LIZ(r2, r6.LIZIZ, r6.LJIILLIIL);
        if (!TextUtils.equals(r6.LIZIZ, "homepage_follow") && !TextUtils.equals(r6.LIZIZ, "homepage_friends") && !TextUtils.equals(r6.LIZIZ, "general_search") && ((!TextUtils.equals(r6.LIZIZ, "personal_homepage") || !TextUtils.isEmpty(r6.LJII)) && (!TextUtils.equals(r6.LIZIZ, "others_homepage") || !TextUtils.isEmpty(r6.LJII)))) {
            i = 2131887008;
        } else {
            i = 2131887001;
        }
        4qA LIZ3 = ShareDependService.LIZ.LIZ().LIZ(r6.LJIILL, r2.LIZ(), i);
        LIZ3.setOnShowListener(new JQ0(r6, LIZ3));
        LIZ2.LIZIZ = new 4ka(r6, LIZ2, LIZ3);
        Window window = LIZ3.getWindow();
        if (!(window == null || (attributes = window.getAttributes()) == null)) {
            attributes.windowAnimations = 2131886951;
        }
        LIZ3.show();
        2fU.LIZ.LIZ(LIZ3);
        ShareExtServiceImpl.LJIILJJIL().LIZIZ(r6.LJIILLIIL);
        return LIZ3;
    }

    public final void LIZ(Activity activity, Music music, COa cOa, Lel lel, String str) {
        M12.LIZ(activity, cOa);
        M12.LIZ(activity, cOa);
        if (music != null && music.getShareInfo() != null) {
            if (lel == null) {
                lel = Lel.INSTANCE;
            }
            M12.LIZ(music, activity, lel);
            J7F j7f = new J7F();
            j7f.LIZ("music");
            String mid = music.getMid();
            n.LIZIZ(mid, "");
            j7f.LIZIZ(mid);
            ShareInfo shareInfo = music.getShareInfo();
            n.LIZIZ(shareInfo, "");
            String shareTitle = shareInfo.getShareTitle();
            n.LIZIZ(shareTitle, "");
            j7f.LIZJ(shareTitle);
            ShareInfo shareInfo2 = music.getShareInfo();
            n.LIZIZ(shareInfo2, "");
            String shareDesc = shareInfo2.getShareDesc();
            n.LIZIZ(shareDesc, "");
            j7f.LIZLLL(shareDesc);
            ShareInfo shareInfo3 = music.getShareInfo();
            n.LIZIZ(shareInfo3, "");
            String LIZJ = C3118JLx.LIZJ(C3118JLx.LIZIZ(shareInfo3.getShareUrl()));
            if (LIZJ == null) {
                LIZJ = "";
            }
            j7f.LJ(LIZJ);
            MusicSharePackage musicSharePackage = new MusicSharePackage(j7f);
            Bundle bundle = musicSharePackage.LJIILJJIL;
            bundle.putString("app_name", activity.getString(2131821672));
            bundle.putString("thumb_url", OCa.LIZ(music.getCoverThumb()));
            bundle.putSerializable("video_cover", music.getCoverMedium());
            bundle.putString("music_id", music.getMid());
            bundle.putString("process_id", str);
            bundle.putString("music_name", music.getMusicName());
            bundle.putInt("user_count", music.getUserCount());
            bundle.putSerializable("cover_thumb", music.getCoverThumb());
            4hF.LIZ(bundle, "aweme_cover_list", lel);
            musicSharePackage.LJIILJJIL.putString("enter_from", "single_song");
            musicSharePackage.LJIILJJIL.putString("enter_method", "button");
            4rS r2 = new 4rS();
            r2.LIZ(musicSharePackage);
            if (!4px.LIZ()) {
                4ri.LIZ(r2, ShareDependService.LIZ.LIZ().LIZ(musicSharePackage, ""));
            }
            C3223JPy.LIZ(r2, true, activity, false, 4);
            r2.LIZ(new C3156JNj());
            IAccountUserService LJFF = 46i.LJFF();
            n.LIZIZ(LJFF, "");
            String curUserId = LJFF.getCurUserId();
            if (36a.LIZ(music.getOwnerId()) && (true ^ n.LIZ(music.getOwnerId(), curUserId))) {
                r2.LIZ(new 4gL(music));
            }
            if (SmartRouter.canOpen("//qrcodev2")) {
                r2.LIZ(new BY8(music));
            }
            if (SettingsManager.LIZ().LIZ("enable_remove_original_sound", false) && music.isOriginalSound() && !music.isPgc() && 36a.LIZ(music.getOwnerId()) && n.LIZ(music.getOwnerId(), curUserId)) {
                r2.LIZ(new 4fF(music));
                2UX r0 = new 2UX();
                r0.LIZ("enter_from", "single_song");
                2nK.LIZ("show_remove_original_sound", r0.LIZ);
            }
            r2.LIZ(cOa);
            4rR LIZ2 = r2.LIZ();
            if (4px.LIZ()) {
                ShareDependService LIZ3 = ShareDependService.LIZ.LIZ();
                Integer.valueOf(2131887001);
                4kK.LIZ(LIZ3, activity, LIZ2, (Bundle) null, 8);
                return;
            }
            4qA LIZ4 = ShareDependService.LIZ.LIZ().LIZ(activity, LIZ2, 2131887001);
            LIZ4.show();
            2fU.LIZ.LIZ(LIZ4);
        }
    }

    public final void LIZ(Activity activity, ShareInfo shareInfo, String str, String str2, COa cOa) {
        M12.LIZ(cOa);
        M12.LIZ(cOa);
        if (activity != null && shareInfo != null && str != null) {
            J7F j7f = new J7F();
            j7f.LIZ("playlist");
            j7f.LIZIZ(str);
            String shareTitle = shareInfo.getShareTitle();
            String str3 = "";
            n.LIZIZ(shareTitle, str3);
            j7f.LIZJ(shareTitle);
            String shareDesc = shareInfo.getShareDesc();
            n.LIZIZ(shareDesc, str3);
            j7f.LIZLLL(shareDesc);
            String shareUrl = shareInfo.getShareUrl();
            if (shareUrl != null) {
                str3 = shareUrl;
            }
            j7f.LJ(str3);
            PlaylistSharePackage playlistSharePackage = new PlaylistSharePackage(j7f);
            Bundle bundle = playlistSharePackage.LJIILJJIL;
            bundle.putString("app_name", activity.getString(2131821672));
            bundle.putString("process_id", str2);
            playlistSharePackage.LJIILJJIL.putString("enter_from", "single_song");
            playlistSharePackage.LJIILJJIL.putString("enter_method", "button");
            4rS r3 = new 4rS();
            r3.LIZ(playlistSharePackage);
            C3223JPy.LIZ(r3, true, activity, false, 4);
            r3.LIZ(new C3156JNj());
            r3.LJIILL = false;
            r3.LIZ(cOa);
            4rR LIZ2 = r3.LIZ();
            if (4px.LIZ()) {
                ShareDependService LIZ3 = ShareDependService.LIZ.LIZ();
                Integer.valueOf(2131887001);
                4kK.LIZ(LIZ3, activity, LIZ2, (Bundle) null, 8);
                return;
            }
            4qA LIZ4 = ShareDependService.LIZ.LIZ().LIZ(activity, LIZ2, 2131887001);
            LIZ4.show();
            2fU.LIZ.LIZ(LIZ4);
        }
    }

    public final void LIZ(Activity activity, String str, String str2, Aweme aweme, List<? extends Aweme> list, ShareInfo shareInfo, boolean z, String str3) {
        User author;
        UrlModel cover;
        Activity activity2 = activity;
        Activity activity3 = activity2;
        String str4 = str;
        String str5 = str4;
        String str6 = str3;
        String str7 = str6;
        ShareInfo shareInfo2 = shareInfo;
        List<? extends Aweme> list2 = list;
        String str8 = str2;
        Aweme aweme2 = aweme;
        M12.LIZ(activity3, str5, str8, aweme2, list2, shareInfo2, str7);
        C2546Izx izx = MixVideosSharePackage.LIZ;
        M12.LIZ(activity3, str5, str8, aweme2, list2, shareInfo2, str7);
        Aweme aweme3 = (Aweme) Lea.LJIIIIZZ(list2);
        if (aweme3 != null && (author = aweme3.getAuthor()) != null) {
            ArrayList arrayList = new ArrayList();
            for (Aweme video : list2) {
                Video video2 = video.getVideo();
                if (!(video2 == null || (cover = video2.getCover()) == null)) {
                    arrayList.add(cover);
                }
            }
            List LIZLLL = Lea.LIZLLL(arrayList, 3);
            J7F j7f = new J7F();
            j7f.LIZ("mix_videos");
            j7f.LIZIZ(str4);
            String shareTitle = shareInfo2.getShareTitle();
            n.LIZIZ(shareTitle, "");
            j7f.LIZJ(shareTitle);
            String shareDesc = shareInfo2.getShareDesc();
            n.LIZIZ(shareDesc, "");
            j7f.LIZLLL(shareDesc);
            String shareUrl = shareInfo2.getShareUrl();
            n.LIZIZ(shareUrl, "");
            j7f.LJ(shareUrl);
            j7f.LJFF = izx.LIZ(activity2, str4, str8, list2, str6);
            Bundle bundle = j7f.LJI;
            bundle.putSerializable("video_cover", (Serializable) Lea.LJIIIIZZ(LIZLLL));
            bundle.putString("compilation_id", str4);
            bundle.putString("user_id", author.getUid());
            bundle.putString("sec_user_id", author.getSecUid());
            bundle.putString("name", author.getNickname());
            bundle.putString("compilation_name", str8);
            bundle.putString("aweme_cover_list", 2dc.LIZ().LIZIZ(LIZLLL));
            bundle.putString("aid", aweme2.getAid());
            bundle.putInt("context_id", activity2.hashCode());
            boolean z2 = z;
            bundle.putBoolean("is_creator", z2);
            bundle.putString("enter_from", str6);
            MixVideosSharePackage mixVideosSharePackage = new MixVideosSharePackage(j7f);
            4rS r5 = new 4rS();
            r5.LIZ(mixVideosSharePackage);
            r5.LIZ(new C3156JNj());
            if (!4px.LIZ()) {
                4ri.LIZ(r5, ShareDependService.LIZ.LIZ().LIZ(mixVideosSharePackage, ""));
            }
            C3223JPy.LIZ(r5, false, (Activity) null, false, 7);
            r5.LIZ(new 9tq(str6, author, str4, z2));
            r5.LIZ(new 9tr(str6, author, str4, z2));
            if (!z2) {
                r5.LIZ(new 4f9(aweme2));
            }
            if (4px.LIZ()) {
                4kK.LIZ(ShareDependService.LIZ.LIZ(), activity2, r5.LIZ(), (Bundle) null, 12);
                return;
            }
            4qA LIZ2 = 4kK.LIZ(ShareDependService.LIZ.LIZ(), activity2, r5.LIZ());
            LIZ2.show();
            2fU.LIZ.LIZ(LIZ2);
        }
    }

    public final void LIZ(Activity activity, BPA bpa, String str, List<? extends Aweme> list, String str2) {
        String str3;
        String str4;
        List list2;
        String shareDesc;
        M12.LIZ(activity);
        M12.LIZ(activity);
        if (bpa != null && bpa.shareInfo != null) {
            M12.LIZ(bpa, activity);
            J7F j7f = new J7F();
            j7f.LIZ("sticker");
            String str5 = bpa.id;
            n.LIZIZ(str5, "");
            j7f.LIZIZ(str5);
            ShareInfo shareInfo = bpa.shareInfo;
            String str6 = " ";
            if (shareInfo == null || (str3 = shareInfo.getShareTitle()) == null) {
                str3 = str6;
            }
            j7f.LIZJ(str3);
            ShareInfo shareInfo2 = bpa.shareInfo;
            if (!(shareInfo2 == null || (shareDesc = shareInfo2.getShareDesc()) == null)) {
                str6 = shareDesc;
            }
            j7f.LIZLLL(str6);
            ShareInfo shareInfo3 = bpa.shareInfo;
            String LIZIZ = C3118JLx.LIZIZ(shareInfo3 != null ? shareInfo3.getShareUrl() : null);
            if (LIZIZ == null) {
                LIZIZ = "";
            }
            j7f.LJ(LIZIZ);
            StickerSharePackage stickerSharePackage = new StickerSharePackage(j7f);
            Bundle bundle = stickerSharePackage.LJIILJJIL;
            bundle.putString("app_name", activity.getString(2131821672));
            bundle.putSerializable("video_cover", bpa.iconUrl);
            bundle.putString("sticker_id", bpa.id);
            bundle.putString("sticker_name", bpa.name);
            bundle.putLong("user_count", bpa.userCount);
            if (str == null) {
                str4 = "";
            } else {
                str4 = str;
            }
            bundle.putString("group_id", str4);
            bundle.putString("user_id", bpa.ownerId);
            if (str2 == null) {
                str2 = "";
            }
            bundle.putString("log_pb", str2);
            4hF.LIZ(bundle, "aweme_cover_list", list);
            stickerSharePackage.LJIILJJIL.putString("enter_from", "prop_page");
            stickerSharePackage.LJIILJJIL.putString("enter_method", "button");
            BPw bPw = new BPw(bpa);
            4rS r5 = new 4rS();
            if (!4px.LIZ()) {
                4ri.LIZ(r5, 4kK.LIZ(ShareDependService.LIZ.LIZ(), stickerSharePackage, (String) null, 6));
            }
            4B5.LIZ.LIZ(r5, activity, true);
            r5.LIZ(stickerSharePackage);
            r5.LIZ(new C3156JNj());
            if (!TextUtils.isEmpty(bpa.ownerId)) {
                r5.LIZ(new 4kJ(bpa));
            }
            r5.LIZ(new BY9(bpa, str));
            if (SettingsManager.LIZ().LIZ("enable_effect_info", false) && (list2 = bpa.attributions) != null) {
                n.LIZIZ(list2, "");
                if (!list2.isEmpty()) {
                    6J4 r4 = new 6J4();
                    r4.LIZ("enter_from", "prop_page");
                    r4.LIZ("prop_id", String.valueOf(bpa.id));
                    2nK.LIZ("effect_info_show", r4.LIZ);
                    String str7 = bpa.id;
                    n.LIZIZ(str7, "");
                    r5.LIZ(new 4f5(str7, list2));
                }
            }
            r5.LIZ(bPw);
            4rR LIZ2 = r5.LIZ();
            if (4px.LIZ()) {
                4kK.LIZ(ShareDependService.LIZ.LIZ(), activity, LIZ2, (Bundle) null, 12);
                return;
            }
            4qA LIZ3 = 4kK.LIZ(ShareDependService.LIZ.LIZ(), activity, LIZ2);
            LIZ3.show();
            2fU.LIZ.LIZ(LIZ3);
        }
    }

    public final void LIZ(Activity activity, B9N b9n, COa cOa, String str) {
        M12.LIZ(activity, b9n, cOa);
        M12.LIZ(activity, b9n, cOa);
        J7F j7f = new J7F();
        j7f.LIZ("qna");
        j7f.LIZIZ(String.valueOf(b9n.LIZIZ));
        j7f.LIZJ(b9n.LIZJ);
        ShareInfo shareInfo = b9n.LJ;
        String shareDesc = shareInfo != null ? shareInfo.getShareDesc() : null;
        if (shareDesc == null) {
            shareDesc = "";
        }
        j7f.LIZLLL(shareDesc);
        ShareInfo shareInfo2 = b9n.LJ;
        String LIZJ = C3118JLx.LIZJ(C3118JLx.LIZIZ(shareInfo2 != null ? shareInfo2.getShareUrl() : null));
        if (LIZJ == null) {
            LIZJ = "";
        }
        j7f.LJ(LIZJ);
        QnASharePackage qnASharePackage = new QnASharePackage(j7f);
        qnASharePackage.LJIILJJIL.putLong("qna_id", b9n.LIZIZ);
        qnASharePackage.LJIILJJIL.putString("qna_name", b9n.LIZJ);
        qnASharePackage.LJIILJJIL.putInt("user_count", b9n.LIZLLL);
        qnASharePackage.LJIILJJIL.putString("app_name", activity.getString(2131821672));
        qnASharePackage.LJIILJJIL.putString("process_id", str);
        4hF.LIZ(qnASharePackage.LJIILJJIL, "aweme_cover_list", b9n.LJI);
        qnASharePackage.LJIILJJIL.putString("enter_from", "qa_detail");
        qnASharePackage.LJIILJJIL.putString("enter_method", "button");
        4rS r1 = new 4rS();
        r1.LIZ(qnASharePackage);
        boolean z = b9n.LJ != null;
        if (!4px.LIZ()) {
            4ri.LIZ(r1, ShareDependService.LIZ.LIZ().LIZ(qnASharePackage, ""));
        }
        C3223JPy.LIZ(r1, z, activity, z);
        if (QnaService.LIZ().enablePublicQna()) {
            4kV r0 = new 4kV(b9n);
            M12.LIZ(r1);
            r1.LIZ(r0);
        }
        r1.LIZ(new 4kC(b9n));
        if (z) {
            if (SmartRouter.canOpen("//qrcodev2")) {
                r1.LIZ(new BYA(b9n));
            }
            r1.LIZ(new C3156JNj());
        }
        r1.LIZ(cOa);
        4rR LIZ2 = r1.LIZ();
        if (4px.LIZ()) {
            ShareDependService LIZ3 = ShareDependService.LIZ.LIZ();
            Integer.valueOf(2131887001);
            4kK.LIZ(LIZ3, activity, LIZ2, (Bundle) null, 8);
            return;
        }
        4qA LIZ4 = ShareDependService.LIZ.LIZ().LIZ(activity, LIZ2, 2131887001);
        LIZ4.show();
        2fU.LIZ.LIZ(LIZ4);
    }

    public final void LIZ(Activity activity, Aweme aweme, Comment comment, Bundle bundle, boolean z, boolean z2, COa cOa) {
        String str;
        String str2;
        4rS LIZ2;
        String url;
        M12.LIZ(activity);
        if (aweme != null && comment != null) {
            C2404Ixf ixf = new C2404Ixf();
            CommentShareInfo shareInfo = comment.getShareInfo();
            if (shareInfo != null) {
                str = shareInfo.getDesc();
            } else {
                str = null;
            }
            String str3 = "";
            if (str == null) {
                str = str3;
            }
            M12.LIZ(str);
            ixf.LIZLLL = str;
            CommentShareInfo shareInfo2 = comment.getShareInfo();
            if (shareInfo2 == null || (str2 = shareInfo2.getTitle()) == null) {
                str2 = str3;
            }
            M12.LIZ(str2);
            ixf.LIZJ = str2;
            CommentShareInfo shareInfo3 = comment.getShareInfo();
            if (!(shareInfo3 == null || (url = shareInfo3.getUrl()) == null)) {
                str3 = url;
            }
            M12.LIZ(str3);
            ixf.LJ = str3;
            M12.LIZ(bundle);
            ixf.LJFF.putAll(bundle);
            C2403Ixe ixe = new C2403Ixe(ixf);
            M12.LIZ(activity);
            if (4B5.LIZIZ.LJIIJ()) {
                LIZ2 = LinkDefaultSharePackage.LIZLLL.LIZ(activity);
                LIZ2.LJIILL = z;
                if (!z) {
                    LIZ2.LIZ("chat_merge");
                }
                if (z2) {
                    LIZ2.LJ = true;
                }
            } else {
                LIZ2 = LinkDefaultSharePackage.LIZLLL.LIZ(activity);
                LIZ2.LJIILL = false;
                LIZ2.LJIJJ = false;
                LIZ2.LJIL = true;
                LIZ2.LIZ("chat_merge");
            }
            C2400Ixb ixb = CommentSharePackage.LIZJ;
            M12.LIZ(activity, LIZ2, aweme, comment);
            CommentSharePackage LIZ3 = ixb.LIZ(aweme, comment, z2, ixe);
            M12.LIZ(activity, LIZ2, LIZ3);
            if (!ShareDependService.LIZ.LIZ().LIZJ() && !4px.LIZ()) {
                4ri.LIZ(LIZ2, 4kK.LIZ(ShareDependService.LIZ.LIZ(), LIZ3, (String) null, 6));
            }
            LIZ2.LIZ(LIZ3);
            LIZ2.LIZ(new Cci(LIZ3, cOa));
            4rR LIZ4 = LIZ2.LIZ();
            if (4px.LIZ()) {
                ShareDependService LIZ5 = ShareDependService.LIZ.LIZ();
                Integer.valueOf(LIZ4.LJIJJLI);
                4kK.LIZ(LIZ5, activity, LIZ4, (Bundle) null, 8);
                return;
            }
            4qA LIZ6 = ShareDependService.LIZ.LIZ().LIZ(activity, LIZ4, LIZ4.LJIJJLI);
            LIZ6.show();
            2fU.LIZ.LIZ(LIZ6);
        }
    }

    public final void LIZ(Handler handler, Activity activity, User user, List<? extends Aweme> list, String str) {
        String str2;
        Activity activity2 = activity;
        String str3 = str;
        M12.LIZ(activity2, str3);
        C3221JPw jPw = UserSharePackage.LIZIZ;
        M12.LIZ(activity2, str3);
        User user2 = user;
        if (user2 != null && user2.getShareInfo() != null) {
            UserSharePackage LIZ2 = jPw.LIZ(user2, activity2, list);
            String str4 = ESC.LJII(user2) ? "personal_homepage" : "others_homepage";
            LIZ2.LJIILJJIL.putString("enter_from", str4);
            LIZ2.LJIILJJIL.putString("enter_method", "button");
            4rS r1 = new 4rS();
            if (!4px.LIZ()) {
                4ri.LIZ(r1, 4kK.LIZ(ShareDependService.LIZ.LIZ(), LIZ2, str4, 4));
            }
            4B5.LIZ.LIZ(r1, activity2, true);
            GeneralPermission generalPermission = user2.getGeneralPermission();
            if (generalPermission != null) {
                str2 = generalPermission.getShareProfileToast();
            } else {
                str2 = null;
            }
            if (!TextUtils.isEmpty(str2)) {
                r1.LJIILL = false;
            }
            if (46i.LJFF().isMe(user2.getUid()) || !user2.isSecret()) {
                r1.LIZ(new C3156JNj());
            } else {
                r1.LJ = true;
                r1.LJIILL = false;
            }
            Handler handler2 = handler;
            if (handler2 != null) {
                r1.LIZ(new 4ur(user2, str3));
                IAccountUserService LJFF = 46i.LJFF();
                n.LIZIZ(LJFF, "");
                if (LJFF.isLogin()) {
                    r1.LIZ(new 4f7(user2, handler2));
                }
                IIMUnder16Proxy LJ = IMUnder16ProxyImpl.LJ();
                n.LIZIZ(LJ, "");
                boolean LIZ3 = LJ.LIZ();
                boolean LIZ4 = 4kD.LIZ.LIZ();
                if (!user2.isBlock && !ESC.LIZLLL() && !LIZ3 && !LIZ4) {
                    r1.LIZ(new JR7(handler2));
                }
                SharePrefCache inst = SharePrefCache.inst();
                n.LIZIZ(inst, "");
                2sK removeFollowerSwitch = inst.getRemoveFollowerSwitch();
                n.LIZIZ(removeFollowerSwitch, "");
                Object LIZLLL = removeFollowerSwitch.LIZLLL();
                n.LIZIZ(LIZLLL, "");
                if (((Boolean) LIZLLL).booleanValue() && user2.getFollowerStatus() == 1) {
                    r1.LIZ(new 4nz(handler2));
                }
            }
            r1.LIZ(LIZ2);
            r1.LIZ(new C3220JPv(LIZ2, str4, activity2, user2, handler2, str3));
            4rR LIZ5 = r1.LIZ();
            if (activity2.isFinishing()) {
                return;
            }
            if (4px.LIZ()) {
                4kK.LIZ(ShareDependService.LIZ.LIZ(), activity2, LIZ5, (Bundle) null, 12);
                return;
            }
            4qA LIZ6 = 4kK.LIZ(ShareDependService.LIZ.LIZ(), activity2, LIZ5);
            LIZ6.show();
            2fU.LIZ.LIZ(LIZ6);
        }
    }

    public final void LIZ(Activity activity, Challenge challenge, List<? extends Aweme> list, String str, boolean z, String str2, String str3, String str4) {
        M12.LIZ(activity);
        M12.LIZ(activity);
        Challenge challenge2 = challenge;
        if (challenge2 != null && challenge2.getShareInfo() != null) {
            Activity activity2 = activity;
            M12.LIZ(challenge2, activity2);
            J7F j7f = new J7F();
            j7f.LIZ("challenge");
            String cid = challenge2.getCid();
            n.LIZIZ(cid, "");
            j7f.LIZIZ(cid);
            ShareInfo shareInfo = challenge2.getShareInfo();
            n.LIZIZ(shareInfo, "");
            String shareTitle = shareInfo.getShareTitle();
            if (shareTitle == null) {
                shareTitle = "";
            }
            j7f.LIZJ(shareTitle);
            ShareInfo shareInfo2 = challenge2.getShareInfo();
            n.LIZIZ(shareInfo2, "");
            String shareDesc = shareInfo2.getShareDesc();
            if (shareDesc == null) {
                shareDesc = "";
            }
            j7f.LIZLLL(shareDesc);
            ShareInfo shareInfo3 = challenge2.getShareInfo();
            n.LIZIZ(shareInfo3, "");
            String LIZJ = C3118JLx.LIZJ(C3118JLx.LIZIZ(shareInfo3.getShareUrl()));
            if (LIZJ == null) {
                LIZJ = "";
            }
            j7f.LJ(LIZJ);
            ChallengeSharePackage challengeSharePackage = new ChallengeSharePackage(j7f);
            Bundle bundle = challengeSharePackage.LJIILJJIL;
            bundle.putString("app_name", activity2.getString(2131821672));
            User author = challenge2.getAuthor();
            bundle.putString("uid_for_share", author != null ? author.getUid() : null);
            bundle.putString("challenge_id", challenge2.getCid());
            String str5 = str3;
            bundle.putString("process_id", str5);
            bundle.putString("challenge_name", challenge2.getChallengeName());
            bundle.putLong("view_count", challenge2.getDisplayCount());
            bundle.putBoolean("is_commerce", challenge2.isCommerce());
            4hF.LIZ(bundle, "cover_thumb", list);
            challengeSharePackage.LJIILJJIL.putString("enter_from", "challenge");
            challengeSharePackage.LJIILJJIL.putString("enter_method", "button");
            challengeSharePackage.LJIILJJIL.putString("extra_parent_tag_id", str4);
            BPv bPv = new BPv(challenge2);
            4rS r4 = new 4rS();
            if (!4px.LIZ()) {
                4ri.LIZ(r4, 4kK.LIZ(ShareDependService.LIZ.LIZ(), challengeSharePackage, "challenge", 4));
            }
            4B5.LIZ.LIZ(r4, activity, true);
            r4.LIZ(new C3156JNj());
            IAccountUserService LJFF = 46i.LJFF();
            n.LIZIZ(LJFF, "");
            String curUserId = LJFF.getCurUserId();
            User author2 = challenge2.getAuthor();
            String uid = author2 != null ? author2.getUid() : null;
            if (TextUtils.isEmpty(curUserId) || TextUtils.isEmpty(uid) || !TextUtils.equals(curUserId, uid)) {
                r4.LIZ(new 4mK(challenge2));
            }
            if (!FunctionSupportService.INSTANCE.notSupport(IFunctionKey.QR_CODE)) {
                r4.LIZ(new BY7(challenge2, z, str, str2, str5));
            }
            r4.LIZ(bPv);
            r4.LIZ(challengeSharePackage);
            4rR LIZ2 = r4.LIZ();
            if (4px.LIZ()) {
                4kK.LIZ(ShareDependService.LIZ.LIZ(), activity, LIZ2, (Bundle) null, 12);
                return;
            }
            4qA LIZ3 = 4kK.LIZ(ShareDependService.LIZ.LIZ(), activity, LIZ2);
            LIZ3.show();
            2fU.LIZ.LIZ(LIZ3);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:45:0x0134  */
    /* JADX WARNING: Removed duplicated region for block: B:48:0x015a  */
    /* JADX WARNING: Removed duplicated region for block: B:80:0x020d  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(android.app.Activity r10, com.ss.android.ugc.aweme.feed.model.LiveEvent r11, X.4pf r12, X.KKi r13) {
        /*
            r9 = this;
            X.M12.LIZ(r10)
            X.M12.LIZ(r10)
            java.lang.String r0 = r11.getEventID()
            if (r0 == 0) goto L_0x020c
            X.M12.LIZ(r11, r10)
            X.J7F r1 = new X.J7F
            r1.<init>()
            java.lang.String r0 = "live_event"
            r1.LIZ(r0)
            java.lang.String r0 = r11.getEventID()
            java.lang.String r7 = ""
            if (r0 != 0) goto L_0x0022
            r0 = r7
        L_0x0022:
            r1.LIZIZ(r0)
            java.lang.String r0 = r11.getTitle()
            if (r0 != 0) goto L_0x002c
            r0 = r7
        L_0x002c:
            r1.LIZJ(r0)
            java.lang.String r0 = r11.getShareURL()
            java.lang.String r0 = X.C3118JLx.LIZIZ((java.lang.String) r0)
            java.lang.String r0 = X.C3118JLx.LIZJ(r0)
            if (r0 != 0) goto L_0x003e
            r0 = r7
        L_0x003e:
            r1.LJ(r0)
            com.ss.android.ugc.aweme.share.improve.pkg.LiveEventSharePackage r6 = new com.ss.android.ugc.aweme.share.improve.pkg.LiveEventSharePackage
            r6.<init>(r1)
            android.os.Bundle r2 = r6.LJIILJJIL
            r0 = 2131821672(0x7f110468, float:1.9276094E38)
            java.lang.String r1 = r10.getString(r0)
            java.lang.String r0 = "app_name"
            r2.putString(r0, r1)
            java.lang.String r1 = r11.getEventID()
            java.lang.String r0 = "live_event_id"
            r2.putString(r0, r1)
            java.lang.String r1 = r11.getTitle()
            java.lang.String r0 = "live_event_title"
            r2.putString(r0, r1)
            java.lang.String r1 = r11.getStartTime()
            java.lang.String r0 = "live_event_start_time"
            r2.putString(r0, r1)
            java.lang.String r1 = r11.getInternalURL()
            java.lang.String r0 = "live_event_internal_share_url"
            r2.putString(r0, r1)
            com.ss.android.ugc.aweme.profile.model.User r0 = r11.getOrganizer()
            r5 = 0
            if (r0 == 0) goto L_0x00e5
            java.lang.String r1 = r0.getUid()
        L_0x0083:
            java.lang.String r0 = "live_event_author_id"
            r2.putString(r0, r1)
            java.lang.String r1 = r11.isAnchor()
            java.lang.String r0 = "live_event_is_anchor"
            r2.putString(r0, r1)
            com.ss.android.ugc.aweme.profile.model.User r0 = r11.getOrganizer()
            if (r0 == 0) goto L_0x00e3
            java.lang.String r1 = r0.getUniqueId()
        L_0x009b:
            java.lang.String r0 = "live_event_author_name"
            r2.putString(r0, r1)
            com.ss.android.ugc.aweme.profile.model.User r0 = r11.getOrganizer()
            if (r0 == 0) goto L_0x00e1
            java.lang.String r1 = r0.getCustomVerify()
        L_0x00aa:
            java.lang.String r0 = "live_event_author_verify_info"
            r2.putString(r0, r1)
            com.ss.android.ugc.aweme.profile.model.User r0 = r11.getOrganizer()
            if (r0 == 0) goto L_0x00df
            java.lang.String r1 = r0.getEnterpriseVerifyReason()
        L_0x00b9:
            java.lang.String r0 = "live_event_author_enterprise"
            r2.putString(r0, r1)
            com.ss.android.ugc.aweme.profile.model.User r0 = r11.getOrganizer()
            if (r0 == 0) goto L_0x00dd
            com.ss.android.ugc.aweme.base.model.UrlModel r1 = r0.getAvatarMedium()
        L_0x00c8:
            java.lang.String r0 = "live_event_author_avatar"
            r2.putSerializable(r0, r1)
            java.lang.String r0 = r11.getTrackInfo()
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            java.lang.String r3 = "is_paid_event"
            java.lang.String r8 = "enter_from"
            r4 = 0
            if (r0 != 0) goto L_0x00fe
            goto L_0x00e7
        L_0x00dd:
            r1 = r5
            goto L_0x00c8
        L_0x00df:
            r1 = r5
            goto L_0x00b9
        L_0x00e1:
            r1 = r5
            goto L_0x00aa
        L_0x00e3:
            r1 = r5
            goto L_0x009b
        L_0x00e5:
            r1 = r5
            goto L_0x0083
        L_0x00e7:
            org.json.JSONObject r1 = new org.json.JSONObject     // Catch:{ JSONException -> 0x0100 }
            java.lang.String r0 = r11.getTrackInfo()     // Catch:{ JSONException -> 0x0100 }
            r1.<init>(r0)     // Catch:{ JSONException -> 0x0100 }
            java.lang.String r2 = r1.optString(r8, r7)     // Catch:{ JSONException -> 0x0100 }
            kotlin.h.b.n.LIZIZ(r2, r7)     // Catch:{ JSONException -> 0x0100 }
            boolean r1 = r1.optBoolean(r3, r4)     // Catch:{ JSONException -> 0x00fc }
            goto L_0x0106
        L_0x00fc:
            r0 = move-exception
            goto L_0x0102
        L_0x00fe:
            r2 = r7
            goto L_0x0105
        L_0x0100:
            r0 = move-exception
            r2 = r7
        L_0x0102:
            X.0HH.LIZ(r0)
        L_0x0105:
            r1 = 0
        L_0x0106:
            android.os.Bundle r0 = r6.LJIILJJIL
            r0.putString(r8, r2)
            android.os.Bundle r0 = r6.LJIILJJIL
            r0.putBoolean(r3, r1)
            android.os.Bundle r2 = r6.LJIILJJIL
            java.lang.String r1 = "enter_method"
            java.lang.String r0 = "button"
            r2.putString(r1, r0)
            X.4rS r2 = new X.4rS
            r2.<init>()
            r2.LIZ(r12)
            r2.LIZ(r6)
            java.lang.Boolean r1 = r11.getShowsIMForActivity()
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r4)
            boolean r0 = kotlin.h.b.n.LIZ(r1, r0)
            r3 = 1
            r0 = r0 ^ r3
            if (r0 == 0) goto L_0x020d
            X.4k3 r0 = com.ss.android.ugc.aweme.share.ShareDependService.LIZ
            com.ss.android.ugc.aweme.share.ShareDependService r0 = r0.LIZ()
            X.JOF r0 = r0.LIZ(r6, r7)
            X.4ri.LIZ(r2, r0)
        L_0x0141:
            r0 = 2131832462(0x7f112e8e, float:1.9297979E38)
            r2.LJIIJ = r0
            r0 = 2131822315(0x7f1106eb, float:1.9277398E38)
            r2.LJIILIIL = r0
            java.lang.Boolean r1 = r11.getShowsIMForActivity()
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r4)
            boolean r0 = kotlin.h.b.n.LIZ(r1, r0)
            r0 = r0 ^ r3
            if (r0 == 0) goto L_0x016b
            X.J71 r0 = X.J71.LIZ
            r2.LIZ(r0)
            X.JNj r0 = new X.JNj
            r0.<init>()
            r2.LIZ(r0)
            r0 = 7
            X.C3223JPy.LIZ(r2, r4, r5, r4, r0)
        L_0x016b:
            java.util.List r1 = r11.getCustomActionItems()
            if (r1 == 0) goto L_0x0181
            java.lang.String r0 = "calendar"
            boolean r0 = r1.contains(r0)
            if (r0 != r3) goto L_0x0181
            X.4gq r0 = new X.4gq
            r0.<init>(r11, r13)
            r2.LIZ(r0)
        L_0x0181:
            java.util.List r1 = r11.getCustomActionItems()
            if (r1 == 0) goto L_0x0197
            java.lang.String r0 = "refund"
            boolean r0 = r1.contains(r0)
            if (r0 != r3) goto L_0x0197
            X.4hb r0 = new X.4hb
            r0.<init>(r11, r13)
            r2.LIZ(r0)
        L_0x0197:
            java.util.List r1 = r11.getCustomActionItems()
            if (r1 == 0) goto L_0x01ad
            java.lang.String r0 = "unregister"
            boolean r0 = r1.contains(r0)
            if (r0 != r3) goto L_0x01ad
            X.4gp r0 = new X.4gp
            r0.<init>(r11, r13)
            r2.LIZ(r0)
        L_0x01ad:
            java.util.List r1 = r11.getCustomActionItems()
            if (r1 == 0) goto L_0x01c3
            java.lang.String r0 = "edit"
            boolean r0 = r1.contains(r0)
            if (r0 != r3) goto L_0x01c3
            X.4gm r0 = new X.4gm
            r0.<init>(r11, r13)
            r2.LIZ(r0)
        L_0x01c3:
            java.util.List r1 = r11.getCustomActionItems()
            if (r1 == 0) goto L_0x01d9
            java.lang.String r0 = "delete"
            boolean r0 = r1.contains(r0)
            if (r0 != r3) goto L_0x01d9
            X.4gr r0 = new X.4gr
            r0.<init>(r11, r13)
            r2.LIZ(r0)
        L_0x01d9:
            java.util.List r1 = r11.getCustomActionItems()
            if (r1 == 0) goto L_0x01f3
            java.lang.String r0 = "report"
            boolean r0 = r1.contains(r0)
            if (r0 != r3) goto L_0x01f3
            X.4gl r1 = new X.4gl
            java.lang.String r0 = r11.getTrackInfo()
            r1.<init>(r11, r13, r0)
            r2.LIZ(r1)
        L_0x01f3:
            X.4rR r2 = r2.LIZ()
            X.4k3 r0 = com.ss.android.ugc.aweme.share.ShareDependService.LIZ
            com.ss.android.ugc.aweme.share.ShareDependService r1 = r0.LIZ()
            r0 = 2131887001(0x7f120399, float:1.9408597E38)
            X.4qA r1 = r1.LIZ(r10, r2, r0)
            r1.show()
            X.2fU r0 = X.2fU.LIZ
            r0.LIZ(r1)
        L_0x020c:
            return
        L_0x020d:
            r2.LJIILL = r4
            goto L_0x0141
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.share.ShareServiceImpl.LIZ(android.app.Activity, com.ss.android.ugc.aweme.feed.model.LiveEvent, X.4pf, X.KKi):void");
    }

    public final void LIZ(Activity activity, C3219JPu jPu) {
        Activity activity2 = activity;
        C3219JPu jPu2 = jPu;
        M12.LIZ(activity2, jPu2);
        FWk fWk = PoiSharePackage.LIZ;
        M12.LIZ(activity2, jPu2);
        Activity activity3 = activity2;
        M12.LIZ(activity3, jPu2);
        J7F j7f = new J7F();
        j7f.LIZ("point_of_interest");
        j7f.LIZIZ(jPu2.LIZIZ);
        j7f.LIZJ(jPu2.LIZJ);
        String string = activity3.getResources().getString(2131823116, new Object[]{Long.valueOf(jPu2.LIZLLL)});
        n.LIZIZ(string, "");
        j7f.LIZLLL(string);
        String str = jPu2.LIZIZ;
        String str2 = jPu2.LIZJ;
        long j = jPu2.LIZLLL;
        List<Aweme> list = jPu2.LJ;
        String str3 = jPu2.LIZ;
        String str4 = jPu2.LJIIJJI;
        ArrayList arrayList = new ArrayList();
        for (Aweme video : list) {
            Video video2 = video.getVideo();
            if (video2 != null) {
                arrayList.add(video2);
            }
        }
        List<Video> list2 = arrayList;
        ArrayList arrayList2 = new ArrayList(9HM.LIZ(list2, 10));
        for (Video video3 : list2) {
            UrlModel cover = video3.getCover();
            n.LIZIZ(cover, "");
            List urlList = cover.getUrlList();
            String videoId = video3.getVideoId();
            if (videoId == null) {
                videoId = "";
            }
            VideoCoverType videoCoverType = VideoCoverType.VIDEO;
            n.LIZIZ(urlList, "");
            UrlModel cover2 = video3.getCover();
            n.LIZIZ(cover2, "");
            arrayList2.add(new VideoCoverComponent(new ImageComponent(urlList, cover2.getUri(), 4), videoId, videoCoverType));
        }
        List LIZLLL = Lea.LIZLLL(arrayList2, 3);
        String str5 = "aweme://poi/detail?poi_id=" + str + "&enter_method=internal_share&enter_from=chat&poi_client_info=" + str4;
        ImageComponent imageComponent = new ImageComponent(Lel.INSTANCE, (String) null, 6);
        TextComponent textComponent = new TextComponent(str2);
        String string2 = activity3.getResources().getString(2131823116, new Object[]{Long.valueOf(j)});
        n.LIZIZ(string2, "");
        ImageCardTitleBar imageCardTitleBar = new ImageCardTitleBar(imageComponent, textComponent, new TextComponent(string2), 8);
        ActionLinkComponent actionLinkComponent = new ActionLinkComponent(6iy.LIZ(str5), ActionLinkType.DEEP_LINK);
        String string3 = activity3.getResources().getString(2131830739, new Object[]{str2});
        n.LIZIZ(string3, "");
        TextComponent textComponent2 = new TextComponent(string3);
        String string4 = activity3.getResources().getString(2131830738, new Object[]{str2});
        n.LIZIZ(string4, "");
        TextComponent textComponent3 = new TextComponent(string4);
        String string5 = activity3.getResources().getString(2131830737, new Object[]{str2});
        n.LIZIZ(string5, "");
        j7f.LJFF = new SendMessageTemplateTask("point_of_interest", new ImageCardTemplate(imageCardTitleBar, actionLinkComponent, LIZLLL, new PreviewHintComponent(textComponent2, textComponent3, new TextComponent(string5)), (BaseResponseComponent) null, new BaseRequestComponent(new QueryDataComponent(str, LWw.LIZ(new Cwu[]{CwZ.LIZ("subtitle", "common_use"), CwZ.LIZ("subtitle_args", fWk.LIZ(6iy.LIZ(Long.valueOf(j)))), CwZ.LIZ("sender_preview", "poidmcard_you_shared"), CwZ.LIZ("sender_preview_args", fWk.LIZ(6iy.LIZ(str2))), CwZ.LIZ("receiver_preview", "poidmcard_shared_location"), CwZ.LIZ("receiver_preview_args", fWk.LIZ(6iy.LIZ(str2))), CwZ.LIZ("quote_preview", "poidmcard_location"), CwZ.LIZ("quote_preview_args", fWk.LIZ(6iy.LIZ(str2)))}))), 16), new SendMessageEventParcel(str3));
        Bundle bundle = j7f.LJI;
        bundle.putString("enter_from", jPu2.LIZ);
        bundle.putString("poi_id", jPu2.LIZIZ);
        bundle.putString("poi_city", jPu2.LJFF);
        bundle.putString("poi_region_code", jPu2.LJI);
        bundle.putString("poi_backend_type", jPu2.LJII);
        bundle.putString("poi_info_source", jPu2.LJIIIIZZ);
        bundle.putString("enable_location", String.valueOf(jPu2.LJIIIZ));
        bundle.putString("previous_page", jPu2.LJIIJ);
        PoiSharePackage poiSharePackage = new PoiSharePackage(j7f);
        4rS r2 = new 4rS();
        r2.LIZ(poiSharePackage);
        C3223JPy.LIZ(r2, false, (Activity) null, false, 7);
        r2.LJJ = true;
        r2.LJ = true;
        r2.LIZ(new C3218JPt(jPu2));
        4qA LIZ2 = 4kK.LIZ(ShareDependService.LIZ.LIZ(), activity2, r2.LIZ());
        LIZ2.show();
        2fU.LIZ.LIZ(LIZ2);
    }

    public final void LIZ(4rS r3, Activity activity, boolean z) {
        M12.LIZ(r3);
        C3223JPy.LIZ(r3, z, activity, false, 4);
    }

    public final boolean LIZ() {
        return 9Y3.LIZ(9Y3.LIZ(), false, "download_video_with_mute", false);
    }

    public final void LIZ(Activity activity) {
        M12.LIZ(activity);
        M12.LIZ(activity);
        Intent intent = new Intent(activity, UserQRCodeActivity.class);
        3i8.LIZ(intent, activity);
        activity.startActivity(intent);
    }

    public final void LIZ(Activity activity, C3224JPz jPz, COa cOa, JQI jqi) {
        M12.LIZ(activity, jPz, cOa, jqi);
        M12.LIZ(activity, jPz, cOa, jqi);
        ShareDependService LIZ2 = ShareDependService.LIZ.LIZ();
        4rS r3 = new 4rS();
        C3223JPy.LIZ(r3, true, activity, false, 4);
        r3.LJJ = true;
        r3.LIZ(new C3156JNj());
        M12.LIZ(jPz);
        J7F j7f = new J7F();
        j7f.LIZ("product");
        j7f.LIZIZ(jPz.LIZ);
        String LIZJ = C3118JLx.LIZJ(C3118JLx.LIZIZ(jPz.LJ));
        if (LIZJ == null) {
            LIZJ = "";
        }
        j7f.LJ(LIZJ);
        String string = 9EH.LJJIFFI.LIZ().getResources().getString(2131824350);
        n.LIZIZ(string, "");
        j7f.LIZJ(string);
        String string2 = 9EH.LJJIFFI.LIZ().getResources().getString(2131824351);
        n.LIZIZ(string2, "");
        j7f.LIZLLL(string2);
        ProductSharePackage productSharePackage = new ProductSharePackage(j7f);
        Bundle bundle = productSharePackage.LJIILJJIL;
        bundle.putString("product_title", jPz.LIZIZ);
        bundle.putString("product_price", jPz.LJFF);
        bundle.putString("product_sales", jPz.LJI);
        bundle.putString("product_query_params", jPz.LIZLLL);
        bundle.putSerializable("product_picture", jPz.LJII);
        bundle.putString("seller_name", jPz.LJIIIZ);
        bundle.putSerializable("seller_avatar", jPz.LJIIJ);
        r3.LIZ(productSharePackage);
        4ri.LIZ(r3, 4kK.LIZ(LIZ2, productSharePackage, (String) null, 6));
        r3.LIZ(cOa);
        r3.LIZ(jqi);
        4qA LIZ3 = 4kK.LIZ(LIZ2, activity, r3.LIZ());
        LIZ3.show();
        2fU.LIZ.LIZ(LIZ3);
    }

    public final void LIZ(SharePackage sharePackage, String str, List<? extends IMContact> list, C2201IuO iuO) {
        SharePackage sharePackage2 = sharePackage;
        List<? extends IMContact> list2 = list;
        M12.LIZ(sharePackage2, list2);
        C2178Iu1.LIZ.LIZ(sharePackage2, str, list2, iuO, (BaseContent) null);
    }

    public final void LIZ(4rS r3, Activity activity) {
        M12.LIZ(r3);
        M12.LIZ(r3);
        JQW.LIZIZ.LIZ(r3, true, activity, true);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:20:0x003d, code lost:
        if (r5 != null) goto L_0x0027;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final boolean LIZ(X.OZG r5, java.lang.String r6) {
        /*
            r4 = this;
            r3 = 1
            r0 = 0
            if (r5 == 0) goto L_0x003c
            if (r6 == 0) goto L_0x003c
            java.util.List<java.lang.String> r0 = X.JQF.LIZ
            if (r0 == 0) goto L_0x003c
            boolean r0 = r5.isMuteShare()
            if (r0 == 0) goto L_0x003c
            java.util.List<java.lang.String> r2 = X.JQF.LIZ
            if (r2 != 0) goto L_0x0017
            kotlin.h.b.n.LIZIZ()
        L_0x0017:
            java.lang.String r1 = r6.toLowerCase()
            java.lang.String r0 = ""
            kotlin.h.b.n.LIZIZ(r1, r0)
            boolean r0 = r2.contains(r1)
            if (r0 == 0) goto L_0x003c
            r1 = 1
        L_0x0027:
            boolean r0 = r5.isPreventDownload()
            if (r0 == 0) goto L_0x0040
            boolean r0 = X.S9B.LJIIIZ()
            if (r0 == 0) goto L_0x0040
            com.ss.android.ugc.aweme.share.ShareService r0 = X.4B5.LIZ
            boolean r0 = r0.LIZ()
            if (r0 == 0) goto L_0x0040
        L_0x003b:
            return r3
        L_0x003c:
            r1 = 0
            if (r5 == 0) goto L_0x0040
            goto L_0x0027
        L_0x0040:
            r3 = r1
            goto L_0x003b
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.share.ShareServiceImpl.LIZ(X.OZG, java.lang.String):boolean");
    }

    /* JADX WARNING: type inference failed for: r7v4, types: [java.lang.Integer] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(android.content.Context r11) {
        /*
            r10 = this;
            X.M12.LIZ(r11)
            boolean r0 = X.Aqv.LIZ
            java.lang.String r8 = "group_id"
            java.lang.String r9 = "enter_from"
            r7 = 0
            java.lang.String r4 = "download_cancel"
            r2 = 0
            r6 = 1
            if (r0 == 0) goto L_0x007f
            boolean r0 = X.Aqv.LIZ
            if (r0 != 0) goto L_0x001d
            java.util.Set r0 = X.Aqv.LJIIIIZZ
            boolean r0 = r0.isEmpty()
            r0 = r0 ^ r6
            if (r0 == 0) goto L_0x007a
        L_0x001d:
            java.lang.String r0 = X.Aqv.LJIILLIIL
            com.ss.android.ugc.aweme.feed.model.Aweme r5 = X.Aqv.LJ
            int r3 = X.Aqv.LJI
            X.M12.LIZ(r0)
            X.2UX r1 = new X.2UX
            r1.<init>()
            r1.LIZ(r9, r0)
            if (r5 == 0) goto L_0x007d
            java.lang.String r0 = r5.getAid()
        L_0x0034:
            r1.LIZ(r8, r0)
            if (r5 == 0) goto L_0x0041
            int r0 = r5.getAwemeType()
            java.lang.Integer r7 = java.lang.Integer.valueOf(r0)
        L_0x0041:
            java.lang.String r0 = "aweme_type"
            r1.LIZ(r0, r7)
            if (r5 == 0) goto L_0x0058
            com.ss.android.ugc.aweme.feed.model.PhotoModeImageInfo r0 = r5.getPhotoModeImageInfo()
            if (r0 == 0) goto L_0x0058
            java.util.List r0 = r0.getImageList()
            if (r0 == 0) goto L_0x0058
            int r2 = r0.size()
        L_0x0058:
            java.lang.String r0 = "pic_cnt"
            r1.LIZ(r0, r2)
            java.lang.String r0 = "download_pic_cnt"
            r1.LIZ(r0, r3)
            java.util.Map r0 = r1.LIZ
            X.2nK.LIZ(r4, r0)
            int r0 = X.Aqv.LJFF
            if (r0 == 0) goto L_0x007a
            X.JR5 r0 = X.Aqv.LJIIL
            if (r0 == 0) goto L_0x007a
            int r1 = X.Aqv.LJFF
            com.ss.android.ugc.aweme.download.component_api.DownloadServiceManager r0 = com.ss.android.ugc.aweme.download.component_api.DownloadServiceManager.INSTANCE
            com.ss.android.ugc.aweme.download.component_api.service.IDownloadService r0 = r0.getDownloadService()
            r0.cancel(r1)
        L_0x007a:
            X.Aqv.LIZLLL = r6
            return
        L_0x007d:
            r0 = r7
            goto L_0x0034
        L_0x007f:
            X.M12.LIZ(r11)
            X.2UX r3 = new X.2UX
            r3.<init>()
            java.lang.String r0 = X.Ecz.LJI
            r3.LIZ(r9, r0)
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = X.Ecz.LJFF
            if (r0 == 0) goto L_0x0094
            java.lang.String r7 = r0.getAid()
        L_0x0094:
            r3.LIZ(r8, r7)
            boolean r1 = X.Ecz.LIZIZ()
            java.lang.String r0 = "is_downloading"
            r3.LIZ(r0, r1)
            java.util.Map r0 = r3.LIZ
            X.2nK.LIZ(r4, r0)
            X.JU3.LJJI = r6
            X.Ecz.LIZLLL = r6
            boolean r0 = X.Ecz.LIZIZ
            if (r0 == 0) goto L_0x00dd
            X.M12.LIZ(r11)
            com.ss.android.socialbase.downloader.downloader.Downloader r1 = com.ss.android.socialbase.downloader.downloader.Downloader.getInstance(r11)
            int r0 = X.JYQ.LIZJ
            r1.cancel(r0)
            X.Ecz.LIZIZ = r2
            com.ss.android.ugc.aweme.feedback.runtime.behavior.IRuntimeBehaviorService r0 = com.ss.android.ugc.aweme.feedback.runtime.behavior.RuntimeBehaviorServiceImpl.LIZJ()
            r0.LIZ((java.lang.String) r4)
        L_0x00c2:
            java.lang.String r0 = X.JQ4.LIZIZ
            X.805.LIZJ(r0)
            java.lang.String r0 = X.JQ4.LIZJ
            X.805.LIZJ(r0)
            X.4k3 r0 = com.ss.android.ugc.aweme.share.ShareDependService.LIZ
            com.ss.android.ugc.aweme.share.ShareDependService r0 = r0.LIZ()
            r0.LIZ(r2)
            X.JUF r0 = X.JQ4.LIZ
            if (r0 == 0) goto L_0x00dc
            r0.LIZIZ()
        L_0x00dc:
            return
        L_0x00dd:
            boolean r0 = X.Ecz.LIZJ
            if (r0 == 0) goto L_0x00c2
            X.5gM<com.ss.android.ugc.aweme.services.watermark.IWaterMarkService> r0 = X.JQ4.LIZLLL
            java.lang.Object r0 = r0.LIZIZ()
            com.ss.android.ugc.aweme.services.watermark.IWaterMarkService r0 = (com.ss.android.ugc.aweme.services.watermark.IWaterMarkService) r0
            if (r0 == 0) goto L_0x00ee
            r0.cancelWaterMark()
        L_0x00ee:
            X.Ecz.LIZJ = r2
            com.ss.android.ugc.aweme.feedback.runtime.behavior.IRuntimeBehaviorService r1 = com.ss.android.ugc.aweme.feedback.runtime.behavior.RuntimeBehaviorServiceImpl.LIZJ()
            java.lang.String r0 = "water_mark_cancel"
            r1.LIZ((java.lang.String) r0)
            goto L_0x00c2
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.share.ShareServiceImpl.LIZ(android.content.Context):void");
    }

    public final boolean LIZ(Aweme aweme) {
        ACLCommonShare downloadGeneral;
        ACLCommonShare downloadMaskPanel;
        if (aweme == null) {
            return false;
        }
        if (n.LIZ(JS5.LIZ, "long_press_download")) {
            AwemeACLShare awemeACLShareInfo = aweme.getAwemeACLShareInfo();
            if (awemeACLShareInfo == null || (downloadMaskPanel = awemeACLShareInfo.getDownloadMaskPanel()) == null || !downloadMaskPanel.getMute()) {
                return false;
            }
            return true;
        }
        AwemeACLShare awemeACLShareInfo2 = aweme.getAwemeACLShareInfo();
        if (awemeACLShareInfo2 == null || (downloadGeneral = awemeACLShareInfo2.getDownloadGeneral()) == null || !downloadGeneral.getMute()) {
            return false;
        }
        return true;
    }

    public final void LIZ(Context context, boolean z) {
        if (context != null) {
            0Gp.LIZ(new JQG(context, z));
        }
    }

    public final FPc LIZIZ() {
        return new Lwa();
    }

    public static ShareService LJ() {
        MethodCollector.i(9830);
        ShareService shareService = (ShareService) Lnj.LIZ(ShareService.class, false);
        if (shareService != null) {
            MethodCollector.o(9830);
            return shareService;
        }
        Object LIZIZ = Lnj.LIZIZ(ShareService.class, false);
        if (LIZIZ != null) {
            ShareService shareService2 = (ShareService) LIZIZ;
            MethodCollector.o(9830);
            return shareService2;
        }
        if (Lnj.bl == null) {
            synchronized (ShareService.class) {
                try {
                    if (Lnj.bl == null) {
                        Lnj.bl = new ShareServiceImpl();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(9830);
                    throw th;
                }
            }
        }
        ShareServiceImpl shareServiceImpl = (ShareServiceImpl) Lnj.bl;
        MethodCollector.o(9830);
        return shareServiceImpl;
    }

    public final void LIZ(int i) {
        Aqv.LJIILJJIL = i;
    }

    public final Aweme LIZ(SharePackage sharePackage) {
        if (!(sharePackage instanceof AwemeSharePackage)) {
            sharePackage = null;
        }
        AwemeSharePackage awemeSharePackage = (AwemeSharePackage) sharePackage;
        if (awemeSharePackage != null) {
            return awemeSharePackage.LIZ();
        }
        return null;
    }

    public final SharePackage LIZJ(Activity activity, GgT ggT, J7M j7m) {
        M12.LIZ(activity, ggT, j7m);
        return LiveSharePackage.LIZ.LIZ(ggT, (Context) activity);
    }

    public final F7C LIZ(Activity activity, Aweme aweme, int i) {
        M12.LIZ(activity, aweme);
        FEI fei = new FEI();
        if (i > 0) {
            fei.LIZ = i;
        }
        8bl.LIZ(new FEJ(activity, fei, aweme), 150);
        return fei;
    }

    public final void LIZLLL(Activity activity, GgT ggT, J7M j7m) {
        String str;
        M12.LIZ(activity, ggT, j7m);
        M12.LIZ(activity, ggT, j7m);
        M12.LIZ(ggT, activity);
        Bundle bundle = ggT.LJJJJIZL;
        if (bundle != null) {
            str = bundle.getString("third_party_desc");
        } else {
            str = null;
        }
        String str2 = "";
        if (str == null) {
            str = str2;
        }
        J7F j7f = new J7F();
        j7f.LIZ("subscribe_invite");
        String str3 = ggT.LJIIL;
        if (str3 == null) {
            str3 = str2;
        }
        j7f.LIZJ(str3);
        j7f.LIZLLL(str);
        j7f.LIZIZ("subscribe");
        String LIZJ = C3118JLx.LIZJ(C3118JLx.LIZIZ(ggT.LJIIJJI));
        if (LIZJ == null) {
            LIZJ = str2;
        }
        j7f.LJ(LIZJ);
        LiveSubscribeSharePackage liveSubscribeSharePackage = new LiveSubscribeSharePackage(j7f);
        Bundle bundle2 = liveSubscribeSharePackage.LJIILJJIL;
        bundle2.putString("author_name", ggT.LJIIJ);
        bundle2.putString("uid", String.valueOf(ggT.LIZIZ));
        bundle2.putString("url_for_im_share", ggT.LJJJJI);
        if (ggT.LJFF == null) {
            bundle2.putString("author_id", (String) null);
        } else {
            String str4 = ggT.LJFF;
            str4.toString();
            bundle2.putString("author_id", str4);
        }
        bundle2.putString("app_name", activity.getString(2131821672));
        if (!TextUtils.isEmpty(ggT.LJIILJJIL)) {
            bundle2.putString("thumb_url", ggT.LJIILJJIL);
        }
        String str5 = ggT.LJIILIIL;
        if (str5 != null) {
            str2 = str5;
        }
        bundle2.putString("subscribe_third_party_desc", str2);
        if (ggT.LJJJJIZL != null) {
            bundle2.putAll(ggT.LJJJJIZL);
        }
        M12.LIZ(activity, ggT, j7m, liveSubscribeSharePackage);
        4rS r3 = new 4rS();
        r3.LJJ = true;
        r3.LJIILL = false;
        4ri.LIZ(r3, ShareDependService.LIZ.LIZ().LIZIZ(liveSubscribeSharePackage, "subscribe_invite"));
        r3.LIZ(new C3156JNj());
        C3223JPy.LIZ(r3, false, (Activity) null, false, 7);
        r3.LJIL = true;
        r3.LIZ(liveSubscribeSharePackage);
        r3.LIZ(new J7L(liveSubscribeSharePackage, j7m));
        4qA LIZ2 = ShareDependService.LIZ.LIZ().LIZ(activity, r3.LIZ(), 2131887001);
        LIZ2.show();
        2fU.LIZ.LIZ(LIZ2);
    }

    public final Ef0 LIZ(User user, Activity activity, JTQ jtq) {
        String str;
        int i;
        Activity activity2 = activity;
        JTQ jtq2 = jtq;
        M12.LIZ(activity2, jtq2);
        C3221JPw jPw = UserSharePackage.LIZIZ;
        M12.LIZ(activity2, jtq2);
        User user2 = user;
        if (user2 == null || user2.getShareInfo() == null) {
            return null;
        }
        UserSharePackage LIZ2 = jPw.LIZ(user2, activity2, (List<? extends Aweme>) null);
        if (ESC.LJII(user2)) {
            str = "personal_homepage";
        } else {
            str = "others_homepage";
        }
        LIZ2.LJIILJJIL.putString("enter_from", str);
        LIZ2.LJIILJJIL.putString("enter_method", "button");
        4rS r3 = new 4rS();
        if (!ShareDependService.LIZ.LIZ().LIZJ()) {
            4ri.LIZ(r3, 4kK.LIZ(ShareDependService.LIZ.LIZ(), LIZ2, str, 4));
        }
        4B5.LIZ.LIZ(r3, activity2, true);
        r3.LJIIJ = 2131832496;
        r3.LJIILL = false;
        LayoutInflater from = LayoutInflater.from(activity2);
        if (JQ6.LIZ && ESC.LJII(user2)) {
            i = 2131561314;
        } else if (UserSharePackage.LIZIZ.LIZ(user2)) {
            i = 2131561313;
        } else {
            i = 2131561316;
        }
        r3.LJIILLIIL = C3221JPw.LIZ(from, i);
        if (46i.LJFF().isMe(user2.getUid()) || !user2.isSecret()) {
            r3.LIZ(new C3156JNj());
            2UX r2 = new 2UX();
            r2.LIZ("enter_method", "click_head");
            r2.LIZ("enter_from", str);
            r2.LIZ("author_id", user2.getUid());
            2nK.LIZ("share_person_show", r2.LIZ);
        } else {
            r3.LJ = true;
        }
        r3.LIZ(LIZ2);
        r3.LIZ(new Eei(LIZ2, str, activity2, user2));
        return new JT4(user2, activity2, jtq2, r3.LIZ(), (byte) 0);
    }

    public final Dialog LIZIZ(Activity activity, GgT ggT, J7M j7m) {
        AwemeRawAd awemeRawAd;
        AwemeRawAd awemeRawAd2;
        AwemeRawAd awemeRawAd3;
        2Oi aboutThisAd;
        Integer contentType;
        GgT ggT2 = ggT;
        J7M j7m2 = j7m;
        Activity activity2 = activity;
        M12.LIZ(activity2, ggT2, j7m2);
        Activity activity3 = activity2;
        LiveSharePackage LIZ2 = LiveSharePackage.LIZ.LIZ(ggT2, (Context) activity3);
        C3154JNh jNh = LiveSharePackage.LIZ;
        M12.LIZ(activity3, ggT2);
        ArrayList arrayList = new ArrayList();
        Aweme LIZIZ = AwemeService.LIZIZ().LIZIZ(ggT2.LJJJ);
        if (LIZIZ != null) {
            awemeRawAd = LIZIZ.getAwemeRawAd();
        } else {
            awemeRawAd = null;
        }
        KGj LIZ3 = K0c.LIZ("draw_ad", "otherclick", awemeRawAd);
        LIZ3.LIZIZ("refer", "press");
        LIZ3.LIZIZ();
        if (!(LIZIZ == null || !LIZIZ.isAd() || LIZIZ.getAwemeRawAd() == null || (awemeRawAd2 = LIZIZ.getAwemeRawAd()) == null || awemeRawAd2.getAboutThisAd() == null || ((awemeRawAd3 = LIZIZ.getAwemeRawAd()) != null && (aboutThisAd = awemeRawAd3.getAboutThisAd()) != null && (contentType = aboutThisAd.getContentType()) != null && contentType.intValue() == 0))) {
            arrayList.add(new C3153JNg(new 4gH(ggT2), 21));
        }
        if (ggT2.LJJIJL) {
            if (ggT2.LJJJIL) {
                arrayList.add(new C3153JNg(new 4sI(activity3, ggT2), 10));
            } else {
                arrayList.add(new C3153JNg(new GgV(activity3, ggT2), 10));
            }
        }
        if (ggT2.LJJIJLIJ) {
            if (ggT2.LJJJIL) {
                arrayList.add(new C3153JNg(new 4sJ(ggT2), 15));
            } else {
                arrayList.add(new C3153JNg(new 4sL(ggT2), 15));
            }
        }
        4rR LIZ4 = jNh.LIZ(activity3, ggT2, arrayList, j7m2, LIZ2);
        4j5 r7 = new 4j5(LIZ4.LJIIJ, LIZ4.LJIILIIL, LIZ4.LIZIZ, LiveSharePackage.LIZ.LIZ((Context) activity3, ggT2), false, 16);
        if ((n.LIZ(ggT2.LJJIII, "fyp_long_press") || n.LIZ(ggT2.LJJIII, "following_long_press")) && 4px.LIZ()) {
            LIZ4.LJJI = true;
            LIZ4.LIZLLL = true;
            LIZ4.LJIIIZ.LJIILJJIL.putString("enter_from", "feed_live_long_press");
            4kK.LIZ(ShareDependService.LIZ.LIZ(), activity3, LIZ4, (Bundle) null, 12);
            return null;
        }
        M12.LIZ(activity3, LIZ2, r7);
        return new 4j1(activity3, r7, new 4i1(LIZ2, r7));
    }

    public final F7C LIZ(Activity activity, Aweme aweme, Bundle bundle) {
        Aweme aweme2 = aweme;
        Bundle bundle2 = bundle;
        Activity activity2 = activity;
        M12.LIZ(activity2, aweme2, bundle2);
        JQE jqe = new JQE(bundle2);
        M12.LIZ(activity2, aweme2);
        String string = jqe.LIZ.getString("event_type", "");
        String string2 = jqe.LIZ.getString("enter_method", "");
        String string3 = jqe.LIZ.getString("show_reason", "");
        4pw.LIZIZ = true;
        AwemeSharePackage LIZ2 = JPK.LIZ(AwemeSharePackage.LIZJ, aweme2, activity2, -1, (String) null, (String) null, 24);
        4rS r6 = new 4rS();
        if (!IMUnder16ProxyImpl.LJ().LIZ()) {
            4ri.LIZ(r6, ShareDependService.LIZ.LIZ().LIZ(LIZ2, ""));
        }
        4re.LJIJI.LIZ(aweme2, r6, activity2, (ArrayList<String>) LeS.LIZLLL(new String[]{"whatsapp_status"}));
        r6.LIZ(LIZ2);
        r6.LIZ(new 4rj(aweme2, string, string2));
        FFh fFh = new FFh(aweme2, activity2, r6.LIZ());
        fFh.LIZIZ();
        4s9 r1 = 4s9.LIZLLL;
        n.LIZIZ(string3, "");
        String aid = aweme2.getAid();
        n.LIZIZ(aid, "");
        r1.LIZ(string3, aid);
        4s9.LIZLLL.LIZ().storeLong("last_guide_share_window_show_time", System.currentTimeMillis());
        4pw.LIZIZ = false;
        return fFh;
    }

    public final Dialog LIZ(Activity activity, GgT ggT, J7M j7m) {
        boolean z;
        3P1 LJ;
        3P1 LJ2;
        3P1 LJ3;
        GgT ggT2 = ggT;
        J7M j7m2 = j7m;
        Activity activity2 = activity;
        M12.LIZ(activity2, ggT2, j7m2);
        C3154JNh jNh = LiveSharePackage.LIZ;
        M12.LIZ(activity2, ggT2, j7m2);
        LiveSharePackage LIZ2 = jNh.LIZ(ggT2, (Context) activity2);
        ArrayList arrayList = new ArrayList();
        if (ggT2.LIZJ != -1) {
            IUserService createIUserServicebyMonsterPlugin = BaseUserService.createIUserServicebyMonsterPlugin(false);
            n.LIZIZ(createIUserServicebyMonsterPlugin, "");
            if (!n.LIZ(createIUserServicebyMonsterPlugin.getCurrentUserID(), String.valueOf(ggT2.LIZLLL))) {
                if (TextUtils.equals(ggT2.LJJIFFI, "live_links")) {
                    arrayList.add(new C3153JNg(new 4iV(activity2, ggT2), 10));
                } else if (ggT2.LJJJIL) {
                    arrayList.add(new C3153JNg(new 4sI(activity2, ggT2), 10));
                } else {
                    arrayList.add(new C3153JNg(new 4kv(activity2, ggT2), 10));
                }
            }
            arrayList.add(new C3153JNg(new Hml(activity2, ggT2), 20));
            if (!ggT2.LJIILLIIL) {
                arrayList.add(new C3153JNg(new Hmn(activity2, ggT2), 30));
            }
            ILiveOuterService LJJI = LiveOuterService.LJJI();
            if (!(LJJI == null || (LJ3 = LJJI.LJ()) == null || !LJ3.LJJIZ())) {
                arrayList.add(new C3153JNg(new Hmm(activity2, ggT2), 30));
            }
            if (ggT2.LJIIZILJ) {
                arrayList.add(new C3153JNg(new Hmo(ggT2), 40));
            }
            ILiveOuterService LJJI2 = LiveOuterService.LJJI();
            if (LJJI2 == null || (LJ2 = LJJI2.LJ()) == null) {
                z = false;
            } else {
                z = LJ2.LJJJ();
            }
            ILiveOuterService LJJI3 = LiveOuterService.LJJI();
            if (LJJI3 != null && (LJ = LJJI3.LJ()) != null && LJ.LIZ(ggT2.LJJIFFI, ggT2.LJJII) && z) {
                if (ggT2.LJJJIL) {
                    arrayList.add(new C3153JNg(new 4sJ(ggT2), 15));
                } else {
                    arrayList.add(new C3153JNg(new 4mZ(ggT2), 15));
                }
            }
        }
        return ShareDependService.LIZ.LIZ().LIZ(activity2, jNh.LIZ(activity2, ggT2, arrayList, j7m2, LIZ2), 2131887008);
    }

    public final SharePackage LIZ(Context context, Aweme aweme, String str, String str2) {
        Aweme aweme2 = aweme;
        Context context2 = context;
        String str3 = str;
        M12.LIZ(context2, aweme2);
        JPK jpk = AwemeSharePackage.LIZJ;
        if (str3 == null) {
            str3 = "";
        }
        return jpk.LIZ(aweme2, context2, 0, str3, str2);
    }

    public final F7C LIZ(Activity activity, Aweme aweme, CreateAwemeResponse createAwemeResponse, String[] strArr) {
        FFa iwl;
        Aweme aweme2 = aweme;
        Activity activity2 = activity;
        CreateAwemeResponse createAwemeResponse2 = createAwemeResponse;
        M12.LIZ(activity2, aweme2, createAwemeResponse2);
        4rp r3 = new 4rp();
        M12.LIZ(activity2, aweme2, createAwemeResponse2);
        2kf.LIZ(4, "SilentShare", "silent share: ".concat(String.valueOf(C2352Iwp.LIZ.LIZ())));
        AwemeSharePackage LIZ2 = JPK.LIZ(AwemeSharePackage.LIZJ, aweme2, activity2, -1, (String) null, (String) null, 24);
        4rS r4 = new 4rS();
        if (!IMUnder16ProxyImpl.LJ().LIZ()) {
            C2352Iwp iwp = C2352Iwp.LIZ;
            if (!(iwp.LIZ() == 1 || iwp.LIZ() == 2 || iwp.LIZ() == 3 || iwp.LIZ() == 4)) {
                4ri.LIZ(r4, ShareDependService.LIZ.LIZ().LIZ(LIZ2, "post_page"));
            }
        }
        4re.LJIJI.LIZ(aweme2, r4, activity2, (ArrayList<String>) LeS.LIZLLL(new String[]{"whatsapp_status"}));
        r4.LIZ(LIZ2);
        r4.LIZ(new 4rk(aweme2));
        String[] strArr2 = strArr;
        if (C2352Iwp.LIZ.LIZ() == 0) {
            iwl = new C2395IxW(activity2, r4.LIZ(), strArr2, aweme2);
        } else if (C2352Iwp.LIZ.LJ()) {
            iwl = new C2349Iwm(activity2, r4.LIZ(), strArr2, aweme2, r3.LIZ(activity2));
        } else {
            iwl = new C2348Iwl(activity2, r4.LIZ(), strArr2, aweme2, r3.LIZ(activity2));
        }
        iwl.LJIILIIL = aweme2;
        iwl.LIZ(createAwemeResponse2);
        return iwl;
    }

    public final TuxSheet LIZIZ(Activity activity, Fragment fragment, Aweme aweme, 2YM<Etp> r8, Bundle bundle) {
        M12.LIZ(activity, fragment, aweme, r8, bundle);
        4rY r0 = 4rY.LIZ;
        M12.LIZ(activity, fragment, aweme, r8, bundle);
        4rR LIZ2 = r0.LIZ(activity, aweme, r8, bundle);
        ShareDependService LIZ3 = ShareDependService.LIZ.LIZ();
        Integer.valueOf(2131887008);
        return 4kK.LIZ(LIZ3, activity, LIZ2, (Bundle) null, 8);
    }

    public final 4qA LIZ(Activity activity, Fragment fragment, Aweme aweme, 2YM<Etp> r7, Bundle bundle) {
        M12.LIZ(activity, fragment, aweme, r7, bundle);
        4rY r0 = 4rY.LIZ;
        M12.LIZ(activity, fragment, aweme, r7, bundle);
        4qA LIZ2 = ShareDependService.LIZ.LIZ().LIZ(activity, r0.LIZ(activity, aweme, r7, bundle), 2131887008);
        LIZ2.show();
        2fU.LIZ.LIZ(LIZ2);
        return LIZ2;
    }

    public final 4rR LIZ(Activity activity, B9N b9n, COa cOa, String str, String str2) {
        String str3;
        String str4;
        boolean z;
        M12.LIZ(activity, b9n, cOa, str2);
        M12.LIZ(activity, b9n, cOa, str2);
        J7F j7f = new J7F();
        j7f.LIZ("qna");
        j7f.LIZIZ(String.valueOf(b9n.LIZIZ));
        ShareInfo shareInfo = b9n.LJFF;
        String str5 = null;
        if (shareInfo != null) {
            str3 = shareInfo.getShareTitle();
        } else {
            str3 = null;
        }
        String str6 = "";
        if (str3 == null) {
            str3 = str6;
        }
        j7f.LIZJ(str3);
        ShareInfo shareInfo2 = b9n.LJFF;
        if (shareInfo2 == null || (str4 = shareInfo2.getShareDescInfo()) == null) {
            str4 = str6;
        }
        j7f.LIZLLL(str4);
        ShareInfo shareInfo3 = b9n.LJFF;
        if (shareInfo3 != null) {
            str5 = shareInfo3.getShareUrl();
        }
        String LIZJ = C3118JLx.LIZJ(C3118JLx.LIZIZ(str5));
        if (LIZJ != null) {
            str6 = LIZJ;
        }
        j7f.LJ(str6);
        QnASharePackage qnASharePackage = new QnASharePackage(j7f);
        qnASharePackage.LJIILJJIL.putLong("qna_id", b9n.LIZIZ);
        qnASharePackage.LJIILJJIL.putString("qna_name", b9n.LIZJ);
        qnASharePackage.LJIILJJIL.putString("app_name", activity.getString(2131821672));
        qnASharePackage.LJIILJJIL.putString("process_id", str);
        4hF.LIZ(qnASharePackage.LJIILJJIL, "aweme_cover_list", b9n.LJI);
        4rS r1 = new 4rS();
        r1.LIZ(qnASharePackage);
        if (b9n.LJFF != null) {
            z = true;
        } else {
            z = false;
        }
        C3223JPy.LIZ(r1, z, activity, z);
        if (z) {
            r1.LIZ(new C3156JNj());
        }
        r1.LIZ(cOa);
        return r1.LIZ();
    }

    public final TuxSheet LIZIZ(Activity activity, Fragment fragment, Aweme aweme, boolean z, 2YM<Etp> r18, Bundle bundle) {
        boolean z2;
        Fragment fragment2 = fragment;
        Activity activity2 = activity;
        Aweme aweme2 = aweme;
        Bundle bundle2 = bundle;
        2YM<Etp> r11 = r18;
        M12.LIZ(activity2, fragment2, aweme2, r11, bundle2);
        4re r6 = new 4re(activity2, fragment2, aweme2, z, r11, bundle2);
        if (!r6.LIZIZ(r6.LJIILLIIL)) {
            return null;
        }
        JPK jpk = AwemeSharePackage.LIZJ;
        Aweme aweme3 = r6.LJIILLIIL;
        Activity activity3 = r6.LJIILL;
        int i = r6.LIZ;
        String str = r6.LIZIZ;
        n.LIZIZ(str, "");
        String str2 = r6.LIZJ;
        n.LIZIZ(str2, "");
        AwemeSharePackage LIZ2 = jpk.LIZ(aweme3, activity3, i, str, str2);
        LIZ2.LJIILJJIL.putAll(r6.LJIJ);
        LIZ2.LJIILJJIL.putString("enter_method", "icon");
        LIZ2.LJIILJJIL.putBoolean("is_video_only", r6.LJIILJJIL);
        if (4kD.LIZ.LIZ() || 4rh.LIZ.LIZ(r6.LJIILJJIL)) {
            z2 = true;
        } else {
            z2 = false;
        }
        4rS r5 = new 4rS();
        r5.LIZ(LIZ2);
        JQ3.LIZ(r5, z2);
        r6.LIZ(LIZ2, r5, z2);
        if (!r6.LIZ(r6.LJIILLIIL) || !r6.LIZ() || r6.LJIILL.isFinishing()) {
            return null;
        }
        LIZ2.LJIILJJIL.putString("author_id", 4wQ.LIZ(r6.LJIILLIIL));
        LIZ2.LJIILJJIL.putString("enter_from", r6.LIZIZ);
        LIZ2.LJIILJJIL.putString("content_type", 4wQ.LJI(r6.LJIILLIIL));
        JS5.LIZ(r5, r6.LIZIZ, r6.LJIILLIIL);
        return 4kK.LIZ(ShareDependService.LIZ.LIZ(), r6.LJIILL, r5.LIZ(), r6.LJIJ, 4);
    }
}
