AI Chat v1.1.8版本的 MD5 值为:1bcdce875f86738c8cfbf1e5f4064353
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.mbridge.msdk.mbbanner.common.c;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Base64;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.anythink.expressad.atsignalcommon.mraid.CallMraidJS;
import com.anythink.expressad.atsignalcommon.windvane.AbsFeedBackForH5;
import com.anythink.expressad.foundation.h.i;
import com.google.android.gms.ads.AdError;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.db.j;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.entity.CampaignUnit;
import com.mbridge.msdk.foundation.same.report.d;
import com.mbridge.msdk.foundation.same.report.e;
import com.mbridge.msdk.foundation.tools.ab;
import com.mbridge.msdk.foundation.tools.ac;
import com.mbridge.msdk.foundation.tools.aj;
import com.mbridge.msdk.foundation.tools.q;
import com.mbridge.msdk.foundation.tools.t;
import com.mbridge.msdk.foundation.tools.v;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.mbbanner.common.b.f;
import com.mbridge.msdk.mbbanner.common.util.BannerUtils;
import com.mbridge.msdk.mbbanner.view.MBBannerWebView;
import com.mbridge.msdk.mbsignalcommon.windvane.g;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.MBBannerView;
import com.mbridge.msdk.out.NativeListener;
import com.mbridge.msdk.videocommon.download.h;
import com.mbridge.msdk.widget.FeedBackButton;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.json.JSONObject;
public final class c {
private static String b = "BannerShowManager";
private float A;
public com.mbridge.msdk.click.a a;
private com.mbridge.msdk.mbbanner.common.b.c c;
private boolean f1617d;
private CampaignEx e;
private MBBannerView f;
private ImageView g;
private MBBannerWebView h;
private ImageView i;
private boolean j;
private boolean k;
private boolean l;
private boolean m;
private boolean n;
private boolean o;
private boolean p;
private String q;
private String r;
private List<CampaignEx> s;
private int t;
private com.mbridge.msdk.mbbanner.common.bridge.a v;
private nd7 w;
private float z;
private long u = 15000;
private Handler x = new Handler(Looper.getMainLooper()) {
@Override
public final void handleMessage(Message message) {
super.handleMessage(message);
if (message.what != 1) {
return;
}
try {
if (c.this.w != null) {
md7.a(c.this.w).b();
c.this.w.c();
c.this.w = null;
}
} catch (Throwable th) {
x.a(c.b, th.getMessage());
}
}
};
private com.mbridge.msdk.foundation.same.e.a y = new com.mbridge.msdk.foundation.same.e.a() {
@Override
public final void a() {
c.this.a(com.anythink.expressad.mbbanner.a.a.n);
}
@Override
public final void b() {
}
};
private View.OnClickListener B = new View.OnClickListener() {
@Override
public final void onClick(View view) {
if (c.this.p) {
c.c(c.this);
}
}
};
private com.mbridge.msdk.mbbanner.common.b.a C = new com.mbridge.msdk.mbbanner.common.b.a() {
@Override
public final void a(int i) {
if (i == 2) {
c.d(c.this);
} else {
c.this.g();
}
}
@Override
public final void b(int i) {
if (i == 1) {
c.this.e();
c.this.a("", 1);
return;
}
c.this.d();
}
@Override
public final void a(String str) {
c.c(c.this);
}
@Override
public final void a() {
c.c(c.this);
}
@Override
public final void a(CampaignEx campaignEx) {
c.this.a(campaignEx);
}
@Override
public final void a(boolean z) {
if (c.this.c != null) {
c.this.o = z;
if (z) {
c.this.c.c();
} else {
c.this.c.d();
}
}
}
@Override
public final void a(boolean z, String str) {
try {
if (c.this.c != null) {
if (TextUtils.isEmpty(str)) {
c.this.c.a();
c.this.c.b();
return;
}
CampaignEx parseCampaignWithBackData = CampaignEx.parseCampaignWithBackData(CampaignEx.campaignToJsonObject(c.this.e));
parseCampaignWithBackData.setClickURL(str);
if (z) {
String str2 = c.this.q;
try {
if (!TextUtils.isEmpty(str)) {
new d(com.mbridge.msdk.foundation.controller.a.d().f()).b(parseCampaignWithBackData.getRequestId(), parseCampaignWithBackData.getRequestIdNotice(), parseCampaignWithBackData.getId(), str2, str, parseCampaignWithBackData.isBidCampaign());
}
} catch (Exception e) {
e.printStackTrace();
}
}
c.this.a(parseCampaignWithBackData);
}
} catch (Exception e2) {
x.d(c.b, e2.getMessage());
}
}
};
private com.mbridge.msdk.mbsignalcommon.b.b D = new com.mbridge.msdk.mbsignalcommon.b.b() {
@Override
public final void a(WebView webView, String str) {
c.this.l = true;
x.d("BannerCallJS", "fireOnSignalCommunication");
g.a().a(webView);
c.this.n = true;
if (c.this.e == null || c.this.e.isHasMBTplMark()) {
return;
}
c.this.e();
c.this.a("", 1);
}
@Override
public final void a(WebView webView, int i, String str, String str2) {
c.this.a(str);
c.this.a(str, 2);
}
};
public c(MBBannerView mBBannerView, com.mbridge.msdk.mbbanner.common.b.c cVar, String str, String str2, boolean z, com.mbridge.msdk.c.d dVar) {
this.f1617d = z;
this.f = mBBannerView;
this.q = str2;
this.r = str;
this.c = new f(cVar, dVar);
}
public void d() {
if (this.f != null) {
MBBannerWebView mBBannerWebView = this.h;
if (mBBannerWebView != null && mBBannerWebView.getParent() != null) {
this.f.removeView(this.h);
}
if (this.g == null) {
ImageView imageView = new ImageView(com.mbridge.msdk.foundation.controller.a.d().f());
this.g = imageView;
imageView.setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
c.this.z = motionEvent.getRawX();
c.this.A = motionEvent.getRawY();
String str = c.b;
x.d(str, c.this.z + " " + c.this.A);
return false;
}
});
this.g.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
c.this.a(BannerUtils.managerCampaignEX(com.mbridge.msdk.mbsignalcommon.communication.b.a(c.this.z, c.this.A), c.this.e));
}
});
}
String imageUrl = this.e.getImageUrl();
if (!TextUtils.isEmpty(imageUrl)) {
com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.a.d().f()).a(imageUrl, new com.mbridge.msdk.foundation.same.c.c() {
@Override
public final void onFailedLoad(String str, String str2) {
c.this.a(com.anythink.expressad.mbbanner.a.a.j);
}
@Override
public final void onSuccessLoad(Bitmap bitmap, String str) {
if (c.this.g != null) {
c.this.g.setImageBitmap(bitmap);
}
c.this.l = true;
c.n(c.this);
c.this.g();
c.this.e();
}
});
return;
} else {
a(com.anythink.expressad.mbbanner.a.a.h);
return;
}
}
a(com.anythink.expressad.mbbanner.a.a.i);
}
public static void n(c cVar) {
if (cVar.g != null) {
MBBannerWebView mBBannerWebView = cVar.h;
if (mBBannerWebView != null) {
mBBannerWebView.setVisibility(8);
}
if (cVar.g.getVisibility() != 0) {
cVar.g.setVisibility(0);
}
if (cVar.f != null) {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
layoutParams.addRule(10);
cVar.g.setScaleType(ImageView.ScaleType.FIT_XY);
if (cVar.g.getParent() == null) {
cVar.f.addView(cVar.g, layoutParams);
}
cVar.d(true);
}
}
}
private boolean c() {
String b2 = b(this.e);
if (TextUtils.isEmpty(b2)) {
return false;
}
if (this.f != null) {
if (this.h == null) {
try {
MBBannerWebView mBBannerWebView = new MBBannerWebView(com.mbridge.msdk.foundation.controller.a.d().f());
this.h = mBBannerWebView;
mBBannerWebView.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
this.h.setWebViewClient(new com.mbridge.msdk.mbbanner.view.a(this.q, this.s, this.C));
} catch (Throwable unused) {
a("banner show failed because WebView is not available and try to show default", 1);
return false;
}
}
ImageView imageView = this.g;
if (imageView != null) {
imageView.setVisibility(8);
}
if (this.h.getVisibility() != 0) {
this.h.setVisibility(0);
}
if (this.h.getParent() == null) {
this.f.addView(this.h);
}
d(this.e.isMraid());
this.e.setCampaignUnitId(this.q);
com.mbridge.msdk.foundation.b.b.a().a(this.q, this.e);
g();
com.mbridge.msdk.mbbanner.common.bridge.a aVar = new com.mbridge.msdk.mbbanner.common.bridge.a(this.f.getContext(), this.r, this.q);
this.v = aVar;
aVar.a(this.s);
this.v.a(this.C);
this.v.a(this.t);
this.h.setWebViewListener(this.D);
this.h.setObject(this.v);
if (!b2.startsWith("file")) {
if (this.e.isActiveOm()) {
b2 = com.mbridge.msdk.a.b.a(b2);
}
this.h.loadDataWithBaseURL(this.e.getBannerUrl(), b2, "text/html", com.anythink.expressad.foundation.g.a.bN, null);
} else {
this.h.loadUrl(b2);
}
} else {
a(com.anythink.expressad.mbbanner.a.a.l, 2);
a(com.anythink.expressad.mbbanner.a.a.i);
}
return true;
}
public void e() {
boolean z;
JSONObject jSONObject;
float i;
float j;
int intValue;
int intValue2;
HashMap hashMap;
MBBannerView mBBannerView;
if (this.l && !this.m && this.c != null) {
this.m = true;
this.x.removeCallbacks(this.y);
CampaignEx campaignEx = this.e;
if (campaignEx != null && !campaignEx.isCallbacked()) {
this.e.setCallbacked(true);
this.c.a(this.s);
com.mbridge.msdk.click.b.a(com.mbridge.msdk.foundation.controller.a.d().f(), this.e.getMaitve(), this.e.getMaitve_src());
}
}
if (this.l && this.j && this.k && this.m && this.e != null && !f()) {
MBBannerView mBBannerView2 = this.f;
boolean z2 = (mBBannerView2 == null || aj.a(mBBannerView2) || this.o) ? false : true;
if (!z2 && (mBBannerView = this.f) != null) {
mBBannerView.postDelayed(new Runnable() {
@Override
public final void run() {
c.this.e();
}
}, 1000L);
}
if (this.n && z2) {
int[] iArr = new int[2];
this.f.getLocationInWindow(iArr);
MBBannerWebView mBBannerWebView = this.h;
float f = iArr[0];
float f2 = iArr[1];
x.d("BannerCallJS", "fireOnBannerWebViewShow");
try {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("startX", f);
jSONObject2.put("startY", f2);
jSONObject2.put("scale", ac.d(com.mbridge.msdk.foundation.controller.a.d().f()));
g.a().a((WebView) mBBannerWebView, "webviewshow", Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
} catch (Throwable th) {
x.b("BannerCallJS", "fireOnBannerWebViewShow", th);
}
MBBannerWebView mBBannerWebView2 = this.h;
int i2 = iArr[0];
int i3 = iArr[1];
int width = this.f.getWidth();
int height = this.f.getHeight();
try {
int i4 = com.mbridge.msdk.foundation.controller.a.d().f().getResources().getConfiguration().orientation;
jSONObject = new JSONObject();
jSONObject.put("orientation", i4 == 2 ? "landscape" : i4 == 1 ? "portrait" : AdError.UNDEFINED_DOMAIN);
jSONObject.put("locked", "true");
i = t.i(com.mbridge.msdk.foundation.controller.a.d().f());
j = t.j(com.mbridge.msdk.foundation.controller.a.d().f());
HashMap k = t.k(com.mbridge.msdk.foundation.controller.a.d().f());
intValue = ((Integer) k.get("width")).intValue();
intValue2 = ((Integer) k.get("height")).intValue();
hashMap = new HashMap();
z = z2;
} catch (Throwable th2) {
th = th2;
z = z2;
}
try {
hashMap.put(CallMraidJS.a, CallMraidJS.k);
hashMap.put(CallMraidJS.b, CallMraidJS.f);
hashMap.put(CallMraidJS.c, "true");
hashMap.put(CallMraidJS.f463d, jSONObject);
float f3 = i2;
float f4 = i3;
float f5 = width;
float f6 = height;
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(mBBannerWebView2, f3, f4, f5, f6);
com.mbridge.msdk.mbsignalcommon.mraid.a.a().b(mBBannerWebView2, f3, f4, f5, f6);
com.mbridge.msdk.mbsignalcommon.mraid.a.a().b(mBBannerWebView2, i, j);
com.mbridge.msdk.mbsignalcommon.mraid.a.a().c(mBBannerWebView2, intValue, intValue2);
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(mBBannerWebView2, hashMap);
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(mBBannerWebView2);
} catch (Throwable th3) {
th = th3;
x.b("BannerCallJS", "transInfoForMraid", th);
this.n = false;
if (!TextUtils.isEmpty(this.e.getImageUrl())) {
}
if (!z) {
}
}
this.n = false;
if (!TextUtils.isEmpty(this.e.getImageUrl())) {
com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.a.d().f()).c(this.e.getImageUrl());
}
} else {
z = z2;
}
if (!z) {
ImageView imageView = this.g;
if (imageView != null && imageView.getVisibility() == 0) {
CampaignEx campaignEx2 = this.e;
if (campaignEx2 != null) {
if (campaignEx2 != null) {
c(campaignEx2, com.mbridge.msdk.foundation.controller.a.d().f(), this.q);
b(campaignEx2, com.mbridge.msdk.foundation.controller.a.d().f(), this.q);
a(campaignEx2, com.mbridge.msdk.foundation.controller.a.d().f(), this.q);
}
this.e.setReport(true);
com.mbridge.msdk.foundation.same.a.d.a(this.q, this.e, com.anythink.expressad.foundation.g.a.f.e);
}
} else {
List<CampaignEx> list = this.s;
if (list != null && list.size() > 0) {
int i5 = 0;
boolean z3 = false;
for (int i6 = 0; i6 < this.s.size(); i6++) {
if (!this.s.get(i6).isHasMBTplMark() && (i6 == 0 || !this.s.get(i6).isReport())) {
c(this.s.get(i6), com.mbridge.msdk.foundation.controller.a.d().f(), this.q);
this.s.get(i6).setReport(true);
com.mbridge.msdk.foundation.same.a.d.a(this.q, this.s.get(i6), com.anythink.expressad.foundation.g.a.f.e);
i5 = i6;
z3 = true;
}
}
if (z3) {
b(this.s.get(i5), com.mbridge.msdk.foundation.controller.a.d().f(), this.q);
a(this.s.get(i5), com.mbridge.msdk.foundation.controller.a.d().f(), this.q);
}
}
}
this.p = true;
com.mbridge.msdk.mbbanner.common.b.c cVar = this.c;
if (cVar != null) {
cVar.a(this.e);
}
try {
CampaignEx campaignEx3 = this.e;
if (campaignEx3 != null && campaignEx3.isActiveOm()) {
Context f7 = com.mbridge.msdk.foundation.controller.a.d().f();
MBBannerWebView mBBannerWebView3 = this.h;
nd7 a = com.mbridge.msdk.a.b.a(f7, mBBannerWebView3, mBBannerWebView3.getUrl(), this.e);
this.w = a;
if (a != null) {
try {
a.d(this.h);
ImageView imageView2 = this.i;
if (imageView2 != null) {
this.w.a(imageView2, td7.VIDEO_CONTROLS, null);
}
ImageView imageView3 = this.g;
if (imageView3 != null) {
this.w.a(imageView3, td7.OTHER, null);
}
this.w.g();
} catch (Exception e) {
x.a("OMSDK", e.getMessage());
}
} else {
CampaignEx campaignEx4 = this.e;
if (campaignEx4 != null) {
new d(com.mbridge.msdk.foundation.controller.a.d().f()).a(campaignEx4.getRequestId(), this.e.getRequestIdNotice(), this.e.getId(), this.q, "fetch OM failed, context null");
}
}
}
} catch (Exception unused) {
CampaignEx campaignEx5 = this.e;
if (campaignEx5 != null) {
new d(com.mbridge.msdk.foundation.controller.a.d().f()).a(campaignEx5.getRequestId(), this.e.getRequestIdNotice(), this.e.getId(), this.q, "fetch OM failed, context null");
}
}
this.x.sendEmptyMessageDelayed(1, 1000L);
e.a(com.mbridge.msdk.foundation.controller.a.d().f(), this.e, this.q, "");
return;
}
this.e.setReport(false);
}
}
private synchronized boolean f() {
boolean isReport;
isReport = this.e.isReport();
if (!isReport) {
this.e.setReport(true);
}
return isReport;
}
public void g() {
ImageView imageView;
if (!this.f1617d || (imageView = this.i) == null) {
return;
}
if (imageView.getVisibility() != 0) {
this.i.setVisibility(0);
this.i.setOnClickListener(this.B);
}
if (this.i.getParent() != null || this.f == null) {
return;
}
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ac.b(com.mbridge.msdk.foundation.controller.a.d().f(), 12.0f), ac.b(com.mbridge.msdk.foundation.controller.a.d().f(), 12.0f));
layoutParams.addRule(11);
layoutParams.addRule(10);
this.f.addView(this.i, layoutParams);
}
private String b(CampaignEx campaignEx) {
String str;
if (campaignEx != null) {
String b2 = h.a().b(campaignEx.getBannerUrl());
if (TextUtils.isEmpty(b2)) {
String bannerHtml = campaignEx.getBannerHtml();
if (campaignEx.isActiveOm()) {
try {
File file = new File(bannerHtml);
str = kd7.a(MBridgeConstans.OMID_JS_SERVICE_CONTENT, file.exists() ? v.a(file) : "");
} catch (Exception unused) {
File file2 = new File(bannerHtml);
if (file2.exists() && file2.isFile() && file2.canRead()) {
str = "file:////" + bannerHtml;
}
}
return str;
}
File file3 = new File(bannerHtml);
if (file3.exists() && file3.isFile() && file3.canRead()) {
str = "file:////" + bannerHtml;
return str;
}
return bannerHtml;
}
return kd7.a(MBridgeConstans.OMID_JS_SERVICE_CONTENT, b2);
}
return "";
}
public final void a(boolean z, int i) {
this.t = i;
if (i == 0) {
com.mbridge.msdk.c.d e = com.mbridge.msdk.c.b.a().e(com.mbridge.msdk.foundation.controller.a.d().g(), this.q);
if (e == null) {
return;
}
z = e.c() == 1;
}
this.f1617d = z;
}
public final void a(boolean z) {
this.f1617d = z;
}
public void a(String str) {
if (this.e == null || f()) {
return;
}
this.x.removeCallbacks(this.y);
com.mbridge.msdk.mbbanner.common.b.c cVar = this.c;
if (cVar != null) {
cVar.a(str);
}
e.b(com.mbridge.msdk.foundation.controller.a.d().f(), this.e, this.q, str);
}
private void d(boolean z) {
if (this.f != null) {
FeedBackButton b2 = com.mbridge.msdk.foundation.b.b.a().b(this.q);
if (com.mbridge.msdk.foundation.b.b.a().b() && z && b2 != null) {
ViewGroup viewGroup = (ViewGroup) b2.getParent();
if (viewGroup != null) {
viewGroup.removeView(b2);
}
b2.setVisibility(0);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) b2.getLayoutParams();
if (layoutParams == null) {
layoutParams = new RelativeLayout.LayoutParams(com.mbridge.msdk.foundation.b.b.a, com.mbridge.msdk.foundation.b.b.b);
}
layoutParams.addRule(12);
b2.setLayoutParams(layoutParams);
this.f.addView(b2);
}
com.mbridge.msdk.foundation.b.b.a().a(this.q, new com.mbridge.msdk.foundation.b.a() {
@Override
public final void a() {
String str;
c.this.f.onPause();
try {
JSONObject jSONObject = new JSONObject();
if (com.mbridge.msdk.foundation.controller.a.d().f() != null) {
jSONObject.put("status", 1);
}
str = jSONObject.toString();
} catch (Throwable th) {
x.b(c.b, th.getMessage(), th);
str = "";
}
g.a().a((WebView) c.this.h, AbsFeedBackForH5.a, Base64.encodeToString(str.getBytes(), 2));
}
@Override
public final void b() {
String str;
c.this.f.onResume();
try {
JSONObject jSONObject = new JSONObject();
if (com.mbridge.msdk.foundation.controller.a.d().f() != null) {
jSONObject.put("status", 2);
}
str = jSONObject.toString();
} catch (Throwable th) {
x.b(c.b, th.getMessage(), th);
str = "";
}
g.a().a((WebView) c.this.h, AbsFeedBackForH5.a, Base64.encodeToString(str.getBytes(), 2));
}
@Override
public final void a(String str) {
String str2;
c.this.f.onResume();
try {
JSONObject jSONObject = new JSONObject();
if (com.mbridge.msdk.foundation.controller.a.d().f() != null) {
jSONObject.put("status", 2);
}
str2 = jSONObject.toString();
} catch (Throwable th) {
x.b(c.b, th.getMessage(), th);
str2 = "";
}
g.a().a((WebView) c.this.h, AbsFeedBackForH5.a, Base64.encodeToString(str2.getBytes(), 2));
}
});
this.e.setCampaignUnitId(this.q);
com.mbridge.msdk.foundation.b.b.a().a(this.q, this.e);
}
}
public final void a() {
nd7 nd7Var = this.w;
if (nd7Var != null) {
nd7Var.c();
this.w = null;
}
if (this.c != null) {
this.c = null;
}
MBBannerWebView mBBannerWebView = this.h;
if (mBBannerWebView != null) {
mBBannerWebView.setWebViewListener(null);
}
if (this.D != null) {
this.D = null;
}
ImageView imageView = this.i;
if (imageView != null) {
imageView.setOnClickListener(null);
}
ImageView imageView2 = this.g;
if (imageView2 != null) {
imageView2.setOnClickListener(null);
}
MBBannerView mBBannerView = this.f;
if (mBBannerView != null) {
mBBannerView.removeAllViews();
}
MBBannerWebView mBBannerWebView2 = this.h;
if (mBBannerWebView2 != null) {
mBBannerWebView2.release();
}
com.mbridge.msdk.mbbanner.common.bridge.a aVar = this.v;
if (aVar != null) {
aVar.a();
}
if (this.C != null) {
this.C = null;
}
com.mbridge.msdk.foundation.b.b.a().c(this.q);
}
public final void b(boolean z) {
this.j = z;
e();
if (z) {
return;
}
CampaignEx campaignEx = this.e;
String str = this.q;
if (campaignEx != null) {
String a = com.mbridge.msdk.mbsignalcommon.mraid.c.a(campaignEx.getId());
if (TextUtils.isEmpty(a)) {
return;
}
new d(com.mbridge.msdk.foundation.controller.a.d().f()).a(campaignEx.getRequestId(), campaignEx.getRequestIdNotice(), campaignEx.getId(), str, a, campaignEx.isBidCampaign());
com.mbridge.msdk.mbsignalcommon.mraid.c.b(campaignEx.getId());
}
}
public static void d(c cVar) {
ImageView imageView;
if (cVar.f1617d && (imageView = cVar.i) != null && imageView.getVisibility() == 0) {
cVar.i.setVisibility(8);
cVar.i.setOnClickListener(null);
if (cVar.f == null || cVar.i.getParent() == null) {
return;
}
cVar.f.removeView(cVar.i);
}
}
private void b(CampaignEx campaignEx, Context context, String str) {
if (campaignEx != null) {
try {
if (TextUtils.isEmpty(campaignEx.getOnlyImpressionURL())) {
return;
}
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getOnlyImpressionURL(), false, true, com.mbridge.msdk.click.a.a.h);
} catch (Throwable th) {
x.d(b, th.getMessage());
}
}
}
public final void c(boolean z) {
this.k = z;
e();
}
private void c(final CampaignEx campaignEx, final Context context, String str) {
if (!TextUtils.isEmpty(campaignEx.getImpressionURL())) {
new Thread(new Runnable() {
@Override
public final void run() {
try {
j.a(com.mbridge.msdk.foundation.db.g.a(context)).b(campaignEx.getId());
} catch (Exception e) {
x.d(c.b, e.getMessage());
}
}
}).start();
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().i() == null) {
return;
}
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getNativeVideoTracking().i(), false, false);
}
private void a(CampaignEx campaignEx, Context context, String str) {
if (campaignEx != null) {
try {
List<String> pv_urls = campaignEx.getPv_urls();
if (pv_urls == null || pv_urls.size() <= 0) {
return;
}
for (String str2 : pv_urls) {
com.mbridge.msdk.click.a.a(context, campaignEx, str, str2, false, true);
}
} catch (Throwable th) {
x.d(b, th.getMessage());
}
}
}
public static void c(c cVar) {
MBBannerWebView mBBannerWebView = cVar.h;
if (mBBannerWebView != null && mBBannerWebView.getParent() != null) {
cVar.f.removeView(cVar.h);
}
ImageView imageView = cVar.g;
if (imageView != null && imageView.getParent() != null) {
cVar.g.setVisibility(8);
cVar.f.removeView(cVar.g);
}
ImageView imageView2 = cVar.i;
if (imageView2 != null && imageView2.getParent() != null) {
cVar.f.removeView(cVar.i);
cVar.i.setVisibility(8);
}
com.mbridge.msdk.mbbanner.common.a.a c = com.mbridge.msdk.mbbanner.common.a.a.a().b(cVar.q).e(cVar.e.getRequestId()).d(cVar.e.getRequestIdNotice()).c(cVar.e.getId());
com.mbridge.msdk.mbbanner.common.a.a a = c.f(cVar.e.getCreativeId() + "").a(cVar.e.isBidCampaign());
String str = cVar.q;
if (a != null) {
a.a(com.anythink.expressad.mbbanner.a.b.c.c);
if (com.mbridge.msdk.foundation.same.report.b.a().c()) {
com.mbridge.msdk.foundation.same.report.b.a().a(a.b());
} else {
com.mbridge.msdk.foundation.same.report.c.a(a.b(), com.mbridge.msdk.foundation.controller.a.d().f(), str);
}
}
BannerUtils.inserCloseId(cVar.q, cVar.s);
com.mbridge.msdk.mbbanner.common.b.c cVar2 = cVar.c;
if (cVar2 != null) {
cVar2.e();
}
}
public final void a(CampaignEx campaignEx) {
if (this.p) {
if (this.a == null) {
this.a = new com.mbridge.msdk.click.a(com.mbridge.msdk.foundation.controller.a.d().f(), this.q);
}
this.a.a(new NativeListener.TrackingExListener() {
@Override
public final void onDismissLoading(Campaign campaign) {
}
@Override
public final void onDownloadFinish(Campaign campaign) {
}
@Override
public final void onDownloadProgress(int i) {
}
@Override
public final void onDownloadStart(Campaign campaign) {
}
@Override
public final void onFinishRedirection(Campaign campaign, String str) {
ab.a(c.this.f);
}
@Override
public final boolean onInterceptDefaultLoadingDialog() {
return false;
}
@Override
public final void onLeaveApp() {
if (c.this.c != null) {
c.this.c.b();
}
}
@Override
public final void onRedirectionFailed(Campaign campaign, String str) {
ab.a(c.this.f);
}
@Override
public final void onShowLoading(Campaign campaign) {
}
@Override
public final void onStartRedirection(Campaign campaign, String str) {
ab.a(campaign, c.this.f);
}
});
campaignEx.setCampaignUnitId(this.q);
this.a.a(campaignEx);
if (!this.e.isReportClick()) {
this.e.setReportClick(true);
Context f = com.mbridge.msdk.foundation.controller.a.d().f();
if (campaignEx.getNativeVideoTracking() != null && campaignEx.getNativeVideoTracking().e() != null) {
com.mbridge.msdk.click.a.a(f, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().e(), false, false);
}
}
com.mbridge.msdk.mbbanner.common.b.c cVar = this.c;
if (cVar != null) {
cVar.a();
}
}
}
public void a(String str, int i) {
if (this.e != null) {
com.mbridge.msdk.mbbanner.common.d.a.a(com.mbridge.msdk.mbbanner.common.a.a.a().c(this.e.getId()).b(this.q).e(this.e.getRequestId()).d(this.e.getRequestIdNotice()).g(str).a(i).a(this.e.isBidCampaign()), this.q);
}
}
public final void a(int i, int i2, int i3, int i4) {
if (i == i3 && i2 == i4) {
return;
}
MBBannerWebView mBBannerWebView = this.h;
x.d("BannerCallJS", "fireOnBannerViewSizeChange");
try {
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(mBBannerWebView, i, i2);
} catch (Throwable th) {
x.b("BannerCallJS", "fireOnBannerViewSizeChange", th);
}
}
public final void a(CampaignUnit campaignUnit) {
CampaignEx campaignEx;
if (campaignUnit != null) {
ArrayList<CampaignEx> ads = campaignUnit.getAds();
this.s = ads;
if (ads != null && ads.size() > 0) {
campaignEx = this.s.get(0);
this.e = campaignEx;
if (campaignEx != null) {
a(com.anythink.expressad.mbbanner.a.a.h);
return;
}
this.x.removeCallbacks(this.y);
if (this.f1617d && this.i == null) {
ImageView imageView = new ImageView(com.mbridge.msdk.foundation.controller.a.d().f());
this.i = imageView;
imageView.setBackgroundResource(q.a(com.mbridge.msdk.foundation.controller.a.d().f(), "mbridge_banner_close", i.c));
this.i.setVisibility(8);
this.i.setContentDescription("closeButton");
}
this.l = false;
this.m = false;
this.p = false;
if (!TextUtils.isEmpty(this.e.getBannerHtml()) || !TextUtils.isEmpty(this.e.getBannerUrl())) {
com.mbridge.msdk.mbbanner.common.a.a a = com.mbridge.msdk.mbbanner.common.a.a.a().c(this.e.getId()).e(this.e.getRequestId()).d(this.e.getRequestIdNotice()).b(this.q).a(this.e.isBidCampaign());
String str = this.q;
if (a != null) {
a.a(com.anythink.expressad.mbbanner.a.b.c.a);
if (com.mbridge.msdk.foundation.same.report.b.a().c()) {
com.mbridge.msdk.foundation.same.report.b.a().a(a.b());
} else {
com.mbridge.msdk.foundation.same.report.c.a(a.b(), com.mbridge.msdk.foundation.controller.a.d().f(), str);
}
}
}
this.x.postDelayed(this.y, this.u);
if (c()) {
return;
}
if (!TextUtils.isEmpty(this.e.getBannerHtml()) || !TextUtils.isEmpty(this.e.getBannerUrl())) {
a(com.anythink.expressad.mbbanner.a.a.m, 2);
}
d();
return;
}
}
campaignEx = null;
this.e = campaignEx;
if (campaignEx != null) {
}
}
}