- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
224 lines
9.4 KiB
Java
224 lines
9.4 KiB
Java
package com.fyber.inneractive.sdk.response;
|
|
|
|
import android.text.TextUtils;
|
|
import com.fyber.inneractive.sdk.config.IAConfigManager;
|
|
import com.fyber.inneractive.sdk.config.e0;
|
|
import com.fyber.inneractive.sdk.config.enums.UnitDisplayType;
|
|
import com.fyber.inneractive.sdk.external.InneractiveAdRequest;
|
|
import com.fyber.inneractive.sdk.model.vast.q;
|
|
import com.fyber.inneractive.sdk.model.vast.t;
|
|
import com.fyber.inneractive.sdk.model.vast.w;
|
|
import com.fyber.inneractive.sdk.model.vast.x;
|
|
import com.fyber.inneractive.sdk.network.r;
|
|
import com.fyber.inneractive.sdk.network.s;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import com.fyber.inneractive.sdk.util.a0;
|
|
import com.fyber.inneractive.sdk.util.s;
|
|
import java.io.StringReader;
|
|
import java.util.ArrayList;
|
|
import java.util.LinkedHashMap;
|
|
import javax.xml.parsers.DocumentBuilderFactory;
|
|
import org.json.JSONArray;
|
|
import org.w3c.dom.Document;
|
|
import org.w3c.dom.Node;
|
|
import org.xml.sax.InputSource;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class d extends b {
|
|
public g e;
|
|
public e0 f;
|
|
public com.fyber.inneractive.sdk.model.vast.e g;
|
|
public final ArrayList h = new ArrayList();
|
|
public int i;
|
|
public w j;
|
|
|
|
@Override // com.fyber.inneractive.sdk.response.b
|
|
public final e a() {
|
|
g gVar = new g();
|
|
this.a = gVar;
|
|
this.e = gVar;
|
|
return gVar;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.response.b
|
|
public final void c() {
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.response.b
|
|
public final void a(String str, e0 e0Var) throws Exception {
|
|
this.f = e0Var;
|
|
if (e0Var != null && e0Var.f != null) {
|
|
this.e.K = System.currentTimeMillis();
|
|
this.e.A = this.f.b;
|
|
this.i = IAConfigManager.L.i.b;
|
|
try {
|
|
a(str, 0);
|
|
a(this.g, this.h);
|
|
return;
|
|
} catch (com.fyber.inneractive.sdk.flow.vast.i e) {
|
|
this.e.i = e.getMessage();
|
|
this.e.j = e.getCause().getMessage();
|
|
return;
|
|
} catch (InterruptedException e2) {
|
|
throw e2;
|
|
} catch (Exception e3) {
|
|
this.e.j = String.format("%s", e3.getMessage());
|
|
g gVar = this.e;
|
|
gVar.i = "VastErrorInvalidFile";
|
|
gVar.x = e3;
|
|
if (IAlog.a == 2) {
|
|
e3.printStackTrace();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
this.a.i = "ErrorConfigurationMismatch";
|
|
}
|
|
|
|
public final void a(String str, int i) throws com.fyber.inneractive.sdk.flow.vast.i, Exception {
|
|
t tVar;
|
|
try {
|
|
String replaceFirst = str.replaceFirst("<\\?.*\\?>", "");
|
|
DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
|
|
newInstance.setCoalescing(true);
|
|
Document parse = newInstance.newDocumentBuilder().parse(new InputSource(new StringReader(replaceFirst)));
|
|
if (parse != null) {
|
|
Node firstChild = parse.getFirstChild();
|
|
if (firstChild.getNodeName().equalsIgnoreCase("VAST")) {
|
|
tVar = t.a(firstChild);
|
|
} else {
|
|
IAlog.a("XML does not contain a VAST tag as its first child!", new Object[0]);
|
|
throw new Exception("XML does not contain a VAST tag as its first child!");
|
|
}
|
|
} else {
|
|
tVar = null;
|
|
}
|
|
try {
|
|
if (this.j == null) {
|
|
this.j = new w(tVar.a);
|
|
} else {
|
|
w wVar = new w(tVar.a);
|
|
if (wVar.compareTo(this.j) >= 0) {
|
|
this.j = wVar;
|
|
}
|
|
}
|
|
} catch (w.a unused) {
|
|
}
|
|
ArrayList arrayList = tVar.b;
|
|
if (arrayList != null && !arrayList.isEmpty()) {
|
|
com.fyber.inneractive.sdk.model.vast.e eVar = (com.fyber.inneractive.sdk.model.vast.e) arrayList.get(0);
|
|
x xVar = eVar.b;
|
|
if (xVar != null) {
|
|
IAlog.a("Vast response parser: found VAST wrapper #%d", Integer.valueOf(this.h.size()));
|
|
int size = this.h.size();
|
|
int i2 = this.i;
|
|
if (size < i2) {
|
|
this.h.add(eVar);
|
|
String str2 = xVar.h;
|
|
if (!TextUtils.isEmpty(str2)) {
|
|
if (a0.f(str2)) {
|
|
String a = s.a(str2, 3000, 5000);
|
|
if (TextUtils.isEmpty(a)) {
|
|
throw new com.fyber.inneractive.sdk.flow.vast.i("VastErrorInvalidFile", "Failed getting data from ad tag URI");
|
|
}
|
|
int i3 = this.i - i;
|
|
if (i3 > 0) {
|
|
xVar.f = i3;
|
|
this.e.P.put(str2, a);
|
|
a(a, i + 1);
|
|
return;
|
|
}
|
|
throw new com.fyber.inneractive.sdk.flow.vast.i("VastErrorInvalidFile", "Invalid level for wrapper");
|
|
}
|
|
IAlog.a("Vast response parser: Unsecure Wrapper URL. Aborting! url: %s", str2);
|
|
throw new com.fyber.inneractive.sdk.flow.vast.i("VastErrorUnsecure", "Unsecure ad tag URI for wrapper");
|
|
}
|
|
IAlog.a("Vast response parser: found an empty tag uri in wrapper! aborting!", new Object[0]);
|
|
throw new com.fyber.inneractive.sdk.flow.vast.i("VastErrorInvalidFile", "No ad tag URI for wrapper");
|
|
}
|
|
IAlog.a("Vast response parser: too many vast wrappers! Only %d allowed. stopping", Integer.valueOf(i2));
|
|
throw new com.fyber.inneractive.sdk.flow.vast.i("VastErrorTooManyWrappers", "More than " + this.i + " found");
|
|
}
|
|
if (eVar.c == null) {
|
|
throw new com.fyber.inneractive.sdk.flow.vast.i("VastErrorInvalidFile", "A top level ad with no wrapper on inline found!");
|
|
}
|
|
this.g = eVar;
|
|
return;
|
|
}
|
|
IAlog.a("Vast response parser: no ads found in model. aborting", new Object[0]);
|
|
throw new com.fyber.inneractive.sdk.flow.vast.i("ErrorNoMediaFiles", "No ads found in model. Empty Vast?");
|
|
} catch (Exception e) {
|
|
IAlog.a("Failed parsing Vast file! parsing error = %s", e.getMessage());
|
|
throw new com.fyber.inneractive.sdk.flow.vast.i("VastErrorInvalidFile", e.getMessage());
|
|
}
|
|
}
|
|
|
|
public final void a(com.fyber.inneractive.sdk.model.vast.e eVar, ArrayList arrayList) throws com.fyber.inneractive.sdk.flow.vast.i {
|
|
com.fyber.inneractive.sdk.flow.vast.d dVar = new com.fyber.inneractive.sdk.flow.vast.d();
|
|
int intValue = this.f.f.c.intValue();
|
|
int intValue2 = this.f.f.b.intValue();
|
|
int intValue3 = this.f.f.g.intValue();
|
|
dVar.a = intValue;
|
|
dVar.b = intValue2;
|
|
dVar.c = intValue3;
|
|
if (UnitDisplayType.VERTICAL.equals(this.f.f.j)) {
|
|
dVar.d = true;
|
|
}
|
|
if (this.f.f.k.contains(2)) {
|
|
dVar.e = true;
|
|
}
|
|
try {
|
|
w wVar = this.j;
|
|
this.e.L = dVar.a(eVar, arrayList, wVar != null ? wVar.b : "");
|
|
} catch (com.fyber.inneractive.sdk.flow.vast.i e) {
|
|
g gVar = this.e;
|
|
gVar.getClass();
|
|
gVar.i = e.getMessage();
|
|
}
|
|
com.fyber.inneractive.sdk.model.vast.b bVar = this.e.L;
|
|
if (bVar != null) {
|
|
String str = bVar.o;
|
|
if (!TextUtils.isEmpty(str) && a0.f(str)) {
|
|
new s.a(r.VAST_EVENT_DVC_DETECTED, (InneractiveAdRequest) null, this.a, (JSONArray) null).a("templateURL", str).a((String) null);
|
|
} else if (!TextUtils.isEmpty(str)) {
|
|
this.e.L.o = "";
|
|
com.fyber.inneractive.sdk.player.ui.remote.e.a(com.fyber.inneractive.sdk.web.remoteui.a.SSL_ERROR, (InneractiveAdRequest) null, this.a, "Unsecured URL", str);
|
|
}
|
|
}
|
|
g gVar2 = this.e;
|
|
LinkedHashMap linkedHashMap = dVar.f;
|
|
if (linkedHashMap != null) {
|
|
gVar2.M.putAll(linkedHashMap);
|
|
} else {
|
|
gVar2.getClass();
|
|
}
|
|
g gVar3 = this.e;
|
|
ArrayList arrayList2 = dVar.g;
|
|
if (arrayList2 != null) {
|
|
gVar3.N.addAll(arrayList2);
|
|
} else {
|
|
gVar3.getClass();
|
|
}
|
|
g gVar4 = this.e;
|
|
ArrayList arrayList3 = dVar.j;
|
|
if (arrayList3 != null) {
|
|
gVar4.O.addAll(arrayList3);
|
|
} else {
|
|
gVar4.getClass();
|
|
}
|
|
if (IAlog.a == 2) {
|
|
LinkedHashMap linkedHashMap2 = dVar.f;
|
|
if (linkedHashMap2.size() > 0) {
|
|
IAlog.e(" VParser: Unsupported media files:", new Object[0]);
|
|
for (q qVar : linkedHashMap2.keySet()) {
|
|
IAlog.e("VParser: %s", qVar);
|
|
IAlog.e("VParser: reason = %s", linkedHashMap2.get(qVar));
|
|
}
|
|
return;
|
|
}
|
|
IAlog.e("VParser: Unsupported media files: none", new Object[0]);
|
|
}
|
|
}
|
|
}
|