package com.mbridge.msdk.reward.c.a; import android.text.TextUtils; import com.mbridge.msdk.MBridgeConstans; import com.mbridge.msdk.foundation.entity.CampaignEx; import com.mbridge.msdk.foundation.same.report.d.c; import com.mbridge.msdk.foundation.same.report.d.d; import com.mbridge.msdk.videocommon.d.b; import java.util.List; /* loaded from: classes4.dex */ public class a { private static volatile a a; private a() { } public static a a() { if (a == null) { synchronized (a.class) { try { if (a == null) { a = new a(); } } finally { } } } return a; } public final void a(String str, c cVar) { c cVar2; List h; try { if (cVar == null) { try { cVar2 = new c(); } catch (Exception e) { if (MBridgeConstans.DEBUG) { e.printStackTrace(); } } } else { cVar2 = cVar; } com.mbridge.msdk.videocommon.d.a b = b.a().b(); if (b != null) { cVar2.h(b.b()); cVar2.f(b.c()); } if (cVar != null) { try { int j = cVar.j(); String i = cVar.i(); if (TextUtils.isEmpty(i) && (h = cVar.h()) != null && h.size() > 0 && h.get(0) != null) { i = h.get(0).getCampaignUnitId(); j = h.get(0).getAdType(); cVar.b(j); cVar.d(i); } com.mbridge.msdk.videocommon.d.c a2 = b.a().a(com.mbridge.msdk.foundation.controller.c.m().k(), i, j == 287); if (a2 != null) { cVar.g(a2.l()); cVar.n(a2.k()); } } catch (Exception e2) { if (MBridgeConstans.DEBUG) { e2.printStackTrace(); } } } d.a().a(cVar); d.a().a(str, cVar, (com.mbridge.msdk.foundation.same.report.d.a.a) null); } catch (Exception e3) { if (MBridgeConstans.DEBUG) { e3.printStackTrace(); } } } }