- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
384 lines
13 KiB
Java
384 lines
13 KiB
Java
package com.mbridge.msdk.videocommon.download;
|
|
|
|
import android.content.Context;
|
|
import android.text.TextUtils;
|
|
import com.mbridge.msdk.MBridgeConstans;
|
|
import com.mbridge.msdk.c.k;
|
|
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
import java.util.concurrent.CopyOnWriteArrayList;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class b {
|
|
private static volatile b a;
|
|
private boolean b = false;
|
|
private ConcurrentHashMap<String, j> c = new ConcurrentHashMap<>();
|
|
private ConcurrentHashMap<String, CopyOnWriteArrayList<Map<String, a>>> d;
|
|
private ConcurrentHashMap<String, CopyOnWriteArrayList<CampaignEx>> e;
|
|
private ConcurrentHashMap<String, CopyOnWriteArrayList<a>> f;
|
|
|
|
private b() {
|
|
}
|
|
|
|
public static b getInstance() {
|
|
if (a == null) {
|
|
synchronized (b.class) {
|
|
try {
|
|
if (a == null) {
|
|
a = new b();
|
|
}
|
|
} finally {
|
|
}
|
|
}
|
|
}
|
|
return a;
|
|
}
|
|
|
|
public final a a(String str, String str2) {
|
|
j c = c(str);
|
|
if (c != null) {
|
|
return c.a(str2);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final CopyOnWriteArrayList<CampaignEx> a(String str) {
|
|
ConcurrentHashMap<String, CopyOnWriteArrayList<CampaignEx>> concurrentHashMap = this.e;
|
|
if (concurrentHashMap == null || !concurrentHashMap.containsKey(str)) {
|
|
return null;
|
|
}
|
|
return this.e.get(str);
|
|
}
|
|
|
|
public final void a(String str, CopyOnWriteArrayList<CampaignEx> copyOnWriteArrayList) {
|
|
ConcurrentHashMap<String, CopyOnWriteArrayList<CampaignEx>> concurrentHashMap = this.e;
|
|
if (concurrentHashMap == null) {
|
|
this.e = new ConcurrentHashMap<>();
|
|
} else {
|
|
concurrentHashMap.clear();
|
|
}
|
|
this.e.put(str, copyOnWriteArrayList);
|
|
}
|
|
|
|
public final CopyOnWriteArrayList<a> b(String str) {
|
|
ConcurrentHashMap<String, CopyOnWriteArrayList<a>> concurrentHashMap = this.f;
|
|
if (concurrentHashMap == null || !concurrentHashMap.containsKey(str)) {
|
|
return null;
|
|
}
|
|
return this.f.get(str);
|
|
}
|
|
|
|
public final void b(String str, CopyOnWriteArrayList<a> copyOnWriteArrayList) {
|
|
ConcurrentHashMap<String, CopyOnWriteArrayList<a>> concurrentHashMap = this.f;
|
|
if (concurrentHashMap == null) {
|
|
this.f = new ConcurrentHashMap<>();
|
|
} else {
|
|
concurrentHashMap.clear();
|
|
}
|
|
this.f.put(str, copyOnWriteArrayList);
|
|
}
|
|
|
|
public final j c(String str) {
|
|
ConcurrentHashMap<String, j> concurrentHashMap = this.c;
|
|
if (concurrentHashMap == null || !concurrentHashMap.containsKey(str)) {
|
|
return null;
|
|
}
|
|
return this.c.get(str);
|
|
}
|
|
|
|
public final boolean a(int i, String str, boolean z) {
|
|
try {
|
|
j c = c(str);
|
|
if (c != null) {
|
|
return c.a(i, z) != null;
|
|
}
|
|
return false;
|
|
} catch (Exception e) {
|
|
if (!MBridgeConstans.DEBUG) {
|
|
return false;
|
|
}
|
|
e.printStackTrace();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public final boolean a(int i, String str, boolean z, int i2, boolean z2, int i3, List<CampaignEx> list) {
|
|
return a(i, str, z, i2, z2, i3, list, false, null);
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:137:0x018e, code lost:
|
|
|
|
if (r4.size() > 0) goto L92;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:139:0x0193, code lost:
|
|
|
|
r3 = r14.d;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:140:0x0195, code lost:
|
|
|
|
if (r3 != null) goto L97;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:141:0x0197, code lost:
|
|
|
|
r14.d = new java.util.concurrent.ConcurrentHashMap<>();
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:142:0x01aa, code lost:
|
|
|
|
r3 = r14.f;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:143:0x01ac, code lost:
|
|
|
|
if (r3 != null) goto L103;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:144:0x01ae, code lost:
|
|
|
|
r14.f = new java.util.concurrent.ConcurrentHashMap<>();
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:145:0x01c1, code lost:
|
|
|
|
r3 = r14.e;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:146:0x01c3, code lost:
|
|
|
|
if (r3 != null) goto L109;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:147:0x01c5, code lost:
|
|
|
|
r14.e = new java.util.concurrent.ConcurrentHashMap<>();
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:148:0x01d8, code lost:
|
|
|
|
if (r2 == null) goto L124;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:150:0x01de, code lost:
|
|
|
|
if (r2.size() <= 0) goto L124;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:151:0x01e0, code lost:
|
|
|
|
r3 = new java.util.concurrent.CopyOnWriteArrayList<>();
|
|
r4 = new java.util.concurrent.CopyOnWriteArrayList<>();
|
|
r5 = new java.util.concurrent.CopyOnWriteArrayList<>();
|
|
r2 = r2.iterator();
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:153:0x01f7, code lost:
|
|
|
|
if (r2.hasNext() == false) goto L170;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:154:0x01f9, code lost:
|
|
|
|
r6 = r2.next();
|
|
r7 = new java.util.concurrent.ConcurrentHashMap();
|
|
r8 = r6.l();
|
|
r7.put(r8.getId() + r8.getVideoUrlEncode() + r8.getBidToken(), r6);
|
|
r3.add(r7);
|
|
r4.add(r8);
|
|
r5.add(r6);
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:156:0x0233, code lost:
|
|
|
|
r14.d.put(r16, r3);
|
|
r14.e.put(r16, r4);
|
|
r14.f.put(r16, r5);
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:159:0x01d1, code lost:
|
|
|
|
if (r3.containsKey(r16) == false) goto L112;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:160:0x01d3, code lost:
|
|
|
|
r14.e.remove(r16);
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:162:0x01ba, code lost:
|
|
|
|
if (r3.containsKey(r16) == false) goto L106;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:163:0x01bc, code lost:
|
|
|
|
r14.f.remove(r16);
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:165:0x01a3, code lost:
|
|
|
|
if (r3.containsKey(r16) == false) goto L100;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:166:0x01a5, code lost:
|
|
|
|
r14.d.remove(r16);
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:99:0x0130, code lost:
|
|
|
|
if (r5.size() >= r18) goto L92;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final boolean a(int r15, java.lang.String r16, boolean r17, int r18, boolean r19, int r20, java.util.List<com.mbridge.msdk.foundation.entity.CampaignEx> r21, boolean r22, com.mbridge.msdk.foundation.same.report.d.e r23) {
|
|
/*
|
|
Method dump skipped, instructions count: 587
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.videocommon.download.b.a(int, java.lang.String, boolean, int, boolean, int, java.util.List, boolean, com.mbridge.msdk.foundation.same.report.d.e):boolean");
|
|
}
|
|
|
|
public void load(String str) {
|
|
j c = c(str);
|
|
if (c != null) {
|
|
c.a();
|
|
}
|
|
}
|
|
|
|
public j createUnitCache(Context context, String str, CopyOnWriteArrayList<CampaignEx> copyOnWriteArrayList, int i, com.mbridge.msdk.videocommon.listener.a aVar) {
|
|
j jVar;
|
|
if (TextUtils.isEmpty(str) || copyOnWriteArrayList == null || copyOnWriteArrayList.size() == 0) {
|
|
return null;
|
|
}
|
|
if (this.c.containsKey(str)) {
|
|
jVar = this.c.get(str);
|
|
if (jVar == null) {
|
|
jVar = new j(context, copyOnWriteArrayList, str, i);
|
|
this.c.put(str, jVar);
|
|
}
|
|
if (i == 94 || i == 287) {
|
|
jVar.a(copyOnWriteArrayList.get(0).getRequestId(), aVar);
|
|
} else {
|
|
jVar.a(aVar);
|
|
}
|
|
jVar.a(copyOnWriteArrayList);
|
|
} else {
|
|
jVar = new j(context, copyOnWriteArrayList, str, i);
|
|
if (aVar != null) {
|
|
jVar.a(aVar);
|
|
}
|
|
this.c.put(str, jVar);
|
|
}
|
|
return jVar;
|
|
}
|
|
|
|
public j createUnitCache(Context context, String str, CampaignEx campaignEx, int i, com.mbridge.msdk.videocommon.listener.a aVar) {
|
|
j jVar;
|
|
if (TextUtils.isEmpty(str) || campaignEx == null) {
|
|
return null;
|
|
}
|
|
if (this.c.containsKey(str)) {
|
|
jVar = this.c.get(str);
|
|
if (jVar == null) {
|
|
jVar = new j(context, campaignEx, str, i);
|
|
this.c.put(str, jVar);
|
|
}
|
|
if (i == 94 || i == 287) {
|
|
jVar.a(campaignEx.getRequestId(), aVar);
|
|
} else {
|
|
jVar.a(aVar);
|
|
}
|
|
jVar.a(campaignEx);
|
|
} else {
|
|
jVar = new j(context, campaignEx, str, i);
|
|
if (aVar != null) {
|
|
jVar.a(aVar);
|
|
}
|
|
this.c.put(str, jVar);
|
|
}
|
|
return jVar;
|
|
}
|
|
|
|
public final void a(boolean z) {
|
|
this.b = z;
|
|
ConcurrentHashMap<String, j> concurrentHashMap = this.c;
|
|
if (concurrentHashMap != null) {
|
|
Iterator<Map.Entry<String, j>> it = concurrentHashMap.entrySet().iterator();
|
|
while (it.hasNext()) {
|
|
j value = it.next().getValue();
|
|
if (value != null) {
|
|
value.b();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public final int b(String str, String str2) {
|
|
CopyOnWriteArrayList<Map<String, a>> c;
|
|
a value;
|
|
CampaignEx l;
|
|
ConcurrentHashMap<String, j> concurrentHashMap = this.c;
|
|
if (concurrentHashMap != null) {
|
|
Iterator<Map.Entry<String, j>> it = concurrentHashMap.entrySet().iterator();
|
|
while (it.hasNext()) {
|
|
j value2 = it.next().getValue();
|
|
if (value2 != null && (c = value2.c()) != null) {
|
|
int size = c.size();
|
|
for (int i = 0; i < size; i++) {
|
|
Map<String, a> map = c.get(i);
|
|
if (map != null) {
|
|
Iterator<Map.Entry<String, a>> it2 = map.entrySet().iterator();
|
|
if (it2.hasNext() && (value = it2.next().getValue()) != null && (l = value.l()) != null) {
|
|
String videoUrlEncode = l.getVideoUrlEncode();
|
|
if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(videoUrlEncode) && str2.equals(videoUrlEncode)) {
|
|
return value.k();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public final void b(boolean z) {
|
|
if (!z) {
|
|
this.b = false;
|
|
} else if (this.b) {
|
|
return;
|
|
}
|
|
ConcurrentHashMap<String, j> concurrentHashMap = this.c;
|
|
if (concurrentHashMap != null) {
|
|
Iterator<Map.Entry<String, j>> it = concurrentHashMap.entrySet().iterator();
|
|
while (it.hasNext()) {
|
|
it.next().getValue().a();
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void a() {
|
|
ConcurrentHashMap<String, j> concurrentHashMap = this.c;
|
|
if (concurrentHashMap != null) {
|
|
for (Map.Entry<String, j> entry : concurrentHashMap.entrySet()) {
|
|
j value = entry.getValue();
|
|
String key = entry.getKey();
|
|
try {
|
|
com.mbridge.msdk.videocommon.d.c a2 = com.mbridge.msdk.videocommon.d.b.a().a(com.mbridge.msdk.foundation.controller.c.m().k(), key);
|
|
if (a2 != null) {
|
|
if (a2.w() == 2) {
|
|
value.b();
|
|
} else {
|
|
value.a();
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
af.b("DownLoadManager", e.getMessage());
|
|
try {
|
|
if (!TextUtils.isEmpty(key)) {
|
|
k d = com.mbridge.msdk.c.h.a().d(com.mbridge.msdk.foundation.controller.c.m().k(), key);
|
|
if (d == null) {
|
|
d = k.e(key);
|
|
}
|
|
if (d.k() == 2) {
|
|
value.b();
|
|
} else {
|
|
value.a();
|
|
}
|
|
}
|
|
} catch (Exception e2) {
|
|
af.b("DownLoadManager", e2.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|