笔 趣 阁 破 解 版2023 v4.18.00版本的 MD5 值为:35c48a89f5572ff5a659afd7c5a81cad
以下内容为反编译后的 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.m;
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.n;
import com.anythink.expressad.foundation.h.o;
import com.anythink.expressad.foundation.h.s;
import com.anythink.expressad.foundation.h.w;
import com.anythink.expressad.videocommon.b.g;
import com.bumptech.glide.load.engine.GlideException;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
public final class a {
public static String f4748a = "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 f4749b;
public String f4750c;
public long f4751d;
public com.anythink.expressad.advanced.b.a e;
public ATNativeAdvancedView g;
public com.anythink.expressad.d.c h;
public com.anythink.expressad.foundation.d.c i;
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 g.d x;
public g.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 i = message.what;
if (i == 1) {
Object obj2 = message.obj;
int i2 = 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, g.a().c(cVar.c()), cVar, i2);
} else if (i == 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 (i == 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 (i != 4) {
if (i == 5 && (obj = message.obj) != null && (obj instanceof com.anythink.expressad.foundation.d.c)) {
if (a.this.g != null) {
a.this.g.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.g != null) {
a.this.g.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 f = m.a().e();
public class AnonymousClass10 implements Runnable {
public final ATNativeAdvancedWebview f4753a;
public final String f4754b;
public AnonymousClass10(ATNativeAdvancedWebview aTNativeAdvancedWebview, String str) {
this.f4753a = aTNativeAdvancedWebview;
this.f4754b = str;
}
@Override
public final void run() {
this.f4753a.loadUrl(w.c(this.f4754b));
}
}
public class AnonymousClass9 extends com.anythink.expressad.atsignalcommon.a.b {
public final com.anythink.expressad.foundation.d.c f4779a;
public final int f4780b;
public AnonymousClass9(com.anythink.expressad.foundation.d.c cVar, int i) {
this.f4779a = cVar;
this.f4780b = i;
}
@Override
public final void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
n.d("NativeAdvancedLoadManager", "onPageFinished");
if (!this.f4779a.r()) {
a.this.g.setH5Ready(true);
n.d("NativeAdvancedLoadManager", "=======onPageFinished OK");
com.anythink.expressad.advanced.a.a.a(this.f4779a.aa());
a.b(a.this, this.f4779a, this.f4780b);
}
NativeAdvancedJsUtils.fireOnJSBridgeConnected(webView);
}
@Override
public final void onReceivedError(WebView webView, int i, String str, String str2) {
super.onReceivedError(webView, i, str, str2);
n.d("NativeAdvancedLoadManager", "onReceivedError: " + i + GlideException.a.v + str + GlideException.a.v + str2);
a.this.b(str, this.f4780b);
}
@Override
public final void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
super.onReceivedSslError(webView, sslErrorHandler, sslError);
n.d("NativeAdvancedLoadManager", "onReceivedSslError: " + sslError.getPrimaryError());
a aVar = a.this;
aVar.b("onReceivedSslError:" + sslError.getUrl(), this.f4780b);
}
@Override
public final void readyState(WebView webView, int i) {
super.readyState(webView, i);
n.d("NativeAdvancedLoadManager", "=========readyState: ".concat(String.valueOf(i)));
if (i == 1) {
a.this.g.setH5Ready(true);
com.anythink.expressad.advanced.a.a.a(this.f4779a.aa());
a.b(a.this, this.f4779a, this.f4780b);
return;
}
a.this.b("readyState 2", this.f4780b);
}
}
public a(String str, String str2) {
this.f4750c = str;
this.f4749b = str2;
}
private int e() {
return this.p;
}
private void f() {
try {
int i = this.A + 1;
this.A = i;
if (this.h == null || i > this.h.t()) {
n.b(f4748a, "onload 重置offset为0");
this.A = 0;
}
String str = f4748a;
n.b(str, "onload 算出 下次的offset是:" + this.A);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void g() {
}
private void g(com.anythink.expressad.foundation.d.c cVar) {
this.x = new AnonymousClass8(cVar);
g.a().b(cVar.c(), (g.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 i) {
this.p = i;
}
private void e(com.anythink.expressad.foundation.d.c cVar) {
com.anythink.expressad.foundation.g.d.b.a(m.a().e()).a(cVar.bf(), 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);
com.anythink.expressad.videocommon.b.c.a().a(this.f4749b, arrayList, com.anythink.expressad.foundation.g.a.aX, this.w);
if (!com.anythink.expressad.videocommon.b.c.a().a(com.anythink.expressad.foundation.g.a.aX, this.f4749b, cVar.y())) {
n.a(f4748a, " load Video");
com.anythink.expressad.videocommon.b.c.a().d(this.f4749b);
return;
}
n.a(f4748a, " load Video isReady true");
this.g.setVideoReady(true);
a(cVar, 2);
}
public final com.anythink.expressad.foundation.d.c c() {
return this.i;
}
public class AnonymousClass4 implements com.anythink.expressad.foundation.g.d.c {
public final com.anythink.expressad.foundation.d.c f4759a;
public final int f4760b = 2;
public AnonymousClass4(com.anythink.expressad.foundation.d.c cVar) {
this.f4759a = cVar;
}
@Override
public final void a(Bitmap bitmap, String str) {
n.a(a.f4748a, "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.f4759a, anonymousClass4.f4760b);
}
});
}
}
@Override
public final void a(String str, String str2) {
n.a(a.f4748a, "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.f4759a, anonymousClass4.f4760b);
}
});
}
}
}
public class AnonymousClass6 implements com.anythink.expressad.foundation.g.d.c {
public final com.anythink.expressad.foundation.d.c f4767a;
public final int f4768b = 2;
public AnonymousClass6(com.anythink.expressad.foundation.d.c cVar) {
this.f4767a = cVar;
}
@Override
public final void a(Bitmap bitmap, String str) {
n.a(a.f4748a, "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.f4767a, anonymousClass6.f4768b);
}
});
}
}
@Override
public final void a(String str, String str2) {
n.a(a.f4748a, "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.f4767a, anonymousClass6.f4768b);
}
});
}
}
}
private void c(com.anythink.expressad.foundation.d.c cVar) {
com.anythink.expressad.foundation.g.d.b.a(m.a().e()).a(cVar.w(), new AnonymousClass4(cVar));
}
private void d(com.anythink.expressad.foundation.d.c cVar) {
this.y = new AnonymousClass5(cVar);
g.a().b(cVar.G(), (g.a) this.y);
}
public final void a(com.anythink.expressad.d.c cVar) {
this.h = cVar;
}
public final void b() {
if (this.e != null) {
this.e = 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 i) {
b(str, i);
}
public final void a(ATNativeAdvancedView aTNativeAdvancedView) {
this.g = aTNativeAdvancedView;
}
public class AnonymousClass2 implements com.anythink.expressad.videocommon.d.b {
public final com.anythink.expressad.foundation.d.c f4756a;
public AnonymousClass2(com.anythink.expressad.foundation.d.c cVar) {
this.f4756a = cVar;
}
@Override
public final void a(String str) {
n.a(a.f4748a, "Video 下载成功: ".concat(String.valueOf(str)));
Message obtain = Message.obtain();
obtain.obj = this.f4756a;
obtain.what = 5;
a.this.C.sendMessage(obtain);
}
@Override
public final void a(String str, String str2) {
n.a(a.f4748a, "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 i) {
this.o = i;
}
public class AnonymousClass8 implements g.d {
public final com.anythink.expressad.foundation.d.c f4776a;
public final int f4777b = 2;
public AnonymousClass8(com.anythink.expressad.foundation.d.c cVar) {
this.f4776a = cVar;
}
@Override
public final void a(String str) {
n.a(a.f4748a, "zip 下载成功: ".concat(String.valueOf(str)));
Message obtain = Message.obtain();
obtain.what = 1;
obtain.obj = this.f4776a;
obtain.arg1 = this.f4777b;
a.this.C.sendMessage(obtain);
}
@Override
public final void a(String str, String str2) {
String str3 = a.f4748a;
n.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 i, int i2) {
this.r = i;
this.q = i2;
}
public class AnonymousClass5 implements g.d {
public final com.anythink.expressad.foundation.d.c f4764a;
public final int f4765b = 2;
public AnonymousClass5(com.anythink.expressad.foundation.d.c cVar) {
this.f4764a = cVar;
}
@Override
public final void a(String str) {
n.a(a.f4748a, "endcard 下载成功: ".concat(String.valueOf(str)));
if (a.this.C != null) {
Message obtain = Message.obtain();
obtain.what = 4;
obtain.obj = this.f4764a;
obtain.arg1 = this.f4765b;
a.this.C.sendMessage(obtain);
}
}
@Override
public final void a(String str, String str2) {
n.a(a.f4748a, "endcard 下载失败: ".concat(String.valueOf(str2)));
if (a.this.g != null) {
a.this.g.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 = o.a(w.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 e) {
e = e;
fileOutputStream = fileOutputStream2;
e.printStackTrace();
cVar.j("");
if (fileOutputStream != null) {
fileOutputStream.close();
}
file2 = file;
if (!file2.exists()) {
}
n.a(f4748a, "渲染 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 e2) {
e = e2;
}
}
if (fileOutputStream != null) {
fileOutputStream.close();
}
} catch (Exception e3) {
e = e3;
file = file2;
}
} catch (Exception e4) {
e = e4;
file = null;
}
if (!file2.exists() && file2.isFile() && file2.canRead()) {
cVar.b(file2.getAbsolutePath());
n.a(f4748a, "开始渲染 HTML: ");
if (this.C != null) {
this.C.post(new Runnable() {
public final int f4774c = 2;
@Override
public final void run() {
a aVar = a.this;
a.a(aVar, "file:////" + file2.getAbsolutePath(), cVar, this.f4774c);
}
});
return;
}
return;
}
n.a(f4748a, "渲染 HTML 失败: html file write failed");
b("html file write failed", 2);
} catch (Throwable th2) {
th = th2;
}
} catch (Exception e5) {
b(e5.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.e = aVar;
}
private void a(com.anythink.expressad.foundation.d.c cVar) {
this.i = cVar;
if (c.a(this.g, cVar)) {
a(cVar, 2);
return;
}
ATNativeAdvancedView aTNativeAdvancedView = this.g;
if (aTNativeAdvancedView != null) {
aTNativeAdvancedView.clearResState();
}
if (!TextUtils.isEmpty(cVar.c())) {
String str = f4748a;
n.a(str, "开始下载zip: " + cVar.c());
this.x = new AnonymousClass8(cVar);
g.a().b(cVar.c(), (g.a) this.x);
}
if (!TextUtils.isEmpty(cVar.d())) {
String str2 = f4748a;
n.a(str2, "开始下载HTML: " + cVar.d());
f(cVar);
}
if (!TextUtils.isEmpty(cVar.R())) {
String str3 = f4748a;
n.a(str3, "开始下载Video: " + cVar.R());
this.w = new AnonymousClass2(cVar);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
com.anythink.expressad.videocommon.b.c.a().a(this.f4749b, arrayList, com.anythink.expressad.foundation.g.a.aX, this.w);
if (!com.anythink.expressad.videocommon.b.c.a().a(com.anythink.expressad.foundation.g.a.aX, this.f4749b, cVar.y())) {
n.a(f4748a, " load Video");
com.anythink.expressad.videocommon.b.c.a().d(this.f4749b);
} else {
n.a(f4748a, " load Video isReady true");
this.g.setVideoReady(true);
a(cVar, 2);
}
}
if (!TextUtils.isEmpty(cVar.bf())) {
String str4 = f4748a;
n.a(str4, "开始下载image: " + cVar.bf());
com.anythink.expressad.foundation.g.d.b.a(m.a().e()).a(cVar.bf(), new AnonymousClass6(cVar));
}
if (!TextUtils.isEmpty(cVar.G())) {
String str5 = f4748a;
n.a(str5, "开始下载EndCard: " + cVar.G());
this.y = new AnonymousClass5(cVar);
g.a().b(cVar.G(), (g.a) this.y);
}
if (TextUtils.isEmpty(cVar.w())) {
return;
}
String str6 = f4748a;
n.a(str6, "开始下载gitUrl: " + cVar.w());
com.anythink.expressad.foundation.g.d.b.a(m.a().e()).a(cVar.w(), new AnonymousClass4(cVar));
}
public void b(String str, int i) {
if (this.v) {
return;
}
i();
n.d(f4748a, "real failed: ".concat(String.valueOf(str)));
this.v = true;
com.anythink.expressad.advanced.b.a aVar = this.e;
if (aVar != null) {
aVar.a(str, i);
}
}
private void b(com.anythink.expressad.foundation.d.c cVar) {
ATNativeAdvancedView aTNativeAdvancedView = this.g;
if (aTNativeAdvancedView != null) {
aTNativeAdvancedView.clearResState();
}
if (!TextUtils.isEmpty(cVar.c())) {
String str = f4748a;
n.a(str, "开始下载zip: " + cVar.c());
this.x = new AnonymousClass8(cVar);
g.a().b(cVar.c(), (g.a) this.x);
}
if (!TextUtils.isEmpty(cVar.d())) {
String str2 = f4748a;
n.a(str2, "开始下载HTML: " + cVar.d());
f(cVar);
}
if (!TextUtils.isEmpty(cVar.R())) {
String str3 = f4748a;
n.a(str3, "开始下载Video: " + cVar.R());
this.w = new AnonymousClass2(cVar);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
com.anythink.expressad.videocommon.b.c.a().a(this.f4749b, arrayList, com.anythink.expressad.foundation.g.a.aX, this.w);
if (!com.anythink.expressad.videocommon.b.c.a().a(com.anythink.expressad.foundation.g.a.aX, this.f4749b, cVar.y())) {
n.a(f4748a, " load Video");
com.anythink.expressad.videocommon.b.c.a().d(this.f4749b);
} else {
n.a(f4748a, " load Video isReady true");
this.g.setVideoReady(true);
a(cVar, 2);
}
}
if (!TextUtils.isEmpty(cVar.bf())) {
String str4 = f4748a;
n.a(str4, "开始下载image: " + cVar.bf());
com.anythink.expressad.foundation.g.d.b.a(m.a().e()).a(cVar.bf(), new AnonymousClass6(cVar));
}
if (!TextUtils.isEmpty(cVar.G())) {
String str5 = f4748a;
n.a(str5, "开始下载EndCard: " + cVar.G());
this.y = new AnonymousClass5(cVar);
g.a().b(cVar.G(), (g.a) this.y);
}
if (TextUtils.isEmpty(cVar.w())) {
return;
}
String str6 = f4748a;
n.a(str6, "开始下载gitUrl: " + cVar.w());
com.anythink.expressad.foundation.g.d.b.a(m.a().e()).a(cVar.w(), new AnonymousClass4(cVar));
}
public void a(com.anythink.expressad.foundation.d.c cVar, int i) {
if (!c.a(this.g, cVar) || this.v) {
return;
}
i();
this.v = true;
com.anythink.expressad.advanced.b.a aVar = this.e;
if (aVar != null) {
aVar.a(cVar, i);
}
}
private void b(com.anythink.expressad.foundation.d.c cVar, int i) {
if (this.g.isH5Ready()) {
a(cVar, i);
}
}
private void a(String str, int i) {
b(str, i);
}
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.f4749b);
this.z = dVar.c();
if (cVar.N() != 99) {
if (TextUtils.isEmpty(cVar.c()) && TextUtils.isEmpty(cVar.d())) {
return arrayList;
}
if (s.a(cVar)) {
cVar.h(s.a(this.f, cVar.bb()) ? 1 : 2);
}
if (cVar.ag() != 1 && s.a(this.f, cVar.bb())) {
String str = f4748a;
n.d(str, "onload: " + cVar.bc() + " has been installed.");
if (s.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 i) {
ATNativeAdvancedView aTNativeAdvancedView = this.g;
if (aTNativeAdvancedView == null || aTNativeAdvancedView.getAdvancedNativeWebview() == null) {
return;
}
NativeAdvancedJSBridgeImpl nativeAdvancedJSBridgeImpl = new NativeAdvancedJSBridgeImpl(this.g.getContext(), this.f4750c, this.f4749b);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
nativeAdvancedJSBridgeImpl.setCampaignList(arrayList);
nativeAdvancedJSBridgeImpl.setAllowSkip(this.o);
nativeAdvancedJSBridgeImpl.setCountdownS(this.p);
this.g.setAdvancedNativeJSBridgeImpl(nativeAdvancedJSBridgeImpl);
System.currentTimeMillis();
ATNativeAdvancedWebview advancedNativeWebview = this.g.getAdvancedNativeWebview();
if (advancedNativeWebview == null) {
b("webview is null", i);
} else if (advancedNativeWebview != null && advancedNativeWebview.isDestroyed()) {
b("webview is destroyed", i);
} else {
advancedNativeWebview.setWebViewListener(new AnonymousClass9(cVar, i));
if (!advancedNativeWebview.isDestroyed()) {
n.d(f4748a, "=======开始渲染: ".concat(String.valueOf(str)));
Handler handler = this.C;
if (handler != null) {
handler.post(new AnonymousClass10(advancedNativeWebview, str));
return;
}
return;
}
b("webview has destory", i);
}
}
public static void b(a aVar, com.anythink.expressad.foundation.d.c cVar, int i) {
if (aVar.g.isH5Ready()) {
aVar.a(cVar, i);
}
}
public final String a(String str) {
int h;
if (this.i != null) {
try {
com.anythink.expressad.videocommon.b.a a2 = com.anythink.expressad.videocommon.b.c.a().a(this.f4749b, this.i.ba() + this.i.R() + this.i.z());
if (a2 == null || (h = a2.h()) != 5) {
return str;
}
String d2 = a2.d();
if (new File(d2).exists()) {
String str2 = f4748a;
n.d(str2, "本地已下载完 拿本地播放地址:" + d2 + " state:" + h);
return d2;
}
return str;
} catch (Exception e) {
e.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.f4749b);
this.z = dVar.c();
if (cVar.N() != 99 && (!TextUtils.isEmpty(cVar.c()) || !TextUtils.isEmpty(cVar.d()))) {
if (s.a(cVar)) {
cVar.h(s.a(this.f, cVar.bb()) ? 1 : 2);
}
if (cVar.ag() != 1 && s.a(this.f, cVar.bb())) {
String str = f4748a;
n.d(str, "onload: " + cVar.bc() + " has been installed.");
if (s.a(cVar)) {
arrayList.add(cVar);
}
} else {
arrayList.add(cVar);
}
}
}
if (arrayList != null && arrayList.size() > 0) {
try {
int i = this.A + 1;
this.A = i;
if (this.h == null || i > this.h.t()) {
n.b(f4748a, "onload 重置offset为0");
this.A = 0;
}
String str2 = f4748a;
n.b(str2, "onload 算出 下次的offset是:" + this.A);
} catch (Exception e) {
e.printStackTrace();
}
String str3 = f4748a;
n.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.i = cVar2;
if (c.a(this.g, cVar2)) {
a(cVar2, 2);
return;
}
ATNativeAdvancedView aTNativeAdvancedView = this.g;
if (aTNativeAdvancedView != null) {
aTNativeAdvancedView.clearResState();
}
if (!TextUtils.isEmpty(cVar2.c())) {
String str4 = f4748a;
n.a(str4, "开始下载zip: " + cVar2.c());
this.x = new AnonymousClass8(cVar2);
g.a().b(cVar2.c(), (g.a) this.x);
}
if (!TextUtils.isEmpty(cVar2.d())) {
String str5 = f4748a;
n.a(str5, "开始下载HTML: " + cVar2.d());
f(cVar2);
}
if (!TextUtils.isEmpty(cVar2.R())) {
String str6 = f4748a;
n.a(str6, "开始下载Video: " + cVar2.R());
this.w = new AnonymousClass2(cVar2);
ArrayList arrayList2 = new ArrayList();
arrayList2.add(cVar2);
com.anythink.expressad.videocommon.b.c.a().a(this.f4749b, arrayList2, com.anythink.expressad.foundation.g.a.aX, this.w);
if (!com.anythink.expressad.videocommon.b.c.a().a(com.anythink.expressad.foundation.g.a.aX, this.f4749b, cVar2.y())) {
n.a(f4748a, " load Video");
com.anythink.expressad.videocommon.b.c.a().d(this.f4749b);
} else {
n.a(f4748a, " load Video isReady true");
this.g.setVideoReady(true);
a(cVar2, 2);
}
}
if (!TextUtils.isEmpty(cVar2.bf())) {
String str7 = f4748a;
n.a(str7, "开始下载image: " + cVar2.bf());
com.anythink.expressad.foundation.g.d.b.a(m.a().e()).a(cVar2.bf(), new AnonymousClass6(cVar2));
}
if (!TextUtils.isEmpty(cVar2.G())) {
String str8 = f4748a;
n.a(str8, "开始下载EndCard: " + cVar2.G());
this.y = new AnonymousClass5(cVar2);
g.a().b(cVar2.G(), (g.a) this.y);
}
if (TextUtils.isEmpty(cVar2.w())) {
return;
}
String str9 = f4748a;
n.a(str9, "开始下载gitUrl: " + cVar2.w());
com.anythink.expressad.foundation.g.d.b.a(m.a().e()).a(cVar2.w(), new AnonymousClass4(cVar2));
return;
}
n.b(f4748a, "onload load失败 返回的compaign没有可以用的");
b("invalid campaign", 2);
}
public static void a(a aVar, String str, com.anythink.expressad.foundation.d.c cVar, int i) {
ATNativeAdvancedView aTNativeAdvancedView = aVar.g;
if (aTNativeAdvancedView == null || aTNativeAdvancedView.getAdvancedNativeWebview() == null) {
return;
}
NativeAdvancedJSBridgeImpl nativeAdvancedJSBridgeImpl = new NativeAdvancedJSBridgeImpl(aVar.g.getContext(), aVar.f4750c, aVar.f4749b);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
nativeAdvancedJSBridgeImpl.setCampaignList(arrayList);
nativeAdvancedJSBridgeImpl.setAllowSkip(aVar.o);
nativeAdvancedJSBridgeImpl.setCountdownS(aVar.p);
aVar.g.setAdvancedNativeJSBridgeImpl(nativeAdvancedJSBridgeImpl);
System.currentTimeMillis();
ATNativeAdvancedWebview advancedNativeWebview = aVar.g.getAdvancedNativeWebview();
if (advancedNativeWebview == null) {
aVar.b("webview is null", i);
} else if (advancedNativeWebview != null && advancedNativeWebview.isDestroyed()) {
aVar.b("webview is destroyed", i);
} else {
advancedNativeWebview.setWebViewListener(new AnonymousClass9(cVar, i));
if (!advancedNativeWebview.isDestroyed()) {
n.d(f4748a, "=======开始渲染: ".concat(String.valueOf(str)));
Handler handler = aVar.C;
if (handler != null) {
handler.post(new AnonymousClass10(advancedNativeWebview, str));
return;
}
return;
}
aVar.b("webview has destory", i);
}
}
}