- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
152 lines
6.1 KiB
Java
152 lines
6.1 KiB
Java
package com.mbridge.msdk.mbnative.e;
|
|
|
|
import android.content.Context;
|
|
import android.text.TextUtils;
|
|
import android.util.Log;
|
|
import com.mbridge.msdk.c.g;
|
|
import com.mbridge.msdk.c.h;
|
|
import com.mbridge.msdk.foundation.controller.c;
|
|
import com.mbridge.msdk.foundation.db.j;
|
|
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.mbnative.controller.NativeController;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONException;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class b {
|
|
public static synchronized void a(CampaignEx campaignEx, Context context, String str, com.mbridge.msdk.mbnative.d.a aVar) {
|
|
boolean z;
|
|
int i;
|
|
synchronized (b.class) {
|
|
if (campaignEx == null) {
|
|
return;
|
|
}
|
|
try {
|
|
g a = h.a().a(c.m().k());
|
|
if (a != null) {
|
|
z = a.u() == 1;
|
|
} else {
|
|
z = true;
|
|
}
|
|
if (!campaignEx.isReport()) {
|
|
campaignEx.setReport(true);
|
|
a(campaignEx, context, str);
|
|
a(campaignEx, context, str, aVar, z);
|
|
List<String> a2 = a(campaignEx);
|
|
if (a2 != null && a2.size() != 0) {
|
|
int i2 = 0;
|
|
while (i2 < a2.size()) {
|
|
String str2 = a2.get(i2);
|
|
if (TextUtils.isEmpty(str2)) {
|
|
i = i2;
|
|
} else {
|
|
i = i2;
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, str, str2, false, false);
|
|
}
|
|
i2 = i + 1;
|
|
}
|
|
}
|
|
b(campaignEx, context, str);
|
|
}
|
|
if (aVar != null && !campaignEx.isCallBackImpression()) {
|
|
if (!z) {
|
|
try {
|
|
aVar.onLoggingImpression(campaignEx.getType());
|
|
} catch (Exception e) {
|
|
Log.e("NativeReportUtils", e.getMessage());
|
|
}
|
|
}
|
|
campaignEx.setCallBackImpression(true);
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
private static synchronized void a(final CampaignEx campaignEx, final Context context, String str) {
|
|
synchronized (b.class) {
|
|
try {
|
|
c.m().a(context);
|
|
if (!TextUtils.isEmpty(campaignEx.getImpressionURL())) {
|
|
com.mbridge.msdk.foundation.same.f.a.b().execute(new Runnable() { // from class: com.mbridge.msdk.mbnative.e.b.1
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
try {
|
|
j.a(com.mbridge.msdk.foundation.db.g.a(context)).a(campaignEx.getId());
|
|
} catch (Exception unused) {
|
|
af.b("NativeReportUtils", "campain can't insert db");
|
|
}
|
|
}
|
|
});
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getImpressionURL(), false, true, com.mbridge.msdk.click.a.a.g);
|
|
}
|
|
if (!TextUtils.isEmpty(str) && campaignEx.getNativeVideoTracking() != null && campaignEx.getNativeVideoTracking().p() != null) {
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getNativeVideoTracking().p(), false, false);
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
private static synchronized void b(CampaignEx campaignEx, Context context, String str) {
|
|
synchronized (b.class) {
|
|
if (campaignEx != null) {
|
|
try {
|
|
List<String> pv_urls = campaignEx.getPv_urls();
|
|
if (pv_urls != null && pv_urls.size() > 0) {
|
|
Iterator<String> it = pv_urls.iterator();
|
|
while (it.hasNext()) {
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, str, it.next(), false, true);
|
|
}
|
|
}
|
|
} finally {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private static synchronized void a(CampaignEx campaignEx, Context context, String str, com.mbridge.msdk.mbnative.d.a aVar, boolean z) {
|
|
Map<String, Long> map;
|
|
synchronized (b.class) {
|
|
if (!TextUtils.isEmpty(campaignEx.getOnlyImpressionURL()) && (map = NativeController.b) != null && !map.containsKey(campaignEx.getOnlyImpressionURL())) {
|
|
if (z && aVar != null) {
|
|
try {
|
|
aVar.onLoggingImpression(campaignEx.getAdType());
|
|
} catch (Exception e) {
|
|
Log.e("NativeReportUtils", e.getMessage());
|
|
}
|
|
}
|
|
NativeController.b.put(campaignEx.getOnlyImpressionURL(), Long.valueOf(System.currentTimeMillis()));
|
|
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getOnlyImpressionURL(), false, true, com.mbridge.msdk.click.a.a.h);
|
|
}
|
|
}
|
|
}
|
|
|
|
private static List<String> a(CampaignEx campaignEx) {
|
|
ArrayList arrayList = new ArrayList();
|
|
if (campaignEx == null) {
|
|
return arrayList;
|
|
}
|
|
String ad_url_list = campaignEx.getAd_url_list();
|
|
if (TextUtils.isEmpty(ad_url_list)) {
|
|
return arrayList;
|
|
}
|
|
try {
|
|
JSONArray jSONArray = new JSONArray(ad_url_list);
|
|
for (int i = 0; i < jSONArray.length(); i++) {
|
|
arrayList.add((String) jSONArray.get(i));
|
|
}
|
|
} catch (JSONException e) {
|
|
e.printStackTrace();
|
|
}
|
|
return arrayList;
|
|
}
|
|
}
|