- 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
205 lines
6.6 KiB
Java
205 lines
6.6 KiB
Java
package com.mbridge.msdk.newreward.player.presenter;
|
|
|
|
import android.content.Context;
|
|
import android.text.TextUtils;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
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.a;
|
|
import com.mbridge.msdk.foundation.tools.x;
|
|
import com.mbridge.msdk.newout.RewardVideoListener;
|
|
import com.mbridge.msdk.newreward.a.e;
|
|
import com.mbridge.msdk.newreward.function.command.c;
|
|
import com.mbridge.msdk.newreward.function.command.d;
|
|
import com.mbridge.msdk.newreward.player.iview.IBaseView;
|
|
import com.mbridge.msdk.newreward.player.iview.IMetaData;
|
|
import com.mbridge.msdk.newreward.player.redirect.RedirectModel;
|
|
import com.mbridge.msdk.out.MBridgeIds;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public abstract class AbsPresenter {
|
|
int TEMPLATE_MARK_TYPE;
|
|
e adapterModel;
|
|
CampaignEx campaignEx;
|
|
int closeAlert;
|
|
c commandManager;
|
|
Context context;
|
|
IMetaData data;
|
|
boolean isIV;
|
|
boolean is_dy;
|
|
int ivRewardAlertViewStatus = a.F;
|
|
int ivRewardMode;
|
|
int ivRewardValue;
|
|
int ivRewardValueType;
|
|
MBridgeIds mBridgeIds;
|
|
View moreOfferTemp;
|
|
RedirectModel redirectModel;
|
|
com.mbridge.msdk.videocommon.b.c reward;
|
|
RewardVideoListener rewardVideoListener;
|
|
ViewGroup rootParentView;
|
|
int videoEndType;
|
|
int videoSkipResult;
|
|
int videoSkipTime;
|
|
|
|
public void adClosed() {
|
|
}
|
|
|
|
public void click(View view) {
|
|
}
|
|
|
|
public abstract void finish(boolean z);
|
|
|
|
public abstract void getView();
|
|
|
|
public abstract void initDataForView(com.mbridge.msdk.video.dynview.a aVar);
|
|
|
|
public void onDestroy() {
|
|
}
|
|
|
|
public abstract void releaseSource();
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public AbsPresenter(IBaseView iBaseView) {
|
|
ViewGroup viewGroup = (ViewGroup) iBaseView;
|
|
this.rootParentView = viewGroup;
|
|
Context context = viewGroup.getContext();
|
|
this.context = context;
|
|
IMetaData iMetaData = (IMetaData) context;
|
|
this.data = iMetaData;
|
|
this.adapterModel = (e) iMetaData.getDate();
|
|
this.commandManager = d.a().b();
|
|
this.campaignEx = this.adapterModel.U();
|
|
this.mBridgeIds = this.adapterModel.S();
|
|
this.rewardVideoListener = this.adapterModel.K();
|
|
RedirectModel redirectModel = new RedirectModel();
|
|
this.redirectModel = redirectModel;
|
|
redirectModel.setCampaignEx(this.campaignEx);
|
|
this.redirectModel.setContext(this.context);
|
|
this.redirectModel.setSettingModel(this.adapterModel.x());
|
|
this.redirectModel.setUnitId(this.adapterModel.H());
|
|
this.redirectModel.setDevExtraData(this.adapterModel.W());
|
|
prepareShowParameter();
|
|
buildReward("");
|
|
}
|
|
|
|
private void prepareShowParameter() {
|
|
CampaignEx campaignEx = this.campaignEx;
|
|
if (campaignEx == null) {
|
|
return;
|
|
}
|
|
boolean z = campaignEx.getAdType() == 287;
|
|
this.isIV = z;
|
|
if (z) {
|
|
this.ivRewardMode = this.adapterModel.L();
|
|
this.ivRewardValueType = this.adapterModel.u();
|
|
this.ivRewardValue = this.adapterModel.v();
|
|
}
|
|
this.closeAlert = this.adapterModel.x().b().i();
|
|
CampaignEx campaignEx2 = this.campaignEx;
|
|
if (campaignEx2 != null && campaignEx2.getVst() > -2) {
|
|
this.videoSkipTime = this.campaignEx.getVst();
|
|
} else {
|
|
this.videoSkipTime = this.adapterModel.x().b().e();
|
|
}
|
|
this.videoSkipResult = this.adapterModel.x().b().f();
|
|
this.videoEndType = this.campaignEx.getVideo_end_type();
|
|
}
|
|
|
|
private void buildReward(String str) {
|
|
if (this.campaignEx == null) {
|
|
return;
|
|
}
|
|
this.reward = com.mbridge.msdk.videocommon.b.c.b(str);
|
|
com.mbridge.msdk.videocommon.d.c b = this.adapterModel.x().b();
|
|
if (b != null) {
|
|
this.reward.a(b.m());
|
|
this.reward.a(b.n());
|
|
}
|
|
com.mbridge.msdk.videocommon.b.c cVar = this.reward;
|
|
if (cVar != null && cVar.b() <= 0) {
|
|
this.reward.a(1);
|
|
}
|
|
try {
|
|
if (this.campaignEx.getRewardPlus() != null) {
|
|
RewardPlus rewardPlus = this.campaignEx.getRewardPlus();
|
|
if (!TextUtils.isEmpty(rewardPlus.getName()) && rewardPlus.getAmount() > 0) {
|
|
com.mbridge.msdk.videocommon.b.c cVar2 = new com.mbridge.msdk.videocommon.b.c(rewardPlus.getName(), rewardPlus.getAmount());
|
|
this.reward = cVar2;
|
|
if (cVar2.b() < 0) {
|
|
this.reward.a(1);
|
|
}
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
if (MBridgeConstans.DEBUG) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
RedirectModel redirectModel = this.redirectModel;
|
|
if (redirectModel != null) {
|
|
redirectModel.setReward(this.reward);
|
|
}
|
|
}
|
|
|
|
public boolean isIVRewardEnable() {
|
|
if (!this.isIV) {
|
|
return false;
|
|
}
|
|
int i = this.ivRewardMode;
|
|
return i == a.I || i == a.H;
|
|
}
|
|
|
|
public int filterFindViewId(boolean z, String str) {
|
|
if (z) {
|
|
return findDyID(str);
|
|
}
|
|
return findID(str);
|
|
}
|
|
|
|
public int findID(String str) {
|
|
return x.a(this.context.getApplicationContext(), str, "id");
|
|
}
|
|
|
|
public int findDyID(String str) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return -1;
|
|
}
|
|
return str.hashCode();
|
|
}
|
|
|
|
public void adShowSuccess() {
|
|
e eVar = this.adapterModel;
|
|
if (eVar != null) {
|
|
eVar.j(true);
|
|
com.mbridge.msdk.newreward.function.d.c.a().b().a(this.adapterModel.h(), this.adapterModel.C(), this.adapterModel.H(), this.adapterModel.G(), 6);
|
|
}
|
|
}
|
|
|
|
public void adShowFail(String str, int i) {
|
|
e eVar = this.adapterModel;
|
|
if (eVar != null) {
|
|
eVar.j(true);
|
|
com.mbridge.msdk.newreward.function.d.c.a().b().a(this.adapterModel.h(), this.adapterModel.C(), this.adapterModel.H(), this.adapterModel.G(), 7);
|
|
}
|
|
}
|
|
|
|
public boolean isNotNULL(View... viewArr) {
|
|
if (viewArr == null) {
|
|
return false;
|
|
}
|
|
int length = viewArr.length;
|
|
int i = 0;
|
|
boolean z = false;
|
|
while (i < length) {
|
|
if (viewArr[i] == null) {
|
|
return false;
|
|
}
|
|
i++;
|
|
z = true;
|
|
}
|
|
return z;
|
|
}
|
|
}
|