- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
596 lines
26 KiB
Java
596 lines
26 KiB
Java
package com.mbridge.msdk.newreward.player.presenter;
|
|
|
|
import android.app.Activity;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.text.TextUtils;
|
|
import android.util.Base64;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import androidx.core.app.NotificationCompat;
|
|
import com.facebook.appevents.internal.ViewHierarchyConstants;
|
|
import com.ironsource.mediationsdk.utils.IronSourceConstants;
|
|
import com.mbridge.msdk.foundation.d.a;
|
|
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.foundation.tools.ak;
|
|
import com.mbridge.msdk.newreward.a.b.b;
|
|
import com.mbridge.msdk.newreward.function.command.c;
|
|
import com.mbridge.msdk.newreward.function.command.f;
|
|
import com.mbridge.msdk.newreward.function.command.receiver.d;
|
|
import com.mbridge.msdk.newreward.function.g.e;
|
|
import com.mbridge.msdk.newreward.player.imodel.IPlayModel;
|
|
import com.mbridge.msdk.newreward.player.iview.IWebTemplateView;
|
|
import com.mbridge.msdk.newreward.player.model.WebTemplateModel;
|
|
import com.mbridge.msdk.newreward.player.view.hybrid.util.MBCommunicatorUtil;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
|
|
import java.io.File;
|
|
import java.lang.reflect.Proxy;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class PlayWebPresenter extends BaseTemplatePresenter implements b {
|
|
final int CLOSE_BUILD_TYPE;
|
|
private final String TAG;
|
|
a feedbackDialogEventListener;
|
|
Handler mHandler;
|
|
boolean mNativeHandleClick;
|
|
float mTouchX;
|
|
float mTouchY;
|
|
IWebTemplateView mWebTemplateView;
|
|
private boolean muteState;
|
|
public Runnable nativeCloseBtnVisibleRunnable;
|
|
int webCloseViewStatus;
|
|
|
|
@Override // com.mbridge.msdk.newreward.a.b.b
|
|
public void reqFailed(com.mbridge.msdk.foundation.c.b bVar) {
|
|
}
|
|
|
|
public PlayWebPresenter(IWebTemplateView iWebTemplateView) {
|
|
super(iWebTemplateView);
|
|
this.TAG = "PlayWebPresenter";
|
|
this.muteState = true;
|
|
this.mNativeHandleClick = false;
|
|
this.mHandler = new Handler(Looper.getMainLooper());
|
|
this.webCloseViewStatus = -1;
|
|
this.CLOSE_BUILD_TYPE = 2;
|
|
this.nativeCloseBtnVisibleRunnable = new Runnable() { // from class: com.mbridge.msdk.newreward.player.presenter.PlayWebPresenter.2
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
PlayWebPresenter playWebPresenter = PlayWebPresenter.this;
|
|
if (playWebPresenter.webCloseViewStatus != -1) {
|
|
return;
|
|
}
|
|
playWebPresenter.mWebTemplateView.setNativeCloseButtonVisibility(0);
|
|
}
|
|
};
|
|
this.feedbackDialogEventListener = new a() { // from class: com.mbridge.msdk.newreward.player.presenter.PlayWebPresenter.3
|
|
@Override // com.mbridge.msdk.foundation.d.a
|
|
public void showed() {
|
|
PlayWebPresenter.this.firePrivacyFeedbackEvent(1);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.foundation.d.a
|
|
public void close() {
|
|
PlayWebPresenter.this.firePrivacyFeedbackEvent(2);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.foundation.d.a
|
|
public void summit(String str) {
|
|
PlayWebPresenter.this.firePrivacyFeedbackEvent(2);
|
|
}
|
|
};
|
|
IWebTemplateView iWebTemplateView2 = (IWebTemplateView) Proxy.newProxyInstance(iWebTemplateView.getClass().getClassLoader(), new Class[]{IWebTemplateView.class}, new e(iWebTemplateView, this.adapterModel, this.commandManager));
|
|
this.mWebTemplateView = iWebTemplateView2;
|
|
this.iView = iWebTemplateView2;
|
|
this.TEMPLATE_MARK_TYPE = 2;
|
|
}
|
|
|
|
public void setTemplateModel(IPlayModel iPlayModel) {
|
|
if (iPlayModel == null) {
|
|
this.playTempleModel = (IPlayModel) Proxy.newProxyInstance(WebTemplateModel.class.getClassLoader(), WebTemplateModel.class.getInterfaces(), new e(new WebTemplateModel(this.commandManager, this.adapterModel), this.adapterModel, this.commandManager));
|
|
return;
|
|
}
|
|
if (iPlayModel instanceof WebTemplateModel) {
|
|
WebTemplateModel webTemplateModel = (WebTemplateModel) iPlayModel;
|
|
webTemplateModel.setCommandManager(this.commandManager);
|
|
webTemplateModel.setCallbackListener(this);
|
|
webTemplateModel.setRewardVideoListener(this.adapterModel.K());
|
|
}
|
|
this.playTempleModel = (IPlayModel) Proxy.newProxyInstance(iPlayModel.getClass().getClassLoader(), iPlayModel.getClass().getInterfaces(), new e(iPlayModel, this.adapterModel, this.commandManager));
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.AbsPresenter
|
|
public void getView() {
|
|
initDataForView(null);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.AbsPresenter
|
|
public void initDataForView(com.mbridge.msdk.video.dynview.a aVar) {
|
|
this.mWebTemplateView.initViews(false);
|
|
if (this.campaignEx.getVideoUrlEncode() != null) {
|
|
File g = this.adapterModel.g(this.campaignEx.getRequestIdNotice());
|
|
if (this.campaignEx.getVst() > -2) {
|
|
((BaseTemplatePresenter) this).videoSkipTime = this.campaignEx.getVst();
|
|
} else {
|
|
((BaseTemplatePresenter) this).videoSkipTime = this.adapterModel.x().b().e();
|
|
}
|
|
this.videoCompleteTime = this.campaignEx.getVideoCompleteTime();
|
|
if (g != null && g.exists()) {
|
|
this.mWebTemplateView.play(g.getAbsolutePath(), getBufferTimeout());
|
|
} else {
|
|
this.mWebTemplateView.play(this.campaignEx.getVideoUrlEncode(), getBufferTimeout());
|
|
}
|
|
}
|
|
ak.a(1, this.mWebTemplateView.getPrivacyButton(), this.adapterModel.U(), this.context, false, new a() { // from class: com.mbridge.msdk.newreward.player.presenter.PlayWebPresenter.1
|
|
@Override // com.mbridge.msdk.foundation.d.a
|
|
public void showed() {
|
|
PlayWebPresenter.this.onPause();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.foundation.d.a
|
|
public void close() {
|
|
PlayWebPresenter.this.mWebTemplateView.playOrPauseVideo(1);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.foundation.d.a
|
|
public void summit(String str) {
|
|
PlayWebPresenter.this.mWebTemplateView.playOrPauseVideo(1);
|
|
}
|
|
});
|
|
com.mbridge.msdk.newreward.a.e eVar = this.adapterModel;
|
|
if (eVar == null || !eVar.ai().equals("WEB_EC")) {
|
|
return;
|
|
}
|
|
c cVar = this.commandManager;
|
|
cVar.i(cVar.a("web_resource_action", 1, "parent_temple", this.data.getRootViewGroup(), "adapter_model", this.adapterModel, "bridge_ids", this.campaignEx.getRequestIdNotice()), f.SHOW_OR_PRELOAD_WEB_EC);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.BaseTemplatePresenter, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
|
|
public void onPlayStarted(int i) {
|
|
super.onPlayStarted(i);
|
|
MBCommunicatorUtil.notifyVideoStatus(this.mWebTemplateView.getWebView(), 0);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.BaseTemplatePresenter, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
|
|
public void onPlayProgress(int i, int i2) {
|
|
super.onPlayProgress(i, i2);
|
|
try {
|
|
JSONObject jSONObject = new JSONObject();
|
|
if (i2 == 0) {
|
|
i2 = this.campaignEx.getVideoLength();
|
|
}
|
|
if (i2 == 0) {
|
|
i2 = 1;
|
|
}
|
|
jSONObject.put(NotificationCompat.CATEGORY_PROGRESS, (int) (i / i2));
|
|
jSONObject.put("time", i);
|
|
jSONObject.put(IronSourceConstants.EVENTS_DURATION, i2);
|
|
IPlayModel iPlayModel = this.playTempleModel;
|
|
if (iPlayModel instanceof WebTemplateModel) {
|
|
((WebTemplateModel) iPlayModel).setVideoProgressString(jSONObject.toString());
|
|
}
|
|
MBCommunicatorUtil.notifyVideoProgress(this.mWebTemplateView.getWebView(), i, i2);
|
|
} catch (Throwable th) {
|
|
af.b("PlayWebPresenter", th.getMessage());
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.BaseTemplatePresenter, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
|
|
public void onPlayCompleted() {
|
|
super.onPlayCompleted();
|
|
MBCommunicatorUtil.notifyVideoStatus(this.mWebTemplateView.getWebView(), 1);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.BaseTemplatePresenter, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
|
|
public void onPlayError(String str) {
|
|
super.onPlayError(str);
|
|
MBCommunicatorUtil.notifyVideoStatus(this.mWebTemplateView.getWebView(), 2);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.AbsPresenter
|
|
public void finish(boolean z) {
|
|
try {
|
|
releaseSource();
|
|
if (z) {
|
|
((Activity) this.context).finish();
|
|
d.a().d(f.SHOW_OR_PRELOAD_WEB_EC);
|
|
}
|
|
d.a().a(this.adapterModel.G());
|
|
} catch (Throwable th) {
|
|
af.b("PlayWebPresenter", th.getMessage());
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.AbsPresenter
|
|
public void releaseSource() {
|
|
if (!this.adapterModel.ac()) {
|
|
this.adapterModel.n(true);
|
|
this.playTempleModel.modelReport("2000146");
|
|
}
|
|
this.iView.release();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.BaseTemplatePresenter, com.mbridge.msdk.newreward.player.presenter.AbsPresenter
|
|
public void click(View view) {
|
|
if (view.getId() == filterFindViewId(false, "mbridge_alertview_close_button")) {
|
|
onClick(8);
|
|
} else if (view.getId() == filterFindViewId(false, "mbridge_alertview_continue_button")) {
|
|
onClick(6);
|
|
}
|
|
super.click(view);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.BaseTemplatePresenter, com.mbridge.msdk.newreward.player.presenter.AbsPresenter
|
|
public void adShowSuccess() {
|
|
super.adShowSuccess();
|
|
}
|
|
|
|
public void onClick(int i) {
|
|
if (isIVRewardEnable()) {
|
|
this.adapterModel.b(this.ivRewardAlertViewStatus);
|
|
}
|
|
if (i == 2) {
|
|
onCloseButtonClick();
|
|
}
|
|
if (i == 5) {
|
|
if (this.iView.getMuteState()) {
|
|
this.playTempleModel.eventTrackingForUnMute(this.redirectModel);
|
|
this.muteState = false;
|
|
} else {
|
|
this.playTempleModel.eventTrackingForMute(this.redirectModel);
|
|
this.muteState = true;
|
|
}
|
|
this.mWebTemplateView.setMuteState(this.muteState);
|
|
}
|
|
if ((i == 1 || i == 3) && this.mNativeHandleClick) {
|
|
CampaignEx campaignEx = this.campaignEx;
|
|
if (campaignEx != null) {
|
|
campaignEx.setClickTempSource(com.mbridge.msdk.foundation.same.report.d.a.g);
|
|
if (i == 1) {
|
|
this.campaignEx.setTriggerClickSource(com.mbridge.msdk.foundation.same.report.d.a.n);
|
|
} else {
|
|
this.campaignEx.setTriggerClickSource(com.mbridge.msdk.foundation.same.report.d.a.m);
|
|
}
|
|
}
|
|
this.playTempleModel.onAdClick(this.mBridgeIds);
|
|
this.playTempleModel.eventClickUrl(this.redirectModel);
|
|
this.playTempleModel.eventTrackingForClick(this.redirectModel);
|
|
return;
|
|
}
|
|
MBCommunicatorUtil.notifyClick(this.mWebTemplateView.getWebView(), i, com.mbridge.msdk.newreward.function.h.b.a(this.mTouchX, this.mTouchY, 0));
|
|
}
|
|
|
|
public void onWebContentError() {
|
|
this.mWebTemplateView.onDestroyWebContent(this.TEMPLATE_MARK_TYPE);
|
|
if (!this.adapterModel.Y()) {
|
|
this.mWebTemplateView.removeTempleFromSuperView(this.data.getRootViewGroup());
|
|
} else {
|
|
this.webCloseViewStatus = -1;
|
|
this.mNativeHandleClick = true;
|
|
this.mHandler.post(this.nativeCloseBtnVisibleRunnable);
|
|
}
|
|
d.a().a(this.adapterModel.G());
|
|
}
|
|
|
|
public void changeNativeCloseButton() {
|
|
int cbd = this.adapterModel.U().getCbd();
|
|
if (cbd < 0) {
|
|
cbd = this.adapterModel.x().b().p();
|
|
}
|
|
this.mHandler.postDelayed(this.nativeCloseBtnVisibleRunnable, cbd * 1000);
|
|
}
|
|
|
|
public void setNotchData(String str) {
|
|
MBCommunicatorUtil.notifyNotchData(this.mWebTemplateView.getWebView(), str);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.a.b.b
|
|
public void reqSuccessful(Object obj) {
|
|
char c;
|
|
try {
|
|
} catch (Throwable th) {
|
|
af.b("PlayWebPresenter", th.getMessage());
|
|
}
|
|
if (obj instanceof JSONObject) {
|
|
JSONObject jSONObject = (JSONObject) obj;
|
|
if (jSONObject.length() > 0) {
|
|
String string = jSONObject.getString("action");
|
|
int i = 8;
|
|
switch (string.hashCode()) {
|
|
case -1765453640:
|
|
if (string.equals("toggleCloseBtn")) {
|
|
c = 1;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case -1488920312:
|
|
if (string.equals("onReceivedError")) {
|
|
c = 4;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case -1410229111:
|
|
if (string.equals("videoOperate")) {
|
|
c = 6;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case -1258199123:
|
|
if (string.equals("notifyCloseBtn")) {
|
|
c = 2;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 94750088:
|
|
if (string.equals("click")) {
|
|
c = '\n';
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 94756344:
|
|
if (string.equals("close")) {
|
|
c = 3;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 96046965:
|
|
if (string.equals("readyStatus")) {
|
|
c = 0;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 131169903:
|
|
if (string.equals("showVideoClickView")) {
|
|
c = 11;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 181688693:
|
|
if (string.equals("soundOperate")) {
|
|
c = 7;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 1691567443:
|
|
if (string.equals("showVideoLocation")) {
|
|
c = 5;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 1779467262:
|
|
if (string.equals("progressBarOperate")) {
|
|
c = '\t';
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 1843897919:
|
|
if (string.equals("feedbackOperate")) {
|
|
c = '\f';
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 1941013143:
|
|
if (string.equals("progressOperate")) {
|
|
c = '\b';
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
default:
|
|
c = 65535;
|
|
break;
|
|
}
|
|
switch (c) {
|
|
case 0:
|
|
if (jSONObject.optInt("status", 1) == 1) {
|
|
this.mWebTemplateView.onWebViewShow(this.TEMPLATE_MARK_TYPE);
|
|
break;
|
|
} else {
|
|
onWebContentError();
|
|
break;
|
|
}
|
|
case 1:
|
|
int optInt = jSONObject.optInt("status", 1);
|
|
this.webCloseViewStatus = optInt;
|
|
this.mHandler.removeCallbacks(this.nativeCloseBtnVisibleRunnable);
|
|
this.mWebTemplateView.setNativeCloseButtonVisibility(optInt == 1 ? 0 : 4);
|
|
break;
|
|
case 2:
|
|
int optInt2 = jSONObject.optInt("status", -1);
|
|
this.webCloseViewStatus = optInt2;
|
|
if (optInt2 == 0 || optInt2 == 1) {
|
|
this.mHandler.removeCallbacks(this.nativeCloseBtnVisibleRunnable);
|
|
break;
|
|
}
|
|
case 3:
|
|
this.mWebTemplateView.onCloseViewClick(2);
|
|
break;
|
|
case 4:
|
|
onWebContentError();
|
|
break;
|
|
case 5:
|
|
String optString = jSONObject.optString("status");
|
|
if (!TextUtils.isEmpty(optString)) {
|
|
this.mWebTemplateView.changeVideoViewPosition(new JSONObject(optString));
|
|
break;
|
|
}
|
|
break;
|
|
case 6:
|
|
this.mWebTemplateView.playOrPauseVideo(jSONObject.optInt("status", -999));
|
|
break;
|
|
case 7:
|
|
JSONObject optJSONObject = jSONObject.optJSONObject("status");
|
|
if (optJSONObject != null) {
|
|
this.mWebTemplateView.setMuteState(optJSONObject.optInt(CampaignEx.JSON_NATIVE_VIDEO_MUTE, 2), optJSONObject.optInt("view_visible", 2));
|
|
break;
|
|
}
|
|
break;
|
|
case '\b':
|
|
JSONObject optJSONObject2 = jSONObject.optJSONObject("status");
|
|
if (optJSONObject2 != null) {
|
|
int optInt3 = optJSONObject2.optInt(NotificationCompat.CATEGORY_PROGRESS, -1);
|
|
int optInt4 = optJSONObject2.optInt("view_visible", 2);
|
|
if (optInt3 != -1) {
|
|
this.mWebTemplateView.seekToPlay(optInt3);
|
|
}
|
|
this.mWebTemplateView.getCountDownView().setVisibility(optInt4 == 2 ? 0 : 4);
|
|
break;
|
|
}
|
|
break;
|
|
case '\t':
|
|
JSONObject optJSONObject3 = jSONObject.optJSONObject("status");
|
|
if (optJSONObject3 != null) {
|
|
int optInt5 = optJSONObject3.optInt("view_visible", 2);
|
|
IWebTemplateView iWebTemplateView = this.mWebTemplateView;
|
|
if (optInt5 != 1) {
|
|
i = 0;
|
|
}
|
|
iWebTemplateView.setSegmentsProgressBar(i);
|
|
break;
|
|
}
|
|
break;
|
|
case '\n':
|
|
CampaignEx campaignEx = this.campaignEx;
|
|
if (campaignEx != null) {
|
|
campaignEx.setClickTempSource(com.mbridge.msdk.foundation.same.report.d.a.g);
|
|
}
|
|
this.playTempleModel.onAdClick(this.mBridgeIds);
|
|
this.playTempleModel.eventTrackingForClick(this.redirectModel);
|
|
break;
|
|
case 11:
|
|
showCTAOrMiniEndCard(jSONObject.optInt("type", -999));
|
|
break;
|
|
case '\f':
|
|
String optString2 = jSONObject.optString("type", "");
|
|
String optString3 = jSONObject.optString("status", "");
|
|
if (!TextUtils.isEmpty(optString2)) {
|
|
JSONObject jSONObject2 = new JSONObject(optString3);
|
|
if (optString2.equals("popup")) {
|
|
com.mbridge.msdk.foundation.d.b.a().a(jSONObject2.optString("key", ""), jSONObject2.optInt("view_visible", 1), this.feedbackDialogEventListener);
|
|
}
|
|
if (optString2.equals(ViewHierarchyConstants.DIMENSION_VISIBILITY_KEY)) {
|
|
int optInt6 = jSONObject2.optInt("view_visible", 1);
|
|
String optString4 = jSONObject2.optString("key", "");
|
|
com.mbridge.msdk.foundation.d.b a = com.mbridge.msdk.foundation.d.b.a();
|
|
if (optInt6 != 1) {
|
|
i = 0;
|
|
}
|
|
a.a(optString4, i, this.mWebTemplateView.getWebView());
|
|
}
|
|
if (optString2.equals(TtmlNode.TAG_LAYOUT)) {
|
|
com.mbridge.msdk.foundation.d.b.a().a(jSONObject2.optString("key", ""), jSONObject2.optInt("width", -1), jSONObject2.optInt("height", -1), jSONObject2.optInt("radius", 20), jSONObject2.optInt("left", -1), jSONObject2.optInt("top", -1), (float) jSONObject2.optDouble("opacity", 1.0d), jSONObject2.optString("fontColor", ""), jSONObject2.optString("bgColor", ""), (float) jSONObject2.optDouble(TtmlNode.ATTR_TTS_FONT_SIZE, -1.0d), jSONObject2.optJSONArray("padding"));
|
|
break;
|
|
}
|
|
} else {
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public String getWebViewShowExtraData() {
|
|
if (this.reward == null) {
|
|
return "";
|
|
}
|
|
try {
|
|
JSONObject jSONObject = new JSONObject();
|
|
JSONObject jSONObject2 = new JSONObject();
|
|
jSONObject2.put("name", this.reward.a());
|
|
jSONObject2.put("amount", this.reward.b());
|
|
jSONObject2.put("id", "");
|
|
jSONObject.put("userId", "");
|
|
jSONObject.put("reward", jSONObject2);
|
|
jSONObject.put("playVideoMute", this.muteState);
|
|
jSONObject.put("extra", this.adapterModel.W());
|
|
return jSONObject.toString();
|
|
} catch (JSONException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void firePrivacyFeedbackEvent(int i) {
|
|
String str;
|
|
try {
|
|
JSONObject jSONObject = new JSONObject();
|
|
if (com.mbridge.msdk.foundation.controller.c.m().c() != null) {
|
|
jSONObject.put("status", i);
|
|
}
|
|
str = Base64.encodeToString(jSONObject.toString().getBytes(), 2);
|
|
} catch (Throwable th) {
|
|
af.b("PlayWebPresenter", th.getMessage(), th);
|
|
str = "";
|
|
}
|
|
MBCommunicatorUtil.fireEvent(this.mWebTemplateView.getWebView(), "onFeedbackAlertStatusNotify", str);
|
|
}
|
|
|
|
public int getCampaignOrientation() {
|
|
try {
|
|
if (this.adapterModel.U() != null) {
|
|
return this.adapterModel.U().getRewardTemplateMode().b();
|
|
}
|
|
return 0;
|
|
} catch (Throwable th) {
|
|
af.b("PlayWebPresenter", th.getMessage());
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
private void showCTAOrMiniEndCard(int i) {
|
|
if (i == -1) {
|
|
this.mWebTemplateView.hideCTAView();
|
|
}
|
|
if (i == 1) {
|
|
this.mWebTemplateView.showCTAView(this.adapterModel.H(), this.adapterModel.U());
|
|
}
|
|
if (i == 2) {
|
|
this.mWebTemplateView.showMiniCard();
|
|
}
|
|
}
|
|
|
|
public void onWebViewShow() {
|
|
this.mWebTemplateView.onWebViewShow(this.TEMPLATE_MARK_TYPE);
|
|
}
|
|
|
|
public void onDetachedFromWindow() {
|
|
Handler handler = this.mHandler;
|
|
if (handler != null) {
|
|
handler.removeCallbacks(this.nativeCloseBtnVisibleRunnable);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.BaseTemplatePresenter
|
|
public void handleInterceptTouchEvent(MotionEvent motionEvent) {
|
|
this.mTouchX = motionEvent.getRawX();
|
|
this.mTouchY = motionEvent.getRawY();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.newreward.player.presenter.BaseTemplatePresenter, com.mbridge.msdk.newreward.player.presenter.AbsPresenter
|
|
public void onDestroy() {
|
|
super.onDestroy();
|
|
try {
|
|
releaseSource();
|
|
d.a().a(this.adapterModel.G());
|
|
d.a().d(f.SHOW_OR_PRELOAD_WEB_EC);
|
|
} catch (Throwable th) {
|
|
af.b("PlayWebPresenter", th.getMessage());
|
|
}
|
|
}
|
|
}
|