- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
296 lines
11 KiB
Java
296 lines
11 KiB
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.aq;
|
|
import com.applovin.impl.dq;
|
|
import com.applovin.impl.f0;
|
|
import com.applovin.impl.iq;
|
|
import com.applovin.impl.j3;
|
|
import com.applovin.impl.pi;
|
|
import com.applovin.impl.sdk.utils.StringUtils;
|
|
import com.applovin.impl.sj;
|
|
import com.applovin.impl.tr;
|
|
import com.applovin.impl.yp;
|
|
import com.applovin.impl.z3;
|
|
import com.unity3d.ads.adplayer.AndroidWebViewClient;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class b extends j3 {
|
|
private final com.applovin.impl.sdk.n c;
|
|
private final com.applovin.impl.sdk.j d;
|
|
private com.applovin.impl.sdk.ad.b f;
|
|
private boolean g;
|
|
private boolean h;
|
|
private final List i;
|
|
private final Object j;
|
|
|
|
public b(com.applovin.impl.sdk.j jVar, Context context) {
|
|
super(context);
|
|
this.i = new ArrayList();
|
|
this.j = new Object();
|
|
if (jVar == null) {
|
|
throw new IllegalArgumentException("No sdk specified.");
|
|
}
|
|
this.d = jVar;
|
|
this.c = jVar.J();
|
|
setBackgroundColor(0);
|
|
WebSettings settings = getSettings();
|
|
settings.setSupportMultipleWindows(false);
|
|
settings.setJavaScriptEnabled(true);
|
|
setVerticalScrollBarEnabled(false);
|
|
setHorizontalScrollBarEnabled(false);
|
|
setScrollBarStyle(33554432);
|
|
if (z3.k() && ((Boolean) jVar.a(sj.W5)).booleanValue()) {
|
|
setWebViewRenderProcessClient(new d(jVar).a());
|
|
}
|
|
setOnTouchListener(new View.OnTouchListener() { // from class: com.applovin.impl.adview.b$$ExternalSyntheticLambda0
|
|
@Override // android.view.View.OnTouchListener
|
|
public final boolean onTouch(View view, MotionEvent motionEvent) {
|
|
boolean a;
|
|
a = b.a(view, motionEvent);
|
|
return a;
|
|
}
|
|
});
|
|
setOnLongClickListener(new View.OnLongClickListener() { // from class: com.applovin.impl.adview.b$$ExternalSyntheticLambda1
|
|
@Override // android.view.View.OnLongClickListener
|
|
public final boolean onLongClick(View view) {
|
|
boolean a;
|
|
a = b.this.a(view);
|
|
return a;
|
|
}
|
|
});
|
|
}
|
|
|
|
private void b() {
|
|
synchronized (this.j) {
|
|
try {
|
|
Iterator it = this.i.iterator();
|
|
while (it.hasNext()) {
|
|
tr.a(this, (String) it.next(), "AdWebView", this.d);
|
|
}
|
|
this.i.clear();
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.webkit.WebView, android.view.View
|
|
public void computeScroll() {
|
|
}
|
|
|
|
public com.applovin.impl.sdk.ad.b getCurrentAd() {
|
|
return this.f;
|
|
}
|
|
|
|
@Override // android.webkit.WebView, android.view.View
|
|
public void onScrollChanged(int i, int i2, int i3, int i4) {
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void scrollTo(int i, int i2) {
|
|
}
|
|
|
|
@Override // android.webkit.WebView
|
|
public void destroy() {
|
|
this.g = true;
|
|
this.h = false;
|
|
super.destroy();
|
|
}
|
|
|
|
public void setAdHtmlLoaded(boolean z) {
|
|
this.h = z;
|
|
if (z && ((Boolean) this.d.a(sj.q6)).booleanValue()) {
|
|
b();
|
|
}
|
|
}
|
|
|
|
private void a(String str, String str2, String str3, com.applovin.impl.sdk.j jVar, aq aqVar) {
|
|
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(sj.S4), str);
|
|
if (StringUtils.isValidString(a2)) {
|
|
if (aqVar.B1() && aqVar.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);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ boolean a(View view, MotionEvent motionEvent) {
|
|
if (view.hasFocus()) {
|
|
return false;
|
|
}
|
|
view.requestFocus();
|
|
return false;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ 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(c cVar) {
|
|
if (((Boolean) this.d.a(sj.H1)).booleanValue()) {
|
|
loadUrl(AndroidWebViewClient.BLANK_PAGE);
|
|
clearView();
|
|
}
|
|
setWebViewClient(cVar != null ? cVar : new pi());
|
|
setWebChromeClient(new f0(cVar != null ? cVar.c() : null, this.d));
|
|
synchronized (this.i) {
|
|
this.i.clear();
|
|
}
|
|
onResume();
|
|
}
|
|
|
|
public void a(com.applovin.impl.sdk.ad.b bVar) {
|
|
if (!this.g) {
|
|
this.f = bVar;
|
|
try {
|
|
applySettings(bVar);
|
|
if (yp.a(bVar.getSize())) {
|
|
setVisibility(0);
|
|
}
|
|
if (bVar instanceof com.applovin.impl.sdk.ad.a) {
|
|
loadDataWithBaseURL(bVar.g(), ((com.applovin.impl.sdk.ad.a) bVar).j1(), "text/html", null, "");
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a("AdWebView", "AppLovinAd rendered");
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (bVar instanceof aq) {
|
|
aq aqVar = (aq) bVar;
|
|
dq j1 = aqVar.j1();
|
|
if (j1 != null) {
|
|
iq d = j1.d();
|
|
Uri b = d.b();
|
|
String uri = b != null ? b.toString() : "";
|
|
String a = d.a();
|
|
String l1 = aqVar.l1();
|
|
if (!StringUtils.isValidString(uri) && !StringUtils.isValidString(a)) {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.b("AdWebView", "Unable to load companion ad. No resources provided.");
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (d.c() == iq.a.STATIC) {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a("AdWebView", "Rendering WebView for static VAST ad");
|
|
}
|
|
String a2 = a((String) this.d.a(sj.R4), uri);
|
|
if (aqVar.B1() && aqVar.isOpenMeasurementEnabled() && aqVar.C1()) {
|
|
a2 = this.d.W().a(a2);
|
|
}
|
|
loadDataWithBaseURL(bVar.g(), a2, "text/html", null, "");
|
|
return;
|
|
}
|
|
if (d.c() == iq.a.HTML) {
|
|
if (StringUtils.isValidString(a)) {
|
|
String a3 = a(l1, a);
|
|
String str = StringUtils.isValidString(a3) ? a3 : a;
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a("AdWebView", "Rendering WebView for HTML VAST ad with resourceContents: " + str);
|
|
}
|
|
loadDataWithBaseURL(bVar.g(), 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.g(), l1, this.d, aqVar);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (d.c() == iq.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.g(), l1, this.d, aqVar);
|
|
return;
|
|
} else {
|
|
if (StringUtils.isValidString(a)) {
|
|
String a4 = a(l1, a);
|
|
String str2 = StringUtils.isValidString(a4) ? a4 : a;
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.c.a("AdWebView", "Rendering WebView for iFrame VAST ad with resourceContents: " + str2);
|
|
}
|
|
loadDataWithBaseURL(bVar.g(), 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(sj.q6)).booleanValue()) {
|
|
tr.a(this, str, "AdWebView", this.d);
|
|
} else {
|
|
if (this.h) {
|
|
tr.a(this, str, "AdWebView", this.d);
|
|
return;
|
|
}
|
|
synchronized (this.i) {
|
|
this.i.add(str);
|
|
}
|
|
}
|
|
}
|
|
|
|
private String a(String str, String str2) {
|
|
if (StringUtils.isValidString(str)) {
|
|
return str.replace("{SOURCE}", str2);
|
|
}
|
|
return null;
|
|
}
|
|
}
|