- 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
508 lines
20 KiB
Java
508 lines
20 KiB
Java
package com.fyber.inneractive.sdk.web;
|
|
|
|
import android.app.Activity;
|
|
import android.content.ActivityNotFoundException;
|
|
import android.content.Intent;
|
|
import android.net.Uri;
|
|
import android.os.Bundle;
|
|
import android.text.TextUtils;
|
|
import android.webkit.JavascriptInterface;
|
|
import android.webkit.RenderProcessGoneDetail;
|
|
import android.webkit.WebSettings;
|
|
import android.webkit.WebView;
|
|
import android.webkit.WebViewClient;
|
|
import com.digitalturbine.ignite.cl.aidl.IIgniteServiceAPI;
|
|
import com.fyber.inneractive.sdk.activities.InternalStoreWebpageActivity;
|
|
import com.fyber.inneractive.sdk.config.IAConfigManager;
|
|
import com.fyber.inneractive.sdk.flow.p;
|
|
import com.fyber.inneractive.sdk.ignite.c;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import com.google.android.gms.drive.DriveFile;
|
|
import java.lang.ref.WeakReference;
|
|
import java.util.Iterator;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class u implements com.fyber.inneractive.sdk.ignite.o {
|
|
public boolean B;
|
|
public final WebView a;
|
|
public final com.fyber.inneractive.sdk.ignite.c b;
|
|
public final String c;
|
|
public com.fyber.inneractive.sdk.ignite.l d;
|
|
public final String e;
|
|
public final String f;
|
|
public final String g;
|
|
public final com.fyber.inneractive.sdk.ignite.i h;
|
|
public d i;
|
|
public String k;
|
|
public final com.fyber.inneractive.sdk.config.global.s m;
|
|
public long o;
|
|
public v p;
|
|
public WeakReference<InternalStoreWebpageActivity> q;
|
|
public String j = "invalid_task_id";
|
|
public boolean l = false;
|
|
public long n = 10;
|
|
public boolean r = false;
|
|
public boolean s = false;
|
|
public final AtomicInteger t = new AtomicInteger(0);
|
|
public final AtomicBoolean u = new AtomicBoolean(false);
|
|
public final AtomicBoolean v = new AtomicBoolean(false);
|
|
public boolean w = false;
|
|
public boolean x = false;
|
|
public boolean y = false;
|
|
public boolean z = false;
|
|
public boolean A = false;
|
|
public boolean C = false;
|
|
public boolean D = false;
|
|
public final a E = new a();
|
|
|
|
public class a extends WebViewClient {
|
|
|
|
/* renamed from: com.fyber.inneractive.sdk.web.u$a$a, reason: collision with other inner class name */
|
|
public class RunnableC0112a implements Runnable {
|
|
public RunnableC0112a() {
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
u uVar = u.this;
|
|
if (uVar.y) {
|
|
return;
|
|
}
|
|
uVar.e(uVar.k);
|
|
}
|
|
}
|
|
|
|
public a() {
|
|
}
|
|
|
|
@Override // android.webkit.WebViewClient
|
|
public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
|
|
if (str.endsWith("success")) {
|
|
u uVar = u.this;
|
|
v vVar = uVar.p;
|
|
if (vVar != null) {
|
|
com.fyber.inneractive.sdk.util.p.b.removeCallbacks(vVar);
|
|
uVar.p = null;
|
|
}
|
|
u uVar2 = u.this;
|
|
uVar2.getClass();
|
|
IAlog.a("%sInternalStoreWebpageController: onWebviewLoaded - load took %d msec", IAlog.a(uVar2), Long.valueOf(System.currentTimeMillis() - u.this.o));
|
|
u.this.l = true;
|
|
return true;
|
|
}
|
|
if (!str.startsWith("exit")) {
|
|
return false;
|
|
}
|
|
Activity activity = (Activity) com.fyber.inneractive.sdk.util.t.a(u.this.q);
|
|
if (activity == null) {
|
|
return true;
|
|
}
|
|
try {
|
|
Uri parse = Uri.parse(str);
|
|
String queryParameter = parse.getQueryParameter("target");
|
|
boolean equals = TextUtils.equals("mail", parse.getAuthority());
|
|
Intent intent = new Intent(equals ? "android.intent.action.SENDTO" : "android.intent.action.VIEW", Uri.parse(queryParameter));
|
|
if (equals) {
|
|
intent = Intent.createChooser(intent, "Choose an application");
|
|
}
|
|
if (intent != null) {
|
|
try {
|
|
activity.startActivity(intent);
|
|
} catch (ActivityNotFoundException unused) {
|
|
}
|
|
}
|
|
} catch (Throwable th) {
|
|
com.fyber.inneractive.sdk.network.t.a(th, null, null);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // android.webkit.WebViewClient
|
|
public final boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
|
|
Activity activity = (Activity) com.fyber.inneractive.sdk.util.t.a(u.this.q);
|
|
if (activity != null) {
|
|
activity.finish();
|
|
}
|
|
com.fyber.inneractive.sdk.util.p.b.postDelayed(new RunnableC0112a(), 1000L);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public class b implements Runnable {
|
|
public final /* synthetic */ String a;
|
|
|
|
public b(String str) {
|
|
this.a = str;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
IAlog.a("injecting JS: %s", this.a);
|
|
try {
|
|
if (this.a != null) {
|
|
u.this.a.loadUrl("javascript:" + this.a);
|
|
}
|
|
} catch (Exception unused) {
|
|
IAlog.a("Failed to inject JS", new Object[0]);
|
|
}
|
|
}
|
|
}
|
|
|
|
public class c implements com.digitalturbine.ignite.authenticator.listeners.internal.b {
|
|
public final /* synthetic */ String a;
|
|
public final /* synthetic */ String b;
|
|
|
|
public c(String str, String str2) {
|
|
this.a = str;
|
|
this.b = str2;
|
|
}
|
|
|
|
@Override // com.digitalturbine.ignite.authenticator.listeners.internal.b
|
|
public final void a() {
|
|
u uVar = u.this;
|
|
uVar.b.a(uVar.c, new c.C0073c(uVar.f, uVar.d, com.fyber.inneractive.sdk.flow.p.this));
|
|
u.this.d("onShowInstallStarted();");
|
|
}
|
|
|
|
@Override // com.digitalturbine.ignite.authenticator.listeners.internal.b
|
|
public final void a(String str) {
|
|
u uVar = u.this;
|
|
com.fyber.inneractive.sdk.ignite.c cVar = uVar.b;
|
|
com.fyber.inneractive.sdk.ignite.d dVar = cVar.m;
|
|
if (dVar != null) {
|
|
com.fyber.inneractive.sdk.util.p.b.removeCallbacks(dVar);
|
|
cVar.m = null;
|
|
}
|
|
uVar.d("onInstallationFailed();");
|
|
u uVar2 = u.this;
|
|
((p.a) uVar2.h).a(com.fyber.inneractive.sdk.network.q.IGNITE_FLOW_FAILED_TO_INSTALL_APP, this.a, this.b, uVar2.d);
|
|
}
|
|
}
|
|
|
|
public interface d {
|
|
}
|
|
|
|
public class e {
|
|
public e() {
|
|
}
|
|
|
|
@JavascriptInterface
|
|
public void onBackButtonPressed() {
|
|
WeakReference<InternalStoreWebpageActivity> weakReference = u.this.q;
|
|
if (weakReference == null || weakReference.get() == null) {
|
|
return;
|
|
}
|
|
u.this.q.get().finish();
|
|
}
|
|
|
|
@JavascriptInterface
|
|
public void onCancelButtonPressed() {
|
|
com.fyber.inneractive.sdk.ignite.l lVar;
|
|
com.fyber.inneractive.sdk.ignite.l lVar2;
|
|
com.fyber.inneractive.sdk.ignite.k kVar;
|
|
u uVar = u.this;
|
|
uVar.d = uVar.B ? com.fyber.inneractive.sdk.ignite.l.TRUE_SINGLE_TAP : com.fyber.inneractive.sdk.ignite.l.SINGLE_TAP;
|
|
String str = uVar.j;
|
|
if (str != null) {
|
|
uVar.v.set(true);
|
|
uVar.u.set(false);
|
|
com.fyber.inneractive.sdk.ignite.c cVar = uVar.b;
|
|
x xVar = new x(uVar);
|
|
if (!cVar.m() || (kVar = cVar.p) == null || kVar.a.d()) {
|
|
Iterator it = cVar.h.iterator();
|
|
while (it.hasNext()) {
|
|
com.fyber.inneractive.sdk.ignite.o oVar = (com.fyber.inneractive.sdk.ignite.o) it.next();
|
|
if (oVar != null) {
|
|
com.fyber.inneractive.sdk.ignite.k kVar2 = cVar.p;
|
|
oVar.c(((kVar2 == null || kVar2.a.d()) ? com.fyber.inneractive.sdk.ignite.h.SESSION_EXPIRED : com.fyber.inneractive.sdk.ignite.h.NOT_CONNECTED).e());
|
|
}
|
|
}
|
|
} else {
|
|
try {
|
|
IIgniteServiceAPI iIgniteServiceAPI = cVar.b;
|
|
Bundle bundle = cVar.c;
|
|
cVar.d.getClass();
|
|
iIgniteServiceAPI.cancel(str, bundle, new com.fyber.inneractive.sdk.ignite.a(xVar));
|
|
} catch (Exception unused) {
|
|
IAlog.a("Failed to cancel task", new Object[0]);
|
|
xVar.a(false);
|
|
}
|
|
}
|
|
com.fyber.inneractive.sdk.util.p.b.postDelayed(new y(uVar), 2500L);
|
|
com.fyber.inneractive.sdk.ignite.i iVar = uVar.h;
|
|
if (iVar != null && !uVar.r && (lVar2 = uVar.d) != null) {
|
|
uVar.r = true;
|
|
((p.a) iVar).a(com.fyber.inneractive.sdk.network.r.IGNITE_FLOW_CANCEL_INSTALL_CLICKED, lVar2);
|
|
}
|
|
}
|
|
u uVar2 = u.this;
|
|
com.fyber.inneractive.sdk.ignite.i iVar2 = uVar2.h;
|
|
if (iVar2 == null || uVar2.r || (lVar = uVar2.d) == null) {
|
|
return;
|
|
}
|
|
uVar2.r = true;
|
|
((p.a) iVar2).a(com.fyber.inneractive.sdk.network.r.IGNITE_FLOW_CANCEL_INSTALL_CLICKED, lVar);
|
|
}
|
|
|
|
@JavascriptInterface
|
|
public void onInstallButtonPressed() {
|
|
com.fyber.inneractive.sdk.ignite.l lVar;
|
|
u uVar = u.this;
|
|
com.fyber.inneractive.sdk.ignite.l lVar2 = uVar.B ? com.fyber.inneractive.sdk.ignite.l.TRUE_SINGLE_TAP : com.fyber.inneractive.sdk.ignite.l.SINGLE_TAP;
|
|
uVar.d = lVar2;
|
|
uVar.b.a(uVar.c, new c.C0073c(uVar.f, lVar2, com.fyber.inneractive.sdk.flow.p.this));
|
|
u uVar2 = u.this;
|
|
com.fyber.inneractive.sdk.ignite.i iVar = uVar2.h;
|
|
if (iVar == null || uVar2.s || (lVar = uVar2.d) == null) {
|
|
return;
|
|
}
|
|
uVar2.s = true;
|
|
((p.a) iVar).a(com.fyber.inneractive.sdk.network.r.IGNITE_FLOW_INSTALL_CLICKED, lVar);
|
|
}
|
|
|
|
@JavascriptInterface
|
|
public void onNavigatedInsideStorePage() {
|
|
u.this.w = true;
|
|
}
|
|
|
|
@JavascriptInterface
|
|
public void onNavigatedToMainPage() {
|
|
u.this.w = false;
|
|
}
|
|
|
|
@JavascriptInterface
|
|
public void onOpenButtonPressed() {
|
|
Intent launchIntentForPackage;
|
|
if (TextUtils.isEmpty(u.this.c)) {
|
|
u uVar = u.this;
|
|
uVar.getClass();
|
|
IAlog.f("%smPackageName is null", IAlog.a(uVar));
|
|
return;
|
|
}
|
|
if (TextUtils.isEmpty(u.this.g)) {
|
|
launchIntentForPackage = com.fyber.inneractive.sdk.util.o.a.getPackageManager().getLaunchIntentForPackage(u.this.c);
|
|
} else {
|
|
launchIntentForPackage = new Intent("android.intent.action.MAIN");
|
|
u uVar2 = u.this;
|
|
launchIntentForPackage.setClassName(uVar2.c, uVar2.g);
|
|
}
|
|
if (launchIntentForPackage == null) {
|
|
u uVar3 = u.this;
|
|
uVar3.getClass();
|
|
IAlog.f("%sPackage %s not found", IAlog.a(uVar3), u.this.c);
|
|
return;
|
|
}
|
|
launchIntentForPackage.setFlags(DriveFile.MODE_READ_ONLY);
|
|
try {
|
|
com.fyber.inneractive.sdk.util.o.a.startActivity(launchIntentForPackage);
|
|
} catch (Exception e) {
|
|
com.fyber.inneractive.sdk.ignite.i iVar = u.this.h;
|
|
if (iVar != null) {
|
|
String simpleName = e.getClass().getSimpleName();
|
|
String message = e.getMessage();
|
|
com.fyber.inneractive.sdk.flow.p pVar = com.fyber.inneractive.sdk.flow.p.this;
|
|
com.fyber.inneractive.sdk.network.t.a(simpleName, message, pVar.a, pVar.b);
|
|
}
|
|
}
|
|
}
|
|
|
|
@JavascriptInterface
|
|
public void onTransitionEnded() {
|
|
u.this.x = false;
|
|
}
|
|
|
|
@JavascriptInterface
|
|
public void onTransitionStarting() {
|
|
u.this.x = true;
|
|
}
|
|
}
|
|
|
|
public u(z zVar) {
|
|
this.c = zVar.a;
|
|
this.d = zVar.b;
|
|
this.e = zVar.c;
|
|
this.m = zVar.d;
|
|
this.f = zVar.e;
|
|
this.g = zVar.f;
|
|
this.h = zVar.g;
|
|
com.fyber.inneractive.sdk.ignite.c d2 = IAConfigManager.d();
|
|
this.b = d2;
|
|
d2.a(this);
|
|
this.a = new WebView(com.fyber.inneractive.sdk.util.o.b());
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.ignite.o
|
|
public final void a(String str, String str2) {
|
|
if (str == null || str2 == null || !str2.equals(this.c)) {
|
|
return;
|
|
}
|
|
this.j = str;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.ignite.o
|
|
public final void c(String str) {
|
|
com.fyber.inneractive.sdk.ignite.i iVar;
|
|
IIgniteServiceAPI iIgniteServiceAPI;
|
|
if (this.v.get() && str != null) {
|
|
if (str.equals(com.fyber.inneractive.sdk.ignite.h.NOT_CONNECTED.e()) || str.equals(com.fyber.inneractive.sdk.ignite.h.SESSION_EXPIRED.e())) {
|
|
if (this.t.getAndIncrement() < 2) {
|
|
this.b.a(new w(this));
|
|
return;
|
|
}
|
|
com.fyber.inneractive.sdk.ignite.c cVar = this.b;
|
|
com.fyber.inneractive.sdk.ignite.k kVar = cVar.p;
|
|
if (kVar == null || !kVar.isConnected() || (iIgniteServiceAPI = cVar.b) == null || !iIgniteServiceAPI.asBinder().isBinderAlive()) {
|
|
com.fyber.inneractive.sdk.ignite.h hVar = com.fyber.inneractive.sdk.ignite.h.FAILED_TO_BIND_SERVICE;
|
|
com.fyber.inneractive.sdk.ignite.c cVar2 = this.b;
|
|
if (cVar2.i || (iVar = this.h) == null) {
|
|
return;
|
|
}
|
|
cVar2.i = true;
|
|
((p.a) iVar).a(com.fyber.inneractive.sdk.network.q.IGNITE_FLOW_FAILED_TO_START, null, hVar.e(), null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void d(String str) {
|
|
com.fyber.inneractive.sdk.util.p.b.post(new b(str));
|
|
}
|
|
|
|
public final void e(String str) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
this.k = str;
|
|
WebSettings settings = this.a.getSettings();
|
|
settings.setJavaScriptEnabled(true);
|
|
settings.setUseWideViewPort(true);
|
|
this.a.setInitialScale(1);
|
|
this.a.setBackgroundColor(-1);
|
|
this.a.setWebViewClient(this.E);
|
|
WebView webView = this.a;
|
|
webView.setLongClickable(false);
|
|
webView.setOnLongClickListener(new com.fyber.inneractive.sdk.util.e0());
|
|
this.a.addJavascriptInterface(new e(), "nativeInterface");
|
|
this.a.loadUrl(str);
|
|
com.fyber.inneractive.sdk.config.global.s sVar = this.m;
|
|
if (sVar != null) {
|
|
TimeUnit timeUnit = TimeUnit.SECONDS;
|
|
int i = 10;
|
|
int a2 = ((com.fyber.inneractive.sdk.config.global.features.p) sVar.a(com.fyber.inneractive.sdk.config.global.features.p.class)).a("load_timeout", 10);
|
|
if (a2 < 30 && a2 > 2) {
|
|
i = a2;
|
|
}
|
|
long millis = timeUnit.toMillis(i);
|
|
this.n = millis;
|
|
IAlog.a("InternalStoreWebpageController: Starting load timeout with %d", Long.valueOf(millis));
|
|
}
|
|
this.o = System.currentTimeMillis();
|
|
v vVar = new v(this);
|
|
this.p = vVar;
|
|
com.fyber.inneractive.sdk.util.p.b.postDelayed(vVar, this.n);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.ignite.o
|
|
public final void b(String str) {
|
|
this.z = true;
|
|
if (this.j.equals(str)) {
|
|
com.fyber.inneractive.sdk.ignite.c cVar = this.b;
|
|
com.fyber.inneractive.sdk.ignite.d dVar = cVar.m;
|
|
if (dVar != null) {
|
|
com.fyber.inneractive.sdk.util.p.b.removeCallbacks(dVar);
|
|
cVar.m = null;
|
|
}
|
|
d("onInstallStart();");
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.ignite.o
|
|
public final void a(String str, int i, double d2) {
|
|
if (this.j.equals(str)) {
|
|
if (i == 0) {
|
|
d(String.format("onDownloadProgress(%f);", Double.valueOf(d2)));
|
|
} else {
|
|
if (i != 1) {
|
|
return;
|
|
}
|
|
d("onInstallationProgress();");
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.ignite.o
|
|
public final void a(String str) {
|
|
this.z = false;
|
|
this.A = true;
|
|
if (this.j.equals(str)) {
|
|
com.fyber.inneractive.sdk.ignite.c cVar = this.b;
|
|
com.fyber.inneractive.sdk.ignite.d dVar = cVar.m;
|
|
if (dVar != null) {
|
|
com.fyber.inneractive.sdk.util.p.b.removeCallbacks(dVar);
|
|
cVar.m = null;
|
|
}
|
|
d("onInstallationSuccess();");
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.ignite.o
|
|
public final void a(String str, String str2, String str3) {
|
|
com.fyber.inneractive.sdk.ignite.i iVar;
|
|
IIgniteServiceAPI iIgniteServiceAPI;
|
|
if (this.D) {
|
|
this.z = false;
|
|
if (this.j.equals(str)) {
|
|
com.fyber.inneractive.sdk.ignite.c cVar = this.b;
|
|
com.fyber.inneractive.sdk.ignite.d dVar = cVar.m;
|
|
if (dVar != null) {
|
|
com.fyber.inneractive.sdk.util.p.b.removeCallbacks(dVar);
|
|
cVar.m = null;
|
|
}
|
|
if (!this.v.get() && !TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str2) && str2.equals("App already installed")) {
|
|
d("onInstallationSuccess();");
|
|
this.A = true;
|
|
return;
|
|
}
|
|
}
|
|
if ((str2 != null && (str2.equals(com.fyber.inneractive.sdk.ignite.h.NOT_CONNECTED.e()) || str2.equals(com.fyber.inneractive.sdk.ignite.h.SESSION_EXPIRED.e()))) || !this.b.m()) {
|
|
if (this.t.getAndIncrement() < 2) {
|
|
this.b.a(new c(str2, str3));
|
|
return;
|
|
}
|
|
com.fyber.inneractive.sdk.ignite.c cVar2 = this.b;
|
|
com.fyber.inneractive.sdk.ignite.d dVar2 = cVar2.m;
|
|
if (dVar2 != null) {
|
|
com.fyber.inneractive.sdk.util.p.b.removeCallbacks(dVar2);
|
|
cVar2.m = null;
|
|
}
|
|
d("onInstallationFailed();");
|
|
com.fyber.inneractive.sdk.ignite.c cVar3 = this.b;
|
|
com.fyber.inneractive.sdk.ignite.k kVar = cVar3.p;
|
|
if (kVar == null || !kVar.isConnected() || (iIgniteServiceAPI = cVar3.b) == null || !iIgniteServiceAPI.asBinder().isBinderAlive()) {
|
|
com.fyber.inneractive.sdk.ignite.h hVar = com.fyber.inneractive.sdk.ignite.h.FAILED_TO_BIND_SERVICE;
|
|
com.fyber.inneractive.sdk.ignite.c cVar4 = this.b;
|
|
if (!cVar4.i && (iVar = this.h) != null) {
|
|
cVar4.i = true;
|
|
((p.a) iVar).a(com.fyber.inneractive.sdk.network.q.IGNITE_FLOW_FAILED_TO_START, null, hVar.e(), null);
|
|
}
|
|
}
|
|
} else if (!TextUtils.equals(str2, com.fyber.inneractive.sdk.ignite.h.DOWNLOAD_IS_CANCELLED.e())) {
|
|
com.fyber.inneractive.sdk.ignite.c cVar5 = this.b;
|
|
com.fyber.inneractive.sdk.ignite.d dVar3 = cVar5.m;
|
|
if (dVar3 != null) {
|
|
com.fyber.inneractive.sdk.util.p.b.removeCallbacks(dVar3);
|
|
cVar5.m = null;
|
|
}
|
|
d("onInstallationFailed();");
|
|
}
|
|
com.fyber.inneractive.sdk.ignite.l lVar = this.d;
|
|
if (lVar != null) {
|
|
((p.a) this.h).a(com.fyber.inneractive.sdk.network.q.IGNITE_FLOW_FAILED_TO_INSTALL_APP, str2, str3, lVar);
|
|
}
|
|
}
|
|
}
|
|
}
|