package rl2; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Looper; import android.text.TextUtils; import bh0.n; import bw3.gk3; import bw3.ml1; import com.tencent.mm.R; import com.tencent.mm.opensdk.constants.Build; import com.tencent.mm.opensdk.modelmsg.WXMediaMessage; import com.tencent.mm.opensdk.modelmsg.WXMusicVideoObject; import com.tencent.mm.pluginsdk.model.app.j; import com.tencent.mm.pluginsdk.model.app.q1; import com.tencent.mm.sdk.platformtools.Log; import com.tencent.mm.sdk.platformtools.Util; import ed4.d; import java.net.URLDecoder; import lh4.f0; import lh4.m; import ln.l; import p64.q; import p64.u; public final class c0 { /* renamed from: a reason: collision with root package name */ public static final c0 f295173a = new c0(); public static final class a implements u { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ Context f295174a; /* renamed from: b reason: collision with root package name */ public final /* synthetic */ n f295175b; /* renamed from: c reason: collision with root package name */ public final /* synthetic */ ml1 f295176c; /* renamed from: d reason: collision with root package name */ public final /* synthetic */ q1 f295177d; public a(Context context, n nVar, ml1 ml12, q1 q1Var) { this.f295174a = context; this.f295175b = nVar; this.f295176c = ml12; this.f295177d = q1Var; } @Override // p64.u public final void a(boolean z15, String str) { try { c0.f295173a.d(this.f295174a, this.f295175b, this.f295176c); q1 q1Var = this.f295177d; if (q1Var != null) { q1Var.a(true, false); } } catch (Exception e15) { Log.printErrStackTrace("MusicUIUtil", e15, "launchQQMusic exception", new Object[0]); q1 q1Var2 = this.f295177d; if (q1Var2 != null) { q1Var2.a(false, false); } } } } public static final class b implements u { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ q1 f295178a; public b(q1 q1Var) { this.f295178a = q1Var; } @Override // p64.u public final void a(boolean z15, String str) { q1 q1Var = this.f295178a; if (q1Var != null) { q1Var.a(false, true); } } } public static final class c<I, O> implements ed4.a { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ q f295179a; public c(q qVar) { this.f295179a = qVar; } @Override // ed4.a public Object a(Object obj) { d.b bVar = (d.b) obj; this.f295179a.o(); return null; } } public static final class d implements u { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ Context f295180a; /* renamed from: b reason: collision with root package name */ public final /* synthetic */ Intent f295181b; /* renamed from: c reason: collision with root package name */ public final /* synthetic */ q1 f295182c; public d(Context context, Intent intent, q1 q1Var) { this.f295180a = context; this.f295181b = intent; this.f295182c = q1Var; } @Override // p64.u public final void a(boolean z15, String str) { try { Context context = this.f295180a; Intent intent = this.f295181b; k30.a aVar = new k30.a(); aVar.c(intent); j30.a.d(context, aVar.b(), "com/tencent/mm/plugin/music/model/MusicUIUtil$doJumpToQQMusicPayment$4", "onDialogClick", "(ZLjava/lang/String;)V", "Undefined", "startActivity", "(Landroid/content/Intent;)V"); context.startActivity((Intent) aVar.a(0)); j30.a.e(context, "com/tencent/mm/plugin/music/model/MusicUIUtil$doJumpToQQMusicPayment$4", "onDialogClick", "(ZLjava/lang/String;)V", "Undefined", "startActivity", "(Landroid/content/Intent;)V"); q1 q1Var = this.f295182c; if (q1Var != null) { q1Var.a(true, false); } } catch (Exception e15) { Log.printErrStackTrace("MusicUIUtil", e15, "launchQQMusic exception", new Object[0]); q1 q1Var2 = this.f295182c; if (q1Var2 != null) { q1Var2.a(false, false); } } } } public static final class e implements u { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ q1 f295183a; public e(q1 q1Var) { this.f295183a = q1Var; } @Override // p64.u public final void a(boolean z15, String str) { q1 q1Var = this.f295183a; if (q1Var != null) { q1Var.a(false, true); } } } public static final class f<I, O> implements ed4.a { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ q f295184a; public f(q qVar) { this.f295184a = qVar; } @Override // ed4.a public Object a(Object obj) { d.b bVar = (d.b) obj; this.f295184a.o(); return null; } } public final void a(Context context, n nVar, ml1 ml12, q1 q1Var) { String str; String str2; m.g(context, "context"); m.g(nVar, "wrapper"); j appInfo = ((l) yz3.j.c(l.class)).getAppInfo(nVar.f12717t); if (TextUtils.isEmpty(nVar.f12717t) || appInfo == null || TextUtils.isEmpty(appInfo.field_packageName)) { Log.e("MusicUIUtil", "doJumpToAppSongPage do nothing"); return; } Log.i("MusicUIUtil", "doJumpToAppSongPage launch third party app, package name:%s", appInfo.field_packageName); WXMusicVideoObject wXMusicVideoObject = new WXMusicVideoObject(); wXMusicVideoObject.musicUrl = nVar.f12713p; wXMusicVideoObject.musicDataUrl = nVar.f12711n; String str3 = ""; if (ml12 == null || (str = ml12.f29885t) == null) { str = str3; } wXMusicVideoObject.identification = URLDecoder.decode(str); WXMediaMessage wXMediaMessage = new WXMediaMessage(wXMusicVideoObject); wXMediaMessage.sdkVer = Build.SDK_INT; if (!(ml12 == null || (str2 = ml12.f29884s) == null)) { str3 = str2; } wXMediaMessage.messageExt = URLDecoder.decode(str3); f0 f0Var = new f0(); gk3 gk32 = (gk3) ((ky.b) yz3.j.c(ky.b.class)).Vw0(context, 7, gk3.class); if (gk32 != null) { T t15 = (T) new Bundle(); t15.putString("current_page_biz_info", gk32.f22772e); t15.putString("current_page_source_info", "music_operation_webview"); f0Var.f253292d = t15; } ((l) yz3.j.c(l.class)).ny(context, nVar.f12717t, wXMediaMessage, 0, q1Var, f0Var.f253292d); } /* JADX WARNING: Code restructure failed: missing block: B:6:0x002a, code lost: if ((r17.length() == 0) != false) goto L_0x002c; */ public final void b(Context context, String str, String str2, String str3, String str4, n nVar, ml1 ml12, q1 q1Var) { String str5; String str6; String str7; m.g(context, "context"); m.g(nVar, "wrapper"); if (str != null) { } if (m.b("wx5aa333606550dfd5", nVar.f12717t)) { Log.e("MusicUIUtil", "token is empty"); if (q1Var != null) { q1Var.a(false, false); return; } return; } Log.i("MusicUIUtil", "AppId:%s", nVar.f12717t); String str8 = ""; if (!((l) yz3.j.c(l.class)).so0(context, nVar.f12717t)) { String JN0 = ((l) yz3.j.c(l.class)).JN0(context, ((l) yz3.j.c(l.class)).getAppInfo(nVar.f12717t)); if (JN0 != null) { str8 = JN0; } if (str8.length() > 0) { str7 = context.getString(R.string.g_7, str8); } else { str7 = context.getString(R.string.g_6); } m.f(str7, "if (appName.isNotEmpty()…d_app_tips)\n }"); q qVar = new q(context); qVar.g(str7); qVar.n(context.getString(R.string.g_4)); qVar.j(context.getString(R.string.f367394sg)); qVar.l(new a(context, nVar, ml12, q1Var)); qVar.i(new b(q1Var)); if (m.b(Looper.myLooper(), Looper.getMainLooper())) { qVar.o(); return; } ed4.d<d.b> b15 = ed4.d.b(); b15.f206967b = ed4.d.f206964j; b15.f(new c(qVar)).g(); return; } boolean z15 = !TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3) && !TextUtils.isEmpty(str4); if (m.b("wx5aa333606550dfd5", nVar.f12717t)) { str5 = "qqmusic://qq.com/other/wxpurchase?wx_membership_ticket=" + str; Log.i("MusicUIUtil", "launchQQMusic qqMusicActionUrl: %s", str5); } else if (z15) { m.d(str2); str5 = str2; } else { Log.i("MusicUIUtil", "launchMusic doJumpToAppSongPage"); a(context, nVar, ml12, q1Var); return; } Log.i("MusicUIUtil", "launchMusic launchScheme: %s", str5); Uri parse = Uri.parse(str5); if (parse == null) { Log.w("MusicUIUtil", "launchMusic parse music scheme action url fail, url %s", str5); if (q1Var != null) { q1Var.a(false, false); return; } return; } Intent intent = new Intent("android.intent.action.VIEW", parse); intent.addFlags(268435456); if (Util.isIntentAvailable(context, intent, false)) { String JN02 = ((l) yz3.j.c(l.class)).JN0(context, ((l) yz3.j.c(l.class)).getAppInfo(nVar.f12717t)); if (JN02 == null) { JN02 = str8; } if (JN02.length() > 0) { str6 = context.getString(R.string.g_8, JN02); } else { str6 = context.getString(R.string.g_8, str8); } m.f(str6, "if (appName.isNotEmpty()…p_tips, \"\")\n }"); String string = context.getString(R.string.g_5); m.f(string, "context.getString(com.te…h_3rd_app_confirm_to_pay)"); if (z15) { m.d(str3); m.d(str4); str6 = str3; string = str4; } q qVar2 = new q(context); qVar2.g(str6); qVar2.n(string); qVar2.j(context.getString(R.string.f367394sg)); qVar2.l(new d(context, intent, q1Var)); qVar2.i(new e(q1Var)); if (m.b(Looper.myLooper(), Looper.getMainLooper())) { qVar2.o(); return; } ed4.d<d.b> b16 = ed4.d.b(); b16.f206967b = ed4.d.f206964j; b16.f(new f(qVar2)).g(); return; } Log.i("MusicUIUtil", "isIntentAvailable fail, launchMusic doJumpToAppSongPage"); a(context, nVar, ml12, q1Var); } public final void c(Context context, n nVar) { String str = nVar.f12713p; if (str == null) { str = nVar.f12711n; } String str2 = nVar.f12717t; m.f(str, "url"); e(context, str2, str); } public final void d(Context context, n nVar, ml1 ml12) { String str; m.g(context, "context"); m.g(nVar, "wrapper"); String str2 = null; if (!Util.isNullOrNil(ml12 != null ? ml12.f29888w : null)) { Log.i("MusicUIUtil", "use androdiDownloadUrl"); String str3 = nVar.f12717t; if (ml12 != null) { str2 = ml12.f29888w; } m.d(str2); e(context, str3, str2); return; } String str4 = ""; if (!TextUtils.isEmpty(nVar.f12717t)) { if (m.b("wx5aa333606550dfd5", nVar.f12717t)) { str = "https://y.qq.com/m/download/index.html?channelId=2005000732"; } else if (m.b("wx8dd6ecd81906fd84", nVar.f12717t)) { str = "https://a.app.qq.com/o/simple.jsp?pkgname=com.netease.cloudmusic"; } else if (m.b("wx79f2c4418704b4f8", nVar.f12717t)) { str = "https://a.app.qq.com/o/simple.jsp?pkgname=com.kugou.android"; } else if (m.b("wxc305711a2a7ad71c", nVar.f12717t)) { str = "https://a.app.qq.com/o/simple.jsp?pkgname=cn.kuwo.player"; } str4 = str; } if (!Util.isNullOrNil(str4)) { e(context, nVar.f12717t, str4); } else { c(context, nVar); } } public final void e(Context context, String str, String str2) { m.g(context, "context"); m.g(str2, "url"); Log.i("MusicUIUtil", "launch H5 appId: %s, url:%s", str, str2); if (m.b(str, "wx5aa333606550dfd5")) { dp3.c cVar = new dp3.c(context); cVar.f201865b = "mmdownloadapp_G5AaIuNdPtZyH1oCL8"; ((dp3.d) yz3.j.c(dp3.d.class)).va(cVar, null); return; } Intent intent = new Intent(); intent.putExtra("rawUrl", str2); sv3.b.j(context, "webview", ".ui.tools.WebViewUI", intent, null); } }