package sc2; import a23.l4; import android.app.Activity; import android.graphics.Bitmap; import android.net.Uri; import android.os.Build; import bd2.d; import com.alibaba.wireless.security.open.securitybodysdk.ISecurityBodyPageTrack; import com.igexin.push.core.d.c; import com.taobao.android.dexposed.ClassUtils; import com.xingin.sharesdk.R$string; import com.xingin.socialsdk.ShareEntity; import com.xingin.utils.core.d1; import com.xingin.utils.core.q; import dw2.r; import ed2.b; import f5.j; import fd2.s; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import kotlin.Metadata; import kotlin.collections.CollectionsKt__CollectionsKt; import kotlin.jvm.internal.Intrinsics; import kotlin.text.Typography; import oc2.k; import oc2.x; import wc2.k1; import y7.f; import yj2.g; import z60.h; @Metadata(bv = {}, d1 = {"\u0000@\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010$\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0013\n\u0002\u0018\u0002\n\u0002\b\u000f\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b1\u00102J\u0006\u0010\u0003\u001a\u00020\u0002Jb\u0010\u0012\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\b\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\u00062\u0012\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060\n2\u0018\b\u0002\u0010\u000f\u001a\u0012\u0012\f\u0012\n\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\r\u0018\u00010\f2\n\b\u0002\u0010\u0011\u001a\u0004\u0018\u00010\u0010H\u0007Jb\u0010\u0013\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\b\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\u00062\u0012\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060\n2\u0018\b\u0002\u0010\u000f\u001a\u0012\u0012\f\u0012\n\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\r\u0018\u00010\f2\n\b\u0002\u0010\u0011\u001a\u0004\u0018\u00010\u0010H\u0002Jn\u0010\u0015\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\b\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\u00062\u0012\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060\n2\u0018\b\u0002\u0010\u000f\u001a\u0012\u0012\f\u0012\n\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\r\u0018\u00010\f2\n\b\u0002\u0010\u0011\u001a\u0004\u0018\u00010\u00102\n\b\u0002\u0010\u0014\u001a\u0004\u0018\u00010\u000eH\u0002J\u0010\u0010\u0017\u001a\u00020\u00062\u0006\u0010\u0016\u001a\u00020\u0006H\u0002R\"\u0010\u0018\u001a\u00020\u00068\u0006@\u0006X\u000e¢\u0006\u0012\n\u0004\b\u0018\u0010\u0019\u001a\u0004\b\u001a\u0010\u001b\"\u0004\b\u001c\u0010\u001dR\"\u0010\u001e\u001a\u00020\u00068\u0006@\u0006X\u000e¢\u0006\u0012\n\u0004\b\u001e\u0010\u0019\u001a\u0004\b\u001f\u0010\u001b\"\u0004\b \u0010\u001dR\"\u0010!\u001a\u00020\u00068\u0006@\u0006X\u000e¢\u0006\u0012\n\u0004\b!\u0010\u0019\u001a\u0004\b\"\u0010\u001b\"\u0004\b#\u0010\u001dR\"\u0010%\u001a\u00020$8\u0006@\u0006X\u000e¢\u0006\u0012\n\u0004\b%\u0010&\u001a\u0004\b'\u0010(\"\u0004\b)\u0010*R\"\u0010+\u001a\u00020\u00068\u0006@\u0006X\u000e¢\u0006\u0012\n\u0004\b+\u0010\u0019\u001a\u0004\b,\u0010\u001b\"\u0004\b-\u0010\u001dR\"\u0010.\u001a\u00020\u00068\u0006@\u0006X\u000e¢\u0006\u0012\n\u0004\b.\u0010\u0019\u001a\u0004\b/\u0010\u001b\"\u0004\b0\u0010\u001d¨\u00063"}, d2 = {"Lsc2/p;", "", "", c.f25536c, "Landroid/app/Activity;", "activity", "", "imagePath", "source", ISecurityBodyPageTrack.PAGE_ID_KEY, "", "url", "Ldw2/r;", "Lf5/j;", "Landroid/graphics/Bitmap;", "miniProgramObservable", "Loc2/k;", "shareCallback", "j", "o", "bgBitmap", "m", "word", "c", "searchWord", "Ljava/lang/String;", "getSearchWord", "()Ljava/lang/String;", "e", "(Ljava/lang/String;)V", "searchSessionId", "getSearchSessionId", "d", "searchWordFromStr", "getSearchWordFromStr", "g", "La23/l4;", "searchWordFrom", "La23/l4;", "getSearchWordFrom", "()La23/l4;", f.f156778k, "(La23/l4;)V", "title", "getTitle", "i", "subTitle", "getSubTitle", h.f160753a, "<init>", "()V", "sharesdk_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: SearchScreenshotShare.kt */ public final class p { /* renamed from: a reason: collision with root package name */ public x f129306a; /* renamed from: b reason: collision with root package name */ public String f129307b = ""; /* renamed from: c reason: collision with root package name */ public String f129308c = ""; /* renamed from: d reason: collision with root package name */ public String f129309d = ""; /* renamed from: e reason: collision with root package name */ public l4 f129310e = l4.DEFAULT_17; /* renamed from: f reason: collision with root package name */ public String f129311f = ""; /* renamed from: g reason: collision with root package name */ public String f129312g = ""; /* renamed from: h reason: collision with root package name */ public long f129313h; @Metadata(bv = {}, d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\b\u0010\u0006\u001a\u00020\u0004H\u0016¨\u0006\u0007"}, d2 = {"sc2/p$a", "Led2/b;", "Landroid/graphics/Bitmap;", "bitmap", "", "a", "onFail", "sharesdk_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: SearchScreenshotShare.kt */ public static final class a implements b { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ Activity f129314a; /* renamed from: b reason: collision with root package name */ public final /* synthetic */ g f129315b; /* renamed from: c reason: collision with root package name */ public final /* synthetic */ p f129316c; /* renamed from: d reason: collision with root package name */ public final /* synthetic */ String f129317d; /* renamed from: e reason: collision with root package name */ public final /* synthetic */ String f129318e; /* renamed from: f reason: collision with root package name */ public final /* synthetic */ String f129319f; /* renamed from: g reason: collision with root package name */ public final /* synthetic */ Map<String, String> f129320g; /* renamed from: h reason: collision with root package name */ public final /* synthetic */ r<j<Bitmap>> f129321h; /* renamed from: i reason: collision with root package name */ public final /* synthetic */ k f129322i; public a(Activity activity, g gVar, p pVar, String str, String str2, String str3, Map<String, String> map, r<j<Bitmap>> rVar, k kVar) { this.f129314a = activity; this.f129315b = gVar; this.f129316c = pVar; this.f129317d = str; this.f129318e = str2; this.f129319f = str3; this.f129320g = map; this.f129321h = rVar; this.f129322i = kVar; } @Override // ed2.b public void a(Bitmap bitmap) { g gVar; Intrinsics.checkNotNullParameter(bitmap, "bitmap"); if (!this.f129314a.isFinishing() && (gVar = this.f129315b) != null && gVar.isShowing()) { this.f129316c.m(this.f129314a, this.f129317d, this.f129318e, this.f129319f, this.f129320g, this.f129321h, this.f129322i, bitmap); this.f129315b.dismiss(); } } @Override // ed2.b public void onFail() { g gVar; if (!this.f129314a.isFinishing() && (gVar = this.f129315b) != null && gVar.isShowing()) { p.n(this.f129316c, this.f129314a, this.f129317d, this.f129318e, this.f129319f, this.f129320g, this.f129321h, this.f129322i, null, 128, null); this.f129315b.dismiss(); } } } public static /* synthetic */ void k(p pVar, Activity activity, String str, String str2, String str3, Map map, r rVar, k kVar, int i10, Object obj) { pVar.j(activity, str, str2, str3, map, (i10 & 32) != 0 ? null : rVar, (i10 & 64) != 0 ? null : kVar); } public static final void l(Activity activity, p pVar, String str, String str2, String str3, Map map, r rVar, k kVar) { Intrinsics.checkNotNullParameter(activity, "$activity"); Intrinsics.checkNotNullParameter(pVar, "this$0"); Intrinsics.checkNotNullParameter(str, "$imagePath"); Intrinsics.checkNotNullParameter(str2, "$source"); Intrinsics.checkNotNullParameter(str3, "$pageId"); Intrinsics.checkNotNullParameter(map, "$url"); if (!activity.isFinishing() && !activity.isDestroyed()) { pVar.o(activity, str, str2, str3, map, rVar, kVar); } } public static /* synthetic */ void n(p pVar, Activity activity, String str, String str2, String str3, Map map, r rVar, k kVar, Bitmap bitmap, int i10, Object obj) { pVar.m(activity, str, str2, str3, map, (i10 & 32) != 0 ? null : rVar, (i10 & 64) != 0 ? null : kVar, (i10 & 128) != 0 ? null : bitmap); } public final String c(String str) { LinkedHashSet linkedHashSet = new LinkedHashSet(); linkedHashSet.add(' '); linkedHashSet.add((char) 12288); linkedHashSet.add(','); linkedHashSet.add((char) 65292); linkedHashSet.add((char) 12290); linkedHashSet.add(Character.valueOf(ClassUtils.PACKAGE_SEPARATOR_CHAR)); linkedHashSet.add('@'); linkedHashSet.add((char) 65312); linkedHashSet.add('#'); linkedHashSet.add((char) 65283); StringBuilder sb3 = new StringBuilder(); int length = str.length(); for (int i10 = 0; i10 < length; i10++) { char charAt = str.charAt(i10); if (!linkedHashSet.contains(Character.valueOf(charAt))) { sb3.append(charAt); } } String sb4 = sb3.toString(); Intrinsics.checkNotNullExpressionValue(sb4, "sb.toString()"); return sb4; } public final void d(String str) { Intrinsics.checkNotNullParameter(str, "<set-?>"); this.f129308c = str; } public final void e(String str) { Intrinsics.checkNotNullParameter(str, "<set-?>"); this.f129307b = str; } public final void f(l4 l4Var) { Intrinsics.checkNotNullParameter(l4Var, "<set-?>"); this.f129310e = l4Var; } public final void g(String str) { Intrinsics.checkNotNullParameter(str, "<set-?>"); this.f129309d = str; } public final void h(String str) { Intrinsics.checkNotNullParameter(str, "<set-?>"); this.f129312g = str; } public final void i(String str) { Intrinsics.checkNotNullParameter(str, "<set-?>"); this.f129311f = str; } public final void j(Activity activity, String str, String str2, String str3, Map<String, String> map, r<j<Bitmap>> rVar, k kVar) { Intrinsics.checkNotNullParameter(activity, "activity"); Intrinsics.checkNotNullParameter(str, "imagePath"); Intrinsics.checkNotNullParameter(str2, "source"); Intrinsics.checkNotNullParameter(str3, ISecurityBodyPageTrack.PAGE_ID_KEY); Intrinsics.checkNotNullParameter(map, "url"); if (Build.VERSION.SDK_INT < 23) { d1.m(new o(activity, this, str, str2, str3, map, rVar, kVar), 350); } else { o(activity, str, str2, str3, map, rVar, kVar); } } public final void m(Activity activity, String str, String str2, String str3, Map<String, String> map, r<j<Bitmap>> rVar, k kVar, Bitmap bitmap) { String str4; ShareEntity shareEntity = new ShareEntity(); shareEntity.W(2); shareEntity.H(str); shareEntity.E(activity.getString(R$string.f62683sharesdk_cover_snapshot_title)); boolean z14 = true; String str5 = "https://www.xiaohongshu.com/activity/sem/walle?groupid=5dae8b7de145f500018e3f56"; if (!map.isEmpty()) { for (String str6 : map.keySet()) { if (Intrinsics.areEqual(str6, "deeplink")) { str4 = Uri.parse(map.get(str6)).buildUpon().appendQueryParameter("source", str2 + "_Screenshot").build().toString(); } else { str4 = map.get(str6); } str5 = str5 + Typography.amp + q.a(str6) + '=' + q.a(str4); } } shareEntity.L(str5 + "&ckey=CK1434137644978"); x xVar = this.f129306a; if (xVar != null) { xVar.j(); } x xVar2 = new x(shareEntity); this.f129306a = xVar2; String string = activity.getString(R$string.dy8); long j14 = this.f129313h; Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.sharesdk_title)"); xVar2.D(new s(str, string, bitmap, false, j14, 8, null)); xVar2.A(new k1(activity, this.f129311f, this.f129312g, rVar)); List<bd2.a> j15 = d.f6848a.j(); xVar2.y(j15); String c14 = c(this.f129307b); if (c14.length() <= 0) { z14 = false; } if (z14) { ((ArrayList) j15).add(0, cd2.c.f11510a.f()); xVar2.z(new vc2.x(activity, c14, shareEntity.j())); } List<bd2.a> s14 = xVar2.s(); if (s14 == null) { s14 = CollectionsKt__CollectionsKt.emptyList(); } xVar2.y(xVar2.u(activity, s14)); xVar2.B(new zc2.j(str3, this.f129308c, this.f129307b, this.f129309d, this.f129310e)); xVar2.x(new z(kVar)); x.J(xVar2, activity, "Screenshot", null, null, 12, null); } public final void o(Activity activity, String str, String str2, String str3, Map<String, String> map, r<j<Bitmap>> rVar, k kVar) { g a14 = g.a(activity); a14.setCancelable(false); a14.show(); ed2.f.o("file://" + str, new a(activity, a14, this, str, str2, str3, map, rVar, kVar), null, 4, null); } public final void p() { this.f129313h = System.currentTimeMillis(); } }