我要上王者 v1.1版本的 MD5 值为:b7d3566522def961cabeb92cb17f5db9
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.anythink.expressad.advanced.c;
import android.net.http.SslError;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
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.videocommon.b.e;
import com.anythink.expressad.videocommon.b.i;
import java.io.File;
import java.util.ArrayList;
public final class c {
private static String f2893a = "ResManager";
private static int f2894b = 1;
public interface a {
void a();
void b();
}
private static com.anythink.expressad.foundation.d.c a(com.anythink.expressad.foundation.d.c cVar) {
if (!TextUtils.isEmpty(cVar.c()) || (!TextUtils.isEmpty(cVar.d()) && cVar.d().contains("<MBTPLMARK>"))) {
cVar.a(true);
cVar.b(false);
} else {
cVar.a(false);
cVar.b(true);
}
return cVar;
}
public static boolean a(ATNativeAdvancedView aTNativeAdvancedView, com.anythink.expressad.foundation.d.c cVar, String str, String str2, int i, a aVar) {
boolean z;
boolean z2;
boolean z3 = false;
if (cVar != null) {
aTNativeAdvancedView.clearResState();
if (TextUtils.isEmpty(cVar.S())) {
z2 = true;
} else {
z2 = e.a().a(com.anythink.expressad.foundation.g.a.aX, str2, cVar.A());
}
aTNativeAdvancedView.setVideoReady(true);
boolean z4 = z2;
if (!TextUtils.isEmpty(cVar.I()) && !aTNativeAdvancedView.isEndCardReady() && !TextUtils.isEmpty(i.a().c(cVar.I()))) {
aTNativeAdvancedView.setEndCardReady(true);
}
if (TextUtils.isEmpty(cVar.c()) || aTNativeAdvancedView.isH5Ready()) {
z = false;
} else {
String c = i.a().c(cVar.c());
if (TextUtils.isEmpty(c)) {
z = false;
z4 = false;
} else if (com.anythink.expressad.advanced.a.a.b(cVar.Z())) {
aTNativeAdvancedView.setH5Ready(true);
z = false;
z4 = true;
} else {
a(aTNativeAdvancedView, c, cVar, str, str2, i, aVar);
z = true;
}
}
if (TextUtils.isEmpty(cVar.c()) && !TextUtils.isEmpty(cVar.d()) && !aTNativeAdvancedView.isH5Ready()) {
String a2 = a(cVar.d());
if (!TextUtils.isEmpty(a2)) {
if (com.anythink.expressad.advanced.a.a.b(cVar.Z())) {
aTNativeAdvancedView.setH5Ready(true);
if (cVar.H()) {
aTNativeAdvancedView.setVideoReady(true);
}
z3 = true;
} else {
a(aTNativeAdvancedView, a2, cVar, str, str2, i, aVar);
z = true;
}
}
}
z3 = z4;
} else {
z = false;
}
if (z3 && !z) {
aVar.a();
}
return z3;
}
private static void a(ATNativeAdvancedView aTNativeAdvancedView, String str, com.anythink.expressad.foundation.d.c cVar, String str2, String str3, int i) {
a(aTNativeAdvancedView, str, cVar, str2, str3, i, null);
}
private static void a(final ATNativeAdvancedView aTNativeAdvancedView, final String str, final com.anythink.expressad.foundation.d.c cVar, String str2, String str3, int i, final a aVar) {
if (aTNativeAdvancedView == null || aTNativeAdvancedView.getAdvancedNativeWebview() == null) {
return;
}
NativeAdvancedJSBridgeImpl nativeAdvancedJSBridgeImpl = new NativeAdvancedJSBridgeImpl(aTNativeAdvancedView.getContext(), str2, str3);
ArrayList arrayList = new ArrayList();
arrayList.add(cVar);
nativeAdvancedJSBridgeImpl.setCampaignList(arrayList);
nativeAdvancedJSBridgeImpl.setAllowSkip(i);
aTNativeAdvancedView.setAdvancedNativeJSBridgeImpl(nativeAdvancedJSBridgeImpl);
final ATNativeAdvancedWebview advancedNativeWebview = aTNativeAdvancedView.getAdvancedNativeWebview();
System.currentTimeMillis();
advancedNativeWebview.setWebViewListener(new com.anythink.expressad.atsignalcommon.a.b() {
@Override
public final void readyState(WebView webView, int i2) {
super.readyState(webView, i2);
if (i2 == 1) {
com.anythink.expressad.advanced.a.a.a(com.anythink.expressad.foundation.d.c.this.Z());
aTNativeAdvancedView.setH5Ready(true);
} else {
aTNativeAdvancedView.setH5Ready(false);
}
a aVar2 = aVar;
if (aVar2 != null) {
aVar2.a();
}
}
@Override
public final void onReceivedError(WebView webView, int i2, String str4, String str5) {
super.onReceivedError(webView, i2, str4, str5);
aTNativeAdvancedView.setH5Ready(false);
a aVar2 = aVar;
if (aVar2 != null) {
aVar2.b();
}
}
@Override
public final void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
super.onReceivedSslError(webView, sslErrorHandler, sslError);
aTNativeAdvancedView.setH5Ready(false);
a aVar2 = aVar;
if (aVar2 != null) {
aVar2.b();
}
}
@Override
public final void onPageFinished(WebView webView, String str4) {
super.onPageFinished(webView, str4);
if (!com.anythink.expressad.foundation.d.c.this.s()) {
com.anythink.expressad.advanced.a.a.a(com.anythink.expressad.foundation.d.c.this.Z());
aTNativeAdvancedView.setH5Ready(true);
}
NativeAdvancedJsUtils.fireOnJSBridgeConnected(webView);
}
});
if (!advancedNativeWebview.isDestroyed()) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
ATNativeAdvancedWebview.this.loadUrl(str);
}
});
} else {
aTNativeAdvancedView.setH5Ready(false);
}
}
private static String a(String str) {
try {
File file = new File(str);
if (file.exists()) {
return "file:///" + file.getAbsolutePath();
}
return "";
} catch (Throwable th) {
try {
throw th;
} catch (Exception e) {
e.getMessage();
return "";
}
}
}
public static boolean a(ATNativeAdvancedView aTNativeAdvancedView, com.anythink.expressad.foundation.d.c cVar) {
boolean z = false;
if (aTNativeAdvancedView == null) {
return false;
}
boolean isVideoReady = TextUtils.isEmpty(cVar.S()) ? true : aTNativeAdvancedView.isVideoReady();
if (isVideoReady && !TextUtils.isEmpty(cVar.c())) {
isVideoReady = com.anythink.expressad.advanced.a.a.b(cVar.Z());
StringBuilder sb = new StringBuilder("======isReady getAdZip:");
sb.append(isVideoReady);
sb.append("---requestId:");
sb.append(cVar.Z());
}
if (isVideoReady && TextUtils.isEmpty(cVar.c()) && !TextUtils.isEmpty(cVar.d())) {
isVideoReady = com.anythink.expressad.advanced.a.a.b(cVar.Z());
}
if (!TextUtils.isEmpty(cVar.c()) || !TextUtils.isEmpty(cVar.d())) {
z = isVideoReady;
}
return (!z || TextUtils.isEmpty(cVar.I())) ? z : aTNativeAdvancedView.isEndCardReady();
}
}