- 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
247 lines
9.0 KiB
Java
247 lines
9.0 KiB
Java
package com.fyber.inneractive.sdk.click;
|
|
|
|
import android.app.Activity;
|
|
import android.content.ActivityNotFoundException;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.net.Uri;
|
|
import android.text.TextUtils;
|
|
import com.fyber.inneractive.sdk.activities.InneractiveInternalBrowserActivity;
|
|
import com.fyber.inneractive.sdk.config.IAConfigManager;
|
|
import com.fyber.inneractive.sdk.network.q0;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import com.fyber.inneractive.sdk.util.a0;
|
|
import com.fyber.inneractive.sdk.util.p;
|
|
import com.fyber.inneractive.sdk.web.u;
|
|
import com.google.android.gms.drive.DriveFile;
|
|
import com.ironsource.nb;
|
|
import com.ironsource.v8;
|
|
import java.net.URLDecoder;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class l {
|
|
public Context a;
|
|
public String b;
|
|
public final boolean c;
|
|
public b d;
|
|
public q0 g;
|
|
public u i;
|
|
public boolean j;
|
|
public com.fyber.inneractive.sdk.ignite.l k;
|
|
public long f = 0;
|
|
public final ArrayList<com.fyber.inneractive.sdk.click.a> h = new ArrayList<>();
|
|
public final ArrayList e = new ArrayList();
|
|
public final boolean l = IAConfigManager.c().a().a(false, "should_decode_url");
|
|
|
|
public class a implements Runnable {
|
|
public final /* synthetic */ com.fyber.inneractive.sdk.click.b a;
|
|
|
|
public a(com.fyber.inneractive.sdk.click.b bVar) {
|
|
this.a = bVar;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
b bVar = l.this.d;
|
|
if (bVar != null) {
|
|
bVar.a(this.a);
|
|
}
|
|
}
|
|
}
|
|
|
|
public interface b {
|
|
void a(com.fyber.inneractive.sdk.click.b bVar);
|
|
}
|
|
|
|
public static final class c extends Exception {
|
|
public c(String str) {
|
|
super(str);
|
|
}
|
|
}
|
|
|
|
public enum d {
|
|
FAILED(v8.h.t),
|
|
OPEN_GOOGLE_STORE(v8.h.U),
|
|
OPENED_IN_INTERNAL_BROWSER("internal browser"),
|
|
OPENED_IN_EXTERNAL_BROWSER("external browser"),
|
|
INTERNAL_REDIRECT("internal redirect"),
|
|
OPEN_IN_EXTERNAL_APPLICATION("external app"),
|
|
DEEP_LINK("deep link"),
|
|
OPENED_USING_CHROME_NAVIGATE("chrome navigate"),
|
|
OPEN_INTERNAL_STORE("internal store");
|
|
|
|
public String simpleName;
|
|
|
|
d(String str) {
|
|
this.simpleName = str;
|
|
}
|
|
}
|
|
|
|
public l(boolean z) {
|
|
this.c = z;
|
|
}
|
|
|
|
public final void a(Context context, String str, b bVar, u uVar, boolean z, com.fyber.inneractive.sdk.ignite.l lVar, String str2) {
|
|
this.a = context;
|
|
this.b = str;
|
|
this.d = bVar;
|
|
this.j = z;
|
|
this.f = System.currentTimeMillis();
|
|
this.i = uVar;
|
|
this.k = lVar;
|
|
if (a(this.b) == null) {
|
|
String str3 = this.b;
|
|
try {
|
|
Uri a2 = a(this.l, str3);
|
|
if (a(a2)) {
|
|
IAlog.a("%sfollowRedirects: Fetching uri: %s", IAlog.a(this), a2.toString());
|
|
String uri = a2.toString();
|
|
q0 q0Var = new q0(new k(this, uri, str2), uri);
|
|
this.g = q0Var;
|
|
IAConfigManager.L.r.a(q0Var);
|
|
}
|
|
} catch (Exception e) {
|
|
if (e instanceof InterruptedException) {
|
|
return;
|
|
}
|
|
IAlog.b("%sfailed followRedirects %s", IAlog.a(this), e);
|
|
this.e.add(new i(str3, false, d.INTERNAL_REDIRECT, null));
|
|
a(new com.fyber.inneractive.sdk.click.b(str3, d.FAILED, "followRedirects", e));
|
|
}
|
|
}
|
|
}
|
|
|
|
public final boolean a(Uri uri) {
|
|
if (uri == null) {
|
|
IAlog.a("%s followRedirects: Got a url which is not valid: null", IAlog.a(this));
|
|
this.e.add(new i(null, false, null, "Invalid url"));
|
|
a(a(uri.toString(), "followRedirects", "Invalid url"));
|
|
return false;
|
|
}
|
|
String scheme = uri.getScheme();
|
|
if (scheme != null && (scheme.equalsIgnoreCase("http") || scheme.equalsIgnoreCase("https"))) {
|
|
return true;
|
|
}
|
|
IAlog.a("%scould not follow redirects for scheme: %s", IAlog.a(this), uri.getScheme());
|
|
IAlog.a("%sfull url: %s", IAlog.a(this), uri.toString());
|
|
this.e.add(new i(uri.toString(), false, null, "Invalid scheme: " + uri.getScheme()));
|
|
a(a(uri.toString(), "followRedirects", "Invalid scheme: " + uri.getScheme()));
|
|
return false;
|
|
}
|
|
|
|
public final com.fyber.inneractive.sdk.click.b a(String str) {
|
|
Uri uri;
|
|
try {
|
|
uri = Uri.parse(str);
|
|
} catch (Exception unused) {
|
|
IAlog.a("IAJavaUtil: getValidUri: Invalid url %s", str);
|
|
uri = null;
|
|
}
|
|
if (uri == null) {
|
|
this.e.add(new i(str, false, null, "illegal uri"));
|
|
return a(a(str, (String) null, "illegal uri"));
|
|
}
|
|
if (this.h.isEmpty()) {
|
|
this.e.add(new i(str, false, null, "no click handlers found"));
|
|
return a(a(str, (String) null, "no click handlers found"));
|
|
}
|
|
Iterator<com.fyber.inneractive.sdk.click.a> it = this.h.iterator();
|
|
while (it.hasNext()) {
|
|
com.fyber.inneractive.sdk.click.a next = it.next();
|
|
if (next.a(uri, this)) {
|
|
Context context = this.a;
|
|
com.fyber.inneractive.sdk.click.b a2 = context != null ? next.a(context, uri, this.e) : null;
|
|
if (a2 != null) {
|
|
return a(a2);
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX WARN: Type inference failed for: r9v0, types: [java.lang.Exception] */
|
|
/* JADX WARN: Type inference failed for: r9v3, types: [java.lang.Throwable] */
|
|
/* JADX WARN: Type inference failed for: r9v4, types: [java.lang.Throwable] */
|
|
public static void a(l lVar, String str, String str2, String str3, Exception exc) {
|
|
String message;
|
|
String str4;
|
|
if (lVar.c) {
|
|
Intent intent = new Intent(lVar.a, (Class<?>) InneractiveInternalBrowserActivity.class);
|
|
if (!TextUtils.isEmpty(str)) {
|
|
InneractiveInternalBrowserActivity.setHtmlExtra(str);
|
|
}
|
|
intent.putExtra(InneractiveInternalBrowserActivity.URL_EXTRA, str2);
|
|
intent.putExtra("spotId", str3);
|
|
if (!(lVar.a instanceof Activity)) {
|
|
intent.setFlags(DriveFile.MODE_READ_ONLY);
|
|
}
|
|
try {
|
|
Context context = lVar.a;
|
|
if (context != null) {
|
|
context.startActivity(intent);
|
|
}
|
|
ArrayList arrayList = lVar.e;
|
|
boolean z = exc == 0;
|
|
d dVar = d.OPENED_IN_INTERNAL_BROWSER;
|
|
if (exc == 0) {
|
|
str4 = null;
|
|
} else {
|
|
do {
|
|
message = exc.getMessage();
|
|
exc = exc.getCause();
|
|
} while (exc != 0);
|
|
str4 = message;
|
|
}
|
|
arrayList.add(new i(str2, z, dVar, str4));
|
|
lVar.a(a(str2, d.OPENED_IN_INTERNAL_BROWSER, "followRedirects"));
|
|
return;
|
|
} catch (ActivityNotFoundException unused) {
|
|
lVar.e.add(new i(str2, false, d.OPENED_IN_INTERNAL_BROWSER, "internal browser not registered"));
|
|
lVar.a(a(str2, "followRedirects", "internal browser not registered"));
|
|
return;
|
|
}
|
|
}
|
|
lVar.e.add(new i(str2, false, d.OPENED_IN_INTERNAL_BROWSER, "internal browser not usable"));
|
|
lVar.a(a(str2, "followRedirects", "internal browser not usable"));
|
|
}
|
|
|
|
public static Uri a(boolean z, String str) {
|
|
try {
|
|
if (z) {
|
|
if (!a0.d(str)) {
|
|
return Uri.parse(URLDecoder.decode(str, nb.N));
|
|
}
|
|
return Uri.parse(str);
|
|
}
|
|
if (a0.d(str)) {
|
|
return Uri.parse(URLDecoder.decode(str, nb.N));
|
|
}
|
|
return Uri.parse(str);
|
|
} catch (Exception unused) {
|
|
IAlog.a("%sgetDecodedUri: Failed parsing Uri!", "SuperClickHandler");
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static com.fyber.inneractive.sdk.click.b a(String str, String str2, String str3) {
|
|
return new com.fyber.inneractive.sdk.click.b(str, d.FAILED, str2, new c(str3));
|
|
}
|
|
|
|
public static com.fyber.inneractive.sdk.click.b a(String str, d dVar, String str2) {
|
|
return new com.fyber.inneractive.sdk.click.b(str, dVar, str2, null);
|
|
}
|
|
|
|
public final com.fyber.inneractive.sdk.click.b a(com.fyber.inneractive.sdk.click.b bVar) {
|
|
ArrayList arrayList = this.e;
|
|
bVar.f.clear();
|
|
bVar.f.addAll(arrayList);
|
|
bVar.e = System.currentTimeMillis() - this.f;
|
|
IAlog.a("%s reporting result: %s", IAlog.a(this), bVar);
|
|
p.b.post(new a(bVar));
|
|
return bVar;
|
|
}
|
|
}
|