恐 怖 老 奶 奶1破 解 版 中 文 版 无 敌 版 v4.15.00版本的 MD5 值为:2c4218ea002b12a6cce81f33a9f0144d
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.anythink.expressad.advanced.c;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.http.SslError;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
import com.anythink.core.common.b.n;
import com.anythink.expressad.advanced.js.NativeAdvancedJSBridgeImpl;
import com.anythink.expressad.advanced.js.NativeAdvancedJsUtils;
import com.anythink.expressad.advanced.view.ATNativeAdvancedView;
import com.anythink.expressad.advanced.view.ATNativeAdvancedWebview;
import com.anythink.expressad.foundation.g.c.d;
import com.anythink.expressad.foundation.h.o;
import com.anythink.expressad.foundation.h.p;
import com.anythink.expressad.foundation.h.t;
import com.anythink.expressad.foundation.h.x;
import com.anythink.expressad.videocommon.b.e;
import com.anythink.expressad.videocommon.b.i;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
public final class a {
public static String f3783a = "NativeAdvancedLoadManager";
public static final int j = 1;
public static final int k = 2;
public static final int l = 3;
public static final int m = 4;
public static final int n = 5;
public int A;
public String f3784b;
public String f3785c;
public long f3786d;
public com.anythink.expressad.advanced.b.a f3787e;
public ATNativeAdvancedView f3789g;
public com.anythink.expressad.d.c f3790h;
public com.anythink.expressad.foundation.d.c f3791i;
public int o;
public int p;
public int q;
public int r;
public String s;
public int t;
public boolean u;
public volatile boolean v;
public com.anythink.expressad.videocommon.d.b w;
public i.d x;
public i.d y;
public String z;
public String B = "";
public Handler C = new Handler(Looper.getMainLooper()) {
@Override
public final void handleMessage(Message message) {
Object obj;
super.handleMessage(message);
int i2 = message.what;
if (i2 == 1) {
Object obj2 = message.obj;
int i3 = message.arg1;
if (obj2 == null || !(obj2 instanceof com.anythink.expressad.foundation.d.c)) {
return;
}
com.anythink.expressad.foundation.d.c cVar = (com.anythink.expressad.foundation.d.c) obj2;
a.a(a.this, i.a().c(cVar.c()), cVar, i3);
} else if (i2 == 2) {
Object obj3 = message.obj;
if (obj3 == null || !(obj3 instanceof String)) {
return;
}
a aVar = a.this;
String obj4 = obj3.toString();
String unused = a.this.s;
aVar.b(obj4, a.this.t);
} else if (i2 == 3) {
Object obj5 = message.obj;
if (obj5 == null || !(obj5 instanceof com.anythink.expressad.foundation.d.c)) {
return;
}
a aVar2 = a.this;
aVar2.a((com.anythink.expressad.foundation.d.c) obj5, aVar2.t);
} else if (i2 != 4) {
if (i2 == 5 && (obj = message.obj) != null && (obj instanceof com.anythink.expressad.foundation.d.c)) {
if (a.this.f3789g != null) {
a.this.f3789g.setVideoReady(true);
}
a aVar3 = a.this;
aVar3.a((com.anythink.expressad.foundation.d.c) obj, aVar3.t);
}
} else {
Object obj6 = message.obj;
if (obj6 == null || !(obj6 instanceof com.anythink.expressad.foundation.d.c)) {
return;
}
if (a.this.f3789g != null) {
a.this.f3789g.setEndCardReady(true);
}
a aVar4 = a.this;
aVar4.a((com.anythink.expressad.foundation.d.c) obj6, aVar4.t);
}
}
};
public Runnable D = new Runnable() {
@Override
public final void run() {
a aVar = a.this;
String unused = aVar.s;
aVar.b("load timeout", a.this.t);
}
};
public Context f3788f = n.a().f();
public class AnonymousClass10 implements Runnable {
public final ATNativeAdvancedWebview f3793a;
public final String f3794b;
public AnonymousClass10(ATNativeAdvancedWebview aTNativeAdvancedWebview, String str) {
this.f3793a = aTNativeAdvancedWebview;
this.f3794b = str;
}
@Override
public final void run() {
this.f3793a.loadUrl(x.c(this.f3794b));
}
}
public class AnonymousClass9 extends com.anythink.expressad.atsignalcommon.a.b {
public final com.anythink.expressad.foundation.d.c f3819a;
public final int f3820b;
public AnonymousClass9(com.anythink.expressad.foundation.d.c cVar, int i2) {
this.f3819a = cVar;
this.f3820b = i2;
}
@Override
public final void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
o.d("NativeAdvancedLoadManager", "onPageFinished");
if (!this.f3819a.s()) {
a.this.f3789g.setH5Ready(true);
o.d("NativeAdvancedLoadManager", "=======onPageFinished OK");
com.anythink.expressad.advanced.a.a.a(this.f3819a.Z());
a.b(a.this, this.f3819a, this.f3820b);
}
NativeAdvancedJsUtils.fireOnJSBridgeConnected(webView);
}
@Override
public final void onReceivedError(WebView webView, int i2, String str, String str2) {
super.onReceivedError(webView, i2, str, str2);
o.d("NativeAdvancedLoadManager", "onReceivedError: " + i2 + " " + str + " " + str2);
a.this.b(str, this.f3820b);
}
@Override
public final void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
super.onReceivedSslError(webView, sslErrorHandler, sslError);
o.d("NativeAdvancedLoadManager", "onReceivedSslError: " + sslError.getPrimaryError());
a aVar = a.this;
aVar.b("onReceivedSslError:" + sslError.getUrl(), this.f3820b);
}
@Override
public final void readyState(WebView webView, int i2) {
super.readyState(webView, i2);
o.d("NativeAdvancedLoadManager", "=========readyState: ".concat(String.valueOf(i2)));
if (i2 == 1) {
a.this.f3789g.setH5Ready(true);
com.anythink.expressad.advanced.a.a.a(this.f3819a.Z());
a.b(a.this, this.f3819a, this.f3820b);
return;
}
a.this.b("readyState 2", this.f3820b);
}
}
public a(String str, String str2) {
this.f3785c = str;
this.f3784b = str2;
}
private int e() {
return this.p;
}
private void f() {
try {
int i2 = this.A + 1;
this.A = i2;
if (this.f3790h == null || i2 > this.f3790h.t()) {
o.b(f3783a, "onload 重置offset为0");
this.A = 0;
}
String str = f3783a;
o.b(str, "onload 算出 下次的offset是:" + this.A);
} catch (Exception e2) {
e2.printStackTrace();
}
}
public static void g() {
}
private void g(com.anythink.expressad.foundation.d.c cVar) {
this.x = new AnonymousClass8(cVar);
i.a().b(cVar.c(), (i.a) this.x);
}
private void h() {
this.A = 0;
}
private void i() {
this.C.removeCallbacks(this.D);
}
public static void j() {
}
private void b(int i2) {
this.p = i2;
}
private void e(com.anythink.expressad.foundation.d.c cVar) {
com.anythink.expressad.foundation.g.d.b.a(n.a().f()).a(cVar.be(), new AnonymousClass6(cVar));
}
private void h(com.anythink.expressad.foundation.d.c cVar) {
this.w = new AnonymousClass2(cVar);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
e.a().a(this.f3784b, arrayList, com.anythink.expressad.foundation.g.a.aX, this.w);
if (!e.a().a(com.anythink.expressad.foundation.g.a.aX, this.f3784b, cVar.A())) {
o.a(f3783a, " load Video");
e.a().d(this.f3784b);
return;
}
o.a(f3783a, " load Video isReady true");
this.f3789g.setVideoReady(true);
a(cVar, 2);
}
public final com.anythink.expressad.foundation.d.c c() {
return this.f3791i;
}
public class AnonymousClass4 implements com.anythink.expressad.foundation.g.d.c {
public final com.anythink.expressad.foundation.d.c f3799a;
public final int f3800b = 2;
public AnonymousClass4(com.anythink.expressad.foundation.d.c cVar) {
this.f3799a = cVar;
}
@Override
public final void a(Bitmap bitmap, String str) {
o.a(a.f3783a, "giturl 下载成功: ".concat(String.valueOf(str)));
if (a.this.C != null) {
a.this.C.post(new Runnable() {
@Override
public final void run() {
AnonymousClass4 anonymousClass4 = AnonymousClass4.this;
a.this.a(anonymousClass4.f3799a, anonymousClass4.f3800b);
}
});
}
}
@Override
public final void a(String str, String str2) {
o.a(a.f3783a, "gifurl 下载失败: ".concat(String.valueOf(str2)));
if (a.this.C != null) {
a.this.C.post(new Runnable() {
@Override
public final void run() {
AnonymousClass4 anonymousClass4 = AnonymousClass4.this;
a.this.a(anonymousClass4.f3799a, anonymousClass4.f3800b);
}
});
}
}
}
public class AnonymousClass6 implements com.anythink.expressad.foundation.g.d.c {
public final com.anythink.expressad.foundation.d.c f3807a;
public final int f3808b = 2;
public AnonymousClass6(com.anythink.expressad.foundation.d.c cVar) {
this.f3807a = cVar;
}
@Override
public final void a(Bitmap bitmap, String str) {
o.a(a.f3783a, "image 下载成功: ".concat(String.valueOf(str)));
if (a.this.C != null) {
a.this.C.post(new Runnable() {
@Override
public final void run() {
AnonymousClass6 anonymousClass6 = AnonymousClass6.this;
a.this.a(anonymousClass6.f3807a, anonymousClass6.f3808b);
}
});
}
}
@Override
public final void a(String str, String str2) {
o.a(a.f3783a, "image 下载失败: ".concat(String.valueOf(str2)));
if (a.this.C != null) {
a.this.C.post(new Runnable() {
@Override
public final void run() {
AnonymousClass6 anonymousClass6 = AnonymousClass6.this;
a.this.a(anonymousClass6.f3807a, anonymousClass6.f3808b);
}
});
}
}
}
private void c(com.anythink.expressad.foundation.d.c cVar) {
com.anythink.expressad.foundation.g.d.b.a(n.a().f()).a(cVar.y(), new AnonymousClass4(cVar));
}
private void d(com.anythink.expressad.foundation.d.c cVar) {
this.y = new AnonymousClass5(cVar);
i.a().b(cVar.I(), (i.a) this.y);
}
public final void a(com.anythink.expressad.d.c cVar) {
this.f3790h = cVar;
}
public final void b() {
if (this.f3787e != null) {
this.f3787e = null;
}
b("LoadManager release", this.t);
if (this.w != null) {
this.w = null;
}
if (this.x != null) {
this.x = null;
}
}
private void c(String str, int i2) {
b(str, i2);
}
public final void a(ATNativeAdvancedView aTNativeAdvancedView) {
this.f3789g = aTNativeAdvancedView;
}
public class AnonymousClass2 implements com.anythink.expressad.videocommon.d.b {
public final com.anythink.expressad.foundation.d.c f3796a;
public AnonymousClass2(com.anythink.expressad.foundation.d.c cVar) {
this.f3796a = cVar;
}
@Override
public final void a(String str) {
o.a(a.f3783a, "Video 下载成功: ".concat(String.valueOf(str)));
Message obtain = Message.obtain();
obtain.obj = this.f3796a;
obtain.what = 5;
a.this.C.sendMessage(obtain);
}
@Override
public final void a(String str, String str2) {
o.a(a.f3783a, "Video 下载失败: ".concat(String.valueOf(str)));
Message obtain = Message.obtain();
obtain.obj = str;
obtain.what = 2;
a.this.C.sendMessage(obtain);
}
}
public final void a(int i2) {
this.o = i2;
}
public class AnonymousClass8 implements i.d {
public final com.anythink.expressad.foundation.d.c f3816a;
public final int f3817b = 2;
public AnonymousClass8(com.anythink.expressad.foundation.d.c cVar) {
this.f3816a = cVar;
}
@Override
public final void a(String str) {
o.a(a.f3783a, "zip 下载成功: ".concat(String.valueOf(str)));
Message obtain = Message.obtain();
obtain.what = 1;
obtain.obj = this.f3816a;
obtain.arg1 = this.f3817b;
a.this.C.sendMessage(obtain);
}
@Override
public final void a(String str, String str2) {
String str3 = a.f3783a;
o.a(str3, "zip 下载失败: " + str2 + " " + str);
Message obtain = Message.obtain();
obtain.what = 2;
obtain.obj = str;
a.this.C.sendMessage(obtain);
}
}
public final void a(int i2, int i3) {
this.r = i2;
this.q = i3;
}
public class AnonymousClass5 implements i.d {
public final com.anythink.expressad.foundation.d.c f3804a;
public final int f3805b = 2;
public AnonymousClass5(com.anythink.expressad.foundation.d.c cVar) {
this.f3804a = cVar;
}
@Override
public final void a(String str) {
o.a(a.f3783a, "endcard 下载成功: ".concat(String.valueOf(str)));
if (a.this.C != null) {
Message obtain = Message.obtain();
obtain.what = 4;
obtain.obj = this.f3804a;
obtain.arg1 = this.f3805b;
a.this.C.sendMessage(obtain);
}
}
@Override
public final void a(String str, String str2) {
o.a(a.f3783a, "endcard 下载失败: ".concat(String.valueOf(str2)));
if (a.this.f3789g != null) {
a.this.f3789g.setEndCardReady(false);
}
Message obtain = Message.obtain();
obtain.what = 2;
obtain.obj = str;
a.this.C.sendMessage(obtain);
}
}
private void f(final com.anythink.expressad.foundation.d.c cVar) {
File file;
final File file2;
FileOutputStream fileOutputStream = null;
try {
try {
try {
file2 = new File(cVar.d());
try {
if (!file2.exists()) {
String b2 = d.b(com.anythink.expressad.foundation.g.c.a.ANYTHINK_700_HTML);
String a2 = p.a(x.a(cVar.d()));
if (TextUtils.isEmpty(a2)) {
a2 = String.valueOf(System.currentTimeMillis());
}
file = new File(b2, a2.concat(".html"));
try {
if (!file.exists()) {
FileOutputStream fileOutputStream2 = new FileOutputStream(file);
try {
fileOutputStream2.write(("<script>" + com.anythink.expressad.d.b.a.a().b() + "</script>" + cVar.d()).getBytes());
fileOutputStream2.flush();
fileOutputStream = fileOutputStream2;
} catch (Exception e2) {
e = e2;
fileOutputStream = fileOutputStream2;
e.printStackTrace();
cVar.j("");
if (fileOutputStream != null) {
fileOutputStream.close();
}
file2 = file;
if (!file2.exists()) {
}
o.a(f3783a, "渲染 HTML 失败: html file write failed");
b("html file write failed", 2);
} catch (Throwable th) {
th = th;
fileOutputStream = fileOutputStream2;
if (fileOutputStream != null) {
fileOutputStream.close();
}
throw th;
}
}
file2 = file;
} catch (Exception e3) {
e = e3;
}
}
if (fileOutputStream != null) {
fileOutputStream.close();
}
} catch (Exception e4) {
e = e4;
file = file2;
}
} catch (Exception e5) {
e = e5;
file = null;
}
if (!file2.exists() && file2.isFile() && file2.canRead()) {
cVar.b(file2.getAbsolutePath());
o.a(f3783a, "开始渲染 HTML: ");
if (this.C != null) {
this.C.post(new Runnable() {
public final int f3814c = 2;
@Override
public final void run() {
a aVar = a.this;
a.a(aVar, "file:////" + file2.getAbsolutePath(), cVar, this.f3814c);
}
});
return;
}
return;
}
o.a(f3783a, "渲染 HTML 失败: html file write failed");
b("html file write failed", 2);
} catch (Throwable th2) {
th = th2;
}
} catch (Exception e6) {
b(e6.getMessage(), 2);
}
}
private void a(long j2) {
this.C.postDelayed(this.D, j2);
}
public final String a() {
return this.B;
}
public final void a(com.anythink.expressad.advanced.b.a aVar) {
this.f3787e = aVar;
}
private void a(com.anythink.expressad.foundation.d.c cVar) {
this.f3791i = cVar;
if (c.a(this.f3789g, cVar)) {
a(cVar, 2);
return;
}
ATNativeAdvancedView aTNativeAdvancedView = this.f3789g;
if (aTNativeAdvancedView != null) {
aTNativeAdvancedView.clearResState();
}
if (!TextUtils.isEmpty(cVar.c())) {
String str = f3783a;
o.a(str, "开始下载zip: " + cVar.c());
this.x = new AnonymousClass8(cVar);
i.a().b(cVar.c(), (i.a) this.x);
}
if (!TextUtils.isEmpty(cVar.d())) {
String str2 = f3783a;
o.a(str2, "开始下载HTML: " + cVar.d());
f(cVar);
}
if (!TextUtils.isEmpty(cVar.S())) {
String str3 = f3783a;
o.a(str3, "开始下载Video: " + cVar.S());
this.w = new AnonymousClass2(cVar);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
e.a().a(this.f3784b, arrayList, com.anythink.expressad.foundation.g.a.aX, this.w);
if (!e.a().a(com.anythink.expressad.foundation.g.a.aX, this.f3784b, cVar.A())) {
o.a(f3783a, " load Video");
e.a().d(this.f3784b);
} else {
o.a(f3783a, " load Video isReady true");
this.f3789g.setVideoReady(true);
a(cVar, 2);
}
}
if (!TextUtils.isEmpty(cVar.be())) {
String str4 = f3783a;
o.a(str4, "开始下载image: " + cVar.be());
com.anythink.expressad.foundation.g.d.b.a(n.a().f()).a(cVar.be(), new AnonymousClass6(cVar));
}
if (!TextUtils.isEmpty(cVar.I())) {
String str5 = f3783a;
o.a(str5, "开始下载EndCard: " + cVar.I());
this.y = new AnonymousClass5(cVar);
i.a().b(cVar.I(), (i.a) this.y);
}
if (TextUtils.isEmpty(cVar.y())) {
return;
}
String str6 = f3783a;
o.a(str6, "开始下载gitUrl: " + cVar.y());
com.anythink.expressad.foundation.g.d.b.a(n.a().f()).a(cVar.y(), new AnonymousClass4(cVar));
}
public void b(String str, int i2) {
if (this.v) {
return;
}
i();
o.d(f3783a, "real failed: ".concat(String.valueOf(str)));
this.v = true;
com.anythink.expressad.advanced.b.a aVar = this.f3787e;
if (aVar != null) {
aVar.a(str, i2);
}
}
private void b(com.anythink.expressad.foundation.d.c cVar) {
ATNativeAdvancedView aTNativeAdvancedView = this.f3789g;
if (aTNativeAdvancedView != null) {
aTNativeAdvancedView.clearResState();
}
if (!TextUtils.isEmpty(cVar.c())) {
String str = f3783a;
o.a(str, "开始下载zip: " + cVar.c());
this.x = new AnonymousClass8(cVar);
i.a().b(cVar.c(), (i.a) this.x);
}
if (!TextUtils.isEmpty(cVar.d())) {
String str2 = f3783a;
o.a(str2, "开始下载HTML: " + cVar.d());
f(cVar);
}
if (!TextUtils.isEmpty(cVar.S())) {
String str3 = f3783a;
o.a(str3, "开始下载Video: " + cVar.S());
this.w = new AnonymousClass2(cVar);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
e.a().a(this.f3784b, arrayList, com.anythink.expressad.foundation.g.a.aX, this.w);
if (!e.a().a(com.anythink.expressad.foundation.g.a.aX, this.f3784b, cVar.A())) {
o.a(f3783a, " load Video");
e.a().d(this.f3784b);
} else {
o.a(f3783a, " load Video isReady true");
this.f3789g.setVideoReady(true);
a(cVar, 2);
}
}
if (!TextUtils.isEmpty(cVar.be())) {
String str4 = f3783a;
o.a(str4, "开始下载image: " + cVar.be());
com.anythink.expressad.foundation.g.d.b.a(n.a().f()).a(cVar.be(), new AnonymousClass6(cVar));
}
if (!TextUtils.isEmpty(cVar.I())) {
String str5 = f3783a;
o.a(str5, "开始下载EndCard: " + cVar.I());
this.y = new AnonymousClass5(cVar);
i.a().b(cVar.I(), (i.a) this.y);
}
if (TextUtils.isEmpty(cVar.y())) {
return;
}
String str6 = f3783a;
o.a(str6, "开始下载gitUrl: " + cVar.y());
com.anythink.expressad.foundation.g.d.b.a(n.a().f()).a(cVar.y(), new AnonymousClass4(cVar));
}
public void a(com.anythink.expressad.foundation.d.c cVar, int i2) {
if (!c.a(this.f3789g, cVar) || this.v) {
return;
}
i();
this.v = true;
com.anythink.expressad.advanced.b.a aVar = this.f3787e;
if (aVar != null) {
aVar.a(cVar, i2);
}
}
private void b(com.anythink.expressad.foundation.d.c cVar, int i2) {
if (this.f3789g.isH5Ready()) {
a(cVar, i2);
}
}
private void a(String str, int i2) {
b(str, i2);
}
private List<com.anythink.expressad.foundation.d.c> b(com.anythink.expressad.foundation.d.d dVar) {
if (dVar == null || dVar.J == null) {
return null;
}
ArrayList arrayList = new ArrayList();
com.anythink.expressad.foundation.d.c cVar = dVar.J.get(0);
cVar.l(this.f3784b);
this.z = dVar.c();
if (cVar.O() != 99) {
if (TextUtils.isEmpty(cVar.c()) && TextUtils.isEmpty(cVar.d())) {
return arrayList;
}
if (t.a(cVar)) {
cVar.i(t.a(this.f3788f, cVar.ba()) ? 1 : 2);
}
if (cVar.ae() != 1 && t.a(this.f3788f, cVar.ba())) {
String str = f3783a;
o.d(str, "onload: " + cVar.bb() + " has been installed.");
if (t.a(cVar)) {
arrayList.add(cVar);
return arrayList;
}
return arrayList;
}
arrayList.add(cVar);
return arrayList;
}
return arrayList;
}
private void a(String str, com.anythink.expressad.foundation.d.c cVar, int i2) {
ATNativeAdvancedView aTNativeAdvancedView = this.f3789g;
if (aTNativeAdvancedView == null || aTNativeAdvancedView.getAdvancedNativeWebview() == null) {
return;
}
NativeAdvancedJSBridgeImpl nativeAdvancedJSBridgeImpl = new NativeAdvancedJSBridgeImpl(this.f3789g.getContext(), this.f3785c, this.f3784b);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
nativeAdvancedJSBridgeImpl.setCampaignList(arrayList);
nativeAdvancedJSBridgeImpl.setAllowSkip(this.o);
nativeAdvancedJSBridgeImpl.setCountdownS(this.p);
this.f3789g.setAdvancedNativeJSBridgeImpl(nativeAdvancedJSBridgeImpl);
System.currentTimeMillis();
ATNativeAdvancedWebview advancedNativeWebview = this.f3789g.getAdvancedNativeWebview();
if (advancedNativeWebview == null) {
b("webview is null", i2);
} else if (advancedNativeWebview != null && advancedNativeWebview.isDestroyed()) {
b("webview is destroyed", i2);
} else {
advancedNativeWebview.setWebViewListener(new AnonymousClass9(cVar, i2));
if (!advancedNativeWebview.isDestroyed()) {
o.d(f3783a, "=======开始渲染: ".concat(String.valueOf(str)));
Handler handler = this.C;
if (handler != null) {
handler.post(new AnonymousClass10(advancedNativeWebview, str));
return;
}
return;
}
b("webview has destory", i2);
}
}
public static void b(a aVar, com.anythink.expressad.foundation.d.c cVar, int i2) {
if (aVar.f3789g.isH5Ready()) {
aVar.a(cVar, i2);
}
}
public final String a(String str) {
int k2;
if (this.f3791i != null) {
try {
com.anythink.expressad.videocommon.b.c a2 = e.a().a(this.f3784b, this.f3791i.aZ() + this.f3791i.S() + this.f3791i.B());
if (a2 == null || (k2 = a2.k()) != 5) {
return str;
}
String e2 = a2.e();
if (new File(e2).exists()) {
String str2 = f3783a;
o.d(str2, "本地已下载完 拿本地播放地址:" + e2 + " state:" + k2);
return e2;
}
return str;
} catch (Exception e3) {
e3.printStackTrace();
return str;
}
}
return "";
}
public final void a(com.anythink.expressad.foundation.d.d dVar) {
ArrayList arrayList;
if (dVar == null || dVar.J == null) {
arrayList = null;
} else {
arrayList = new ArrayList();
com.anythink.expressad.foundation.d.c cVar = dVar.J.get(0);
cVar.l(this.f3784b);
this.z = dVar.c();
if (cVar.O() != 99 && (!TextUtils.isEmpty(cVar.c()) || !TextUtils.isEmpty(cVar.d()))) {
if (t.a(cVar)) {
cVar.i(t.a(this.f3788f, cVar.ba()) ? 1 : 2);
}
if (cVar.ae() != 1 && t.a(this.f3788f, cVar.ba())) {
String str = f3783a;
o.d(str, "onload: " + cVar.bb() + " has been installed.");
if (t.a(cVar)) {
arrayList.add(cVar);
}
} else {
arrayList.add(cVar);
}
}
}
if (arrayList != null && arrayList.size() > 0) {
try {
int i2 = this.A + 1;
this.A = i2;
if (this.f3790h == null || i2 > this.f3790h.t()) {
o.b(f3783a, "onload 重置offset为0");
this.A = 0;
}
String str2 = f3783a;
o.b(str2, "onload 算出 下次的offset是:" + this.A);
} catch (Exception e2) {
e2.printStackTrace();
}
String str3 = f3783a;
o.b(str3, "onload load成功 size:" + arrayList.size());
com.anythink.expressad.foundation.d.c cVar2 = (com.anythink.expressad.foundation.d.c) arrayList.get(0);
if (TextUtils.isEmpty(cVar2.c()) && (TextUtils.isEmpty(cVar2.d()) || !cVar2.d().contains("<MBTPLMARK>"))) {
cVar2.a(false);
cVar2.b(true);
} else {
cVar2.a(true);
cVar2.b(false);
}
this.f3791i = cVar2;
if (c.a(this.f3789g, cVar2)) {
a(cVar2, 2);
return;
}
ATNativeAdvancedView aTNativeAdvancedView = this.f3789g;
if (aTNativeAdvancedView != null) {
aTNativeAdvancedView.clearResState();
}
if (!TextUtils.isEmpty(cVar2.c())) {
String str4 = f3783a;
o.a(str4, "开始下载zip: " + cVar2.c());
this.x = new AnonymousClass8(cVar2);
i.a().b(cVar2.c(), (i.a) this.x);
}
if (!TextUtils.isEmpty(cVar2.d())) {
String str5 = f3783a;
o.a(str5, "开始下载HTML: " + cVar2.d());
f(cVar2);
}
if (!TextUtils.isEmpty(cVar2.S())) {
String str6 = f3783a;
o.a(str6, "开始下载Video: " + cVar2.S());
this.w = new AnonymousClass2(cVar2);
ArrayList arrayList2 = new ArrayList();
arrayList2.add(cVar2);
e.a().a(this.f3784b, arrayList2, com.anythink.expressad.foundation.g.a.aX, this.w);
if (!e.a().a(com.anythink.expressad.foundation.g.a.aX, this.f3784b, cVar2.A())) {
o.a(f3783a, " load Video");
e.a().d(this.f3784b);
} else {
o.a(f3783a, " load Video isReady true");
this.f3789g.setVideoReady(true);
a(cVar2, 2);
}
}
if (!TextUtils.isEmpty(cVar2.be())) {
String str7 = f3783a;
o.a(str7, "开始下载image: " + cVar2.be());
com.anythink.expressad.foundation.g.d.b.a(n.a().f()).a(cVar2.be(), new AnonymousClass6(cVar2));
}
if (!TextUtils.isEmpty(cVar2.I())) {
String str8 = f3783a;
o.a(str8, "开始下载EndCard: " + cVar2.I());
this.y = new AnonymousClass5(cVar2);
i.a().b(cVar2.I(), (i.a) this.y);
}
if (TextUtils.isEmpty(cVar2.y())) {
return;
}
String str9 = f3783a;
o.a(str9, "开始下载gitUrl: " + cVar2.y());
com.anythink.expressad.foundation.g.d.b.a(n.a().f()).a(cVar2.y(), new AnonymousClass4(cVar2));
return;
}
o.b(f3783a, "onload load失败 返回的compaign没有可以用的");
b("invalid campaign", 2);
}
public static void a(a aVar, String str, com.anythink.expressad.foundation.d.c cVar, int i2) {
ATNativeAdvancedView aTNativeAdvancedView = aVar.f3789g;
if (aTNativeAdvancedView == null || aTNativeAdvancedView.getAdvancedNativeWebview() == null) {
return;
}
NativeAdvancedJSBridgeImpl nativeAdvancedJSBridgeImpl = new NativeAdvancedJSBridgeImpl(aVar.f3789g.getContext(), aVar.f3785c, aVar.f3784b);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
nativeAdvancedJSBridgeImpl.setCampaignList(arrayList);
nativeAdvancedJSBridgeImpl.setAllowSkip(aVar.o);
nativeAdvancedJSBridgeImpl.setCountdownS(aVar.p);
aVar.f3789g.setAdvancedNativeJSBridgeImpl(nativeAdvancedJSBridgeImpl);
System.currentTimeMillis();
ATNativeAdvancedWebview advancedNativeWebview = aVar.f3789g.getAdvancedNativeWebview();
if (advancedNativeWebview == null) {
aVar.b("webview is null", i2);
} else if (advancedNativeWebview != null && advancedNativeWebview.isDestroyed()) {
aVar.b("webview is destroyed", i2);
} else {
advancedNativeWebview.setWebViewListener(new AnonymousClass9(cVar, i2));
if (!advancedNativeWebview.isDestroyed()) {
o.d(f3783a, "=======开始渲染: ".concat(String.valueOf(str)));
Handler handler = aVar.C;
if (handler != null) {
handler.post(new AnonymousClass10(advancedNativeWebview, str));
return;
}
return;
}
aVar.b("webview has destory", i2);
}
}
}