Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,203 @@
package com.mbridge.msdk.newreward.function.c.a;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.newreward.function.c.c.d;
import com.mbridge.msdk.newreward.function.c.c.f;
import com.mbridge.msdk.newreward.function.c.c.g;
import com.mbridge.msdk.newreward.function.c.c.h;
import com.mbridge.msdk.newreward.function.c.c.j;
import com.mbridge.msdk.newreward.function.c.c.k;
import com.mbridge.msdk.newreward.function.c.c.l;
import com.mbridge.msdk.newreward.function.c.c.m;
import com.mbridge.msdk.newreward.function.c.c.n;
import com.mbridge.msdk.newreward.function.h.c;
/* loaded from: classes4.dex */
public final class a {
private final b a;
private CampaignEx b;
private String c;
private String d;
private String e;
private d<?> f;
private n g;
private d<?> h;
private l i;
private h j;
private m k;
private boolean l = false;
private boolean m = false;
public final void a(CampaignEx campaignEx) {
this.b = campaignEx;
}
public final void a(String str) {
this.c = str;
}
public final void a(boolean z) {
this.l = z;
}
public final void b(String str) {
this.d = str;
}
public final void b(boolean z) {
this.m = z;
}
public final void c(String str) {
this.e = str;
}
public final String g() {
return this.e;
}
public final CampaignEx h() {
return this.b;
}
public final b i() {
return this.a;
}
public final boolean k() {
return this.l;
}
public final boolean l() {
return this.m;
}
public a(b bVar) {
this.a = bVar;
}
public final m a() {
CampaignEx.c rewardTemplateMode;
m mVar = this.k;
if (mVar != null) {
return mVar;
}
CampaignEx campaignEx = this.b;
if (campaignEx == null || (rewardTemplateMode = campaignEx.getRewardTemplateMode()) == null) {
return null;
}
String c = rewardTemplateMode.c();
if (TextUtils.isEmpty(c)) {
return null;
}
if (this.k == null) {
this.k = new m(this.a, this, c);
}
return this.k;
}
public final h b() {
h hVar = this.j;
if (hVar != null) {
return hVar;
}
CampaignEx campaignEx = this.b;
if (campaignEx == null || TextUtils.isEmpty(campaignEx.getEndScreenUrl())) {
return null;
}
if (this.j == null) {
this.j = new h(this.a, this);
}
return this.j;
}
public final d<?> c() {
d<?> dVar = this.f;
if (dVar != null) {
return dVar;
}
CampaignEx campaignEx = this.b;
if (campaignEx == null || campaignEx.getRewardTemplateMode() == null) {
return null;
}
String e = campaignEx.getRewardTemplateMode().e();
if (TextUtils.isEmpty(e)) {
return null;
}
if (this.f == null) {
if (c.b(e)) {
this.f = new g(this.a, this);
} else {
this.f = new k(this.a, this);
}
}
return this.f;
}
public final n d() {
n nVar = this.g;
if (nVar != null) {
return nVar;
}
CampaignEx campaignEx = this.b;
if (campaignEx == null || TextUtils.isEmpty(campaignEx.getVideoUrlEncode())) {
return null;
}
if (this.g == null) {
this.g = new n(this.a, this);
}
return this.g;
}
public final l e() {
l lVar = this.i;
if (lVar != null) {
return lVar;
}
CampaignEx campaignEx = this.b;
if (campaignEx == null || TextUtils.isEmpty(campaignEx.getMraid())) {
return null;
}
if (this.i == null) {
this.i = new l(this.a, this);
}
return this.i;
}
public final d<?> f() {
d<?> dVar = this.h;
if (dVar != null) {
return dVar;
}
CampaignEx campaignEx = this.b;
if (campaignEx == null) {
return null;
}
String str = campaignEx.getendcard_url();
if (TextUtils.isEmpty(str)) {
return null;
}
if (this.h == null) {
if (c.b(str)) {
if (ak.l(str)) {
this.h = new j(this.a, this);
} else {
this.h = new f(this.a, this);
}
} else {
this.h = new j(this.a, this);
}
}
return this.h;
}
public final boolean j() {
CampaignEx campaignEx = this.b;
if (campaignEx != null) {
return campaignEx.isMraid();
}
return false;
}
}

View File

@@ -0,0 +1,502 @@
package com.mbridge.msdk.newreward.function.c.a;
import android.content.Context;
import android.text.TextUtils;
import androidx.work.WorkRequest;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.newreward.function.c.c.d;
import com.mbridge.msdk.newreward.function.c.c.e;
import com.mbridge.msdk.newreward.function.c.c.i;
import com.mbridge.msdk.newreward.function.c.c.n;
import com.mbridge.msdk.newreward.function.common.MBridgeCommon;
import com.mbridge.msdk.newreward.function.h.c;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class b {
private String A;
private int B;
private int C;
private List<CampaignEx> D;
private int E;
private long G;
private Map<String, Object> H;
private String I;
private int a;
private String b;
private String c;
private String d;
private String e;
private String f;
private String g;
private boolean h;
private int j;
private String k;
private String l;
private String m;
private String n;
private int o;
private long p;
private long q;
private long r;
private double s;
private int t;
private List<a> u;
private JSONObject v;
private d<?> w;
private Context z;
private long i = WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS;
private int x = MBridgeCommon.DEFAULT_LOAD_TIMEOUT;
private int y = MBridgeCommon.DEFAULT_LOAD_TIMEOUT;
private int F = 0;
private boolean J = false;
private int K = 0;
private int L = 0;
public final String B() {
return this.A;
}
public final int C() {
return this.C;
}
public final int D() {
return this.B;
}
public final List<CampaignEx> E() {
return this.D;
}
public final int F() {
int i = this.E;
if (i <= 0) {
return 1;
}
return i;
}
public final int G() {
return this.F;
}
public final long I() {
return this.G;
}
public final String J() {
return this.I;
}
public final boolean K() {
return this.J;
}
public final int a() {
return this.K;
}
public final void a(double d) {
this.s = d;
}
public final void a(int i) {
this.K = i;
}
public final void a(long j) {
this.i = j;
}
public final void a(String str) {
this.e = str;
}
public final void a(List<a> list) {
this.u = list;
}
public final void a(JSONObject jSONObject) {
this.v = jSONObject;
}
public final void a(boolean z) {
this.h = z;
}
public final int b() {
return this.L;
}
public final void b(int i) {
this.L = i;
}
public final void b(long j) {
this.p = j;
}
public final void b(String str) {
this.f = str;
}
public final void b(List<CampaignEx> list) {
this.D = list;
}
public final void b(boolean z) {
this.J = z;
}
public final int c() {
return this.a;
}
public final void c(int i) {
this.j = i;
}
public final void c(long j) {
this.q = j;
}
public final void c(String str) {
this.g = str;
}
public final String d() {
return this.c;
}
public final void d(int i) {
this.o = i;
}
public final void d(long j) {
this.r = j;
}
public final void d(String str) {
this.k = str;
}
public final String e() {
return this.d;
}
public final void e(int i) {
this.t = i;
}
public final void e(long j) {
this.G = j;
}
public final void e(String str) {
this.l = str;
}
public final String f() {
return this.e;
}
public final void f(int i) {
this.x = i;
}
public final void f(String str) {
this.m = str;
}
public final String g() {
return this.f;
}
public final void g(int i) {
this.y = i;
}
public final void g(String str) {
this.n = str;
}
public final String h() {
return this.g;
}
public final void h(int i) {
this.C = i;
}
public final void h(String str) {
this.A = str;
}
public final void i(int i) {
this.B = i;
}
public final void i(String str) {
this.I = str;
}
public final boolean i() {
return this.h;
}
public final int j() {
return this.j;
}
public final void j(int i) {
this.E = i;
}
public final String k() {
return this.k;
}
public final void k(int i) {
this.F = i;
}
public final String l() {
return this.l;
}
public final String m() {
return this.m;
}
public final String n() {
return this.n;
}
public final int o() {
return this.o;
}
public final long p() {
return this.p;
}
public final long q() {
return this.q;
}
public final long r() {
return this.r;
}
public final double s() {
return this.s;
}
public final int t() {
return this.t;
}
public final List<a> u() {
return this.u;
}
public final JSONObject v() {
return this.v;
}
public final Context x() {
return this.z;
}
public b(int i, String str, String str2, String str3) {
this.a = i;
this.b = str;
this.c = str2;
this.d = str3;
}
public final d<?> w() {
d<?> dVar = this.w;
if (dVar != null) {
return dVar;
}
String str = this.A;
if (TextUtils.isEmpty(str)) {
return null;
}
if (this.w == null) {
if (c.b(str)) {
this.w = new e(this, null);
} else {
this.w = new i(this, null);
}
}
return this.w;
}
public final boolean y() {
List<a> list;
d<?> dVar = this.w;
if ((dVar != null && !dVar.d()) || (list = this.u) == null || list.isEmpty()) {
return false;
}
int size = this.u.size();
Iterator<a> it = this.u.iterator();
int i = 0;
while (true) {
boolean z = true;
if (!it.hasNext()) {
break;
}
a next = it.next();
n d = next.d();
boolean z2 = d == null || d.d();
d<?> f = next.f();
boolean z3 = f == null || f.d();
d<?> c = next.c();
if (c != null && !c.d()) {
z = false;
}
if (z2 && z3 && z) {
i++;
}
}
return i == size;
}
/* JADX WARN: Removed duplicated region for block: B:13:0x0095 */
/* JADX WARN: Removed duplicated region for block: B:22:0x00a6 */
/* JADX WARN: Removed duplicated region for block: B:24:0x00ab A[ADDED_TO_REGION] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final boolean z() {
/*
r10 = this;
boolean r0 = r10.A()
boolean r1 = r10.y()
com.mbridge.msdk.newreward.function.c.c.d<?> r2 = r10.w
r3 = 1
r4 = 0
if (r2 == 0) goto L14
boolean r2 = r2.d()
if (r2 == 0) goto L76
L14:
java.util.List<com.mbridge.msdk.newreward.function.c.a.a> r2 = r10.u
if (r2 == 0) goto L76
boolean r2 = r2.isEmpty()
if (r2 == 0) goto L20
goto L76
L20:
java.util.List<com.mbridge.msdk.newreward.function.c.a.a> r2 = r10.u
int r2 = r2.size()
java.util.List<com.mbridge.msdk.newreward.function.c.a.a> r5 = r10.u
java.util.Iterator r5 = r5.iterator()
r6 = r4
L2d:
boolean r7 = r5.hasNext()
if (r7 == 0) goto L72
java.lang.Object r7 = r5.next()
com.mbridge.msdk.newreward.function.c.a.a r7 = (com.mbridge.msdk.newreward.function.c.a.a) r7
com.mbridge.msdk.newreward.function.c.c.n r8 = r7.d()
if (r8 == 0) goto L48
boolean r8 = r8.e()
if (r8 == 0) goto L46
goto L48
L46:
r8 = r4
goto L49
L48:
r8 = r3
L49:
com.mbridge.msdk.newreward.function.c.c.d r9 = r7.f()
if (r9 == 0) goto L58
boolean r9 = r9.e()
if (r9 == 0) goto L56
goto L58
L56:
r9 = r4
goto L59
L58:
r9 = r3
L59:
com.mbridge.msdk.newreward.function.c.c.d r7 = r7.c()
if (r7 == 0) goto L68
boolean r7 = r7.e()
if (r7 == 0) goto L66
goto L68
L66:
r7 = r4
goto L69
L68:
r7 = r3
L69:
if (r8 == 0) goto L2d
if (r9 == 0) goto L2d
if (r7 == 0) goto L2d
int r6 = r6 + 1
goto L2d
L72:
if (r6 != r2) goto L76
r2 = r3
goto L77
L76:
r2 = r4
L77:
java.util.List<com.mbridge.msdk.newreward.function.c.a.a> r5 = r10.u
if (r5 == 0) goto La8
boolean r5 = r5.isEmpty()
if (r5 == 0) goto L82
goto La8
L82:
java.util.List<com.mbridge.msdk.newreward.function.c.a.a> r5 = r10.u
int r5 = r5.size()
java.util.List<com.mbridge.msdk.newreward.function.c.a.a> r6 = r10.u
java.util.Iterator r6 = r6.iterator()
r7 = r4
L8f:
boolean r8 = r6.hasNext()
if (r8 == 0) goto La4
java.lang.Object r8 = r6.next()
com.mbridge.msdk.newreward.function.c.a.a r8 = (com.mbridge.msdk.newreward.function.c.a.a) r8
boolean r8 = r8.l()
if (r8 != 0) goto L8f
int r7 = r7 + 1
goto L8f
La4:
if (r7 != r5) goto La8
r5 = r3
goto La9
La8:
r5 = r4
La9:
if (r0 == 0) goto Lb2
if (r1 == 0) goto Lb2
if (r2 == 0) goto Lb2
if (r5 == 0) goto Lb2
goto Lb3
Lb2:
r3 = r4
Lb3:
return r3
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.newreward.function.c.a.b.z():boolean");
}
public final boolean A() {
return this.p > System.currentTimeMillis();
}
public final Map<String, Object> H() {
if (this.H == null) {
this.H = new HashMap();
}
return this.H;
}
}

View File

@@ -0,0 +1,282 @@
package com.mbridge.msdk.newreward.function.c.b;
import android.content.Context;
import android.os.SystemClock;
import android.text.TextUtils;
import androidx.work.WorkRequest;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.download.core.DownloadCommon;
import com.mbridge.msdk.foundation.entity.CampaignUnit;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.newreward.a.c.a;
import com.mbridge.msdk.newreward.function.common.MBridgeGlobalCommon;
import com.mbridge.msdk.newreward.function.common.VolleyErrorUtils;
import com.mbridge.msdk.tracker.network.ac;
import com.mbridge.msdk.tracker.network.ad;
import com.mbridge.msdk.tracker.network.r;
import com.mbridge.msdk.tracker.network.t;
import com.mbridge.msdk.tracker.network.u;
import com.mbridge.msdk.tracker.network.w;
import com.mbridge.msdk.tracker.network.y;
import com.mbridge.msdk.tracker.network.z;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class a extends u<JSONObject> implements w.a {
protected com.mbridge.msdk.newreward.function.c.a.b a;
protected Context b;
protected int c;
protected String d;
protected String e;
protected String f;
private Map<String, String> g;
private c h;
private z i;
private long j;
private long k;
private String l;
private String m;
private String n;
private String o;
private Map<String, String> p;
private long q;
public final void a(c cVar) {
this.h = cVar;
}
public final void a(String str) {
this.m = str;
}
@Override // com.mbridge.msdk.tracker.network.u
public final boolean d() {
return true;
}
@Override // com.mbridge.msdk.tracker.network.u
public final /* synthetic */ void a(JSONObject jSONObject) {
c cVar;
JSONObject jSONObject2 = jSONObject;
if (MBridgeConstans.DEBUG) {
af.a("BaseCampaignRequest", "deliverResponse: " + jSONObject2);
}
com.mbridge.msdk.newreward.a.c.a.a().a(this.l);
int optInt = jSONObject2.optInt("status");
if (optInt == 1) {
JSONObject optJSONObject = jSONObject2.optJSONObject("data");
if (optJSONObject != null) {
CampaignUnit parseCampaignUnit = com.mbridge.msdk.foundation.entity.b.parseCampaignUnit(optJSONObject, this.m);
this.a.a(optJSONObject);
this.a.f(optJSONObject.optString("c"));
this.a.e(optJSONObject.optString(DownloadCommon.DOWNLOAD_REPORT_FIND_FILE_RESULT_VALUE_B));
this.a.d(optJSONObject.optString("a"));
this.a.d(optJSONObject.optInt("template"));
this.a.a(System.currentTimeMillis());
this.a.c(this.m);
this.a.g(optJSONObject.optString(com.mbridge.msdk.foundation.same.a.T));
this.a.c(1);
this.a.e(0);
this.a.a(parseCampaignUnit.getRequestId());
this.a.a(parseCampaignUnit.getEcppv());
this.a.i(this.o);
this.a.a(parseCampaignUnit.getSecondRequestIndex());
this.a.b(parseCampaignUnit.getSecondShowIndex());
MBridgeGlobalCommon.handlerCampaigns(this.n, this.a, parseCampaignUnit.getAds(), new ArrayList());
com.mbridge.msdk.newreward.function.c.a.b bVar = this.a;
if (bVar != null && (cVar = this.h) != null) {
try {
cVar.a(bVar, this);
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
af.b("BaseCampaignRequest", "handlerOnSuccessEvent Exception: ", e);
}
}
}
} else {
a(this, this.a, new b(7, "data is null"));
}
} else {
b bVar2 = new b(9);
bVar2.a(jSONObject2.optString("msg", ""));
bVar2.a(optInt);
bVar2.c(jSONObject2.toString());
a(this, this.a, bVar2);
}
this.k = SystemClock.elapsedRealtime();
}
public a(int i, String str, String str2, String str3, long j, String str4, String str5) {
super(0, str4, 0, str5);
this.b = com.mbridge.msdk.foundation.controller.c.m().c();
this.c = i;
this.d = str;
this.e = str2;
this.f = str3;
this.l = UUID.randomUUID().toString();
this.j = SystemClock.elapsedRealtime();
this.o = str4;
this.a = new com.mbridge.msdk.newreward.function.c.a.b(this.c, this.d, this.e, this.f);
a((w.a) this);
d(true);
c(true);
this.q = j <= 0 ? WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS : j;
com.mbridge.msdk.newreward.a.c.a.a().a(this.l, this.q, new C0217a(this, this.a));
}
public final void a(String str, String str2) {
if (this.g == null) {
this.g = new HashMap();
}
if (TextUtils.isEmpty(str)) {
return;
}
Map<String, String> map = this.g;
if (str2 == null) {
str2 = "";
}
map.put(str, str2);
}
public final void b(String str) {
c("local_id", str);
c("ad_type", String.valueOf(this.c));
this.n = str;
}
public final void a(Map<String, String> map) {
if (this.g == null) {
this.g = new HashMap();
}
if (map == null || map.size() == 0) {
return;
}
this.g.putAll(map);
}
@Override // com.mbridge.msdk.tracker.network.u
public final Map<String, String> a() {
if (this.g == null) {
this.g = new HashMap();
}
return this.g;
}
@Override // com.mbridge.msdk.tracker.network.u
public final z b() {
if (this.i == null) {
this.i = new com.mbridge.msdk.tracker.network.e(10000, this.q, 5);
}
return this.i;
}
@Override // com.mbridge.msdk.tracker.network.u
public final w<JSONObject> a(r rVar) {
if (rVar != null) {
try {
byte[] bArr = rVar.b;
if (bArr != null && bArr.length != 0) {
return w.a(new JSONObject(new String(bArr, StandardCharsets.UTF_8)), com.mbridge.msdk.tracker.network.toolbox.f.a(rVar));
}
} catch (JSONException e) {
if (MBridgeConstans.DEBUG) {
af.b("BaseCampaignRequest", "parseNetworkResponse JSONException: ", e);
}
return w.a(new t(e));
} catch (Exception e2) {
if (MBridgeConstans.DEBUG) {
af.b("BaseCampaignRequest", "parseNetworkResponse Exception: ", e2);
}
return w.a(new ac(e2));
}
}
return w.a(new y());
}
@Override // com.mbridge.msdk.tracker.network.w.a
public final void a(ad adVar) {
c cVar;
com.mbridge.msdk.newreward.a.c.a.a().a(this.l);
if (MBridgeConstans.DEBUG) {
af.b("BaseCampaignRequest", "onErrorResponse: " + adVar.getMessage());
}
com.mbridge.msdk.newreward.function.c.a.b bVar = this.a;
if (bVar == null || (cVar = this.h) == null) {
return;
}
try {
cVar.b(bVar, this, VolleyErrorUtils.parseVolleyError(adVar));
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
af.b("BaseCampaignRequest", "onError Exception: ", e);
}
}
}
/* renamed from: com.mbridge.msdk.newreward.function.c.b.a$a, reason: collision with other inner class name */
public static final class C0217a implements a.InterfaceC0214a {
private final a a;
private final com.mbridge.msdk.newreward.function.c.a.b b;
public C0217a(a aVar, com.mbridge.msdk.newreward.function.c.a.b bVar) {
this.a = aVar;
this.b = bVar;
}
@Override // com.mbridge.msdk.newreward.a.c.a.InterfaceC0214a
public final void a(String str, long j) {
af.a("BaseCampaignRequest", "onTimeout taskID = " + str + ", timeout = " + j);
a.a(this.a, this.b, j);
}
}
public final void b(String str, String str2) {
if (this.p == null) {
this.p = new HashMap();
}
this.p.put(str, str2);
}
@Override // com.mbridge.msdk.tracker.network.u
public final Map<String, String> c() {
if (this.p == null) {
this.p = new HashMap();
}
this.p.put("Charset", "UTF-8");
return this.p;
}
private static void a(a aVar, com.mbridge.msdk.newreward.function.c.a.b bVar, b bVar2) {
c cVar;
if (aVar == null || bVar == null || (cVar = aVar.h) == null) {
return;
}
try {
cVar.a(bVar, aVar, bVar2);
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
af.b("BaseCampaignRequest", "handlerOnFailedEvent Exception: ", e);
}
}
}
public static /* synthetic */ void a(a aVar, com.mbridge.msdk.newreward.function.c.a.b bVar, long j) {
c cVar;
if (aVar == null || bVar == null || (cVar = aVar.h) == null) {
return;
}
try {
cVar.a(bVar, aVar, j, new b(10, "v3 is timeout"));
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
af.b("BaseCampaignRequest", "onTimeout Exception: ", e);
}
}
}
}

View File

@@ -0,0 +1,67 @@
package com.mbridge.msdk.newreward.function.c.b;
import com.mbridge.msdk.tracker.network.ad;
/* loaded from: classes4.dex */
public final class b {
private int a;
private String b;
private ad c;
private int d;
private String e;
private String f;
public final int a() {
return this.d;
}
public final void a(int i) {
this.d = i;
}
public final void a(ad adVar) {
this.c = adVar;
}
public final void a(String str) {
this.e = str;
}
public final String b() {
return this.e;
}
public final void b(String str) {
this.b = str;
}
public final int c() {
return this.a;
}
public final void c(String str) {
this.f = str;
}
public final String d() {
return this.b;
}
public final ad e() {
return this.c;
}
public final String f() {
return this.f;
}
public b(int i) {
this.a = i;
this.b = "";
}
public b(int i, String str) {
this.a = i;
this.b = str;
}
}

View File

@@ -0,0 +1,12 @@
package com.mbridge.msdk.newreward.function.c.b;
/* loaded from: classes4.dex */
public interface c {
void a(com.mbridge.msdk.newreward.function.c.a.b bVar, a aVar);
void a(com.mbridge.msdk.newreward.function.c.a.b bVar, a aVar, long j, b bVar2);
void a(com.mbridge.msdk.newreward.function.c.a.b bVar, a aVar, b bVar2);
void b(com.mbridge.msdk.newreward.function.c.a.b bVar, a aVar, b bVar2);
}

View File

@@ -0,0 +1,21 @@
package com.mbridge.msdk.newreward.function.c.b;
/* loaded from: classes4.dex */
public final class d {
private int a;
private String b;
public final String a() {
return this.b;
}
public d(int i) {
this.a = i;
this.b = "";
}
public d(int i, String str) {
this.a = i;
this.b = str;
}
}

View File

@@ -0,0 +1,11 @@
package com.mbridge.msdk.newreward.function.c.b;
import com.mbridge.msdk.tracker.network.u;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public interface e {
void a(u<JSONObject> uVar, d dVar);
void a(JSONObject jSONObject, u<JSONObject> uVar);
}

View File

@@ -0,0 +1,65 @@
package com.mbridge.msdk.newreward.function.c.b;
import com.mbridge.msdk.tracker.network.toolbox.j;
import com.mbridge.msdk.tracker.network.toolbox.k;
import com.mbridge.msdk.tracker.network.toolbox.n;
import com.mbridge.msdk.tracker.network.u;
import com.mbridge.msdk.tracker.network.v;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class f {
private static volatile f a;
private v b;
private f() {
}
public static f a() {
if (a == null) {
synchronized (f.class) {
try {
if (a == null) {
a = new f();
}
} finally {
}
}
}
return a;
}
public final void a(a aVar) {
b().a(aVar);
}
public final void a(u<JSONObject> uVar) {
b().a(uVar);
}
private v b() {
if (this.b == null) {
v a2 = n.a(new com.mbridge.msdk.tracker.network.toolbox.b(new k()), new com.mbridge.msdk.tracker.network.g(c()), 5, new j());
this.b = a2;
a2.a();
}
return this.b;
}
private static ThreadPoolExecutor c() {
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5, 5, 100L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), new ThreadFactory() { // from class: com.mbridge.msdk.newreward.function.c.b.f.1
@Override // java.util.concurrent.ThreadFactory
public final Thread newThread(Runnable runnable) {
Thread thread = new Thread(runnable);
thread.setName("campaign_response_thread");
return thread;
}
}, new ThreadPoolExecutor.DiscardPolicy());
threadPoolExecutor.allowCoreThreadTimeOut(true);
return threadPoolExecutor;
}
}

View File

@@ -0,0 +1,8 @@
package com.mbridge.msdk.newreward.function.c.b;
/* loaded from: classes4.dex */
public final class g extends a {
public g(int i, String str, String str2, long j, String str3) {
super(i, com.mbridge.msdk.foundation.controller.c.m().k(), str, str2, j, str3, "more_offer");
}
}

View File

@@ -0,0 +1,114 @@
package com.mbridge.msdk.newreward.function.c.b;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.tracker.network.ac;
import com.mbridge.msdk.tracker.network.ad;
import com.mbridge.msdk.tracker.network.r;
import com.mbridge.msdk.tracker.network.u;
import com.mbridge.msdk.tracker.network.w;
import com.mbridge.msdk.tracker.network.y;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class h extends u<JSONObject> implements w.a {
public static int a = 0;
public static int b = 1;
private e c;
private HashMap<String, String> d;
private Map<String, String> e;
public final void a(e eVar) {
this.c = eVar;
}
@Override // com.mbridge.msdk.tracker.network.u
public final boolean d() {
return true;
}
@Override // com.mbridge.msdk.tracker.network.u
public final /* synthetic */ void a(JSONObject jSONObject) {
JSONObject jSONObject2 = jSONObject;
e eVar = this.c;
if (eVar == null) {
return;
}
try {
if (jSONObject2 == null) {
eVar.a(this, new d(-1));
} else {
eVar.a(jSONObject2, this);
}
} catch (Exception e) {
af.b("RewardSettingRequest", "onError Exception: ", e);
}
}
public h(String str) {
super(0, str, 0, "setting");
}
public final void a(Map<String, String> map) {
if (this.d == null) {
this.d = new HashMap<>();
}
if (map == null || map.isEmpty()) {
return;
}
this.d.putAll(map);
}
@Override // com.mbridge.msdk.tracker.network.u
public final Map<String, String> a() {
if (this.d == null) {
this.d = new HashMap<>();
}
return this.d;
}
@Override // com.mbridge.msdk.tracker.network.u
public final w<JSONObject> a(r rVar) {
if (rVar != null) {
try {
byte[] bArr = rVar.b;
if (bArr != null && bArr.length != 0) {
return w.a(new JSONObject(new String(bArr, com.mbridge.msdk.tracker.network.toolbox.f.a(rVar.c))), com.mbridge.msdk.tracker.network.toolbox.f.a(rVar));
}
} catch (UnsupportedEncodingException e) {
af.b("RewardSettingRequest", "parseNetworkResponse UnsupportedEncodingException: ", e);
return w.a(new com.mbridge.msdk.tracker.network.f(e));
} catch (Exception e2) {
af.b("RewardSettingRequest", "parseNetworkResponse Exception: ", e2);
return w.a(new ac(e2));
}
}
return w.a(new y());
}
public final void a(String str, String str2) {
if (this.e == null) {
this.e = new HashMap();
}
this.e.put(str, str2);
}
@Override // com.mbridge.msdk.tracker.network.u
public final Map<String, String> c() {
Map<String, String> map = this.e;
if (map == null) {
HashMap hashMap = new HashMap();
this.e = hashMap;
return hashMap;
}
map.put("Charset", "UTF-8");
return this.e;
}
@Override // com.mbridge.msdk.tracker.network.w.a
public final void a(ad adVar) {
this.c.a(this, new d(-1, adVar.getMessage()));
}
}

View File

@@ -0,0 +1,11 @@
package com.mbridge.msdk.newreward.function.c.b;
import com.mbridge.msdk.interstitial.view.MBInterstitialActivity;
/* loaded from: classes4.dex */
public final class i extends a {
public i(int i, String str, String str2, long j, String str3) {
super(i, com.mbridge.msdk.foundation.controller.c.m().k(), str, str2, j, com.mbridge.msdk.foundation.same.net.e.d.f().a(str3), MBInterstitialActivity.INTENT_CAMAPIGN);
super.a(str3);
}
}

View File

@@ -0,0 +1,58 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
/* loaded from: classes4.dex */
public abstract class a<Resource> implements o {
private final com.mbridge.msdk.newreward.function.c.a.b b;
private final com.mbridge.msdk.newreward.function.c.a.a c;
private int d = 0;
private boolean e = false;
private boolean f = false;
protected boolean a = false;
public abstract Resource a();
public final void a(int i) {
this.d = i;
}
public final void a(boolean z) {
this.a = z;
}
public final com.mbridge.msdk.newreward.function.c.a.b b() {
return this.b;
}
public final void b(boolean z) {
this.e = z;
}
public final com.mbridge.msdk.newreward.function.c.a.a c() {
return this.c;
}
public final int f() {
return this.d;
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public abstract /* synthetic */ String j();
@Override // com.mbridge.msdk.newreward.function.c.c.o
public abstract /* synthetic */ q l();
public a(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
this.b = bVar;
this.c = aVar;
}
public boolean d() {
return TextUtils.isEmpty(j()) || h() || this.e;
}
public boolean e() {
return TextUtils.isEmpty(j()) || k() || this.f;
}
}

View File

@@ -0,0 +1,31 @@
package com.mbridge.msdk.newreward.function.c.c;
import java.io.File;
/* loaded from: classes4.dex */
public abstract class b extends d<File> {
private File b;
@Override // com.mbridge.msdk.newreward.function.c.c.a
public final /* bridge */ /* synthetic */ Object a() {
return this.b;
}
public final void a(File file) {
this.b = file;
}
@Override // com.mbridge.msdk.newreward.function.c.c.d
public final boolean g() {
return true;
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final boolean h() {
return true;
}
public b(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
}
}

View File

@@ -0,0 +1,43 @@
package com.mbridge.msdk.newreward.function.c.c;
/* loaded from: classes4.dex */
public abstract class c extends d<String> {
protected Boolean b;
private String c;
@Override // com.mbridge.msdk.newreward.function.c.c.a
public final /* bridge */ /* synthetic */ Object a() {
return this.c;
}
public final void a(String str) {
this.c = str;
}
public abstract boolean a_();
@Override // com.mbridge.msdk.newreward.function.c.c.d
public final boolean g() {
return false;
}
public final String i() {
return this.c;
}
public c(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
this.b = null;
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final boolean h() {
Boolean bool = this.b;
if (bool != null) {
return bool.booleanValue();
}
Boolean valueOf = Boolean.valueOf(a_());
this.b = valueOf;
return valueOf.booleanValue();
}
}

View File

@@ -0,0 +1,25 @@
package com.mbridge.msdk.newreward.function.c.c;
/* loaded from: classes4.dex */
public abstract class d<Resource> extends a<Resource> {
public abstract boolean g();
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final boolean k() {
return true;
}
public d(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a
public final boolean d() {
return g() || super.d();
}
@Override // com.mbridge.msdk.newreward.function.c.c.a
public final boolean e() {
return g() || super.e();
}
}

View File

@@ -0,0 +1,28 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
/* loaded from: classes4.dex */
public final class e extends b {
private final s b;
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 3;
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return this.b;
}
public e(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
this.b = new s(b(), c(), this);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
return (b() == null || TextUtils.isEmpty(b().B())) ? "" : b().B();
}
}

View File

@@ -0,0 +1,30 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.entity.CampaignEx;
/* loaded from: classes4.dex */
public final class f extends b {
private final t b;
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 4;
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return this.b;
}
public f(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
this.b = new t(b(), c(), this);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
CampaignEx h;
return (c() == null || (h = c().h()) == null || TextUtils.isEmpty(h.getendcard_url())) ? "" : h.getendcard_url();
}
}

View File

@@ -0,0 +1,30 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.entity.CampaignEx;
/* loaded from: classes4.dex */
public final class g extends b {
private final u b;
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 2;
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return this.b;
}
public g(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
this.b = new u(b(), c(), this);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
CampaignEx h;
return (c() == null || (h = c().h()) == null || h.getRewardTemplateMode() == null || TextUtils.isEmpty(h.getRewardTemplateMode().e())) ? "" : h.getRewardTemplateMode().e();
}
}

View File

@@ -0,0 +1,29 @@
package com.mbridge.msdk.newreward.function.c.c;
/* loaded from: classes4.dex */
public final class h extends c {
@Override // com.mbridge.msdk.newreward.function.c.c.c
public final boolean a_() {
return true;
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 8;
}
public h(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
b(true);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
return (c() == null || c().h() == null) ? "" : c().h().getEndScreenUrl();
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return new v(b(), c(), this);
}
}

View File

@@ -0,0 +1,36 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
/* loaded from: classes4.dex */
public final class i extends c {
@Override // com.mbridge.msdk.newreward.function.c.c.c
public final boolean a_() {
return true;
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 3;
}
public i(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
b(true);
a(false);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
if (c() == null) {
return "";
}
String B = b().B();
return TextUtils.isEmpty(B) ? "" : B;
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return new z(b(), c(), this);
}
}

View File

@@ -0,0 +1,50 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import java.util.ArrayList;
/* loaded from: classes4.dex */
public final class j extends c {
private final v c;
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 4;
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return this.c;
}
public j(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
this.c = new v(b(), c(), this);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
CampaignEx h;
return (c() == null || (h = c().h()) == null || TextUtils.isEmpty(h.getendcard_url())) ? "" : h.getendcard_url();
}
@Override // com.mbridge.msdk.newreward.function.c.c.c
public final boolean a_() {
if (c() == null) {
return false;
}
CampaignEx h = c().h();
if (h == null || TextUtils.isEmpty(h.getendcard_url())) {
return true;
}
ArrayList<Integer> rsIgnoreCheckRule = h.getRsIgnoreCheckRule();
if (rsIgnoreCheckRule != null && rsIgnoreCheckRule.size() != 0) {
try {
return rsIgnoreCheckRule.contains(2);
} catch (Exception unused) {
}
}
return false;
}
}

View File

@@ -0,0 +1,50 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import java.util.ArrayList;
/* loaded from: classes4.dex */
public final class k extends c {
private final v c;
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 2;
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return this.c;
}
public k(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
this.c = new v(b(), c(), this);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
CampaignEx h;
return (c() == null || (h = c().h()) == null || h.getRewardTemplateMode() == null || TextUtils.isEmpty(h.getRewardTemplateMode().e())) ? "" : h.getRewardTemplateMode().e();
}
@Override // com.mbridge.msdk.newreward.function.c.c.c
public final boolean a_() {
if (c() == null) {
return false;
}
CampaignEx h = c().h();
if (h == null || h.getRewardTemplateMode() == null || TextUtils.isEmpty(h.getRewardTemplateMode().e())) {
return true;
}
ArrayList<Integer> rsIgnoreCheckRule = h.getRsIgnoreCheckRule();
if (rsIgnoreCheckRule != null && !rsIgnoreCheckRule.isEmpty()) {
try {
return rsIgnoreCheckRule.contains(1);
} catch (Exception unused) {
}
}
return false;
}
}

View File

@@ -0,0 +1,43 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.entity.CampaignEx;
/* loaded from: classes4.dex */
public final class l extends a<String> {
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 5;
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final boolean h() {
return true;
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
return "";
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final boolean k() {
return true;
}
public l(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a
/* renamed from: g, reason: merged with bridge method [inline-methods] */
public final String a() {
CampaignEx h;
return (c() == null || (h = c().h()) == null || TextUtils.isEmpty(h.getMraid())) ? "" : h.getMraid();
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return new w(b(), c(), this);
}
}

View File

@@ -0,0 +1,34 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
/* loaded from: classes4.dex */
public final class m extends c {
private final String c;
@Override // com.mbridge.msdk.newreward.function.c.c.c
public final boolean a_() {
return true;
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 7;
}
public m(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, String str) {
super(bVar, aVar);
this.c = str;
b(true);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
return TextUtils.isEmpty(this.c) ? "" : this.c;
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return new v(b(), c(), this);
}
}

View File

@@ -0,0 +1,60 @@
package com.mbridge.msdk.newreward.function.c.c;
import java.io.File;
import java.util.ArrayList;
/* loaded from: classes4.dex */
public final class n extends a<File> {
private final y b;
private File c;
@Override // com.mbridge.msdk.newreward.function.c.c.a
public final /* bridge */ /* synthetic */ File a() {
return this.c;
}
public final void a(File file) {
this.c = file;
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final int b_() {
return 1;
}
public final File g() {
return this.c;
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final boolean k() {
return true;
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final q l() {
return this.b;
}
public n(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar) {
super(bVar, aVar);
this.b = new y(b(), c(), this, 100);
}
@Override // com.mbridge.msdk.newreward.function.c.c.a, com.mbridge.msdk.newreward.function.c.c.o
public final String j() {
return (c() == null || c().h() == null) ? "" : c().h().getVideoUrlEncode();
}
@Override // com.mbridge.msdk.newreward.function.c.c.o
public final boolean h() {
if (c() == null || c().h() == null) {
return true;
}
ArrayList<Integer> rsIgnoreCheckRule = c().h().getRsIgnoreCheckRule();
if (rsIgnoreCheckRule == null) {
return false;
}
return rsIgnoreCheckRule.contains(0);
}
}

View File

@@ -0,0 +1,14 @@
package com.mbridge.msdk.newreward.function.c.c;
/* loaded from: classes4.dex */
interface o {
int b_();
boolean h();
String j();
boolean k();
q l();
}

View File

@@ -0,0 +1,6 @@
package com.mbridge.msdk.newreward.function.c.c;
/* loaded from: classes4.dex */
public interface p {
void a(int i, x xVar);
}

View File

@@ -0,0 +1,5 @@
package com.mbridge.msdk.newreward.function.c.c;
/* loaded from: classes4.dex */
public abstract class q implements p {
}

View File

@@ -0,0 +1,278 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
import androidx.work.WorkRequest;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.download.DownloadError;
import com.mbridge.msdk.foundation.download.DownloadMessage;
import com.mbridge.msdk.foundation.download.DownloadPriority;
import com.mbridge.msdk.foundation.download.DownloadProgress;
import com.mbridge.msdk.foundation.download.DownloadResourceType;
import com.mbridge.msdk.foundation.download.MBDownloadManager;
import com.mbridge.msdk.foundation.download.OnDownloadStateListener;
import com.mbridge.msdk.foundation.download.OnProgressStateListener;
import com.mbridge.msdk.foundation.download.core.DownloadRequest;
import com.mbridge.msdk.foundation.download.resource.MBResourceManager;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.newreward.function.common.MBridgeError;
import com.mbridge.msdk.playercommon.exoplayer2.source.chunk.ChunkedTrackBlacklistUtil;
import java.io.File;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes4.dex */
abstract class r extends q implements OnDownloadStateListener<com.mbridge.msdk.newreward.function.c.a.b>, OnProgressStateListener<com.mbridge.msdk.newreward.function.c.a.b> {
private final com.mbridge.msdk.newreward.function.c.a.b a;
private final com.mbridge.msdk.newreward.function.c.a.a b;
private final b c;
private final String d;
private final String e;
private DownloadRequest<?> f;
private final String g;
private x h;
private final String i;
private boolean j;
public abstract boolean a();
public abstract String b();
public com.mbridge.msdk.newreward.function.c.a.a c() {
return this.b;
}
public com.mbridge.msdk.newreward.function.c.a.b d() {
return this.a;
}
public a<?> e() {
return this.c;
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public void onDownloadStart(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
}
@Override // com.mbridge.msdk.foundation.download.OnProgressStateListener
public void onProgress(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadProgress downloadProgress) {
}
public r(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, b bVar2) {
this.j = false;
this.a = bVar;
this.b = aVar;
this.c = bVar2;
String j = bVar2.j();
this.d = j;
String str = com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_XML) + File.separator;
this.i = str;
String a = com.mbridge.msdk.newreward.function.h.c.a(j);
this.e = a;
String str2 = str + a.replace(".zip", "").replace(".xml", "");
this.g = str2;
bVar2.a(true);
File a2 = a(str2);
if (a2 == null || !a2.exists()) {
return;
}
this.j = true;
bVar2.a(1);
bVar2.a(a2);
bVar2.b(true);
bVar2.a(false);
}
@Override // com.mbridge.msdk.newreward.function.c.c.p
public void a(int i, x xVar) {
this.h = xVar;
if (xVar != null) {
xVar.a(this.a, this.b, this);
}
if (a()) {
if (xVar != null) {
xVar.b(this.a, this.b, this);
return;
}
return;
}
if (this.j) {
if (xVar != null) {
xVar.b(this.a, this.b, this);
}
} else {
if (TextUtils.isEmpty(this.d)) {
if (this.c.d()) {
if (xVar != null) {
xVar.b(this.a, this.b, this);
return;
}
return;
} else {
if (xVar != null) {
xVar.a(this.a, this.b, this, new MBridgeError(5, MBridgeError.ERROR_MESSAGE_DOWNLOAD_RESOURCE_URL_ERROR));
return;
}
return;
}
}
DownloadRequest<?> build = MBDownloadManager.getInstance().download(new DownloadMessage<>(this.a, this.d, this.e, 100, DownloadResourceType.DOWNLOAD_RESOURCE_TYPE_ZIP)).withReadTimeout(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS).withConnectTimeout(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS).withWriteTimeout(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS).withDownloadPriority(DownloadPriority.HIGH).withHttpRetryCounter(5).withDirectoryPathInternal(this.i).withDownloadStateListener(this).withProgressStateListener(this).withTimeout(ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS).with("download_scene", "download_dynamic_view").with("do_us_fi_re", Boolean.toString(true)).build();
this.f = build;
build.start();
}
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public void onCancelDownload(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
this.c.a(TextUtils.equals(this.f.get("cache", "2"), "2") ? 2 : 1);
this.c.b(false);
this.c.a(false);
if (this.c.d()) {
x xVar = this.h;
if (xVar != null) {
xVar.b(this.a, this.b, this);
return;
}
return;
}
x xVar2 = this.h;
if (xVar2 != null) {
xVar2.a(this.a, this.b, this, new MBridgeError(4, MBridgeError.ERROR_MESSAGE_DOWNLOAD_DOWNLOAD_TIMEOUT));
}
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public void onDownloadComplete(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
x xVar;
com.mbridge.msdk.newreward.function.c.a.b bVar;
com.mbridge.msdk.newreward.function.c.a.a aVar;
MBridgeError mBridgeError;
x xVar2;
try {
try {
MBResourceManager.getInstance().unZip(downloadMessage.getSaveFilePath(), this.i);
this.c.a(TextUtils.equals(this.f.get("cache", "2"), "2") ? 2 : 1);
this.c.b(true);
this.c.a(false);
this.c.a(a(this.g));
this.c.a(2);
com.mbridge.msdk.newreward.function.command.c b = com.mbridge.msdk.newreward.function.command.d.a().b();
if (b != null) {
b.a(b.a("metrics_config_path", this.g + File.separator + "metrics_config.json", "resource_type", Integer.valueOf(e().b_())), "SharePreReceiver");
}
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
af.a("MBridgeDownloader", "onDownloadComplete.unZip: " + e.getMessage());
}
if (this.c.d()) {
xVar2 = this.h;
if (xVar2 == null) {
return;
}
} else {
xVar = this.h;
if (xVar == null) {
return;
}
bVar = this.a;
aVar = this.b;
mBridgeError = new MBridgeError(6, MBridgeError.ERROR_MESSAGE_DOWNLOAD_UN_ZIP_ERROR);
}
}
if (this.c.d()) {
xVar2 = this.h;
if (xVar2 == null) {
return;
}
xVar2.b(this.a, this.b, this);
return;
}
xVar = this.h;
if (xVar != null) {
bVar = this.a;
aVar = this.b;
mBridgeError = new MBridgeError(6, MBridgeError.ERROR_MESSAGE_DOWNLOAD_UN_ZIP_ERROR);
xVar.a(bVar, aVar, this, mBridgeError);
}
} catch (Throwable th) {
if (this.c.d()) {
x xVar3 = this.h;
if (xVar3 != null) {
xVar3.b(this.a, this.b, this);
}
} else {
x xVar4 = this.h;
if (xVar4 != null) {
xVar4.a(this.a, this.b, this, new MBridgeError(6, MBridgeError.ERROR_MESSAGE_DOWNLOAD_UN_ZIP_ERROR));
}
}
throw th;
}
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public void onDownloadError(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadError downloadError) {
String str;
this.c.a(TextUtils.equals(this.f.get("cache", "2"), "2") ? 2 : 1);
this.c.b(false);
this.c.a(false);
if (this.h != null) {
b bVar = this.c;
if (bVar != null) {
int b_ = bVar.b_();
if (b_ == 2) {
str = MBridgeError.ERROR_MESSAGE_DOWNLOAD_VIDEO_TEMPLATE_ERROR;
} else if (b_ == 3) {
str = MBridgeError.ERROR_MESSAGE_DOWNLOAD_BIG_TEMPLATE_ERROR;
} else if (b_ == 4) {
str = MBridgeError.ERROR_MESSAGE_DOWNLOAD_EC_TEMPLATE_ERROR;
}
MBridgeError mBridgeError = new MBridgeError(2, str);
mBridgeError.setException(downloadError.getException());
this.h.a(this.a, this.b, this, mBridgeError);
}
str = "network error";
MBridgeError mBridgeError2 = new MBridgeError(2, str);
mBridgeError2.setException(downloadError.getException());
this.h.a(this.a, this.b, this, mBridgeError2);
}
}
private File a(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
File file = new File(str + ".xml");
return (file.isFile() && file.exists()) ? file : b(str);
}
private File b(String str) {
JSONArray jSONArray;
String a = com.mbridge.msdk.newreward.function.h.c.a(new File(str + File.separator + "template_config.json"));
if (TextUtils.isEmpty(a)) {
return null;
}
try {
jSONArray = new JSONArray(a);
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
af.a("MBridgeDownloader", "findTemplateFile: " + e.getMessage());
}
}
if (jSONArray.length() == 0) {
return null;
}
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject optJSONObject = jSONArray.optJSONObject(i);
if (optJSONObject != null) {
String optString = optJSONObject.optString("xml_type", "");
if (!TextUtils.isEmpty(optString) && TextUtils.equals(optString, b())) {
File file = new File(str + File.separator + optJSONObject.optString("name", ""));
if (file.exists()) {
return file;
}
}
}
}
return null;
}
}

View File

@@ -0,0 +1,71 @@
package com.mbridge.msdk.newreward.function.c.c;
import com.mbridge.msdk.foundation.download.DownloadError;
import com.mbridge.msdk.foundation.download.DownloadMessage;
import com.mbridge.msdk.foundation.download.DownloadProgress;
/* loaded from: classes4.dex */
public final class s extends r {
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.newreward.function.c.c.p
public final /* bridge */ /* synthetic */ void a(int i, x xVar) {
super.a(i, xVar);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final /* bridge */ /* synthetic */ com.mbridge.msdk.newreward.function.c.a.a c() {
return super.c();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final /* bridge */ /* synthetic */ com.mbridge.msdk.newreward.function.c.a.b d() {
return super.d();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final /* bridge */ /* synthetic */ a e() {
return super.e();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onCancelDownload(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
super.onCancelDownload(downloadMessage);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onDownloadComplete(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
super.onDownloadComplete(downloadMessage);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onDownloadError(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadError downloadError) {
super.onDownloadError(downloadMessage, downloadError);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onDownloadStart(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
super.onDownloadStart(downloadMessage);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnProgressStateListener
public final /* bridge */ /* synthetic */ void onProgress(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadProgress downloadProgress) {
super.onProgress(downloadMessage, downloadProgress);
}
public s(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, b bVar2) {
super(bVar, aVar, bVar2);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final String b() {
return "template_" + super.d().C() + "_" + super.d().D();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final boolean a() {
com.mbridge.msdk.newreward.function.c.a.b d = super.d();
if (d == null) {
return true;
}
return d.K();
}
}

View File

@@ -0,0 +1,87 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.content.Context;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.download.DownloadError;
import com.mbridge.msdk.foundation.download.DownloadMessage;
import com.mbridge.msdk.foundation.download.DownloadProgress;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.ab;
/* loaded from: classes4.dex */
public final class t extends r {
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final boolean a() {
return false;
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.newreward.function.c.c.p
public final /* bridge */ /* synthetic */ void a(int i, x xVar) {
super.a(i, xVar);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final /* bridge */ /* synthetic */ com.mbridge.msdk.newreward.function.c.a.a c() {
return super.c();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final /* bridge */ /* synthetic */ com.mbridge.msdk.newreward.function.c.a.b d() {
return super.d();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final /* bridge */ /* synthetic */ a e() {
return super.e();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onCancelDownload(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
super.onCancelDownload(downloadMessage);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onDownloadComplete(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
super.onDownloadComplete(downloadMessage);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onDownloadError(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadError downloadError) {
super.onDownloadError(downloadMessage, downloadError);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onDownloadStart(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
super.onDownloadStart(downloadMessage);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnProgressStateListener
public final /* bridge */ /* synthetic */ void onProgress(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadProgress downloadProgress) {
super.onProgress(downloadMessage, downloadProgress);
}
public t(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, b bVar2) {
super(bVar, aVar, bVar2);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final String b() {
CampaignEx h;
if (super.c() != null && super.c().h() != null && (h = super.c().h()) != null && !TextUtils.isEmpty(h.getendcard_url())) {
Context x = super.d().x();
if (x == null) {
x = com.mbridge.msdk.foundation.controller.c.m().c();
}
try {
StringBuilder sb = new StringBuilder();
sb.append("template_");
sb.append(com.mbridge.msdk.e.b.a() ? "cn" : "en");
sb.append("_");
sb.append(ab.s(x.getApplicationContext()));
return sb.toString();
} catch (Exception unused) {
}
}
return "";
}
}

View File

@@ -0,0 +1,77 @@
package com.mbridge.msdk.newreward.function.c.c;
import com.mbridge.msdk.foundation.download.DownloadError;
import com.mbridge.msdk.foundation.download.DownloadMessage;
import com.mbridge.msdk.foundation.download.DownloadProgress;
import com.mbridge.msdk.foundation.entity.CampaignEx;
/* loaded from: classes4.dex */
public final class u extends r {
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.newreward.function.c.c.p
public final /* bridge */ /* synthetic */ void a(int i, x xVar) {
super.a(i, xVar);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final /* bridge */ /* synthetic */ com.mbridge.msdk.newreward.function.c.a.a c() {
return super.c();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final /* bridge */ /* synthetic */ com.mbridge.msdk.newreward.function.c.a.b d() {
return super.d();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final /* bridge */ /* synthetic */ a e() {
return super.e();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onCancelDownload(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
super.onCancelDownload(downloadMessage);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onDownloadComplete(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
super.onDownloadComplete(downloadMessage);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onDownloadError(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadError downloadError) {
super.onDownloadError(downloadMessage, downloadError);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final /* bridge */ /* synthetic */ void onDownloadStart(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
super.onDownloadStart(downloadMessage);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r, com.mbridge.msdk.foundation.download.OnProgressStateListener
public final /* bridge */ /* synthetic */ void onProgress(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadProgress downloadProgress) {
super.onProgress(downloadMessage, downloadProgress);
}
public u(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, b bVar2) {
super(bVar, aVar, bVar2);
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final boolean a() {
com.mbridge.msdk.newreward.function.c.a.a c = super.c();
if (c == null) {
return true;
}
return c.k();
}
@Override // com.mbridge.msdk.newreward.function.c.c.r
public final String b() {
CampaignEx h;
CampaignEx.c rewardTemplateMode;
if (super.c() == null || super.c().h() == null || (h = super.c().h()) == null || (rewardTemplateMode = h.getRewardTemplateMode()) == null) {
return "";
}
return "template_" + rewardTemplateMode.f();
}
}

View File

@@ -0,0 +1,240 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
import androidx.work.WorkRequest;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.download.DownloadError;
import com.mbridge.msdk.foundation.download.DownloadMessage;
import com.mbridge.msdk.foundation.download.DownloadPriority;
import com.mbridge.msdk.foundation.download.DownloadProgress;
import com.mbridge.msdk.foundation.download.DownloadResourceType;
import com.mbridge.msdk.foundation.download.MBDownloadManager;
import com.mbridge.msdk.foundation.download.OnDownloadStateListener;
import com.mbridge.msdk.foundation.download.OnProgressStateListener;
import com.mbridge.msdk.foundation.download.core.DownloadRequest;
import com.mbridge.msdk.foundation.download.core.RequestBuilder;
import com.mbridge.msdk.foundation.download.download.HTMLResourceManager;
import com.mbridge.msdk.foundation.download.download.ResourceManager;
import com.mbridge.msdk.foundation.download.resource.MBResourceManager;
import com.mbridge.msdk.foundation.tools.SameMD5;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.aq;
import com.mbridge.msdk.newreward.function.common.MBridgeError;
import com.mbridge.msdk.playercommon.exoplayer2.source.chunk.ChunkedTrackBlacklistUtil;
/* loaded from: classes4.dex */
public final class v extends q implements OnDownloadStateListener<com.mbridge.msdk.newreward.function.c.a.b>, OnProgressStateListener<com.mbridge.msdk.newreward.function.c.a.b> {
private final String a;
private final String b;
private final String c;
private final com.mbridge.msdk.newreward.function.c.a.b d;
private final com.mbridge.msdk.newreward.function.c.a.a e;
private final c f;
private final String g;
private DownloadRequest<?> h;
private x i;
private boolean j;
private String k;
private boolean l;
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onDownloadStart(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
}
@Override // com.mbridge.msdk.foundation.download.OnProgressStateListener
public final void onProgress(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadProgress downloadProgress) {
}
public v(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, c cVar) {
this.j = false;
this.l = false;
this.d = bVar;
this.e = aVar;
this.f = cVar;
String j = cVar.j();
this.g = j;
if (!TextUtils.isEmpty(j)) {
this.l = j.contains(".zip") && j.contains(ResourceManager.KEY_MD5FILENAME);
}
String a = com.mbridge.msdk.foundation.same.b.e.a(this.l ? com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_RES : com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_HTML);
String md5 = SameMD5.getMD5(aq.b(j));
this.a = md5;
this.b = a + "/";
this.c = a + "/" + md5;
cVar.a(true);
String resDirFromCampaign = this.l ? ResourceManager.getinstance().getResDirFromCampaign(j) : HTMLResourceManager.getInstance().getHtmlContentFromUrl(j);
if (TextUtils.isEmpty(resDirFromCampaign)) {
return;
}
this.j = true;
cVar.a(1);
cVar.a(resDirFromCampaign);
cVar.b(true);
cVar.a(false);
}
@Override // com.mbridge.msdk.newreward.function.c.c.p
public final void a(int i, x xVar) {
StringBuilder sb;
String str;
String str2;
this.i = xVar;
if (xVar != null) {
xVar.a(this.d, this.e, this);
}
if (this.j) {
x xVar2 = this.i;
if (xVar2 != null) {
xVar2.b(this.d, this.e, this);
return;
}
return;
}
if (this.l) {
sb = new StringBuilder();
sb.append(this.a);
str = ".zip";
} else {
sb = new StringBuilder();
sb.append(this.a);
str = ".html";
}
sb.append(str);
String sb2 = sb.toString();
this.k = this.b + sb2;
RequestBuilder withTimeout = MBDownloadManager.getInstance().download(new DownloadMessage<>(this.d, this.g, sb2, 100, this.l ? DownloadResourceType.DOWNLOAD_RESOURCE_TYPE_ZIP : DownloadResourceType.DOWNLOAD_RESOURCE_TYPE_HTML)).withReadTimeout(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS).withConnectTimeout(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS).withWriteTimeout(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS).withDownloadPriority(DownloadPriority.IMMEDIATE).withHttpRetryCounter(5).withDirectoryPathInternal(this.b).withDownloadStateListener(this).withProgressStateListener(this).withTimeout(ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS);
c cVar = this.f;
if (cVar != null) {
int b_ = cVar.b_();
if (b_ == 2) {
str2 = "download_template";
} else if (b_ == 3) {
str2 = "download_big_template";
} else if (b_ == 4) {
str2 = "download_end_card";
}
DownloadRequest<?> build = withTimeout.with("download_scene", str2).with("do_us_fi_re", Boolean.toString(true)).build();
this.h = build;
build.start();
}
str2 = "un_known";
DownloadRequest<?> build2 = withTimeout.with("download_scene", str2).with("do_us_fi_re", Boolean.toString(true)).build();
this.h = build2;
build2.start();
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onCancelDownload(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
this.f.a(TextUtils.equals(this.h.get("cache", "2"), "2") ? 2 : 1);
this.f.b(false);
this.f.a(false);
if (this.f.d()) {
x xVar = this.i;
if (xVar != null) {
xVar.b(this.d, this.e, this);
return;
}
return;
}
x xVar2 = this.i;
if (xVar2 != null) {
xVar2.a(this.d, this.e, this, new MBridgeError(4, MBridgeError.ERROR_MESSAGE_DOWNLOAD_DOWNLOAD_TIMEOUT));
}
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onDownloadComplete(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
x xVar;
String str = MBridgeError.ERROR_MESSAGE_DOWNLOAD_UN_ZIP_ERROR;
Exception exc = null;
try {
try {
if (this.l) {
MBResourceManager.getInstance().unZip(this.k, this.c);
}
String resDirFromCampaign = this.l ? ResourceManager.getinstance().getResDirFromCampaign(this.g) : HTMLResourceManager.getInstance().getHtmlContentFromUrl(this.g);
this.f.b(true);
this.f.a(false);
this.f.a(TextUtils.equals(this.h.get("cache", "2"), "2") ? 2 : 1);
this.f.a(resDirFromCampaign);
} catch (Exception e) {
exc = e;
if (MBridgeConstans.DEBUG) {
af.a("MBridgeDownloader", "onDownloadComplete.unZip: " + exc.getMessage());
}
if (!this.f.d()) {
if (this.i != null) {
this.i.a(this.d, this.e, this, new MBridgeError(6, "unzip error:" + exc.getMessage()));
return;
}
return;
}
xVar = this.i;
if (xVar == null) {
return;
}
}
if (this.f.d()) {
xVar = this.i;
if (xVar == null) {
return;
}
xVar.b(this.d, this.e, this);
return;
}
x xVar2 = this.i;
if (xVar2 != null) {
xVar2.a(this.d, this.e, this, new MBridgeError(6, MBridgeError.ERROR_MESSAGE_DOWNLOAD_UN_ZIP_ERROR));
}
} catch (Throwable th) {
if (this.f.d()) {
x xVar3 = this.i;
if (xVar3 != null) {
xVar3.b(this.d, this.e, this);
}
} else if (this.i != null) {
if (exc != null) {
str = "unzip error:" + exc.getMessage();
}
this.i.a(this.d, this.e, this, new MBridgeError(6, str));
}
throw th;
}
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onDownloadError(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadError downloadError) {
String str;
this.f.a(TextUtils.equals(this.h.get("cache", "2"), "2") ? 2 : 1);
this.f.b(false);
this.f.a(false);
if (this.f.d()) {
x xVar = this.i;
if (xVar != null) {
xVar.b(this.d, this.e, this);
return;
}
return;
}
if (this.i != null) {
c cVar = this.f;
if (cVar != null) {
int b_ = cVar.b_();
if (b_ == 2) {
str = MBridgeError.ERROR_MESSAGE_DOWNLOAD_VIDEO_TEMPLATE_ERROR;
} else if (b_ == 3) {
str = MBridgeError.ERROR_MESSAGE_DOWNLOAD_BIG_TEMPLATE_ERROR;
} else if (b_ == 4) {
str = MBridgeError.ERROR_MESSAGE_DOWNLOAD_EC_TEMPLATE_ERROR;
}
MBridgeError mBridgeError = new MBridgeError(2, str);
mBridgeError.setException(downloadError.getException());
this.i.a(this.d, this.e, this, mBridgeError);
}
str = "network error";
MBridgeError mBridgeError2 = new MBridgeError(2, str);
mBridgeError2.setException(downloadError.getException());
this.i.a(this.d, this.e, this, mBridgeError2);
}
}
}

View File

@@ -0,0 +1,108 @@
package com.mbridge.msdk.newreward.function.c.c;
/* loaded from: classes4.dex */
public final class w extends q {
private final com.mbridge.msdk.newreward.function.c.a.b a;
private final com.mbridge.msdk.newreward.function.c.a.a b;
private final l c;
public w(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, l lVar) {
this.a = bVar;
this.b = aVar;
this.c = lVar;
}
/* JADX WARN: Removed duplicated region for block: B:21:0x00a0 */
/* JADX WARN: Removed duplicated region for block: B:23:? A[RETURN, SYNTHETIC] */
@Override // com.mbridge.msdk.newreward.function.c.c.p
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(int r5, com.mbridge.msdk.newreward.function.c.c.x r6) {
/*
r4 = this;
com.mbridge.msdk.newreward.function.c.a.a r5 = r4.b
com.mbridge.msdk.foundation.entity.CampaignEx r5 = r5.h()
java.lang.String r0 = r5.getMraid()
boolean r0 = android.text.TextUtils.isEmpty(r0)
if (r0 == 0) goto L21
if (r6 == 0) goto L20
com.mbridge.msdk.newreward.function.c.a.b r5 = r4.a
com.mbridge.msdk.newreward.function.c.a.a r0 = r4.b
r6.a(r5, r0, r4)
com.mbridge.msdk.newreward.function.c.a.b r5 = r4.a
com.mbridge.msdk.newreward.function.c.a.a r0 = r4.b
r6.b(r5, r0, r4)
L20:
return
L21:
com.mbridge.msdk.foundation.same.b.c r0 = com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_HTML
java.lang.String r0 = com.mbridge.msdk.foundation.same.b.e.a(r0)
java.lang.String r1 = r5.getMraid()
java.lang.String r1 = com.mbridge.msdk.foundation.tools.SameMD5.getMD5(r1)
boolean r2 = android.text.TextUtils.isEmpty(r1)
if (r2 == 0) goto L3d
long r1 = java.lang.System.currentTimeMillis()
java.lang.String r1 = java.lang.String.valueOf(r1)
L3d:
java.lang.String r2 = ".html"
java.lang.String r1 = r1.concat(r2)
r2 = 0
java.io.File r3 = new java.io.File // Catch: java.lang.Throwable -> L8d java.lang.Exception -> L8f
r3.<init>(r0, r1) // Catch: java.lang.Throwable -> L8d java.lang.Exception -> L8f
java.io.FileOutputStream r0 = new java.io.FileOutputStream // Catch: java.lang.Throwable -> L8d java.lang.Exception -> L8f
r0.<init>(r3) // Catch: java.lang.Throwable -> L8d java.lang.Exception -> L8f
java.lang.StringBuilder r1 = new java.lang.StringBuilder // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
r1.<init>() // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
java.lang.String r2 = "<script>"
r1.append(r2) // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
com.mbridge.msdk.c.b.a r2 = com.mbridge.msdk.c.b.a.a() // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
java.lang.String r2 = r2.b() // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
r1.append(r2) // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
java.lang.String r2 = "</script>"
r1.append(r2) // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
java.lang.String r2 = r5.getMraid() // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
r1.append(r2) // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
java.lang.String r1 = r1.toString() // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
byte[] r1 = r1.getBytes() // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
r0.write(r1) // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
r0.flush() // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
java.lang.String r1 = r3.getAbsolutePath() // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
r5.setMraid(r1) // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8b
r0.close() // Catch: java.lang.Exception -> L9e
goto L9e
L88:
r5 = move-exception
r2 = r0
goto La8
L8b:
r2 = r0
goto L8f
L8d:
r5 = move-exception
goto La8
L8f:
if (r2 == 0) goto L94
r2.close() // Catch: java.lang.Throwable -> L8d java.io.IOException -> L94
L94:
java.lang.String r0 = ""
r5.setMraid(r0) // Catch: java.lang.Throwable -> L8d
if (r2 == 0) goto L9e
r2.close() // Catch: java.lang.Exception -> L9e
L9e:
if (r6 == 0) goto La7
com.mbridge.msdk.newreward.function.c.a.b r5 = r4.a
com.mbridge.msdk.newreward.function.c.a.a r0 = r4.b
r6.b(r5, r0, r4)
La7:
return
La8:
if (r2 == 0) goto Lad
r2.close() // Catch: java.lang.Exception -> Lad
Lad:
throw r5
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.newreward.function.c.c.w.a(int, com.mbridge.msdk.newreward.function.c.c.x):void");
}
}

View File

@@ -0,0 +1,14 @@
package com.mbridge.msdk.newreward.function.c.c;
import com.mbridge.msdk.newreward.function.common.MBridgeError;
/* loaded from: classes4.dex */
public interface x {
void a(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, q qVar);
void a(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, q qVar, MBridgeError mBridgeError);
void b(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, q qVar);
void b(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, q qVar, MBridgeError mBridgeError);
}

View File

@@ -0,0 +1,163 @@
package com.mbridge.msdk.newreward.function.c.c;
import android.text.TextUtils;
import androidx.work.WorkRequest;
import com.mbridge.msdk.foundation.download.DownloadError;
import com.mbridge.msdk.foundation.download.DownloadMessage;
import com.mbridge.msdk.foundation.download.DownloadPriority;
import com.mbridge.msdk.foundation.download.DownloadProgress;
import com.mbridge.msdk.foundation.download.DownloadResourceType;
import com.mbridge.msdk.foundation.download.MBDownloadManager;
import com.mbridge.msdk.foundation.download.OnDownloadStateListener;
import com.mbridge.msdk.foundation.download.OnProgressStateListener;
import com.mbridge.msdk.foundation.download.core.DownloadRequest;
import com.mbridge.msdk.newreward.function.common.MBridgeError;
import com.mbridge.msdk.playercommon.exoplayer2.source.chunk.ChunkedTrackBlacklistUtil;
import java.io.File;
/* loaded from: classes4.dex */
public final class y extends q implements OnDownloadStateListener<com.mbridge.msdk.newreward.function.c.a.b>, OnProgressStateListener<com.mbridge.msdk.newreward.function.c.a.b> {
private final com.mbridge.msdk.newreward.function.c.a.b a;
private final com.mbridge.msdk.newreward.function.c.a.a b;
private final n c;
private final String d;
private final String e;
private final String f;
private final int h;
private DownloadRequest i;
private x j;
private boolean g = false;
private volatile boolean k = false;
private boolean l = false;
public y(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, n nVar, int i) {
this.a = bVar;
this.b = aVar;
this.c = nVar;
this.h = i;
String j = nVar.j();
this.d = j;
String str = com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_VC) + File.separator;
this.e = str;
String a = com.mbridge.msdk.newreward.function.h.c.a(j);
this.f = a;
String str2 = str + a;
nVar.a(new File(str2));
nVar.a(true);
File file = new File(str2);
if (file.exists() && file.isFile()) {
nVar.a(1);
nVar.b(true);
nVar.a(false);
}
}
@Override // com.mbridge.msdk.newreward.function.c.c.p
public final void a(int i, x xVar) {
DownloadMessage<?> downloadMessage;
int i2;
this.j = xVar;
if (TextUtils.isEmpty(this.d)) {
if (this.c.d()) {
x xVar2 = this.j;
if (xVar2 != null) {
xVar2.a(this.a, this.b, this);
this.j.b(this.a, this.b, this);
return;
}
return;
}
x xVar3 = this.j;
if (xVar3 != null) {
xVar3.a(this.a, this.b, this);
this.j.a(this.a, this.b, this, new MBridgeError(5, MBridgeError.ERROR_MESSAGE_DOWNLOAD_RESOURCE_URL_ERROR));
return;
}
return;
}
if (this.l) {
x xVar4 = this.j;
if (xVar4 != null) {
xVar4.b(this.a, this.b, this);
return;
}
return;
}
this.k = false;
int videoCtnType = this.b.h().getVideoCtnType();
if (i == 1 || (i2 = this.h) == 100) {
this.g = false;
downloadMessage = new DownloadMessage<>(this.a, this.d, this.f, 100, DownloadResourceType.DOWNLOAD_RESOURCE_TYPE_VIDEO);
} else if (videoCtnType == 1) {
this.g = false;
downloadMessage = new DownloadMessage<>(this.a, this.d, this.f, 100, DownloadResourceType.DOWNLOAD_RESOURCE_TYPE_VIDEO);
} else {
this.g = true;
downloadMessage = new DownloadMessage<>(this.a, this.d, this.f, i2, DownloadResourceType.DOWNLOAD_RESOURCE_TYPE_VIDEO);
}
DownloadRequest build = MBDownloadManager.getInstance().download(downloadMessage).withReadTimeout(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS).withConnectTimeout(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS).withWriteTimeout(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS).withDownloadPriority(DownloadPriority.IMMEDIATE).withHttpRetryCounter(5).withDirectoryPathInternal(this.e).withDownloadStateListener(this).withProgressStateListener(this).withTimeout(ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS).with("download_scene", "download_video").with("do_us_fi_re", Boolean.toString(true)).build();
this.i = build;
build.start();
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onCancelDownload(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
if (this.k) {
x xVar = this.j;
if (xVar != null) {
xVar.b(this.a, this.b, this, new MBridgeError(4, MBridgeError.ERROR_MESSAGE_DOWNLOAD_DOWNLOAD_TIMEOUT));
return;
}
return;
}
x xVar2 = this.j;
if (xVar2 != null) {
xVar2.a(this.a, this.b, this, new MBridgeError(2, "network error"));
}
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onDownloadComplete(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
this.c.a(TextUtils.equals(this.i.get("cache", "2"), "2") ? 2 : 1);
this.c.b(true);
this.c.a(false);
this.l = true;
x xVar = this.j;
if (xVar != null) {
xVar.b(this.a, this.b, this);
}
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onDownloadError(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadError downloadError) {
this.c.a(TextUtils.equals(this.i.get("cache", "2"), "2") ? 2 : 1);
this.c.b(false);
this.c.a(false);
MBridgeError mBridgeError = new MBridgeError(2, MBridgeError.ERROR_MESSAGE_DOWNLOAD_VIDEO_ERROR);
mBridgeError.setException(downloadError.getException());
x xVar = this.j;
if (xVar != null) {
xVar.a(this.a, this.b, this, mBridgeError);
}
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onDownloadStart(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage) {
x xVar = this.j;
if (xVar != null) {
xVar.a(this.a, this.b, this);
}
}
@Override // com.mbridge.msdk.foundation.download.OnProgressStateListener
public final void onProgress(DownloadMessage<com.mbridge.msdk.newreward.function.c.a.b> downloadMessage, DownloadProgress downloadProgress) {
if (downloadProgress.getCurrentDownloadRate() >= this.h) {
this.c.a(TextUtils.equals(this.i.get("cache", "2"), "2") ? 2 : 1);
this.c.b(true);
this.c.a(false);
if (this.g) {
this.i.cancel(downloadMessage);
}
}
}
}

View File

@@ -0,0 +1,24 @@
package com.mbridge.msdk.newreward.function.c.c;
/* loaded from: classes4.dex */
public final class z extends q {
private final com.mbridge.msdk.newreward.function.c.a.b a;
private final com.mbridge.msdk.newreward.function.c.a.a b;
private final c c;
public z(com.mbridge.msdk.newreward.function.c.a.b bVar, com.mbridge.msdk.newreward.function.c.a.a aVar, c cVar) {
this.a = bVar;
this.b = aVar;
this.c = cVar;
cVar.b(true);
cVar.a(false);
}
@Override // com.mbridge.msdk.newreward.function.c.c.p
public final void a(int i, x xVar) {
if (xVar != null) {
xVar.a(this.a, this.b, this);
xVar.b(this.a, this.b, this);
}
}
}