WeChat.apk(点击下载) / p.java


package pf3;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Base64;
import bw3.wz4;
import bz.c1;
import com.tencent.mm.R;
import com.tencent.mm.autogen.events.DoFavoriteEvent;
import com.tencent.mm.opensdk.constants.Build;
import com.tencent.mm.opensdk.constants.ConstantsAPI;
import com.tencent.mm.opensdk.modelmsg.SendMessageToWX;
import com.tencent.mm.opensdk.modelmsg.WXFileObject;
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
import com.tencent.mm.opensdk.modelmsg.WXMusicVideoObject;
import com.tencent.mm.opensdk.modelmsg.WXMusicVipInfo;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MMApplicationContext;
import com.tencent.tinker.loader.hotplug.EnvConsts;
import com.tencent.wechat.aff.ting.TingClientProto;
import com.tencent.wechat.aff.ting.TingProto;
import ek4.y;
import ih.s1;
import java.util.List;
import k30.a;
import lh4.m;
import m60.d;
import nf0.z0;
import qd3.z;
import qh1.n1;
import sv3.b;
import sz.h;
import ve3.a0;
import wg4.b0;
import xf3.k;
import xf3.n;
import xg4.u;
import yz3.j;
import zz.g;

public final class p implements Runnable {

    /* renamed from: d  reason: collision with root package name */
    public final /* synthetic */ long f282927d;

    /* renamed from: e  reason: collision with root package name */
    public final /* synthetic */ l f282928e;

    /* renamed from: f  reason: collision with root package name */
    public final /* synthetic */ Activity f282929f;

    /* renamed from: g  reason: collision with root package name */
    public final /* synthetic */ TingClientProto.TingItem f282930g;

    /* renamed from: h  reason: collision with root package name */
    public final /* synthetic */ byte[] f282931h;

    public p(long j15, l lVar, Activity activity, TingClientProto.TingItem tingItem, byte[] bArr) {
        this.f282927d = j15;
        this.f282928e = lVar;
        this.f282929f = activity;
        this.f282930g = tingItem;
        this.f282931h = bArr;
    }

    public final void run() {
        TingProto.MMListenCommentInfo mMListenCommentInfo;
        String str;
        String str2;
        String str3;
        String str4;
        TingProto.MMListenMusicInfo musicInfo;
        String extraInfo;
        TingProto.MMListenMusicInfo musicInfo2;
        TingProto.MMListenMusicInfo musicInfo3;
        TingProto.MMListenMusicInfo musicInfo4;
        TingProto.MMListenMusicInfo musicInfo5;
        TingProto.MMListenMusicInfo musicInfo6;
        TingProto.MMListenMusicInfo musicInfo7;
        TingProto.MMListenMusicInfo musicInfo8;
        long j15 = this.f282927d;
        boolean z15 = false;
        boolean z16 = true;
        String str5 = "";
        TingProto.MMListenMusicInfo mMListenMusicInfo = null;
        if (j15 == 1) {
            k c15 = this.f282928e.c();
            Activity activity = this.f282929f;
            TingClientProto.TingItem tingItem = this.f282930g;
            m.f(tingItem, "tingItem");
            c15.getClass();
            m.g(activity, "context");
            Object[] objArr = new Object[2];
            TingProto.MMListenItem listenItem = tingItem.getListenItem();
            objArr[0] = listenItem != null ? listenItem.getListenId() : null;
            TingProto.MMListenItem listenItem2 = tingItem.getListenItem();
            objArr[1] = (listenItem2 == null || (musicInfo8 = listenItem2.getMusicInfo()) == null) ? null : musicInfo8.getSongName();
            Log.i("MicroMsg.TingShareHelper", "shareMusicToChat listenId: %s, songName: %s", objArr);
            TingProto.MMListenItem listenItem3 = tingItem.getListenItem();
            if (listenItem3 != null && listenItem3.getType() == 100) {
                Log.i("MicroMsg.TingShareHelper", "shareLocalFileToChat fileName: " + tingItem.getListenItem().getLocalFileInfo().getFileName() + ", filePath: " + tingItem.getListenItem().getLocalFileInfo().getFilePath());
                WXMediaMessage wXMediaMessage = new WXMediaMessage(new WXFileObject(tingItem.getListenItem().getLocalFileInfo().getFilePath()));
                wXMediaMessage.title = tingItem.getListenItem().getLocalFileInfo().getFileName();
                SendMessageToWX.Req req = new SendMessageToWX.Req();
                req.scene = 0;
                req.transaction = null;
                req.message = wXMediaMessage;
                Bundle bundle = new Bundle();
                req.toBundle(bundle);
                bundle.putInt(ConstantsAPI.SDK_VERSION, Build.SDK_INT);
                bundle.putString(ConstantsAPI.APP_PACKAGE, "com.tencent.mm.openapi");
                bundle.putString("SendAppMessageWrapper_AppId", str5);
                bundle.putBoolean("SendAppMessageWrapper_NoNeedStayInWeixin", true);
                Intent intent = new Intent();
                intent.setClassName(activity, "com.tencent.mm.ui.transmit.SendAppMessageWrapperUI");
                intent.putExtras(bundle);
                Intent intent2 = new Intent();
                intent2.setClassName(activity, "com.tencent.mm.ui.transmit.SelectConversationUI");
                intent2.putExtra("Select_Conv_NextStep", intent);
                a aVar = new a();
                aVar.c(intent2);
                j30.a.d(activity, aVar.b(), "com/tencent/mm/plugin/ting/helper/TingShareHelper", "shareLocalFileToChat", "(Landroid/content/Context;Lcom/tencent/wechat/aff/ting/TingClientProto$TingItem;)V", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
                activity.startActivity((Intent) aVar.a(0));
                j30.a.e(activity, "com/tencent/mm/plugin/ting/helper/TingShareHelper", "shareLocalFileToChat", "(Landroid/content/Context;Lcom/tencent/wechat/aff/ting/TingClientProto$TingItem;)V", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
                return;
            }
            String g15 = c15.g(tingItem);
            if (g15 != null) {
                String Ke = ((g) j.c(g.class)).Ke(i0.c(tingItem));
                Intent intent3 = new Intent();
                intent3.putExtra("Retr_Msg_Type", 2);
                intent3.putExtra("Retr_Msg_content", g15);
                intent3.putExtra("Multi_Retr", true);
                intent3.putExtra("Retr_go_to_chattingUI", false);
                intent3.putExtra("Retr_show_success_tips", true);
                intent3.putExtra("Retr_Msg_thumb_path", Ke);
                intent3.putExtra("Retr_Msg_thumb_url", i0.c(tingItem));
                b.u(activity, ".ui.transmit.MsgRetransmitUI", intent3, 1001);
            }
        } else if (j15 == 2) {
            k c16 = this.f282928e.c();
            Activity activity2 = this.f282929f;
            TingClientProto.TingItem tingItem2 = this.f282930g;
            m.f(tingItem2, "tingItem");
            c16.getClass();
            m.g(activity2, "context");
            TingProto.MMListenItem listenItem4 = tingItem2.getListenItem();
            int type = listenItem4 != null ? listenItem4.getType() : 0;
            WXMusicVideoObject wXMusicVideoObject = new WXMusicVideoObject();
            wXMusicVideoObject.musicUrl = i0.i(tingItem2);
            wXMusicVideoObject.musicDataUrl = i0.h(tingItem2);
            wXMusicVideoObject.singerName = i0.b(tingItem2);
            TingProto.MMListenItem listenItem5 = tingItem2.getListenItem();
            wXMusicVideoObject.songLyric = (listenItem5 == null || (musicInfo7 = listenItem5.getMusicInfo()) == null) ? null : musicInfo7.getLyric();
            TingProto.MMListenItem listenItem6 = tingItem2.getListenItem();
            if (listenItem6 == null || (musicInfo6 = listenItem6.getMusicInfo()) == null || (str = musicInfo6.getAlbumName()) == null) {
                str = str5;
            }
            wXMusicVideoObject.albumName = str;
            TingProto.MMListenItem listenItem7 = tingItem2.getListenItem();
            if (listenItem7 == null || (musicInfo5 = listenItem7.getMusicInfo()) == null || (str2 = musicInfo5.getGenre()) == null) {
                str2 = str5;
            }
            wXMusicVideoObject.musicGenre = str2;
            TingProto.MMListenItem listenItem8 = tingItem2.getListenItem();
            wXMusicVideoObject.issueDate = (listenItem8 == null || (musicInfo4 = listenItem8.getMusicInfo()) == null) ? 0 : musicInfo4.getPublicTimeS();
            TingProto.MMListenItem listenItem9 = tingItem2.getListenItem();
            if (listenItem9 == null || (musicInfo3 = listenItem9.getMusicInfo()) == null || (str3 = musicInfo3.getIdentification()) == null) {
                str3 = str5;
            }
            wXMusicVideoObject.identification = str3;
            wXMusicVideoObject.duration = i0.d(tingItem2);
            WXMusicVipInfo wXMusicVipInfo = new WXMusicVipInfo();
            TingProto.MMListenItem listenItem10 = tingItem2.getListenItem();
            if (listenItem10 == null || (musicInfo2 = listenItem10.getMusicInfo()) == null || (str4 = musicInfo2.getMusicGetlinkMid()) == null) {
                str4 = str5;
            }
            wXMusicVipInfo.musicId = str4;
            wXMusicVideoObject.musicVipInfo = wXMusicVipInfo;
            String str6 = wXMusicVideoObject.musicUrl;
            if (str6 == null || str6.length() == 0) {
                wXMusicVideoObject.musicUrl = b.f282814b;
            }
            WXMediaMessage wXMediaMessage2 = new WXMediaMessage();
            wXMediaMessage2.mediaObject = wXMusicVideoObject;
            wXMediaMessage2.title = i0.g(tingItem2);
            wXMediaMessage2.description = wXMusicVideoObject.singerName;
            wXMediaMessage2.thumbData = null;
            TingProto.MMListenItem listenItem11 = tingItem2.getListenItem();
            if (!(listenItem11 == null || (musicInfo = listenItem11.getMusicInfo()) == null || (extraInfo = musicInfo.getExtraInfo()) == null)) {
                str5 = extraInfo;
            }
            wXMediaMessage2.messageExt = str5;
            Intent intent4 = new Intent();
            Bundle bundle2 = new Bundle();
            i0.c(tingItem2);
            String str7 = wXMusicVideoObject.musicVipInfo.musicId;
            SendMessageToWX.Req req2 = new SendMessageToWX.Req();
            req2.message = wXMediaMessage2;
            req2.toBundle(bundle2);
            intent4.putExtra("Ksnsupload_timeline", bundle2);
            if (type == 1) {
                z15 = true;
            }
            if (z15) {
                intent4.putExtra("Ksnsupload_appid", i0.a(tingItem2));
            }
            intent4.putExtra("music_mv_cover_url", i0.c(tingItem2));
            intent4.putExtra("Ksnsupload_musicid", tingItem2.getListenItem().getListenId());
            intent4.putExtra("Ksnsupload_appname", MMApplicationContext.getContext().getString(R.string.bnx));
            String a15 = z0.a("music_player");
            z0.d().c(a15, true).i("prePublishId", "music_player");
            intent4.putExtra("reportSessionId", a15);
            intent4.putExtra("Ksnsupload_music_share_object_xml", ((c1) j.c(c1.class)).dq0(c16.f(tingItem2)).b());
            intent4.putExtra("Ksnsupload_type", 37);
            intent4.putExtra("need_result", true);
            intent4.putExtra("Ksnsupload_source", 1);
            b.u(activity2, ".plugin.sns.ui.SnsUploadUI", intent4, 1002);
        } else if (j15 == 3) {
            k c17 = this.f282928e.c();
            Activity activity3 = this.f282929f;
            TingClientProto.TingItem tingItem3 = this.f282930g;
            m.f(tingItem3, "tingItem");
            c17.getClass();
            m.g(activity3, "context");
            TingProto.MMListenItem listenItem12 = tingItem3.getListenItem();
            if (listenItem12 != null && listenItem12.getType() == 100) {
                z15 = true;
            }
            if (z15) {
                Log.i("MicroMsg.TingShareHelper", "favLocalFile fileName: " + tingItem3.getListenItem().getLocalFileInfo().getFileName() + ", filePath: " + tingItem3.getListenItem().getLocalFileInfo().getFilePath());
                DoFavoriteEvent doFavoriteEvent = new DoFavoriteEvent();
                doFavoriteEvent.f62174d.f62184i = activity3;
                ((n1) j.c(n1.class)).wv0(doFavoriteEvent, 36, tingItem3.getListenItem().getLocalFileInfo().getFilePath(), tingItem3.getListenItem().getLocalFileInfo().getFileName(), "");
                d.O(new xf3.m(doFavoriteEvent));
                return;
            }
            ((g) j.c(g.class)).I10(i0.c(tingItem3), new n(tingItem3, activity3, c17));
        } else if (j15 == 4) {
            try {
                mMListenCommentInfo = TingProto.MMListenCommentInfo.parseFrom(this.f282931h);
            } catch (Exception unused) {
                mMListenCommentInfo = null;
            }
            k c18 = this.f282928e.c();
            Activity activity4 = this.f282929f;
            TingClientProto.TingItem tingItem4 = this.f282930g;
            m.f(tingItem4, "tingItem");
            c18.getClass();
            m.g(activity4, EnvConsts.ACTIVITY_MANAGER_SRVNAME);
            if (mMListenCommentInfo == null) {
                Log.e("MicroMsg.TingShareHelper", "setMusicToStatus commentInfo is null");
                return;
            }
            try {
                wz4 wz4 = new wz4();
                TingProto.MMListenItem listenItem13 = tingItem4.getListenItem();
                wz4.f41647d = listenItem13 != null ? listenItem13.getListenId() : null;
                wz4.f41648e = mMListenCommentInfo.getStatusCoverUrl();
                String encodeToString = Base64.encodeToString(wz4.toByteArray(), 2);
                m.f(encodeToString, "{\n            Base64.enc…Base64.NO_WRAP)\n        }");
                str5 = encodeToString;
            } catch (Exception e15) {
                Log.e("MicroMsg.TingShareHelper", "getStatusFooterJumpListen exp: " + e15.getMessage());
            }
            if (y.n(str5)) {
                Log.e("MicroMsg.TingShareHelper", "statusFooterJumpListen is null");
                return;
            }
            a0 a0Var = new a0();
            a0Var.f325223d = "15";
            a0Var.f325226g = str5;
            b0 b0Var = b0.f332794a;
            List<a0> h15 = u.h(a0Var);
            if (tingItem4.getListenItem().getType() == 1) {
                TingProto.MMListenItem listenItem14 = tingItem4.getListenItem();
                if (listenItem14 == null || !listenItem14.hasMusicInfo()) {
                    z16 = false;
                }
                if (z16) {
                    TingProto.MMListenItem listenItem15 = tingItem4.getListenItem();
                    if (listenItem15 != null) {
                        mMListenMusicInfo = listenItem15.getMusicInfo();
                    }
                    if (mMListenMusicInfo != null) {
                        a0 a0Var2 = new a0();
                        a0Var2.f325223d = "1";
                        a0Var2.f325225f = ((s1) j.c(s1.class)).Ry0(tingItem4);
                        h15.add(a0Var2);
                    }
                }
            }
            a0 a0Var3 = new a0();
            a0Var3.f325223d = "3";
            a0Var3.f325225f = "https://support.weixin.qq.com/security/readtemplate?t=w_security_center_website/upgrade&scene=1#wechat_redirect";
            h15.add(a0Var3);
            z.a aVar2 = new z.a();
            aVar2.a(mMListenCommentInfo.getStatusIconId());
            aVar2.f289149a.f325204e = c18.a(tingItem4);
            aVar2.e("listen@inner");
            aVar2.f(mMListenCommentInfo.getStatusTailIconText());
            aVar2.d(mMListenCommentInfo.getStatusTailIconUrl());
            aVar2.g(mMListenCommentInfo.getStatusBase64());
            aVar2.b(h15);
            z zVar = aVar2.f289149a;
            zVar.f325206g = false;
            ((h) j.c(h.class)).zs(activity4, 1003, zVar);
        }
    }
}