正在查看: Handling Master v2 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Handling Master v2 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.applovin.impl.adview;
import android.content.Context;
import android.net.Uri;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.WebSettings;
import com.applovin.impl.a7;
import com.applovin.impl.a8;
import com.applovin.impl.d7;
import com.applovin.impl.f0;
import com.applovin.impl.h4;
import com.applovin.impl.i7;
import com.applovin.impl.k0;
import com.applovin.impl.l4;
import com.applovin.impl.r;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.z6;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
public class b extends f0 {
private static final Set j = Collections.newSetFromMap(new WeakHashMap());
private static final Object k = new Object();
private final com.applovin.impl.sdk.n c;
private final com.applovin.impl.sdk.j d;
private com.applovin.impl.sdk.ad.b e;
private boolean f;
private boolean g;
private final List h;
private final Object i;
public b(c cVar, com.applovin.impl.sdk.j jVar, Context context) {
super(context);
this.h = new ArrayList();
this.i = new Object();
if (jVar == null) {
throw new IllegalArgumentException("No sdk specified.");
}
this.d = jVar;
this.c = jVar.I();
Integer num = (Integer) jVar.a(l4.U5);
if (num.intValue() > 0) {
synchronized (k) {
Set set = j;
set.add(this);
z6.a("AdWebView", set.size(), num.intValue(), jVar.A());
}
}
setBackgroundColor(0);
WebSettings settings = getSettings();
settings.setSupportMultipleWindows(false);
settings.setJavaScriptEnabled(true);
setWebViewClient(cVar != null ? cVar : new h4());
setWebChromeClient(new r(cVar != null ? cVar.c() : null, jVar));
setVerticalScrollBarEnabled(false);
setHorizontalScrollBarEnabled(false);
setScrollBarStyle(33554432);
if (k0.i() && ((Boolean) jVar.a(l4.q5)).booleanValue()) {
setWebViewRenderProcessClient(new d(jVar).a());
}
setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
boolean a;
a = b.a(view, motionEvent);
return a;
}
});
setOnLongClickListener(new View.OnLongClickListener() {
@Override
public final boolean onLongClick(View view) {
boolean a;
a = b.this.a(view);
return a;
}
});
}
public static boolean a(View view, MotionEvent motionEvent) {
if (view.hasFocus()) {
return false;
}
view.requestFocus();
return false;
}
private void b() {
synchronized (this.i) {
Iterator it = this.h.iterator();
while (it.hasNext()) {
a8.a(this, (String) it.next(), "AdWebView", this.d);
}
this.h.clear();
}
}
@Override
public void computeScroll() {
}
@Override
public void destroy() {
this.f = true;
this.g = false;
super.destroy();
}
public com.applovin.impl.sdk.ad.b getCurrentAd() {
return this.e;
}
@Override
public void onScrollChanged(int i, int i2, int i3, int i4) {
}
@Override
public void scrollTo(int i, int i2) {
}
public void setAdHtmlLoaded(boolean z) {
this.g = z;
if (z && ((Boolean) this.d.a(l4.M5)).booleanValue()) {
b();
}
}
public boolean a(View view) {
if (!com.applovin.impl.sdk.n.a()) {
return true;
}
this.c.a("AdWebView", "Received a LongClick event.");
return true;
}
public void a(com.applovin.impl.sdk.ad.b bVar) {
if (!this.f) {
this.e = bVar;
try {
applySettings(bVar);
if (z6.a(bVar.getSize())) {
setVisibility(0);
}
if (bVar instanceof com.applovin.impl.sdk.ad.a) {
loadDataWithBaseURL(bVar.h(), ((com.applovin.impl.sdk.ad.a) bVar).f1(), "text/html", null, "");
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "AppLovinAd rendered");
return;
}
return;
}
if (bVar instanceof a7) {
a7 a7Var = (a7) bVar;
d7 f1 = a7Var.f1();
if (f1 != null) {
i7 e = f1.e();
Uri c = e.c();
String uri = c != null ? c.toString() : "";
String b = e.b();
String h1 = a7Var.h1();
if (!StringUtils.isValidString(uri) && !StringUtils.isValidString(b)) {
if (com.applovin.impl.sdk.n.a()) {
this.c.b("AdWebView", "Unable to load companion ad. No resources provided.");
return;
}
return;
}
if (e.d() == i7.a.STATIC) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering WebView for static VAST ad");
}
String a = a((String) this.d.a(l4.i4), uri);
if (a7Var.w1() && a7Var.isOpenMeasurementEnabled() && a7Var.x1()) {
a = this.d.W().a(a);
}
loadDataWithBaseURL(bVar.h(), a, "text/html", null, "");
return;
}
if (e.d() == i7.a.HTML) {
if (StringUtils.isValidString(b)) {
String a2 = a(h1, b);
String str = StringUtils.isValidString(a2) ? a2 : b;
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering WebView for HTML VAST ad with resourceContents: " + str);
}
loadDataWithBaseURL(bVar.h(), str, "text/html", null, "");
return;
}
if (StringUtils.isValidString(uri)) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Preparing to load HTML VAST ad resourceUri");
}
a(uri, bVar.h(), h1, this.d, a7Var);
return;
}
return;
}
if (e.d() == i7.a.IFRAME) {
if (StringUtils.isValidString(uri)) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Preparing to load iFrame VAST ad resourceUri");
}
a(uri, bVar.h(), h1, this.d, a7Var);
return;
} else {
if (StringUtils.isValidString(b)) {
String a3 = a(h1, b);
String str2 = StringUtils.isValidString(a3) ? a3 : b;
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering WebView for iFrame VAST ad with resourceContents: " + str2);
}
loadDataWithBaseURL(bVar.h(), str2, "text/html", null, "");
return;
}
return;
}
}
if (com.applovin.impl.sdk.n.a()) {
this.c.b("AdWebView", "Failed to render VAST companion ad of invalid type");
return;
}
return;
}
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "No companion ad provided.");
return;
}
return;
}
return;
} catch (Throwable th) {
throw new RuntimeException("Unable to render AppLovin ad (" + (bVar != null ? String.valueOf(bVar.getAdIdNumber()) : "null") + ") - " + th);
}
}
com.applovin.impl.sdk.n.h("AdWebView", "Ad can not be loaded in a destroyed webview");
}
public void a(String str) {
if (((Boolean) this.d.a(l4.M5)).booleanValue()) {
if (this.g) {
a8.a(this, str, "AdWebView", this.d);
return;
}
synchronized (this.h) {
this.h.add(str);
}
return;
}
a8.a(this, str, "AdWebView", this.d);
}
private void a(String str, String str2, String str3, com.applovin.impl.sdk.j jVar, a7 a7Var) {
String a = a(str3, str);
if (StringUtils.isValidString(a)) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering webview for VAST ad with resourceContents : " + a);
}
loadDataWithBaseURL(str2, a, "text/html", null, "");
return;
}
String a2 = a((String) jVar.a(l4.j4), str);
if (StringUtils.isValidString(a2)) {
if (a7Var.w1() && a7Var.isOpenMeasurementEnabled()) {
a2 = jVar.W().a(a2);
}
String str4 = a2;
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering webview for VAST ad with resourceContents : " + str4);
}
loadDataWithBaseURL(str2, str4, "text/html", null, "");
return;
}
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering webview for VAST ad with resourceURL : " + str);
}
loadUrl(str);
}
private String a(String str, String str2) {
if (StringUtils.isValidString(str)) {
return str.replace("{SOURCE}", str2);
}
return null;
}
}