- 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
196 lines
7.5 KiB
Java
196 lines
7.5 KiB
Java
package com.applovin.impl;
|
|
|
|
import android.webkit.RenderProcessGoneDetail;
|
|
import android.webkit.WebView;
|
|
import android.webkit.WebViewClient;
|
|
import com.applovin.impl.sdk.utils.CollectionUtils;
|
|
import com.applovin.impl.sdk.utils.StringUtils;
|
|
import com.applovin.sdk.AppLovinPostbackListener;
|
|
import com.applovin.sdk.AppLovinSdkUtils;
|
|
import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.HashSet;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class qr extends pi {
|
|
private final com.applovin.impl.sdk.j a;
|
|
private final com.applovin.impl.sdk.n b;
|
|
private WebView c;
|
|
private boolean d;
|
|
private final Set e = Collections.synchronizedSet(new HashSet());
|
|
|
|
public qr(com.applovin.impl.sdk.j jVar) {
|
|
this.a = jVar;
|
|
this.b = jVar.J();
|
|
}
|
|
|
|
public void b(final String str) {
|
|
if (!AppLovinSdkUtils.isValidString(str)) {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.b.b("WebTrackerManager", "Failed to fire tracker due to empty script string");
|
|
}
|
|
} else {
|
|
if (!str.startsWith("<script")) {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.b.b("WebTrackerManager", "Failed to fire tracker due to improperly formatted script tag");
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.qr$$ExternalSyntheticLambda1
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
qr.this.c(str);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void c(String str) {
|
|
final WebView a2 = a(str);
|
|
if (a2 == null) {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.b.b("WebTrackerManager", "Failed to fire tracker since web view could not be created");
|
|
}
|
|
} else {
|
|
this.e.add(a2);
|
|
AppLovinSdkUtils.runOnUiThreadDelayed(new Runnable() { // from class: com.applovin.impl.qr$$ExternalSyntheticLambda5
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
qr.this.b(a2);
|
|
}
|
|
}, ((Integer) this.a.a(sj.d3)).intValue());
|
|
}
|
|
}
|
|
|
|
public class a extends WebViewClient {
|
|
public a() {
|
|
}
|
|
|
|
@Override // android.webkit.WebViewClient
|
|
public void onPageFinished(WebView webView, String str) {
|
|
com.applovin.impl.sdk.n unused = qr.this.b;
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
qr.this.b.a("WebTrackerManager", "Successfully initialized web view for postbacks");
|
|
}
|
|
qr.this.d = true;
|
|
}
|
|
}
|
|
|
|
private boolean d() {
|
|
return ((Boolean) this.a.a(sj.i3)).booleanValue();
|
|
}
|
|
|
|
public void c() {
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.qr$$ExternalSyntheticLambda0
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
qr.this.b();
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override // com.applovin.impl.pi, android.webkit.WebViewClient
|
|
public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
|
|
if (webView == this.c) {
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.qr$$ExternalSyntheticLambda2
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
qr.this.a();
|
|
}
|
|
});
|
|
} else {
|
|
b(webView);
|
|
}
|
|
return super.onRenderProcessGone(webView, renderProcessGoneDetail);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void b(final WebView webView) {
|
|
if (webView == null || !this.e.remove(webView)) {
|
|
return;
|
|
}
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.qr$$ExternalSyntheticLambda4
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
webView.destroy();
|
|
}
|
|
});
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void b(com.applovin.impl.sdk.network.e eVar, AppLovinPostbackListener appLovinPostbackListener) {
|
|
String appendQueryParameters = StringUtils.appendQueryParameters(eVar.f(), eVar.i(), ((Boolean) this.a.a(sj.A3)).booleanValue());
|
|
if (this.c == null) {
|
|
WebView a2 = a("<script>window.al_firePostback = function(url) {\n setTimeout(function() {\n var img = new Image();\n img.src = url;\n }, 100);\n}\n</script>", true);
|
|
this.c = a2;
|
|
if (a2 == null) {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.b.b("WebTrackerManager", "Failed to fire postback since web view could not be created");
|
|
}
|
|
appLovinPostbackListener.onPostbackFailure(appendQueryParameters, -1);
|
|
return;
|
|
}
|
|
}
|
|
if (d() && !this.d) {
|
|
if (com.applovin.impl.sdk.n.a()) {
|
|
this.b.b("WebTrackerManager", "Failed to fire postback since web view was not initialized in time");
|
|
}
|
|
HashMap<String, String> hashMap = CollectionUtils.hashMap("top_main_method", "firePostback");
|
|
hashMap.put("url", appendQueryParameters);
|
|
this.a.E().a(la.U, (Map) hashMap);
|
|
appLovinPostbackListener.onPostbackFailure(appendQueryParameters, -1);
|
|
return;
|
|
}
|
|
tr.a(this.c, "al_firePostback('" + appendQueryParameters + "')");
|
|
appLovinPostbackListener.onPostbackSuccess(appendQueryParameters);
|
|
}
|
|
|
|
private WebView a(String str) {
|
|
return a(str, false);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void b() {
|
|
WebView a2 = a("<script>window.al_firePostback = function(url) {\n setTimeout(function() {\n var img = new Image();\n img.src = url;\n }, 100);\n}\n</script>", true);
|
|
this.c = a2;
|
|
if (a2 == null && com.applovin.impl.sdk.n.a()) {
|
|
this.b.b("WebTrackerManager", "Failed to preload postback web view");
|
|
}
|
|
}
|
|
|
|
public void a(final com.applovin.impl.sdk.network.e eVar, final AppLovinPostbackListener appLovinPostbackListener) {
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.qr$$ExternalSyntheticLambda3
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
qr.this.b(eVar, appLovinPostbackListener);
|
|
}
|
|
});
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a() {
|
|
this.c.destroy();
|
|
this.c = null;
|
|
}
|
|
|
|
private WebView a(String str, boolean z) {
|
|
yp.b();
|
|
WebView b = yp.b(com.applovin.impl.sdk.j.l(), "web tracker");
|
|
if (b == null) {
|
|
return null;
|
|
}
|
|
b.getSettings().setJavaScriptEnabled(true);
|
|
b.setWebViewClient(this);
|
|
if (z && d()) {
|
|
b.setWebViewClient(new a());
|
|
}
|
|
b.loadData("<html><head><link rel=\"icon\" href=\"data:,\">" + str + "</head><body></body></html>", "text/html", "UTF-8");
|
|
return b;
|
|
}
|
|
}
|