- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
172 lines
6.6 KiB
Java
172 lines
6.6 KiB
Java
package com.mbridge.msdk.newreward.function.common;
|
|
|
|
import android.content.Context;
|
|
import android.text.TextUtils;
|
|
import com.ironsource.v8;
|
|
import com.mbridge.msdk.MBridgeConstans;
|
|
import com.mbridge.msdk.foundation.controller.c;
|
|
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.foundation.tools.ak;
|
|
import com.mbridge.msdk.foundation.tools.an;
|
|
import com.mbridge.msdk.newreward.function.c.a.a;
|
|
import com.mbridge.msdk.newreward.function.c.a.b;
|
|
import com.mbridge.msdk.newreward.function.c.c.d;
|
|
import com.mbridge.msdk.newreward.function.c.c.n;
|
|
import com.mbridge.msdk.video.bt.module.b.h;
|
|
import java.net.URLEncoder;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class MBridgeGlobalCommon {
|
|
public static String SESSION_ID = "";
|
|
public static Map<String, h> showRewardListenerMap = new HashMap();
|
|
|
|
public static void setAlertDialogText(String str, String str2, String str3, String str4, String str5) {
|
|
Context c = c.m().c();
|
|
if (!TextUtils.isEmpty(str2)) {
|
|
an.b(c, "MBridge_ConfirmTitle" + str, str2.trim());
|
|
}
|
|
if (!TextUtils.isEmpty(str3)) {
|
|
an.b(c, "MBridge_ConfirmContent" + str, str3.trim());
|
|
}
|
|
if (!TextUtils.isEmpty(str5)) {
|
|
an.b(c, "MBridge_CancelText" + str, str5.trim());
|
|
}
|
|
if (TextUtils.isEmpty(str4)) {
|
|
return;
|
|
}
|
|
an.b(c, "MBridge_ConfirmText" + str, str4.trim());
|
|
}
|
|
|
|
public static void handlerCampaigns(String str, b bVar, List<CampaignEx> list, List<a> list2) {
|
|
if (bVar == null || list == null || list2 == null) {
|
|
return;
|
|
}
|
|
for (CampaignEx campaignEx : list) {
|
|
try {
|
|
campaignEx.setRequestId(bVar.f());
|
|
campaignEx.setLocalRequestId(str);
|
|
campaignEx.setCampaignUnitId(bVar.e());
|
|
a aVar = new a(bVar);
|
|
aVar.c(campaignEx.getRequestIdNotice());
|
|
aVar.b(campaignEx.getAppName());
|
|
aVar.a(campaignEx.getId());
|
|
aVar.a(campaignEx);
|
|
list2.add(aVar);
|
|
if (!com.mbridge.msdk.foundation.same.b.a().a("new_bridge_reward_show") && !TextUtils.isEmpty(campaignEx.getCMPTEntryUrl()) && campaignEx.getAdSpaceT() != 2) {
|
|
String cMPTEntryUrl = campaignEx.getCMPTEntryUrl();
|
|
boolean i = ak.i(cMPTEntryUrl);
|
|
bVar.b(!i);
|
|
if (!i) {
|
|
cMPTEntryUrl = addQueryParameter(cMPTEntryUrl, "dyview", MBridgeCommon.DYNAMIC_VIEW_TEMPLATE_VALUE);
|
|
}
|
|
campaignEx.setCMPTEntryUrl(cMPTEntryUrl);
|
|
}
|
|
if (TextUtils.isEmpty(bVar.B())) {
|
|
bVar.h(campaignEx.getCMPTEntryUrl());
|
|
bVar.h(campaignEx.getMof_tplid());
|
|
}
|
|
long candidateCacheTime = campaignEx.getCandidateCacheTime();
|
|
if (candidateCacheTime > 0) {
|
|
bVar.b((candidateCacheTime * 1000) + System.currentTimeMillis());
|
|
}
|
|
bVar.j(campaignEx.getVcn());
|
|
bVar.k(campaignEx.getTokenRule());
|
|
CampaignEx.c rewardTemplateMode = campaignEx.getRewardTemplateMode();
|
|
if (!com.mbridge.msdk.foundation.same.b.a().a("new_bridge_reward_show")) {
|
|
if (rewardTemplateMode != null) {
|
|
bVar.i(rewardTemplateMode.b());
|
|
String e = rewardTemplateMode.e();
|
|
if (!TextUtils.isEmpty(e) && campaignEx.getAdSpaceT() != 2) {
|
|
boolean i2 = ak.i(e);
|
|
aVar.a(!i2);
|
|
if (!i2) {
|
|
e = addQueryParameter(e, "dyview", MBridgeCommon.DYNAMIC_VIEW_TEMPLATE_VALUE);
|
|
}
|
|
rewardTemplateMode.b(e);
|
|
campaignEx.setRewardTemplateMode(rewardTemplateMode);
|
|
}
|
|
}
|
|
String str2 = campaignEx.getendcard_url();
|
|
if (!TextUtils.isEmpty(str2)) {
|
|
boolean l = ak.l(str2);
|
|
boolean i3 = ak.i(str2);
|
|
if (!l && !i3) {
|
|
campaignEx.setendcard_url(addQueryParameter(str2, "isplayableec", "0"));
|
|
}
|
|
}
|
|
}
|
|
} catch (Exception e2) {
|
|
if (MBridgeConstans.DEBUG) {
|
|
af.b("MBridgeGlobalCommon", "handlerCampaigns", e2);
|
|
}
|
|
}
|
|
}
|
|
bVar.b(list);
|
|
bVar.a(list2);
|
|
}
|
|
|
|
public static String addQueryParameter(String str, String str2, String str3) {
|
|
if (str != null && !TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
|
|
try {
|
|
String encode = URLEncoder.encode(str2, "UTF-8");
|
|
String encode2 = URLEncoder.encode(str3, "UTF-8");
|
|
StringBuilder sb = new StringBuilder(str);
|
|
if (str.contains("?")) {
|
|
if (!str.endsWith(v8.i.c) && !str.endsWith("?")) {
|
|
sb.append(v8.i.c);
|
|
}
|
|
} else {
|
|
sb.append("?");
|
|
}
|
|
sb.append(encode);
|
|
sb.append(v8.i.b);
|
|
sb.append(encode2);
|
|
return sb.toString();
|
|
} catch (Exception e) {
|
|
if (MBridgeConstans.DEBUG) {
|
|
af.b("MBridgeGlobalCommon", "addQueryParameter", e);
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
|
|
public static String getIsReadyNotReadyReasonType(b bVar) {
|
|
if (bVar == null) {
|
|
return "8";
|
|
}
|
|
d<?> w = bVar.w();
|
|
if (w != null && !w.d()) {
|
|
return "4";
|
|
}
|
|
if (!bVar.A()) {
|
|
return "10";
|
|
}
|
|
List<a> u = bVar.u();
|
|
if (u == null || u.isEmpty()) {
|
|
return "8";
|
|
}
|
|
for (a aVar : u) {
|
|
if (aVar != null) {
|
|
n d = aVar.d();
|
|
if (d != null && !d.d()) {
|
|
return "1";
|
|
}
|
|
d<?> c = aVar.c();
|
|
if (c != null && !c.d()) {
|
|
return "2";
|
|
}
|
|
d<?> f = aVar.f();
|
|
if (f != null && !f.d()) {
|
|
return "6";
|
|
}
|
|
}
|
|
}
|
|
return "0";
|
|
}
|
|
}
|