- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
254 lines
11 KiB
Java
254 lines
11 KiB
Java
package com.mbridge.msdk.video.module.b;
|
|
|
|
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.same.report.d.d;
|
|
import com.mbridge.msdk.foundation.same.report.d.e;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.foundation.tools.z;
|
|
import java.net.URLEncoder;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class b {
|
|
public static HashMap<String, ArrayList<String>> a = new HashMap<>();
|
|
|
|
public static void a(String str) {
|
|
a.remove(str);
|
|
}
|
|
|
|
public static void a(Context context, CampaignEx campaignEx) {
|
|
if (campaignEx == null || campaignEx.getNativeVideoTracking() == null || campaignEx.getNativeVideoTracking().p() == null) {
|
|
return;
|
|
}
|
|
d.a().a("2000141", campaignEx);
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().p(), false, false);
|
|
}
|
|
|
|
public static void b(Context context, CampaignEx campaignEx) {
|
|
if (campaignEx == null || campaignEx.getNativeVideoTracking() == null || campaignEx.getNativeVideoTracking().j() == null) {
|
|
return;
|
|
}
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().j(), false, false);
|
|
}
|
|
|
|
public static void c(Context context, CampaignEx campaignEx) {
|
|
if (campaignEx == null || campaignEx.getNativeVideoTracking() == null || campaignEx.getNativeVideoTracking().k() == null) {
|
|
return;
|
|
}
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().k(), false, false);
|
|
}
|
|
|
|
public static void d(Context context, CampaignEx campaignEx) {
|
|
if (campaignEx == null || campaignEx.getNativeVideoTracking() == null || campaignEx.getNativeVideoTracking().l() == null) {
|
|
return;
|
|
}
|
|
String campaignUnitId = campaignEx.getCampaignUnitId();
|
|
ArrayList<String> arrayList = a.get(campaignUnitId);
|
|
if (arrayList == null) {
|
|
arrayList = new ArrayList<>();
|
|
a.put(campaignUnitId, arrayList);
|
|
}
|
|
if (arrayList.contains(campaignEx.getId())) {
|
|
return;
|
|
}
|
|
try {
|
|
d.a().a("2000142", campaignEx);
|
|
} catch (Exception unused) {
|
|
}
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().l(), false, false);
|
|
arrayList.add(campaignEx.getId());
|
|
}
|
|
|
|
public static void a(Context context, CampaignEx campaignEx, int i, int i2) {
|
|
try {
|
|
String[] r = campaignEx.getNativeVideoTracking().r();
|
|
if (campaignEx.getNativeVideoTracking() == null || r == null) {
|
|
return;
|
|
}
|
|
String[] strArr = new String[r.length];
|
|
for (int i3 = 0; i3 < r.length; i3++) {
|
|
String str = r[i3];
|
|
JSONObject jSONObject = new JSONObject();
|
|
jSONObject.put("endscreen_type", i);
|
|
String jSONObject2 = jSONObject.toString();
|
|
if (!TextUtils.isEmpty(jSONObject2)) {
|
|
jSONObject2 = z.b(jSONObject2);
|
|
}
|
|
if (!TextUtils.isEmpty(jSONObject2)) {
|
|
str = str + "&value=" + URLEncoder.encode(jSONObject2);
|
|
}
|
|
strArr[i3] = campaignEx.getSpareOfferFlag() == 1 ? str + "&to=1&cbt=" + campaignEx.getCbt() + "&tmorl=" + i2 : str + "&to=0&cbt=" + campaignEx.getCbt() + "&tmorl=" + i2;
|
|
}
|
|
try {
|
|
e eVar = new e();
|
|
eVar.a("type", Integer.valueOf(i));
|
|
d.a().a("2000144", campaignEx, eVar);
|
|
d.a().a("2000147", campaignEx, eVar);
|
|
} catch (Exception unused) {
|
|
}
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, campaignEx.getCampaignUnitId(), strArr, false, true);
|
|
} catch (Throwable unused2) {
|
|
af.b("VideoViewReport", "reportEndcardshowData error");
|
|
}
|
|
}
|
|
|
|
public static void e(Context context, CampaignEx campaignEx) {
|
|
if (campaignEx == null || campaignEx.getNativeVideoTracking() == null || campaignEx.getNativeVideoTracking().s() == null) {
|
|
return;
|
|
}
|
|
d.a().a("2000143", campaignEx);
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().s(), false, false);
|
|
}
|
|
|
|
public static void f(Context context, CampaignEx campaignEx) {
|
|
if (campaignEx == null || campaignEx.getNativeVideoTracking() == null || campaignEx.getNativeVideoTracking().m() == null) {
|
|
return;
|
|
}
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().m(), false, false);
|
|
}
|
|
|
|
public static void a(Context context, CampaignEx campaignEx, int i, int i2, int i3) {
|
|
String str;
|
|
if (i2 == 0 || context == null || campaignEx == null) {
|
|
return;
|
|
}
|
|
try {
|
|
List<Map<Integer, String>> i4 = campaignEx.getNativeVideoTracking().i();
|
|
int i5 = ((i + 1) * 100) / i2;
|
|
if (i4 != null) {
|
|
int i6 = 0;
|
|
int i7 = 0;
|
|
while (i6 < i4.size()) {
|
|
Map<Integer, String> map = i4.get(i6);
|
|
if (map != null && map.size() > 0) {
|
|
Iterator<Map.Entry<Integer, String>> it = map.entrySet().iterator();
|
|
int i8 = i6;
|
|
while (it.hasNext()) {
|
|
Map.Entry<Integer, String> next = it.next();
|
|
int intValue = next.getKey().intValue();
|
|
String value = next.getValue();
|
|
if (campaignEx.getSpareOfferFlag() == 1) {
|
|
str = value + "&to=1&cbt=" + campaignEx.getCbt() + "&tmorl=" + i3;
|
|
} else {
|
|
str = value + "&to=0&cbt=" + campaignEx.getCbt() + "&tmorl=" + i3;
|
|
}
|
|
if (intValue <= i5 && !TextUtils.isEmpty(str)) {
|
|
String[] strArr = {str};
|
|
if (i7 < 1) {
|
|
i7++;
|
|
try {
|
|
e eVar = new e();
|
|
eVar.a("percent", Integer.valueOf(intValue));
|
|
d.a().a("2000140", campaignEx, eVar);
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
int i9 = i7;
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, campaignEx.getCampaignUnitId(), strArr, false, true);
|
|
it.remove();
|
|
i4.remove(i8);
|
|
i8--;
|
|
i7 = i9;
|
|
}
|
|
}
|
|
i6 = i8;
|
|
}
|
|
i6++;
|
|
}
|
|
}
|
|
} catch (Throwable unused2) {
|
|
af.b("VideoViewReport", "reportPlayPercentageData error");
|
|
}
|
|
}
|
|
|
|
public static void a(CampaignEx campaignEx, Map<Integer, String> map, String str, int i) {
|
|
if (campaignEx == null || map == null) {
|
|
return;
|
|
}
|
|
try {
|
|
if (map.size() > 0) {
|
|
Iterator<Map.Entry<Integer, String>> it = map.entrySet().iterator();
|
|
while (it.hasNext()) {
|
|
Map.Entry<Integer, String> next = it.next();
|
|
Integer key = next.getKey();
|
|
String value = next.getValue();
|
|
if (i == key.intValue() && !TextUtils.isEmpty(value)) {
|
|
com.mbridge.msdk.click.a.a(c.m().c(), campaignEx, str, value, false, false);
|
|
it.remove();
|
|
}
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
public static void a(CampaignEx campaignEx, String str) {
|
|
if (campaignEx != null) {
|
|
try {
|
|
if (campaignEx.getAdUrlList() == null || campaignEx.getAdUrlList().size() <= 0) {
|
|
return;
|
|
}
|
|
for (String str2 : campaignEx.getAdUrlList()) {
|
|
if (!TextUtils.isEmpty(str2)) {
|
|
com.mbridge.msdk.click.a.a(c.m().c(), campaignEx, str, str2, false, false);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void a(CampaignEx campaignEx, com.mbridge.msdk.videocommon.b.c cVar, String str, String str2, String str3) {
|
|
String str4 = v8.i.c;
|
|
String str5 = "";
|
|
if (campaignEx == null || cVar == null) {
|
|
return;
|
|
}
|
|
try {
|
|
com.mbridge.msdk.video.module.c.b bVar = new com.mbridge.msdk.video.module.c.b(c.m().c());
|
|
com.mbridge.msdk.foundation.same.net.f.e eVar = new com.mbridge.msdk.foundation.same.net.f.e();
|
|
eVar.a("user_id", z.b(str2));
|
|
eVar.a("cb_type", "1");
|
|
eVar.a(CampaignEx.JSON_KEY_REWARD_NAME, cVar.a());
|
|
eVar.a(CampaignEx.JSON_KEY_REWARD_AMOUNT, cVar.b() + "");
|
|
eVar.a(MBridgeConstans.PROPERTIES_UNIT_ID, str);
|
|
eVar.a("click_id", campaignEx.getRequestIdNotice());
|
|
if (!TextUtils.isEmpty(str3)) {
|
|
eVar.a("extra", str3);
|
|
}
|
|
bVar.addExtraParams("", eVar);
|
|
String str6 = campaignEx.getHost() + "/addReward?";
|
|
String trim = eVar.b().trim();
|
|
if (!TextUtils.isEmpty(trim)) {
|
|
if (!str6.endsWith("?") && !str6.endsWith(v8.i.c)) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(str6);
|
|
if (!str6.contains("?")) {
|
|
str4 = "?";
|
|
}
|
|
sb.append(str4);
|
|
str6 = sb.toString();
|
|
}
|
|
str5 = str6 + trim;
|
|
}
|
|
String str7 = str5;
|
|
af.b("VideoViewReport", "rewardUrl:" + str7);
|
|
com.mbridge.msdk.click.a.a(c.m().c(), campaignEx, campaignEx.getCampaignUnitId(), str7, false, false);
|
|
} catch (Throwable th) {
|
|
af.b("VideoViewReport", th.getMessage(), th);
|
|
}
|
|
}
|
|
}
|