- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1215 lines
48 KiB
Java
1215 lines
48 KiB
Java
package com.mbridge.msdk.reward.player;
|
||
|
||
import android.content.Intent;
|
||
import android.content.res.Configuration;
|
||
import android.graphics.drawable.BitmapDrawable;
|
||
import android.os.Bundle;
|
||
import android.os.SystemClock;
|
||
import android.text.TextUtils;
|
||
import android.view.View;
|
||
import android.view.ViewGroup;
|
||
import android.widget.FrameLayout;
|
||
import android.widget.ImageView;
|
||
import androidx.core.view.ViewCompat;
|
||
import com.iab.omid.library.mmadbridge.adsession.AdEvents;
|
||
import com.iab.omid.library.mmadbridge.adsession.AdSession;
|
||
import com.iab.omid.library.mmadbridge.adsession.media.MediaEvents;
|
||
import com.ironsource.v8;
|
||
import com.mbridge.msdk.MBridgeConstans;
|
||
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
||
import com.mbridge.msdk.foundation.entity.RewardPlus;
|
||
import com.mbridge.msdk.foundation.same.report.d.c;
|
||
import com.mbridge.msdk.foundation.same.report.d.e;
|
||
import com.mbridge.msdk.foundation.tools.af;
|
||
import com.mbridge.msdk.foundation.tools.ak;
|
||
import com.mbridge.msdk.foundation.tools.x;
|
||
import com.mbridge.msdk.mbsignalcommon.windvane.WindVaneWebView;
|
||
import com.mbridge.msdk.newreward.function.common.MBridgeGlobalCommon;
|
||
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
|
||
import com.mbridge.msdk.reward.adapter.RewardUnitCacheManager;
|
||
import com.mbridge.msdk.scheme.applet.AppletModelManager;
|
||
import com.mbridge.msdk.video.bt.module.MBTempContainer;
|
||
import com.mbridge.msdk.video.bt.module.MBridgeBTContainer;
|
||
import com.mbridge.msdk.video.bt.module.b.h;
|
||
import com.mbridge.msdk.video.dynview.e.d;
|
||
import com.mbridge.msdk.video.module.MBridgeVideoView;
|
||
import com.mbridge.msdk.video.signal.a.k;
|
||
import com.mbridge.msdk.video.signal.activity.AbstractJSActivity;
|
||
import com.mbridge.msdk.videocommon.a;
|
||
import com.mbridge.msdk.videocommon.download.j;
|
||
import java.util.ArrayList;
|
||
import java.util.Iterator;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
/* loaded from: classes4.dex */
|
||
public class MBRewardVideoActivity extends AbstractJSActivity {
|
||
public static String INTENT_EXTRADATA = "extraData";
|
||
public static String INTENT_ISBID = "isBid";
|
||
public static String INTENT_ISBIG_OFFER = "isBigOffer";
|
||
public static String INTENT_ISIV = "isIV";
|
||
public static String INTENT_IVREWARD_MODETYPE = "ivRewardMode";
|
||
public static String INTENT_IVREWARD_VALUE = "ivRewardValue";
|
||
public static String INTENT_IVREWARD_VALUETYPE = "ivRewardValueType";
|
||
public static String INTENT_LOCAL_REQUEST_ID = "lRid";
|
||
public static String INTENT_MUTE = "mute";
|
||
public static String INTENT_REWARD = "reward";
|
||
public static String INTENT_UNITID = "unitId";
|
||
public static String INTENT_USERID = "userId";
|
||
public static String SAVE_STATE_KEY_REPORT = "hasRelease";
|
||
private boolean A;
|
||
private String I;
|
||
private c J;
|
||
private boolean L;
|
||
private String a;
|
||
private String b;
|
||
private String c;
|
||
private com.mbridge.msdk.videocommon.b.c d;
|
||
private int h;
|
||
private int i;
|
||
private int j;
|
||
private h m;
|
||
private com.mbridge.msdk.videocommon.d.c n;
|
||
private com.mbridge.msdk.videocommon.download.a q;
|
||
private CampaignEx r;
|
||
private List<com.mbridge.msdk.videocommon.download.a> s;
|
||
private List<CampaignEx> t;
|
||
private MBTempContainer u;
|
||
private MBridgeBTContainer v;
|
||
private WindVaneWebView w;
|
||
private com.mbridge.msdk.video.bt.module.a.a x;
|
||
private String y;
|
||
private String z;
|
||
private int e = 2;
|
||
private boolean f = false;
|
||
private boolean g = false;
|
||
private boolean k = false;
|
||
private boolean l = false;
|
||
private boolean o = false;
|
||
private boolean p = false;
|
||
private int B = 1;
|
||
private int C = 0;
|
||
private int D = 0;
|
||
private int E = 0;
|
||
private int F = 0;
|
||
private int G = 0;
|
||
private int H = 0;
|
||
private boolean K = false;
|
||
private AdSession M = null;
|
||
private MediaEvents N = null;
|
||
private AdEvents O = null;
|
||
private long P = 0;
|
||
private String Q = "";
|
||
private boolean R = false;
|
||
private boolean S = false;
|
||
private boolean T = false;
|
||
private com.mbridge.msdk.video.dynview.e.a U = new com.mbridge.msdk.video.dynview.e.a() { // from class: com.mbridge.msdk.reward.player.MBRewardVideoActivity.1
|
||
@Override // com.mbridge.msdk.video.dynview.e.a
|
||
public final void a(Map<String, Object> map) {
|
||
if (map == null) {
|
||
return;
|
||
}
|
||
if (map.containsKey(CampaignEx.JSON_NATIVE_VIDEO_MUTE)) {
|
||
MBRewardVideoActivity.this.e = ((Integer) map.get(CampaignEx.JSON_NATIVE_VIDEO_MUTE)).intValue();
|
||
}
|
||
if (map.containsKey(v8.h.L)) {
|
||
int intValue = ((Integer) map.get(v8.h.L)).intValue();
|
||
if (MBRewardVideoActivity.this.t == null || MBRewardVideoActivity.this.t.size() <= 0 || intValue < 1) {
|
||
return;
|
||
}
|
||
MBRewardVideoActivity mBRewardVideoActivity = MBRewardVideoActivity.this;
|
||
mBRewardVideoActivity.r = (CampaignEx) mBRewardVideoActivity.t.get(intValue);
|
||
MBRewardVideoActivity.b(MBRewardVideoActivity.this);
|
||
int i = intValue - 1;
|
||
if (MBRewardVideoActivity.this.t.get(i) != null) {
|
||
MBRewardVideoActivity mBRewardVideoActivity2 = MBRewardVideoActivity.this;
|
||
MBRewardVideoActivity.b(mBRewardVideoActivity2, ((CampaignEx) mBRewardVideoActivity2.t.get(i)).getVideoLength());
|
||
}
|
||
MBRewardVideoActivity mBRewardVideoActivity3 = MBRewardVideoActivity.this;
|
||
MBRewardVideoActivity.this.r.setVideoCompleteTime(mBRewardVideoActivity3.a(mBRewardVideoActivity3.r.getVideoCompleteTime(), MBRewardVideoActivity.this.B));
|
||
MBRewardVideoActivity.this.r.setShowIndex(MBRewardVideoActivity.this.B);
|
||
MBRewardVideoActivity.this.r.setShowType(1);
|
||
MBRewardVideoActivity mBRewardVideoActivity4 = MBRewardVideoActivity.this;
|
||
mBRewardVideoActivity4.b(mBRewardVideoActivity4.r);
|
||
}
|
||
}
|
||
};
|
||
private d V = new d() { // from class: com.mbridge.msdk.reward.player.MBRewardVideoActivity.2
|
||
@Override // com.mbridge.msdk.video.dynview.e.d
|
||
public final void itemClick(CampaignEx campaignEx) {
|
||
if (campaignEx != null) {
|
||
if (MBRewardVideoActivity.this.v != null) {
|
||
new com.mbridge.msdk.video.dynview.h.b().b(MBRewardVideoActivity.this.v, 500L);
|
||
}
|
||
MBRewardVideoActivity.this.r = campaignEx;
|
||
MBRewardVideoActivity.this.r.setShowType(2);
|
||
MBRewardVideoActivity mBRewardVideoActivity = MBRewardVideoActivity.this;
|
||
mBRewardVideoActivity.b(mBRewardVideoActivity.r);
|
||
return;
|
||
}
|
||
MBRewardVideoActivity.this.a("campaign is null");
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.dynview.e.d
|
||
public final void countDownClick() {
|
||
if (MBRewardVideoActivity.this.v != null) {
|
||
new com.mbridge.msdk.video.dynview.h.b().b(MBRewardVideoActivity.this.v, 500L);
|
||
}
|
||
MBRewardVideoActivity.this.k = true;
|
||
MBRewardVideoActivity.this.b();
|
||
if (MBRewardVideoActivity.this.u != null) {
|
||
MBRewardVideoActivity.this.u.setNotchPadding(MBRewardVideoActivity.this.H, MBRewardVideoActivity.this.D, MBRewardVideoActivity.this.F, MBRewardVideoActivity.this.E, MBRewardVideoActivity.this.G);
|
||
}
|
||
}
|
||
};
|
||
|
||
private void c(CampaignEx campaignEx) {
|
||
}
|
||
|
||
public static /* synthetic */ int b(MBRewardVideoActivity mBRewardVideoActivity) {
|
||
int i = mBRewardVideoActivity.B;
|
||
mBRewardVideoActivity.B = i + 1;
|
||
return i;
|
||
}
|
||
|
||
public static /* synthetic */ int b(MBRewardVideoActivity mBRewardVideoActivity, int i) {
|
||
int i2 = mBRewardVideoActivity.C - i;
|
||
mBRewardVideoActivity.C = i2;
|
||
return i2;
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.activity.MBBaseActivity, android.app.Activity
|
||
public void onCreate(Bundle bundle) {
|
||
String str;
|
||
List<com.mbridge.msdk.videocommon.download.a> list;
|
||
String str2 = "";
|
||
super.onCreate(bundle);
|
||
MBridgeConstans.isRewardActivityShowing = true;
|
||
com.mbridge.msdk.foundation.controller.c.m().a(this);
|
||
this.P = SystemClock.elapsedRealtime();
|
||
if (TextUtils.isEmpty(this.Q)) {
|
||
str = "onCreate";
|
||
} else {
|
||
str = this.Q + "_onCreate";
|
||
}
|
||
this.Q = str;
|
||
try {
|
||
Intent intent = getIntent();
|
||
this.a = intent.getStringExtra(INTENT_UNITID);
|
||
this.b = intent.getStringExtra(MBridgeConstans.PLACEMENT_ID);
|
||
this.d = com.mbridge.msdk.videocommon.b.c.b(intent.getStringExtra(INTENT_REWARD));
|
||
this.c = intent.getStringExtra(INTENT_USERID);
|
||
this.e = intent.getIntExtra(INTENT_MUTE, 2);
|
||
this.f = intent.getBooleanExtra(INTENT_ISIV, false);
|
||
com.mbridge.msdk.foundation.controller.c.m().b(this.f ? 287 : 94);
|
||
this.g = intent.getBooleanExtra(INTENT_ISBID, false);
|
||
this.z = intent.getStringExtra(INTENT_EXTRADATA);
|
||
boolean booleanExtra = intent.getBooleanExtra("is_refactor", false);
|
||
this.K = booleanExtra;
|
||
if (booleanExtra) {
|
||
this.m = MBridgeGlobalCommon.showRewardListenerMap.get(this.a);
|
||
} else {
|
||
this.m = com.mbridge.msdk.reward.b.a.f.get(this.a);
|
||
}
|
||
if (this.f) {
|
||
this.h = intent.getIntExtra(INTENT_IVREWARD_MODETYPE, 0);
|
||
this.i = intent.getIntExtra(INTENT_IVREWARD_VALUETYPE, 0);
|
||
this.j = intent.getIntExtra(INTENT_IVREWARD_VALUE, 0);
|
||
}
|
||
this.k = intent.getBooleanExtra(INTENT_ISBIG_OFFER, false);
|
||
this.s = com.mbridge.msdk.videocommon.download.b.getInstance().b(this.a);
|
||
this.t = com.mbridge.msdk.videocommon.download.b.getInstance().a(this.a);
|
||
int findLayout = findLayout("mbridge_more_offer_activity");
|
||
if (findLayout < 0) {
|
||
a("no mbridge_more_offer_activity layout");
|
||
return;
|
||
}
|
||
setContentView(findLayout);
|
||
if (TextUtils.isEmpty(this.a)) {
|
||
a("data empty error");
|
||
return;
|
||
}
|
||
com.mbridge.msdk.video.signal.factory.b bVar = new com.mbridge.msdk.video.signal.factory.b(this);
|
||
this.jsFactory = bVar;
|
||
registerJsFactory(bVar);
|
||
if (this.m == null) {
|
||
a("showRewardListener is null");
|
||
return;
|
||
}
|
||
com.mbridge.msdk.videocommon.d.c cVar = RewardUnitCacheManager.getInstance().get(this.b, this.a);
|
||
this.n = cVar;
|
||
if (cVar == null) {
|
||
com.mbridge.msdk.videocommon.d.c a2 = com.mbridge.msdk.videocommon.d.b.a().a(com.mbridge.msdk.foundation.controller.c.m().k(), this.a);
|
||
this.n = a2;
|
||
if (a2 == null) {
|
||
this.n = com.mbridge.msdk.videocommon.d.b.a().a(com.mbridge.msdk.foundation.controller.c.m().k(), this.a, this.f);
|
||
}
|
||
}
|
||
com.mbridge.msdk.videocommon.d.c cVar2 = this.n;
|
||
if (cVar2 != null) {
|
||
this.d.a(cVar2.m());
|
||
this.d.a(this.n.n());
|
||
}
|
||
com.mbridge.msdk.videocommon.b.c cVar3 = this.d;
|
||
if (cVar3 != null && cVar3.b() <= 0) {
|
||
this.d.a(1);
|
||
}
|
||
int a3 = x.a(this, "mbridge_reward_activity_open", "anim");
|
||
int a4 = x.a(this, "mbridge_reward_activity_stay", "anim");
|
||
if (a3 > 1 && a4 > 1) {
|
||
overridePendingTransition(a3, a4);
|
||
}
|
||
if (bundle != null) {
|
||
try {
|
||
this.p = bundle.getBoolean(SAVE_STATE_KEY_REPORT);
|
||
} catch (Exception e) {
|
||
e.printStackTrace();
|
||
}
|
||
}
|
||
af.a("DynamicViewCampaignResourceDownloader", "进入 show,大模板 " + this.k);
|
||
if (!this.k) {
|
||
List<com.mbridge.msdk.videocommon.download.a> list2 = this.s;
|
||
if (list2 != null && list2.size() > 0) {
|
||
this.q = this.s.get(0);
|
||
}
|
||
com.mbridge.msdk.videocommon.download.a aVar = this.q;
|
||
if (aVar != null) {
|
||
this.r = aVar.l();
|
||
this.q.e(true);
|
||
this.q.f(false);
|
||
CampaignEx campaignEx = this.r;
|
||
if (campaignEx != null) {
|
||
this.I = campaignEx.getCurrentLocalRid();
|
||
this.r.setShowIndex(1);
|
||
this.r.setShowType(1);
|
||
com.mbridge.msdk.reward.b.a.b = this.r.getEcppv();
|
||
com.mbridge.msdk.click.c.a(com.mbridge.msdk.foundation.controller.c.m().c(), this.r.getMaitve(), this.r.getMaitve_src());
|
||
}
|
||
}
|
||
if (this.q == null || this.r == null || this.d == null) {
|
||
a("data empty error");
|
||
}
|
||
ArrayList arrayList = new ArrayList();
|
||
arrayList.add(this.r);
|
||
b(arrayList);
|
||
a(this.r);
|
||
b();
|
||
if (com.mbridge.msdk.e.b.a()) {
|
||
return;
|
||
}
|
||
a();
|
||
return;
|
||
}
|
||
b(this.t);
|
||
this.y = "";
|
||
List<CampaignEx> list3 = this.t;
|
||
if (list3 != null && list3.size() > 0) {
|
||
CampaignEx campaignEx2 = this.t.get(0);
|
||
a(campaignEx2);
|
||
str2 = campaignEx2.getCMPTEntryUrl();
|
||
this.y = campaignEx2.getRequestId();
|
||
this.I = campaignEx2.getCurrentLocalRid();
|
||
com.mbridge.msdk.reward.b.a.b = campaignEx2.getEcppv();
|
||
com.mbridge.msdk.click.c.a(com.mbridge.msdk.foundation.controller.c.m().c(), campaignEx2.getMaitve(), campaignEx2.getMaitve_src());
|
||
}
|
||
a.C0246a a5 = com.mbridge.msdk.videocommon.a.a(this.a + "_" + this.y + "_" + str2);
|
||
WindVaneWebView a6 = a5 != null ? a5.a() : null;
|
||
this.w = a6;
|
||
if (a6 == null) {
|
||
if (this.q == null && (list = this.s) != null && list.size() > 0) {
|
||
this.q = this.s.get(0);
|
||
}
|
||
if (this.q == null) {
|
||
com.mbridge.msdk.videocommon.download.b bVar2 = com.mbridge.msdk.videocommon.download.b.getInstance();
|
||
int i = this.f ? 287 : 94;
|
||
String str3 = this.a;
|
||
boolean z = this.g;
|
||
j c = bVar2.c(str3);
|
||
this.q = c != null ? c.b(i, z) : null;
|
||
}
|
||
com.mbridge.msdk.videocommon.download.a aVar2 = this.q;
|
||
if (aVar2 != null) {
|
||
this.r = aVar2.l();
|
||
this.q.e(true);
|
||
this.q.f(false);
|
||
}
|
||
if (this.q != null && this.r != null && this.d != null) {
|
||
this.k = false;
|
||
List<CampaignEx> a7 = com.mbridge.msdk.videocommon.a.a.a().a(this.t);
|
||
if (a7 == null) {
|
||
a("no available campaign");
|
||
return;
|
||
}
|
||
int size = a7.size();
|
||
if (size == 0) {
|
||
a("no available campaign");
|
||
return;
|
||
}
|
||
if (a7.get(0) == null || !a7.get(0).isDynamicView()) {
|
||
b();
|
||
} else if (size == 1) {
|
||
CampaignEx campaignEx3 = a7.get(0);
|
||
this.r = campaignEx3;
|
||
if (campaignEx3 != null) {
|
||
this.I = campaignEx3.getCurrentLocalRid();
|
||
this.r.setCampaignIsFiltered(true);
|
||
}
|
||
b(this.r);
|
||
} else {
|
||
a(a7);
|
||
}
|
||
}
|
||
a("data empty error");
|
||
return;
|
||
}
|
||
a(this.t.get(0));
|
||
WindVaneWebView windVaneWebView = this.w;
|
||
if (windVaneWebView != null) {
|
||
try {
|
||
k kVar = (k) windVaneWebView.getObject();
|
||
kVar.a(this.O);
|
||
kVar.a(this.M);
|
||
kVar.a(this.N);
|
||
this.w.setObject(kVar);
|
||
} catch (Exception e2) {
|
||
af.b("MBRewardVideoActivity", e2.getMessage());
|
||
}
|
||
}
|
||
c();
|
||
if (com.mbridge.msdk.e.b.a()) {
|
||
return;
|
||
}
|
||
a();
|
||
} catch (Throwable th) {
|
||
b(this.t);
|
||
a("onCreate error" + th);
|
||
}
|
||
}
|
||
|
||
private void a(CampaignEx campaignEx) {
|
||
if (campaignEx != null) {
|
||
try {
|
||
if (campaignEx.isActiveOm() && this.M == null) {
|
||
AdSession a2 = com.mbridge.msdk.a.b.a(getApplicationContext(), false, campaignEx.getOmid(), campaignEx.getRequestId(), campaignEx.getId(), this.a, campaignEx.getVideoUrlEncode(), campaignEx.getRequestIdNotice());
|
||
this.M = a2;
|
||
if (a2 != null) {
|
||
this.O = AdEvents.createAdEvents(a2);
|
||
this.N = MediaEvents.createMediaEvents(this.M);
|
||
}
|
||
}
|
||
} catch (Throwable th) {
|
||
af.b("MBRewardVideoActivity", th.getMessage());
|
||
}
|
||
}
|
||
}
|
||
|
||
private void a() {
|
||
try {
|
||
ViewGroup viewGroup = (ViewGroup) getWindow().getDecorView();
|
||
BitmapDrawable a2 = com.mbridge.msdk.foundation.controller.c.m().a(this.a, this.f ? 287 : 94);
|
||
if (a2 != null) {
|
||
ImageView imageView = new ImageView(com.mbridge.msdk.foundation.controller.c.m().c());
|
||
ak.a(imageView, a2, getResources().getDisplayMetrics());
|
||
((ViewGroup) ((ViewGroup) ((ViewGroup) viewGroup.getChildAt(0)).getChildAt(1)).getChildAt(0)).addView(imageView, new ViewGroup.LayoutParams(-1, -1));
|
||
}
|
||
} catch (Exception e) {
|
||
e.printStackTrace();
|
||
}
|
||
}
|
||
|
||
private void a(List<CampaignEx> list) {
|
||
if (list == null) {
|
||
a("no available campaign");
|
||
return;
|
||
}
|
||
if (list.size() == 0) {
|
||
a("no available campaign");
|
||
return;
|
||
}
|
||
if (list.get(0) != null) {
|
||
int dynamicTempCode = list.get(0).getDynamicTempCode();
|
||
this.I = list.get(0).getCurrentLocalRid();
|
||
if (dynamicTempCode == 5) {
|
||
for (CampaignEx campaignEx : list) {
|
||
if (campaignEx != null) {
|
||
this.C += campaignEx.getVideoLength();
|
||
}
|
||
}
|
||
CampaignEx campaignEx2 = list.get(0);
|
||
if (campaignEx2 != null) {
|
||
int a2 = a(campaignEx2.getVideoCompleteTime(), this.B);
|
||
this.r = campaignEx2;
|
||
campaignEx2.setCampaignIsFiltered(true);
|
||
this.B = 1;
|
||
this.r.setVideoCompleteTime(a2);
|
||
this.r.setShowIndex(this.B);
|
||
this.r.setShowType(1);
|
||
b(this.r);
|
||
return;
|
||
}
|
||
a("campaign is less");
|
||
return;
|
||
}
|
||
}
|
||
c();
|
||
}
|
||
|
||
/* JADX INFO: Access modifiers changed from: private */
|
||
public void b(CampaignEx campaignEx) {
|
||
CampaignEx l;
|
||
try {
|
||
List<com.mbridge.msdk.videocommon.download.a> list = this.s;
|
||
if (list != null && list.size() > 0) {
|
||
for (com.mbridge.msdk.videocommon.download.a aVar : this.s) {
|
||
if (aVar != null && (l = aVar.l()) != null && TextUtils.equals(l.getId(), campaignEx.getId()) && TextUtils.equals(l.getRequestId(), campaignEx.getRequestId())) {
|
||
this.q = aVar;
|
||
}
|
||
}
|
||
}
|
||
this.k = true;
|
||
b();
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer != null) {
|
||
mBTempContainer.setNotchPadding(this.H, this.D, this.F, this.E, this.G);
|
||
}
|
||
} catch (Exception e) {
|
||
af.b("MBRewardVideoActivity", e.getMessage());
|
||
a("more offer to one offer exception");
|
||
}
|
||
}
|
||
|
||
/* JADX INFO: Access modifiers changed from: private */
|
||
public void a(String str) {
|
||
af.b("MBRewardVideoActivity", str);
|
||
b(this.t);
|
||
h hVar = this.m;
|
||
if (hVar != null) {
|
||
hVar.a(this.J, str);
|
||
}
|
||
finish();
|
||
}
|
||
|
||
/* JADX INFO: Access modifiers changed from: private */
|
||
public void b() {
|
||
List<CampaignEx> list;
|
||
RewardPlus rewardPlus;
|
||
CampaignEx campaignEx;
|
||
List<CampaignEx> list2;
|
||
int findID = findID("mbridge_temp_container");
|
||
if (findID < 0) {
|
||
a("no id mbridge_bt_container in mbridge_more_offer_activity layout");
|
||
}
|
||
MBTempContainer mBTempContainer = (MBTempContainer) findViewById(findID);
|
||
this.u = mBTempContainer;
|
||
if (mBTempContainer == null) {
|
||
a("env error");
|
||
}
|
||
List<CampaignEx> list3 = this.t;
|
||
if (list3 != null && list3.size() > 0 && this.t.get(0).isDynamicView()) {
|
||
new com.mbridge.msdk.video.dynview.h.b().c(this.u, 500L);
|
||
} else {
|
||
this.u.setVisibility(0);
|
||
}
|
||
changeHalfScreenPadding(-1);
|
||
this.u.setActivity(this);
|
||
this.u.setBidCampaign(this.g);
|
||
this.u.setBigOffer(this.k);
|
||
this.u.setUnitId(this.a);
|
||
this.u.setCampaign(this.r);
|
||
if (this.r.getDynamicTempCode() == 5 && (list2 = this.t) != null && list2.size() > 1) {
|
||
View findViewById = findViewById(findID("mbridge_reward_root_container"));
|
||
if (findViewById != null) {
|
||
findViewById.setBackgroundColor(ViewCompat.MEASURED_STATE_MASK);
|
||
}
|
||
this.u.removeAllViews();
|
||
this.u.setCampOrderViewData(this.t, this.C);
|
||
this.u.setCamPlayOrderCallback(this.U, this.B);
|
||
}
|
||
this.u.setCampaignDownLoadTask(this.q);
|
||
this.u.setIV(this.f);
|
||
CampaignEx campaignEx2 = this.r;
|
||
if (campaignEx2 != null && campaignEx2.getAdSpaceT() == 2) {
|
||
this.u.setIVRewardEnable(0, 0, 0);
|
||
} else {
|
||
this.u.setIVRewardEnable(this.h, this.i, this.j);
|
||
}
|
||
this.u.setMute(this.e);
|
||
CampaignEx campaignEx3 = this.r;
|
||
if (((campaignEx3 != null && (rewardPlus = campaignEx3.getRewardPlus()) != null) || ((list = this.t) != null && list.size() > 0 && this.t.get(0) != null && (rewardPlus = this.t.get(0).getRewardPlus()) != null)) && !TextUtils.isEmpty(rewardPlus.getName()) && rewardPlus.getAmount() > 0) {
|
||
com.mbridge.msdk.videocommon.b.c cVar = new com.mbridge.msdk.videocommon.b.c(rewardPlus.getName(), rewardPlus.getAmount());
|
||
if (cVar.b() < 0) {
|
||
cVar.a(1);
|
||
}
|
||
this.d = cVar;
|
||
}
|
||
this.u.setReward(this.d);
|
||
this.u.setRewardUnitSetting(this.n);
|
||
this.u.setPlacementId(this.b);
|
||
this.u.setUserId(this.c);
|
||
this.u.setShowRewardListener(this.m);
|
||
this.u.setDeveloperExtraData(this.z);
|
||
this.u.init(this);
|
||
this.u.setAdSession(this.M);
|
||
this.u.setAdEvents(this.O);
|
||
this.u.setVideoEvents(this.N);
|
||
this.u.onCreate();
|
||
if (!com.mbridge.msdk.e.b.a() || (campaignEx = this.r) == null) {
|
||
return;
|
||
}
|
||
c(campaignEx);
|
||
}
|
||
|
||
private void c() {
|
||
RewardPlus rewardPlus;
|
||
List<CampaignEx> list;
|
||
int findID = findID("mbridge_bt_container");
|
||
if (findID < 0) {
|
||
a("no mbridge_webview_framelayout in mbridge_more_offer_activity layout");
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = (MBridgeBTContainer) findViewById(findID);
|
||
this.v = mBridgeBTContainer;
|
||
if (mBridgeBTContainer == null) {
|
||
a("env error");
|
||
}
|
||
this.v.setVisibility(0);
|
||
com.mbridge.msdk.video.bt.module.a.a d = d();
|
||
this.x = d;
|
||
this.v.setBTContainerCallback(d);
|
||
this.v.setShowRewardVideoListener(this.m);
|
||
this.v.setChoiceOneCallback(this.V);
|
||
this.v.setCampaigns(this.t);
|
||
this.v.setCampaignDownLoadTasks(this.s);
|
||
this.v.setRewardUnitSetting(this.n);
|
||
this.v.setUnitId(this.a);
|
||
this.v.setPlacementId(this.b);
|
||
this.v.setUserId(this.c);
|
||
this.v.setActivity(this);
|
||
CampaignEx campaignEx = this.r;
|
||
if (((campaignEx != null && (rewardPlus = campaignEx.getRewardPlus()) != null) || (this.t.get(0) != null && (rewardPlus = this.t.get(0).getRewardPlus()) != null)) && !TextUtils.isEmpty(rewardPlus.getName()) && rewardPlus.getAmount() > 0) {
|
||
com.mbridge.msdk.videocommon.b.c cVar = new com.mbridge.msdk.videocommon.b.c(rewardPlus.getName(), rewardPlus.getAmount());
|
||
if (cVar.b() < 0) {
|
||
cVar.a(1);
|
||
}
|
||
this.d = cVar;
|
||
}
|
||
this.v.setReward(this.d);
|
||
this.v.setIVRewardEnable(this.h, this.i, this.j);
|
||
this.v.setIV(this.f);
|
||
this.v.setMute(this.e);
|
||
this.v.setJSFactory((com.mbridge.msdk.video.signal.factory.b) this.jsFactory);
|
||
this.v.setDeveloperExtraData(this.z);
|
||
this.v.init(this);
|
||
this.v.setAdSession(this.M);
|
||
this.v.setVideoEvents(this.N);
|
||
this.v.setAdEvents(this.O);
|
||
this.v.onCreate(this.K);
|
||
if (!com.mbridge.msdk.e.b.a() || (list = this.t) == null || list.size() <= 0 || this.t.get(0) == null) {
|
||
return;
|
||
}
|
||
c(this.t.get(0));
|
||
}
|
||
|
||
private com.mbridge.msdk.video.bt.module.a.a d() {
|
||
if (this.x == null) {
|
||
this.x = new com.mbridge.msdk.video.bt.module.a.a() { // from class: com.mbridge.msdk.reward.player.MBRewardVideoActivity.3
|
||
@Override // com.mbridge.msdk.video.bt.module.a.a
|
||
public final void a() {
|
||
if (MBRewardVideoActivity.this.m != null) {
|
||
MBRewardVideoActivity.this.m.a(MBRewardVideoActivity.this.J);
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.bt.module.a.a
|
||
public final void a(boolean z, com.mbridge.msdk.videocommon.b.c cVar) {
|
||
if (MBRewardVideoActivity.this.m != null) {
|
||
MBRewardVideoActivity.this.m.a(MBRewardVideoActivity.this.J, z, cVar);
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.bt.module.a.a
|
||
public final void a(boolean z, int i) {
|
||
if (MBRewardVideoActivity.this.m != null) {
|
||
MBRewardVideoActivity.this.m.a(z, i);
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.bt.module.a.a
|
||
public final void a(String str) {
|
||
if (MBRewardVideoActivity.this.m != null) {
|
||
MBRewardVideoActivity.this.m.a(MBRewardVideoActivity.this.J, str);
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.bt.module.a.a
|
||
public final void a(boolean z, String str, String str2) {
|
||
if (MBRewardVideoActivity.this.m != null) {
|
||
MBRewardVideoActivity.this.m.a(z, str, str2);
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.bt.module.a.a
|
||
public final void a(String str, String str2) {
|
||
if (MBRewardVideoActivity.this.m != null) {
|
||
MBRewardVideoActivity.this.m.a(str, str2);
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.bt.module.a.a
|
||
public final void b(String str, String str2) {
|
||
if (MBRewardVideoActivity.this.m != null) {
|
||
MBRewardVideoActivity.this.m.b(str, str2);
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.bt.module.a.a
|
||
public final void a(int i, String str, String str2) {
|
||
if (MBRewardVideoActivity.this.m != null) {
|
||
MBRewardVideoActivity.this.m.a(i, str, str2);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
return this.x;
|
||
}
|
||
|
||
/* JADX INFO: Access modifiers changed from: private */
|
||
public int a(int i, int i2) {
|
||
List<CampaignEx> list = this.t;
|
||
if (list == null || list.size() == 0) {
|
||
return i;
|
||
}
|
||
int i3 = 0;
|
||
int i4 = 0;
|
||
for (int i5 = 0; i5 < this.t.size(); i5++) {
|
||
if (this.t.get(0) != null) {
|
||
if (i5 == 0) {
|
||
i4 = this.t.get(0).getVideoCompleteTime();
|
||
}
|
||
i3 += this.t.get(i5).getVideoLength();
|
||
}
|
||
}
|
||
if (i2 == 1) {
|
||
if (i == 0) {
|
||
if (i3 >= 45) {
|
||
return 45;
|
||
}
|
||
} else if (i3 > i) {
|
||
if (i > 45) {
|
||
return 45;
|
||
}
|
||
return i;
|
||
}
|
||
return i3;
|
||
}
|
||
int i6 = 0;
|
||
for (int i7 = 0; i7 < i2 - 1; i7++) {
|
||
if (this.t.get(i7) != null) {
|
||
i6 += this.t.get(i7).getVideoLength();
|
||
}
|
||
}
|
||
if (i4 > i6) {
|
||
return i4 - i6;
|
||
}
|
||
return 0;
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.signal.activity.AbstractJSActivity, com.mbridge.msdk.activity.MBBaseActivity, android.app.Activity
|
||
public void onResume() {
|
||
String str;
|
||
MBridgeVideoView mBridgeVideoView;
|
||
super.onResume();
|
||
if (TextUtils.isEmpty(this.Q)) {
|
||
str = v8.h.u0;
|
||
} else {
|
||
str = this.Q + "_onResume";
|
||
}
|
||
this.Q = str;
|
||
if (com.mbridge.msdk.foundation.d.b.c) {
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer == null || (mBridgeVideoView = mBTempContainer.mbridgeVideoView) == null) {
|
||
return;
|
||
}
|
||
mBridgeVideoView.setCover(false);
|
||
return;
|
||
}
|
||
com.mbridge.msdk.foundation.controller.c.m().a(this);
|
||
try {
|
||
com.mbridge.msdk.foundation.same.f.a.b().execute(new b(this.a, this.s));
|
||
} catch (Throwable th) {
|
||
af.b("MBRewardVideoActivity", th.getMessage());
|
||
}
|
||
MBTempContainer mBTempContainer2 = this.u;
|
||
if (mBTempContainer2 != null) {
|
||
mBTempContainer2.onResume();
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.onResume();
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.signal.activity.AbstractJSActivity, android.app.Activity
|
||
public void onPause() {
|
||
String str;
|
||
super.onPause();
|
||
if (TextUtils.isEmpty(this.Q)) {
|
||
str = v8.h.t0;
|
||
} else {
|
||
str = this.Q + "_onPause";
|
||
}
|
||
this.Q = str;
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer != null) {
|
||
mBTempContainer.onPause();
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.onPause();
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.signal.activity.AbstractJSActivity, android.app.Activity, android.content.ComponentCallbacks
|
||
public void onConfigurationChanged(Configuration configuration) {
|
||
super.onConfigurationChanged(configuration);
|
||
if (this.u != null) {
|
||
changeHalfScreenPadding(configuration.orientation);
|
||
this.u.onConfigurationChanged(configuration);
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.onConfigurationChanged(configuration);
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.signal.activity.AbstractJSActivity, android.app.Activity
|
||
public void onBackPressed() {
|
||
this.T = true;
|
||
super.onBackPressed();
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer != null) {
|
||
mBTempContainer.onBackPressed();
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.onBackPressed();
|
||
}
|
||
}
|
||
|
||
@Override // android.app.Activity
|
||
public void onStop() {
|
||
String str;
|
||
if (TextUtils.isEmpty(this.Q)) {
|
||
str = "onStop";
|
||
} else {
|
||
str = this.Q + "_onStop";
|
||
}
|
||
this.Q = str;
|
||
MBridgeConstans.isRewardActivityShowing = false;
|
||
super.onStop();
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer != null) {
|
||
mBTempContainer.onStop();
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.onStop();
|
||
}
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.video.signal.activity.AbstractJSActivity, com.mbridge.msdk.activity.MBBaseActivity, android.app.Activity
|
||
public void onDestroy() {
|
||
String str;
|
||
h hVar;
|
||
if (TextUtils.isEmpty(this.Q)) {
|
||
str = "onDestroy";
|
||
} else {
|
||
str = this.Q + "_onDestroy";
|
||
}
|
||
this.Q = str;
|
||
super.onDestroy();
|
||
h hVar2 = this.m;
|
||
if (hVar2 != null && (hVar2 instanceof com.mbridge.msdk.video.bt.module.b.b)) {
|
||
try {
|
||
com.mbridge.msdk.video.bt.module.b.b bVar = (com.mbridge.msdk.video.bt.module.b.b) hVar2;
|
||
if (!bVar.b && !bVar.c) {
|
||
this.R = true;
|
||
}
|
||
} catch (Throwable th) {
|
||
af.b("MBRewardVideoActivity", th.getMessage());
|
||
}
|
||
}
|
||
e eVar = new e();
|
||
eVar.a("activity_life_cycle", TextUtils.isEmpty(this.Q) ? "unKnown" : this.Q);
|
||
eVar.a("activity_duration", Long.valueOf(SystemClock.elapsedRealtime() - this.P));
|
||
eVar.a("is_unexpected_destroy", Integer.valueOf(this.R ? 1 : 2));
|
||
eVar.a("is_listener_null", Integer.valueOf(this.m == null ? 1 : 2));
|
||
eVar.a("is_called_finish", Integer.valueOf(this.S ? 1 : 2));
|
||
eVar.a("is_back_pressed", Integer.valueOf(this.T ? 1 : 2));
|
||
com.mbridge.msdk.foundation.same.report.d.d.a().a("2000151", this.r, eVar);
|
||
try {
|
||
if (this.R && (hVar = this.m) != null) {
|
||
hVar.a(this.J, "show fail : unexpected destroy");
|
||
}
|
||
} catch (Throwable th2) {
|
||
af.b("MBRewardVideoActivity", th2.getMessage());
|
||
}
|
||
com.mbridge.msdk.video.module.b.b.a(this.a);
|
||
e();
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer != null) {
|
||
mBTempContainer.onDestroy();
|
||
this.u = null;
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.onDestroy();
|
||
this.v = null;
|
||
}
|
||
this.U = null;
|
||
this.V = null;
|
||
com.mbridge.msdk.foundation.d.b.a().c(this.a + "_1");
|
||
com.mbridge.msdk.foundation.d.b.a().c(this.a + "_2");
|
||
com.mbridge.msdk.foundation.same.f.a.b().execute(new a(this.s, this.a, this.y));
|
||
}
|
||
|
||
@Override // android.app.Activity
|
||
public void onRestart() {
|
||
String str;
|
||
super.onRestart();
|
||
if (TextUtils.isEmpty(this.Q)) {
|
||
str = "onRestart";
|
||
} else {
|
||
str = this.Q + "_onRestart";
|
||
}
|
||
this.Q = str;
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer != null) {
|
||
mBTempContainer.onRestart();
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.onRestart();
|
||
}
|
||
}
|
||
|
||
@Override // android.app.Activity
|
||
public void onStart() {
|
||
String str;
|
||
super.onStart();
|
||
if (TextUtils.isEmpty(this.Q)) {
|
||
str = "onStart";
|
||
} else {
|
||
str = this.Q + "_onStart";
|
||
}
|
||
this.Q = str;
|
||
if (com.mbridge.msdk.foundation.d.b.c) {
|
||
return;
|
||
}
|
||
new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.reward.player.MBRewardVideoActivity.4
|
||
@Override // com.mbridge.msdk.foundation.d.a
|
||
public final void showed() {
|
||
MBRewardVideoActivity.this.onPause();
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.foundation.d.a
|
||
public final void close() {
|
||
MBRewardVideoActivity.this.onResume();
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.foundation.d.a
|
||
public final void summit(String str2) {
|
||
MBRewardVideoActivity.this.onResume();
|
||
}
|
||
};
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer != null) {
|
||
mBTempContainer.onStart();
|
||
this.r.setCampaignUnitId(this.a);
|
||
com.mbridge.msdk.foundation.d.b.a().a(this.a + "_1", this.r);
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.onStart();
|
||
List<CampaignEx> list = this.t;
|
||
if (list != null && list.size() > 0) {
|
||
CampaignEx campaignEx = this.t.get(0);
|
||
campaignEx.setCampaignUnitId(this.a);
|
||
com.mbridge.msdk.foundation.d.b.a().a(this.a + "_1", campaignEx);
|
||
}
|
||
}
|
||
if (this.A) {
|
||
return;
|
||
}
|
||
com.mbridge.msdk.foundation.d.b.a().a(this.a + "_1", 1);
|
||
com.mbridge.msdk.foundation.d.b.a().c(this.a + "_2");
|
||
this.A = true;
|
||
}
|
||
|
||
public static final class a implements Runnable {
|
||
private final List<com.mbridge.msdk.videocommon.download.a> a;
|
||
private final String b;
|
||
private final String c;
|
||
|
||
public a(List<com.mbridge.msdk.videocommon.download.a> list, String str, String str2) {
|
||
this.a = list;
|
||
this.b = str;
|
||
this.c = str2;
|
||
}
|
||
|
||
@Override // java.lang.Runnable
|
||
public final void run() {
|
||
try {
|
||
List<com.mbridge.msdk.videocommon.download.a> list = this.a;
|
||
if (list == null || list.size() <= 0) {
|
||
return;
|
||
}
|
||
for (com.mbridge.msdk.videocommon.download.a aVar : this.a) {
|
||
if (aVar != null && aVar.l() != null) {
|
||
CampaignEx l = aVar.l();
|
||
try {
|
||
AppletModelManager.getInstance().remove(l);
|
||
} catch (Exception e) {
|
||
if (MBridgeConstans.DEBUG) {
|
||
af.b("MBRewardVideoActivity", "AppletModelManager remove error", e);
|
||
}
|
||
}
|
||
String str = l.getRequestId() + l.getId() + l.getVideoUrlEncode();
|
||
j c = com.mbridge.msdk.videocommon.download.b.getInstance().c(this.b);
|
||
if (c != null) {
|
||
try {
|
||
c.b(str);
|
||
} catch (Exception e2) {
|
||
if (MBridgeConstans.DEBUG) {
|
||
af.b("DownLoadManager", e2.getMessage());
|
||
}
|
||
}
|
||
}
|
||
if (l.getRewardTemplateMode() != null) {
|
||
if (!TextUtils.isEmpty(l.getRewardTemplateMode().e())) {
|
||
com.mbridge.msdk.videocommon.a.b(this.b + "_" + l.getId() + "_" + this.c + "_" + l.getRewardTemplateMode().e());
|
||
com.mbridge.msdk.videocommon.a.b(l.getAdType(), l);
|
||
}
|
||
if (!TextUtils.isEmpty(l.getCMPTEntryUrl())) {
|
||
com.mbridge.msdk.videocommon.a.b(this.b + "_" + this.c + "_" + l.getCMPTEntryUrl());
|
||
}
|
||
com.mbridge.msdk.videocommon.a.a.a().a(l);
|
||
}
|
||
}
|
||
}
|
||
} catch (Exception e3) {
|
||
af.a("MBRewardVideoActivity", e3.getMessage());
|
||
}
|
||
}
|
||
}
|
||
|
||
@Override // android.app.Activity
|
||
public void finish() {
|
||
this.S = true;
|
||
if (this.M != null) {
|
||
af.b("omsdk", "mbrewardvideoac finish");
|
||
this.M.removeAllFriendlyObstructions();
|
||
this.M.finish();
|
||
this.M = null;
|
||
}
|
||
com.mbridge.msdk.foundation.controller.c.m().b(0);
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer != null) {
|
||
mBTempContainer.onDestroy();
|
||
this.u = null;
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.onDestroy();
|
||
this.v = null;
|
||
}
|
||
com.mbridge.msdk.foundation.d.b.a().c(this.a);
|
||
super.finish();
|
||
}
|
||
|
||
@Override // android.app.Activity
|
||
public void onSaveInstanceState(Bundle bundle) {
|
||
bundle.putBoolean(SAVE_STATE_KEY_REPORT, this.p);
|
||
super.onSaveInstanceState(bundle);
|
||
}
|
||
|
||
@Override // com.mbridge.msdk.activity.MBBaseActivity
|
||
public void setTopControllerPadding(int i, int i2, int i3, int i4, int i5) {
|
||
this.D = i2;
|
||
this.F = i3;
|
||
this.E = i4;
|
||
this.G = i5;
|
||
this.H = i;
|
||
MBTempContainer mBTempContainer = this.u;
|
||
if (mBTempContainer != null) {
|
||
mBTempContainer.setNotchPadding(i, i2, i3, i4, i5);
|
||
}
|
||
MBridgeBTContainer mBridgeBTContainer = this.v;
|
||
if (mBridgeBTContainer != null) {
|
||
mBridgeBTContainer.setNotchPadding(i, i2, i3, i4, i5);
|
||
}
|
||
com.mbridge.msdk.video.dynview.a.a.e = i;
|
||
com.mbridge.msdk.video.dynview.a.a.a = i2;
|
||
com.mbridge.msdk.video.dynview.a.a.b = i3;
|
||
com.mbridge.msdk.video.dynview.a.a.c = i4;
|
||
com.mbridge.msdk.video.dynview.a.a.d = i5;
|
||
}
|
||
|
||
public int findID(String str) {
|
||
return x.a(getApplicationContext(), str, "id");
|
||
}
|
||
|
||
public int findLayout(String str) {
|
||
return x.a(getApplicationContext(), str, TtmlNode.TAG_LAYOUT);
|
||
}
|
||
|
||
public void changeHalfScreenPadding(int i) {
|
||
int e;
|
||
int f;
|
||
int f2;
|
||
float f3;
|
||
try {
|
||
CampaignEx campaignEx = this.r;
|
||
if (campaignEx == null || campaignEx.getAdSpaceT() != 2) {
|
||
return;
|
||
}
|
||
getWindow().getDecorView().setBackgroundColor(-1728053248);
|
||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.u.getLayoutParams();
|
||
layoutParams.gravity = 17;
|
||
if (this.r.getRewardTemplateMode().b() == 0) {
|
||
if (i == 2) {
|
||
e = (int) (ak.e(this) * 0.6f);
|
||
f2 = ak.f(this);
|
||
f3 = f2 * 0.6f;
|
||
} else {
|
||
e = (int) (ak.e(this) * 0.6f);
|
||
f = ak.f(this);
|
||
f3 = f * 0.7f;
|
||
}
|
||
} else if (this.r.getRewardTemplateMode().b() == 2) {
|
||
e = (int) (ak.e(this) * 0.6f);
|
||
f2 = ak.f(this);
|
||
f3 = f2 * 0.6f;
|
||
} else {
|
||
e = (int) (ak.e(this) * 0.6f);
|
||
f = ak.f(this);
|
||
f3 = f * 0.7f;
|
||
}
|
||
int i2 = (int) f3;
|
||
layoutParams.height = e;
|
||
layoutParams.width = i2;
|
||
this.u.setLayoutParams(layoutParams);
|
||
} catch (Throwable th) {
|
||
af.b("MBRewardVideoActivity", th.getMessage());
|
||
}
|
||
}
|
||
|
||
private void e() {
|
||
try {
|
||
List<CampaignEx> list = this.t;
|
||
if (list != null && list.size() > 0) {
|
||
Iterator<CampaignEx> it = this.t.iterator();
|
||
while (it.hasNext()) {
|
||
d(it.next());
|
||
}
|
||
}
|
||
CampaignEx campaignEx = this.r;
|
||
if (campaignEx != null) {
|
||
d(campaignEx);
|
||
}
|
||
} catch (Throwable th) {
|
||
af.b("MBRewardVideoActivity", th.getMessage());
|
||
}
|
||
}
|
||
|
||
private void d(CampaignEx campaignEx) {
|
||
if (campaignEx != null) {
|
||
if (!TextUtils.isEmpty(campaignEx.getImageUrl())) {
|
||
com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.c.m().c());
|
||
campaignEx.getImageUrl();
|
||
}
|
||
if (TextUtils.isEmpty(campaignEx.getIconUrl())) {
|
||
return;
|
||
}
|
||
com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.c.m().c());
|
||
campaignEx.getIconUrl();
|
||
}
|
||
}
|
||
|
||
@Override // android.app.Activity, android.view.ContextThemeWrapper, android.content.ContextWrapper, android.content.Context
|
||
public void setTheme(int i) {
|
||
super.setTheme(x.a(this, "mbridge_transparent_theme", "style"));
|
||
}
|
||
|
||
public static final class b implements Runnable {
|
||
private final List<com.mbridge.msdk.videocommon.download.a> a;
|
||
private final String b;
|
||
|
||
public b(String str, List<com.mbridge.msdk.videocommon.download.a> list) {
|
||
this.a = list;
|
||
this.b = str;
|
||
}
|
||
|
||
@Override // java.lang.Runnable
|
||
public final void run() {
|
||
try {
|
||
List<com.mbridge.msdk.videocommon.download.a> list = this.a;
|
||
if (list == null || list.size() <= 0) {
|
||
return;
|
||
}
|
||
for (com.mbridge.msdk.videocommon.download.a aVar : this.a) {
|
||
if (aVar != null && aVar.l() != null) {
|
||
com.mbridge.msdk.videocommon.a.a.a().a(aVar.l(), this.b);
|
||
}
|
||
}
|
||
} catch (Throwable th) {
|
||
af.b("MBRewardVideoActivity", th.getMessage());
|
||
}
|
||
}
|
||
}
|
||
|
||
private void b(List<CampaignEx> list) {
|
||
CampaignEx campaignEx;
|
||
if (this.L) {
|
||
return;
|
||
}
|
||
if (list == null) {
|
||
try {
|
||
if (this.k) {
|
||
list = this.t;
|
||
} else {
|
||
list = new ArrayList<>();
|
||
List<com.mbridge.msdk.videocommon.download.a> list2 = this.s;
|
||
if (list2 != null && list2.get(0) != null && this.s.get(0).l() != null) {
|
||
list.add(this.s.get(0).l());
|
||
}
|
||
}
|
||
} catch (Exception e) {
|
||
if (MBridgeConstans.DEBUG) {
|
||
e.printStackTrace();
|
||
return;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
String currentLocalRid = (list == null || list.isEmpty() || (campaignEx = list.get(0)) == null) ? "" : campaignEx.getCurrentLocalRid();
|
||
if (!TextUtils.isEmpty(currentLocalRid)) {
|
||
this.J = com.mbridge.msdk.foundation.same.report.d.d.a().a(currentLocalRid, "");
|
||
}
|
||
if (this.J == null) {
|
||
this.J = new c();
|
||
e eVar = new e();
|
||
eVar.a(MBridgeConstans.PROPERTIES_UNIT_ID, this.a);
|
||
eVar.a("hb", Integer.valueOf(this.g ? 1 : 0));
|
||
eVar.a("adtp", Integer.valueOf(this.f ? 287 : 94));
|
||
eVar.a("lrid", this.I);
|
||
eVar.a("his_reason", "show campaign is null");
|
||
this.J.a("2000129", eVar);
|
||
}
|
||
if (list != null) {
|
||
this.J.b(list);
|
||
}
|
||
this.L = true;
|
||
com.mbridge.msdk.reward.c.a.a.a().a("2000129", this.J);
|
||
}
|
||
}
|