- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
434 lines
14 KiB
Java
434 lines
14 KiB
Java
package com.mbridge.msdk.mbbanner.a;
|
|
|
|
import android.text.TextUtils;
|
|
import com.mbridge.msdk.c.h;
|
|
import com.mbridge.msdk.c.j;
|
|
import com.mbridge.msdk.c.k;
|
|
import com.mbridge.msdk.foundation.c.b;
|
|
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
|
import com.mbridge.msdk.foundation.entity.CampaignUnit;
|
|
import com.mbridge.msdk.foundation.same.report.d.e;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.foundation.tools.as;
|
|
import com.mbridge.msdk.mbbanner.common.c.c;
|
|
import com.mbridge.msdk.out.BannerAdListener;
|
|
import com.mbridge.msdk.out.BannerSize;
|
|
import com.mbridge.msdk.out.MBBannerView;
|
|
import com.mbridge.msdk.out.MBridgeIds;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class a {
|
|
private static String a = "BannerController";
|
|
private String b;
|
|
private String c;
|
|
private String d;
|
|
private MBridgeIds e;
|
|
private boolean f;
|
|
private int g;
|
|
private MBBannerView h;
|
|
private int i;
|
|
private int j;
|
|
private int k;
|
|
private BannerAdListener m;
|
|
private CampaignUnit n;
|
|
private c o;
|
|
private k p;
|
|
private j q;
|
|
private boolean r;
|
|
private boolean s;
|
|
private boolean t;
|
|
private boolean u;
|
|
private boolean v;
|
|
private int l = -1;
|
|
private com.mbridge.msdk.mbbanner.common.b.c w = new com.mbridge.msdk.mbbanner.common.b.c() { // from class: com.mbridge.msdk.mbbanner.a.a.1
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.c
|
|
public final void a(List<CampaignEx> list) {
|
|
af.b(a.a, "onShowSuccessed:");
|
|
if (a.this.m != null) {
|
|
a.this.m.onLoadSuccessed(a.this.e);
|
|
}
|
|
try {
|
|
com.mbridge.msdk.foundation.same.report.d.c a2 = com.mbridge.msdk.mbbanner.common.d.a.a(a.this.b, list.get(0).getLocalRequestId());
|
|
a2.b(list);
|
|
a2.g(1);
|
|
a2.f(TextUtils.isEmpty(list.get(0).getBannerUrl()) ? 2 : 1);
|
|
com.mbridge.msdk.mbbanner.common.d.a.a("2000048", a2, null);
|
|
} catch (Exception e) {
|
|
af.b(a.a, e.getMessage());
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.c
|
|
public final void a(CampaignEx campaignEx) {
|
|
a.this.d();
|
|
if (a.this.m != null) {
|
|
a.this.m.onLogImpression(a.this.e);
|
|
}
|
|
try {
|
|
com.mbridge.msdk.foundation.same.report.d.c a2 = com.mbridge.msdk.mbbanner.common.d.a.a(a.this.b, campaignEx.getLocalRequestId());
|
|
a2.a(campaignEx);
|
|
a2.i(campaignEx.isBidCampaign() ? "1" : "2");
|
|
int i = 1;
|
|
a2.g(a.this.o != null ? a.this.o.b() : 1);
|
|
if (a.this.k != 0) {
|
|
i = 2;
|
|
}
|
|
a2.d(i);
|
|
a2.e(a.this.k);
|
|
com.mbridge.msdk.mbbanner.common.d.a.a("2000128", a2, null);
|
|
com.mbridge.msdk.mbbanner.common.d.a.a("2000130", a2, null);
|
|
} catch (Exception e) {
|
|
af.b(a.a, e.getMessage());
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.c
|
|
public final void a(b bVar) {
|
|
a.this.a(bVar);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.c
|
|
public final void a() {
|
|
if (a.this.m != null) {
|
|
a.this.m.onClick(a.this.e);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.c
|
|
public final void b() {
|
|
if (a.this.m != null) {
|
|
a.this.m.onLeaveApp(a.this.e);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.c
|
|
public final void c() {
|
|
if (a.this.m != null) {
|
|
a.this.m.showFullScreen(a.this.e);
|
|
a.this.v = true;
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(2, a.this.c, a.this.b, null, null);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.c
|
|
public final void d() {
|
|
if (a.this.m != null) {
|
|
a.this.m.closeFullScreen(a.this.e);
|
|
a.this.v = false;
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(3, a.this.c, a.this.b, new com.mbridge.msdk.mbbanner.common.a.a(a.this.j + "x" + a.this.i, a.this.k * 1000), a.this.x);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.c
|
|
public final void e() {
|
|
if (a.this.m != null) {
|
|
a.this.m.onCloseBanner(a.this.e);
|
|
}
|
|
}
|
|
};
|
|
private com.mbridge.msdk.mbbanner.common.b.b x = new com.mbridge.msdk.mbbanner.common.b.b() { // from class: com.mbridge.msdk.mbbanner.a.a.2
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.b
|
|
public final void a(String str, CampaignUnit campaignUnit, boolean z) {
|
|
a.this.n = campaignUnit;
|
|
a.a(a.this, 1, (b) null);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.b
|
|
public final void a(b bVar) {
|
|
a.a(a.this, 2, bVar);
|
|
a.this.a(bVar.f(), bVar);
|
|
a.this.d();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.b
|
|
public final void a(String str, int i, boolean z) {
|
|
if (a.this.h != null) {
|
|
a.this.u = true;
|
|
a.this.i();
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.b
|
|
public final void b(b bVar) {
|
|
a.this.a(bVar.f(), bVar);
|
|
a.this.d();
|
|
}
|
|
};
|
|
|
|
private int b(int i) {
|
|
if (i <= 0) {
|
|
return i;
|
|
}
|
|
int i2 = 10;
|
|
if (i >= 10) {
|
|
i2 = 180;
|
|
if (i <= 180) {
|
|
return i;
|
|
}
|
|
}
|
|
return i2;
|
|
}
|
|
|
|
public final void a(BannerAdListener bannerAdListener) {
|
|
this.m = bannerAdListener;
|
|
}
|
|
|
|
public final void a(boolean z) {
|
|
this.f = z;
|
|
this.g = z ? 1 : 2;
|
|
}
|
|
|
|
public final String a() {
|
|
CampaignUnit campaignUnit = this.n;
|
|
return (campaignUnit == null || campaignUnit.getRequestId() == null) ? "" : this.n.getRequestId();
|
|
}
|
|
|
|
public final String b() {
|
|
CampaignUnit campaignUnit = this.n;
|
|
return campaignUnit != null ? com.mbridge.msdk.foundation.same.c.a(campaignUnit.getAds()) : "";
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void a(String str, b bVar) {
|
|
CampaignUnit campaignUnit;
|
|
String str2 = "";
|
|
if (bVar != null) {
|
|
try {
|
|
str2 = bVar.b();
|
|
if (TextUtils.isEmpty(str)) {
|
|
str = bVar.f();
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b(a, th.getMessage());
|
|
}
|
|
}
|
|
if (TextUtils.isEmpty(str) && (campaignUnit = this.n) != null) {
|
|
str = campaignUnit.getLocalRequestId();
|
|
}
|
|
com.mbridge.msdk.foundation.same.report.d.c a2 = com.mbridge.msdk.mbbanner.common.d.a.a(this.b, str);
|
|
CampaignUnit campaignUnit2 = this.n;
|
|
a2.b(campaignUnit2 != null ? campaignUnit2.getAds() : null);
|
|
a2.a(bVar);
|
|
CampaignUnit campaignUnit3 = this.n;
|
|
if (campaignUnit3 != null && !campaignUnit3.getAds().isEmpty()) {
|
|
a2.f(TextUtils.isEmpty(this.n.getAds().get(0).getBannerUrl()) ? 1 : 2);
|
|
}
|
|
a2.c(true);
|
|
com.mbridge.msdk.mbbanner.common.d.a.a("2000047", a2, null);
|
|
BannerAdListener bannerAdListener = this.m;
|
|
if (bannerAdListener != null) {
|
|
bannerAdListener.onLoadFailed(this.e, str2);
|
|
}
|
|
}
|
|
|
|
public a(MBBannerView mBBannerView, BannerSize bannerSize, String str, String str2) {
|
|
this.h = mBBannerView;
|
|
if (bannerSize != null) {
|
|
this.i = bannerSize.getHeight();
|
|
this.j = bannerSize.getWidth();
|
|
}
|
|
this.b = str2;
|
|
str = TextUtils.isEmpty(str) ? "" : str;
|
|
this.c = str;
|
|
this.e = new MBridgeIds(str, this.b);
|
|
String k = com.mbridge.msdk.foundation.controller.c.m().k();
|
|
String b = com.mbridge.msdk.foundation.controller.c.m().b();
|
|
if (this.q == null) {
|
|
this.q = new j();
|
|
}
|
|
this.q.a(com.mbridge.msdk.foundation.controller.c.m().c(), k, b, this.b);
|
|
h();
|
|
}
|
|
|
|
public final void a(BannerSize bannerSize) {
|
|
if (bannerSize != null) {
|
|
this.i = bannerSize.getHeight();
|
|
this.j = bannerSize.getWidth();
|
|
}
|
|
}
|
|
|
|
public final void a(int i) {
|
|
int b = b(i);
|
|
this.l = b;
|
|
this.k = b;
|
|
}
|
|
|
|
private void h() {
|
|
k d = h.a().d(com.mbridge.msdk.foundation.controller.c.m().k(), this.b);
|
|
this.p = d;
|
|
if (d == null) {
|
|
this.p = k.d(this.b);
|
|
}
|
|
if (this.l == -1) {
|
|
this.k = b(this.p.q());
|
|
}
|
|
if (this.g == 0) {
|
|
boolean z = this.p.f() == 1;
|
|
this.f = z;
|
|
c cVar = this.o;
|
|
if (cVar != null) {
|
|
cVar.a(z);
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void a(String str, String str2) {
|
|
if (this.i < 1 || this.j < 1) {
|
|
a(str2, new b(880037));
|
|
return;
|
|
}
|
|
try {
|
|
if (com.mbridge.msdk.mbsignalcommon.webEnvCheck.a.a(com.mbridge.msdk.foundation.controller.c.m().c())) {
|
|
this.d = str2;
|
|
com.mbridge.msdk.mbbanner.common.a.a aVar = new com.mbridge.msdk.mbbanner.common.a.a(this.j + "x" + this.i, this.k * 1000);
|
|
aVar.a(str);
|
|
aVar.b(this.c);
|
|
aVar.c(str2);
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(this.c, this.b, aVar, this.x);
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(1, this.c, this.b, aVar, this.x);
|
|
return;
|
|
}
|
|
} catch (Exception e) {
|
|
af.b(a, e.getMessage());
|
|
}
|
|
a(str2, new b(880029));
|
|
}
|
|
|
|
public final void c() {
|
|
this.t = true;
|
|
if (this.m != null) {
|
|
this.m = null;
|
|
}
|
|
if (this.x != null) {
|
|
this.x = null;
|
|
}
|
|
if (this.w != null) {
|
|
this.w = null;
|
|
}
|
|
if (this.h != null) {
|
|
this.h = null;
|
|
}
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(4, this.c, this.b, null, null);
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(this.b);
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().b();
|
|
c cVar = this.o;
|
|
if (cVar != null) {
|
|
cVar.a();
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void i() {
|
|
if (this.t || !this.u) {
|
|
return;
|
|
}
|
|
MBBannerView mBBannerView = this.h;
|
|
if (this.n != null) {
|
|
if (this.o == null) {
|
|
this.o = new c(mBBannerView, this.w, this.c, this.b, this.f, this.p);
|
|
}
|
|
this.o.a(this.d);
|
|
this.o.b(this.r);
|
|
this.o.c(this.s);
|
|
this.o.a(this.f, this.g);
|
|
this.o.a(this.n);
|
|
} else {
|
|
a(new b(880043));
|
|
}
|
|
this.u = false;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void a(b bVar) {
|
|
a(this.d, bVar);
|
|
d();
|
|
}
|
|
|
|
public final void d() {
|
|
if (this.t) {
|
|
return;
|
|
}
|
|
j();
|
|
h();
|
|
com.mbridge.msdk.mbbanner.common.a.a aVar = new com.mbridge.msdk.mbbanner.common.a.a(this.j + "x" + this.i, this.k * 1000);
|
|
aVar.b(this.c);
|
|
aVar.a(true);
|
|
aVar.c(com.mbridge.msdk.mbbanner.common.d.a.a(""));
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().b(this.c, this.b, aVar, this.x);
|
|
}
|
|
|
|
public final void b(boolean z) {
|
|
this.r = z;
|
|
k();
|
|
i();
|
|
}
|
|
|
|
public final void c(boolean z) {
|
|
this.s = z;
|
|
k();
|
|
}
|
|
|
|
private void j() {
|
|
MBBannerView mBBannerView = this.h;
|
|
if (mBBannerView != null) {
|
|
if (this.r && this.s && !this.v && !as.a(mBBannerView, 1)) {
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(3, this.c, this.b, new com.mbridge.msdk.mbbanner.common.a.a(this.j + "x" + this.i, this.k * 1000), this.x);
|
|
} else {
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(2, this.c, this.b, null, null);
|
|
}
|
|
if (this.r) {
|
|
return;
|
|
}
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(4, this.c, this.b, null, null);
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(this.b);
|
|
}
|
|
}
|
|
|
|
private void k() {
|
|
j();
|
|
c cVar = this.o;
|
|
if (cVar != null) {
|
|
cVar.b(this.r);
|
|
this.o.c(this.s);
|
|
}
|
|
}
|
|
|
|
public final void a(int i, int i2, int i3, int i4) {
|
|
c cVar = this.o;
|
|
if (cVar != null) {
|
|
cVar.a(i, i2, i3, i4);
|
|
}
|
|
}
|
|
|
|
public final void e() {
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(4, this.c, this.b, new com.mbridge.msdk.mbbanner.common.a.a(this.j + "x" + this.i, this.k * 1000), this.x);
|
|
}
|
|
|
|
public final void f() {
|
|
com.mbridge.msdk.mbbanner.common.c.a.a().a(3, this.c, this.b, new com.mbridge.msdk.mbbanner.common.a.a(this.j + "x" + this.i, this.k * 1000), this.x);
|
|
}
|
|
|
|
public static /* synthetic */ void a(a aVar, int i, b bVar) {
|
|
try {
|
|
com.mbridge.msdk.foundation.same.report.d.c a2 = com.mbridge.msdk.mbbanner.common.d.a.a(aVar.b, bVar == null ? aVar.n.getLocalRequestId() : bVar.f());
|
|
e eVar = new e();
|
|
eVar.a("result", Integer.valueOf(i));
|
|
CampaignUnit campaignUnit = aVar.n;
|
|
if (campaignUnit != null && !campaignUnit.getAds().isEmpty()) {
|
|
CampaignEx campaignEx = aVar.n.getAds().get(0);
|
|
if (campaignEx != null) {
|
|
a2.f(TextUtils.isEmpty(campaignEx.getBannerUrl()) ? 2 : 1);
|
|
}
|
|
a2.b(aVar.n.getAds());
|
|
}
|
|
if (bVar != null) {
|
|
a2.a(bVar);
|
|
}
|
|
com.mbridge.msdk.mbbanner.common.d.a.a("2000126", a2, eVar);
|
|
} catch (Exception e) {
|
|
af.b(a, e.getMessage());
|
|
}
|
|
}
|
|
}
|