package mg0; import a.f; import android.content.Context; import android.graphics.Bitmap; import android.os.Bundle; import android.util.ArrayMap; import android.widget.Toast; import androidx.fragment.app.FragmentManager; import com.meituan.robust.ChangeQuickRedirect; import com.meituan.robust.PatchProxy; import com.meituan.robust.PatchProxyResult; import com.meizu.cloud.pushsdk.constants.PushConstants; import com.shizhuang.duapp.R; import com.shizhuang.duapp.common.base.BaseApplication; import com.shizhuang.duapp.common.ui.BaseActivity; import com.shizhuang.duapp.modules.identify_forum.api.ForumFacade; import com.shizhuang.duapp.modules.identify_forum.model.ForumDetailShareImageModel; import com.shizhuang.duapp.modules.identify_forum.report.IdentifyShareEventReportHelper; import com.shizhuang.duapp.modules.identify_forum.ui.detail.ForumDetailShareImageFragment; import com.shizhuang.duapp.modules.router.ServiceManager; import com.shizhuang.duapp.modules.share.PlatformClickListener; import com.shizhuang.duapp.modules.share.ShareDialog; import com.shizhuang.duapp.modules.share.ShareIconBean; import com.shizhuang.duapp.modules.share.ShareLineType; import com.shizhuang.duapp.modules.share.callback.DuShareListener; import com.shizhuang.duapp.modules.share.constance.SHARE_MEDIA; import com.shizhuang.model.trend.PersonalLetterLinkModel; import com.shizhuang.model.trend.PersonalLetterModel; import df.q; import java.util.ArrayList; import kotlin.jvm.internal.Intrinsics; import pb1.i; import pb1.m; import td.s; import xf0.e; import y20.b0; public final class g { /* renamed from: a */ public static final g f35584a = new g(); public static ChangeQuickRedirect changeQuickRedirect; private static String shareContentId; public static final class a implements PlatformClickListener { public static ChangeQuickRedirect changeQuickRedirect; /* renamed from: a */ public final /* synthetic */ i f35585a; public final /* synthetic */ String b; /* renamed from: c */ public final /* synthetic */ String f35586c; public final /* synthetic */ String d; public a(i iVar, String str, String str2, String str3) { this.f35585a = iVar; this.b = str; this.f35586c = str2; this.d = str3; } @Override // com.shizhuang.duapp.modules.share.PlatformClickListener public final boolean onPlatformClick(int i, ShareDialog shareDialog) { boolean z = true; PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i), shareDialog}, this, changeQuickRedirect, false, 170523, new Class[]{Integer.TYPE, ShareDialog.class}, Boolean.TYPE); if (proxy.isSupported) { return ((Boolean) proxy.result).booleanValue(); } int i3 = 10; if (i == 1) { i3 = 0; } else if (i == 2) { i3 = 1; } else if (i == 3) { i3 = 3; } else if (i == 4) { i3 = 2; } else if (i == 7) { i3 = 4; } else if (i != 10) { i3 = -1; } i iVar = this.f35585a; iVar.F(this.f35585a.m() + "&platform=" + i3); String str = Intrinsics.areEqual(this.b, "177") ? "" : "218"; l30.b bVar = l30.b.f34999a; String str2 = this.b; ArrayMap arrayMap = new ArrayMap(8); if (str2.length() > 0) { arrayMap.put("current_page", str2); } if (str.length() <= 0) { z = false; } if (z) { arrayMap.put("block_type", str); } arrayMap.put("identify_content_id", this.f35586c); arrayMap.put("identify_content_type", this.d); arrayMap.put("identify_share_platform_id", String.valueOf(i3)); bVar.b("identify_content_share_platform_click", arrayMap); e.a(e.f40028a, "23", null, 2); return false; } } public static final class b implements DuShareListener { public static ChangeQuickRedirect changeQuickRedirect; public static final class a extends s<Object> { public a(Context context) { super(context); } } @Override // com.shizhuang.duapp.modules.share.callback.DuShareListener public void onCancel(SHARE_MEDIA share_media) { if (!PatchProxy.proxy(new Object[]{share_media}, this, changeQuickRedirect, false, 170525, new Class[]{SHARE_MEDIA.class}, Void.TYPE).isSupported && SHARE_MEDIA.QQ != share_media) { Toast.makeText(pb1.g.a(), "分享取消", 0).show(); } } @Override // com.shizhuang.duapp.modules.share.callback.DuShareListener public void onError(SHARE_MEDIA share_media, Throwable th2) { if (!PatchProxy.proxy(new Object[]{share_media, th2}, this, changeQuickRedirect, false, 170526, new Class[]{SHARE_MEDIA.class, Throwable.class}, Void.TYPE).isSupported) { m.a(th2); } } @Override // com.shizhuang.duapp.modules.share.callback.DuShareListener public void onResult(SHARE_MEDIA share_media) { if (!PatchProxy.proxy(new Object[]{share_media}, this, changeQuickRedirect, false, 170524, new Class[]{SHARE_MEDIA.class}, Void.TYPE).isSupported) { String d = g.f35584a.d(); if (d != null) { ForumFacade.f16465a.z(d, new a(BaseApplication.b())); } Toast.makeText(pb1.g.a(), "分享成功", 0).show(); } } @Override // com.shizhuang.duapp.modules.share.callback.DuShareListener public void onStart(SHARE_MEDIA share_media) { boolean z = PatchProxy.proxy(new Object[]{share_media}, this, changeQuickRedirect, false, 170527, new Class[]{SHARE_MEDIA.class}, Void.TYPE).isSupported; } } public static final class c implements PlatformClickListener { public static ChangeQuickRedirect changeQuickRedirect; /* renamed from: a */ public final /* synthetic */ ForumDetailShareImageModel f35587a; public final /* synthetic */ FragmentManager b; /* renamed from: c */ public final /* synthetic */ Context f35588c; public final /* synthetic */ String d; public final /* synthetic */ String e; public final /* synthetic */ ShareDialog f; /* renamed from: g */ public final /* synthetic */ String f35589g; /* renamed from: h */ public final /* synthetic */ i f35590h; public final /* synthetic */ String i; public c(ForumDetailShareImageModel forumDetailShareImageModel, FragmentManager fragmentManager, Context context, String str, String str2, ShareDialog shareDialog, String str3, i iVar, String str4) { this.f35587a = forumDetailShareImageModel; this.b = fragmentManager; this.f35588c = context; this.d = str; this.e = str2; this.f = shareDialog; this.f35589g = str3; this.f35590h = iVar; this.i = str4; } @Override // com.shizhuang.duapp.modules.share.PlatformClickListener public final boolean onPlatformClick(int i3, ShareDialog shareDialog) { ForumDetailShareImageFragment forumDetailShareImageFragment; PersonalLetterModel personalLetterModel; int i12 = 1; PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3), shareDialog}, this, changeQuickRedirect, false, 170528, new Class[]{Integer.TYPE, ShareDialog.class}, Boolean.TYPE); if (proxy.isSupported) { return ((Boolean) proxy.result).booleanValue(); } if (i3 == 6) { ForumDetailShareImageFragment.a aVar = ForumDetailShareImageFragment.j; ForumDetailShareImageModel forumDetailShareImageModel = this.f35587a; PatchProxyResult proxy2 = PatchProxy.proxy(new Object[]{forumDetailShareImageModel}, aVar, ForumDetailShareImageFragment.a.changeQuickRedirect, false, 167378, new Class[]{ForumDetailShareImageModel.class}, ForumDetailShareImageFragment.class); if (proxy2.isSupported) { forumDetailShareImageFragment = (ForumDetailShareImageFragment) proxy2.result; } else { Bundle bundle = new Bundle(); bundle.putParcelable("shareImageModel", forumDetailShareImageModel); forumDetailShareImageFragment = new ForumDetailShareImageFragment(); forumDetailShareImageFragment.setArguments(bundle); } FragmentManager fragmentManager = this.b; if (fragmentManager == null) { forumDetailShareImageFragment.i((BaseActivity) this.f35588c); } else { forumDetailShareImageFragment.k(fragmentManager); } IdentifyShareEventReportHelper.f16529a.a(this.d, this.e, 5); this.f.dismissAllowingStateLoss(); } else if (i3 != 16) { if (i3 == 1) { i12 = 0; } else if (i3 != 2) { i12 = i3 != 3 ? i3 != 4 ? i3 != 6 ? i3 != 7 ? i3 != 10 ? -1 : 10 : 4 : 5 : 2 : 3; } i iVar = this.f35590h; iVar.F(this.f35590h.m() + "&platform=" + i12); IdentifyShareEventReportHelper.f16529a.a(this.d, this.e, Integer.valueOf(i12)); e.a(e.f40028a, "23", null, 2); this.f.dismissAllowingStateLoss(); return false; } else { StringBuilder h12 = f.h("https://m.poizon.com/router/identification/identifyComDetailEncrypt?contentId="); h12.append(this.f35589g); String sb2 = h12.toString(); String n = this.f35590h.n(); String str = this.i; PatchProxyResult proxy3 = PatchProxy.proxy(new Object[]{n, str, sb2}, null, b0.changeQuickRedirect, true, 101217, new Class[]{String.class, String.class, String.class}, PersonalLetterModel.class); if (proxy3.isSupported) { personalLetterModel = (PersonalLetterModel) proxy3.result; } else { PersonalLetterModel personalLetterModel2 = new PersonalLetterModel(); personalLetterModel2.type = 6; PersonalLetterLinkModel personalLetterLinkModel = new PersonalLetterLinkModel(); personalLetterLinkModel.title = n; personalLetterLinkModel.cover = str; personalLetterLinkModel.jumpUrl = sb2; personalLetterModel2.innerSite = personalLetterLinkModel; personalLetterModel = personalLetterModel2; } d30.b.f31309a.q(this.f35588c, personalLetterModel); IdentifyShareEventReportHelper.f16529a.a(this.d, this.e, 19); this.f.dismissAllowingStateLoss(); } return true; } } public static final class d implements DuShareListener { public static ChangeQuickRedirect changeQuickRedirect; public static final class a extends s<Object> { public a(Context context) { super(context); } } @Override // com.shizhuang.duapp.modules.share.callback.DuShareListener public void onCancel(SHARE_MEDIA share_media) { if (!PatchProxy.proxy(new Object[]{share_media}, this, changeQuickRedirect, false, 170530, new Class[]{SHARE_MEDIA.class}, Void.TYPE).isSupported && SHARE_MEDIA.QQ != share_media) { q.r("分享取消"); } } @Override // com.shizhuang.duapp.modules.share.callback.DuShareListener public void onError(SHARE_MEDIA share_media, Throwable th2) { if (!PatchProxy.proxy(new Object[]{share_media, th2}, this, changeQuickRedirect, false, 170531, new Class[]{SHARE_MEDIA.class, Throwable.class}, Void.TYPE).isSupported) { m.a(th2); } } @Override // com.shizhuang.duapp.modules.share.callback.DuShareListener public void onResult(SHARE_MEDIA share_media) { if (!PatchProxy.proxy(new Object[]{share_media}, this, changeQuickRedirect, false, 170529, new Class[]{SHARE_MEDIA.class}, Void.TYPE).isSupported) { String d = g.f35584a.d(); if (d != null) { ForumFacade.f16465a.z(d, new a(BaseApplication.b())); } q.r("分享成功"); } } @Override // com.shizhuang.duapp.modules.share.callback.DuShareListener public void onStart(SHARE_MEDIA share_media) { boolean z = PatchProxy.proxy(new Object[]{share_media}, this, changeQuickRedirect, false, 170532, new Class[]{SHARE_MEDIA.class}, Void.TYPE).isSupported; } } /* JADX WARNING: Removed duplicated region for block: B:19:0x00f4 A[ADDED_TO_REGION] */ public final i a(String str, String str2, String str3, String str4, String str5, Bitmap bitmap) { String str6; String str7; PatchProxyResult proxy = PatchProxy.proxy(new Object[]{str, str2, str3, str4, str5, bitmap}, this, changeQuickRedirect, false, 170521, new Class[]{String.class, String.class, String.class, String.class, String.class, Bitmap.class}, i.class); if (proxy.isSupported) { return (i) proxy.result; } i iVar = new i(); shareContentId = str; StringBuilder h12 = f.h("分享 ShareBaseUrl:"); g gVar = f35584a; h12.append(gVar.c()); fo.a.i(h12.toString(), new Object[0]); if (str5 != null) { int hashCode = str5.hashCode(); if (hashCode != 48) { if (hashCode == 49 && str5.equals("1")) { str7 = gVar.c() + "hybird/h5community/identify-center-column?contentId=" + str; str6 = a40.f.g(str3, "在得物App鉴别讨论区发布了专栏,快来围观"); iVar.C(str6); iVar.G(str2); if (Intrinsics.areEqual(str5, PushConstants.PUSH_TYPE_UPLOAD_LOG) || str4 == null) { iVar.u(str4); } else { iVar.r(bitmap); } iVar.D(iVar.l() + ' ' + str7 + " (分享自 @得物APP)"); iVar.s(iVar.n()); iVar.F(str7); return iVar; } } else if (str5.equals("0")) { str7 = gVar.c() + "hybird/h5community/identify-center-share?contentId=" + str; str6 = a40.f.g(str3, "在得物App鉴别讨论区发布了内容,快来看真假"); iVar.C(str6); iVar.G(str2); if (Intrinsics.areEqual(str5, PushConstants.PUSH_TYPE_UPLOAD_LOG)) { } iVar.u(str4); iVar.D(iVar.l() + ' ' + str7 + " (分享自 @得物APP)"); iVar.s(iVar.n()); iVar.F(str7); return iVar; } } str7 = gVar.c() + "hybird/h5community/identify-center-share?contentId=" + str; str6 = a40.f.g(str3, "在得物App鉴别讨论区发布了视频,快来围观"); iVar.C(str6); iVar.G(str2); if (Intrinsics.areEqual(str5, PushConstants.PUSH_TYPE_UPLOAD_LOG)) { } iVar.u(str4); iVar.D(iVar.l() + ' ' + str7 + " (分享自 @得物APP)"); iVar.s(iVar.n()); iVar.F(str7); return iVar; } public final String c() { PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 170522, new Class[0], String.class); if (proxy.isSupported) { return (String) proxy.result; } String snsShareUrl = ServiceManager.o().getCommunityInitViewModel().getSnsShareUrl(); if (snsShareUrl != null) { fo.a.i(a40.f.g("分享 ==> ShareBaseUrl 11:", snsShareUrl), new Object[0]); return snsShareUrl; } String g3 = qc.f.g(); if (g3 != null) { fo.a.i(a40.f.g("分享 ==> ShareBaseUrl 22:", g3), new Object[0]); return g3; } fo.a.i("分享 ==> ShareBaseUrl 33: https://m.poizon.com/", new Object[0]); return "https://m.poizon.com/"; } public final String d() { PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 170515, new Class[0], String.class); return proxy.isSupported ? (String) proxy.result : shareContentId; } public final void e(FragmentManager fragmentManager, i iVar, String str, String str2, String str3) { if (!PatchProxy.proxy(new Object[]{fragmentManager, iVar, str, str2, str3}, this, changeQuickRedirect, false, 170519, new Class[]{FragmentManager.class, i.class, String.class, String.class, String.class}, Void.TYPE).isSupported) { ShareDialog.l(ShareLineType.LINE_TYPE_FIVE).G().w(new a(iVar, str3, str2, str)).y(new b()).x(iVar).E(fragmentManager); } } public final void f(FragmentManager fragmentManager, i iVar, String str, String str2, Context context, String str3, String str4, ForumDetailShareImageModel forumDetailShareImageModel) { ShareDialog shareDialog; if (!PatchProxy.proxy(new Object[]{fragmentManager, iVar, str, str2, context, str3, str4, forumDetailShareImageModel}, this, changeQuickRedirect, false, 170520, new Class[]{FragmentManager.class, i.class, String.class, String.class, Context.class, String.class, String.class, ForumDetailShareImageModel.class}, Void.TYPE).isSupported) { ArrayList<ShareIconBean> h12 = ShareDialog.h(); h12.add(0, new ShareIconBean(R.mipmap.du_share_peronal_latter, R.string.du_share_personal_letter, 16)); ShareDialog m = ShareDialog.m(h12); m.G(); Object[] objArr = {new Integer((int) R.mipmap.du_share_generate_pics), new Integer((int) R.string.identify_share_generate_pics), new Integer(6)}; ChangeQuickRedirect changeQuickRedirect2 = ShareDialog.changeQuickRedirect; Class cls = Integer.TYPE; PatchProxyResult proxy = PatchProxy.proxy(objArr, m, changeQuickRedirect2, false, 321792, new Class[]{cls, cls, cls}, ShareDialog.class); if (proxy.isSupported) { shareDialog = (ShareDialog) proxy.result; } else { shareDialog = m.f(new ShareIconBean(R.mipmap.du_share_generate_pics, R.string.identify_share_generate_pics, 6)); } shareDialog.w(new c(forumDetailShareImageModel, fragmentManager, context, str2, str, m, str4, iVar, str3)).y(new d()).x(iVar).E(fragmentManager); } } }