- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
203 lines
6.1 KiB
Java
203 lines
6.1 KiB
Java
package com.applovin.impl;
|
|
|
|
import android.net.Uri;
|
|
import com.applovin.impl.bm;
|
|
import com.applovin.impl.f1;
|
|
import com.applovin.sdk.AppLovinAdLoadListener;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class cm extends bm {
|
|
private final com.applovin.impl.sdk.ad.a r;
|
|
private boolean s;
|
|
private boolean t;
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public String d(String str) {
|
|
if (yp.h(com.applovin.impl.sdk.j.l())) {
|
|
str = yp.b(str);
|
|
}
|
|
return this.r.isOpenMeasurementEnabled() ? this.a.W().a(str) : str;
|
|
}
|
|
|
|
private void m() {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a(this.b, "Caching HTML resources...");
|
|
}
|
|
this.r.b(d(a(a(this.r.j1(), this.r.k1(), this.r.r1(), this.r.X(), this.r.s1()), this.r.X(), this.r)));
|
|
this.r.b(true);
|
|
a(this.r);
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a(this.b, "Finish caching non-video resources for ad #" + this.r.getAdIdNumber());
|
|
}
|
|
this.c.f(this.b, "Ad updated with cachedHTML = " + this.r.j1());
|
|
}
|
|
|
|
private e1 o() {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a(this.b, "Caching HTML resources...");
|
|
}
|
|
return a(this.r.j1(), this.r.X(), new b());
|
|
}
|
|
|
|
public void b(boolean z) {
|
|
this.t = z;
|
|
}
|
|
|
|
public void c(boolean z) {
|
|
this.s = z;
|
|
}
|
|
|
|
public cm(com.applovin.impl.sdk.ad.a aVar, com.applovin.impl.sdk.j jVar, AppLovinAdLoadListener appLovinAdLoadListener) {
|
|
super("TaskCacheAppLovinAd", aVar, jVar, appLovinAdLoadListener);
|
|
this.r = aVar;
|
|
}
|
|
|
|
@Override // com.applovin.impl.bm, java.lang.Runnable
|
|
public void run() {
|
|
super.run();
|
|
boolean I0 = this.r.I0();
|
|
boolean z = this.t;
|
|
if (!I0 && !z) {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a(this.b, "Begin processing for non-streaming ad #" + this.r.getAdIdNumber() + "...");
|
|
}
|
|
if (((Boolean) this.a.a(sj.c1)).booleanValue()) {
|
|
ArrayList arrayList = new ArrayList();
|
|
if (!z3.f()) {
|
|
arrayList.addAll(e());
|
|
}
|
|
e1 o = o();
|
|
if (o != null) {
|
|
arrayList.add(o);
|
|
}
|
|
f1 p = p();
|
|
if (p != null) {
|
|
arrayList.add(p);
|
|
}
|
|
a(arrayList);
|
|
f();
|
|
} else {
|
|
j();
|
|
m();
|
|
n();
|
|
f();
|
|
}
|
|
} else {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a(this.b, "Begin caching for streaming ad #" + this.r.getAdIdNumber() + "...");
|
|
}
|
|
if (((Boolean) this.a.a(sj.c1)).booleanValue()) {
|
|
if (!z3.f()) {
|
|
a(e());
|
|
}
|
|
ArrayList arrayList2 = new ArrayList();
|
|
if (!I0) {
|
|
f();
|
|
e1 o2 = o();
|
|
if (o2 != null) {
|
|
arrayList2.add(o2);
|
|
}
|
|
} else if (this.s) {
|
|
f();
|
|
e1 o3 = o();
|
|
if (o3 != null) {
|
|
arrayList2.add(o3);
|
|
}
|
|
f1 p2 = p();
|
|
if (p2 != null) {
|
|
arrayList2.add(p2);
|
|
}
|
|
} else {
|
|
e1 o4 = o();
|
|
if (o4 != null) {
|
|
a(Arrays.asList(o4));
|
|
}
|
|
f();
|
|
f1 p3 = p();
|
|
if (p3 != null) {
|
|
arrayList2.add(p3);
|
|
}
|
|
}
|
|
a(arrayList2);
|
|
f();
|
|
} else {
|
|
j();
|
|
if (I0) {
|
|
if (this.s) {
|
|
f();
|
|
}
|
|
m();
|
|
if (!this.s) {
|
|
f();
|
|
}
|
|
n();
|
|
} else {
|
|
f();
|
|
m();
|
|
}
|
|
}
|
|
}
|
|
k();
|
|
}
|
|
|
|
private void n() {
|
|
Uri c;
|
|
if (l() || (c = c(this.r.o1())) == null) {
|
|
return;
|
|
}
|
|
if (this.r.K0()) {
|
|
this.r.b(this.r.j1().replaceFirst(this.r.m1(), c.toString()));
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a(this.b, "Replaced video URL with cached video URI in HTML for web video ad");
|
|
}
|
|
}
|
|
this.r.q1();
|
|
this.r.d(c);
|
|
}
|
|
|
|
public class a implements f1.a {
|
|
public a() {
|
|
}
|
|
|
|
@Override // com.applovin.impl.f1.a
|
|
public void a(Uri uri) {
|
|
if (uri != null) {
|
|
if (cm.this.r.K0()) {
|
|
cm.this.r.b(cm.this.r.j1().replaceFirst(cm.this.r.m1(), uri.toString()));
|
|
com.applovin.impl.sdk.n nVar = cm.this.c;
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
cm cmVar = cm.this;
|
|
cmVar.c.a(cmVar.b, "Replaced video URL with cached video URI in HTML for web video ad");
|
|
}
|
|
}
|
|
cm.this.r.q1();
|
|
cm.this.r.d(uri);
|
|
}
|
|
}
|
|
}
|
|
|
|
private f1 p() {
|
|
return b(this.r.o1(), new a());
|
|
}
|
|
|
|
public class b implements bm.e {
|
|
public b() {
|
|
}
|
|
|
|
@Override // com.applovin.impl.bm.e
|
|
public void a(String str) {
|
|
cm.this.r.b(cm.this.d(str));
|
|
cm.this.r.b(true);
|
|
com.applovin.impl.sdk.n nVar = cm.this.c;
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
cm cmVar = cm.this;
|
|
cmVar.c.a(cmVar.b, "Finish caching non-video resources for ad #" + cm.this.r.getAdIdNumber());
|
|
}
|
|
cm cmVar2 = cm.this;
|
|
cmVar2.c.f(cmVar2.b, "Ad updated with cachedHTML = " + cm.this.r.j1());
|
|
}
|
|
}
|
|
}
|