- 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
352 lines
10 KiB
Java
352 lines
10 KiB
Java
package com.fyber.inneractive.sdk.network;
|
|
|
|
import android.util.Log;
|
|
import com.fyber.inneractive.sdk.config.IAConfigManager;
|
|
import com.fyber.inneractive.sdk.factories.b;
|
|
import com.fyber.inneractive.sdk.network.c0;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public abstract class f0<T> implements c0<T> {
|
|
public volatile boolean a;
|
|
public final w<T> b;
|
|
public final g c;
|
|
public c0.a d;
|
|
public j e;
|
|
public volatile r0 f;
|
|
public final String g;
|
|
public final com.fyber.inneractive.sdk.config.global.s h;
|
|
public long i;
|
|
public long j;
|
|
public int k;
|
|
public boolean l;
|
|
public boolean m;
|
|
public final Object n;
|
|
public boolean o;
|
|
|
|
public class a implements Runnable {
|
|
public final /* synthetic */ Object a;
|
|
public final /* synthetic */ Exception b;
|
|
public final /* synthetic */ boolean c;
|
|
|
|
public a(Object obj, Exception exc, boolean z) {
|
|
this.a = obj;
|
|
this.b = exc;
|
|
this.c = z;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
f0.this.b.a(this.a, this.b, this.c);
|
|
}
|
|
}
|
|
|
|
public f0(w<T> wVar, g gVar) {
|
|
this(wVar, gVar, null);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public void a(b0 b0Var, String str, String str2) {
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public String b() {
|
|
return null;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public void b(long j) {
|
|
synchronized (this.n) {
|
|
try {
|
|
if (!this.l) {
|
|
this.l = true;
|
|
this.j = j;
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public void c() {
|
|
boolean z;
|
|
synchronized (this.n) {
|
|
z = this.l;
|
|
}
|
|
if (z) {
|
|
a(System.currentTimeMillis());
|
|
} else if (v()) {
|
|
c(System.currentTimeMillis());
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public boolean e() {
|
|
return !(this instanceof q0);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public u0 f() {
|
|
IAConfigManager iAConfigManager = IAConfigManager.L;
|
|
return new u0(iAConfigManager.t.b.a(5000, 1, "connect_timeout"), iAConfigManager.t.b.a(5000, 1, "read_timeout"));
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final String getId() {
|
|
return this.g;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final r0 h() {
|
|
return this.f;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final boolean isCancelled() {
|
|
return this.a;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public Map<String, String> k() {
|
|
return null;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public com.fyber.inneractive.sdk.network.a<T> o() {
|
|
return null;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public com.fyber.inneractive.sdk.config.global.s p() {
|
|
return this.h;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public String q() {
|
|
return "application/json; charset=utf-8";
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public byte[] r() {
|
|
return null;
|
|
}
|
|
|
|
public int t() {
|
|
return this.k;
|
|
}
|
|
|
|
public int u() {
|
|
int i;
|
|
synchronized (this.n) {
|
|
i = this.k;
|
|
}
|
|
return i;
|
|
}
|
|
|
|
public final boolean v() {
|
|
boolean z;
|
|
synchronized (this.n) {
|
|
z = this.m;
|
|
}
|
|
return z;
|
|
}
|
|
|
|
public f0(w<T> wVar, g gVar, com.fyber.inneractive.sdk.config.global.s sVar) {
|
|
this.a = false;
|
|
this.f = r0.INITIAL;
|
|
this.i = 0L;
|
|
this.j = 0L;
|
|
this.k = 0;
|
|
this.l = false;
|
|
this.m = false;
|
|
this.n = new Object();
|
|
this.o = false;
|
|
this.b = wVar;
|
|
this.c = gVar;
|
|
this.g = UUID.randomUUID().toString();
|
|
this.h = sVar;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final boolean i() {
|
|
return this.o && ((com.fyber.inneractive.sdk.config.global.features.k) IAConfigManager.L.K.a(com.fyber.inneractive.sdk.config.global.features.k.class)).a(true, "should_manage_request_watchdog");
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public int m() {
|
|
com.fyber.inneractive.sdk.config.global.s sVar = this.h;
|
|
if (sVar != null) {
|
|
return ((com.fyber.inneractive.sdk.config.global.features.k) sVar.a(com.fyber.inneractive.sdk.config.global.features.k.class)).a("watchdog_buffer_time_ms", 500);
|
|
}
|
|
return 500;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final boolean n() {
|
|
if (!this.o) {
|
|
return false;
|
|
}
|
|
com.fyber.inneractive.sdk.config.global.features.k kVar = (com.fyber.inneractive.sdk.config.global.features.k) IAConfigManager.L.K.a(com.fyber.inneractive.sdk.config.global.features.k.class);
|
|
return kVar.a(false, "should_add_request_watchdog") || kVar.a(false, "should_report_request_watchdog");
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public j a(String str) throws Exception {
|
|
IAConfigManager iAConfigManager;
|
|
try {
|
|
c0.a aVar = this.d;
|
|
if (aVar != null) {
|
|
aVar.a("sdkInitNetworkRequest");
|
|
}
|
|
int i = 0;
|
|
while (true) {
|
|
iAConfigManager = IAConfigManager.L;
|
|
if (iAConfigManager.x.c.compareAndSet(true, true) || i >= 25) {
|
|
break;
|
|
}
|
|
IAlog.a("UserAgentProvider | waiting on user agent", new Object[0]);
|
|
try {
|
|
Thread.sleep(100L);
|
|
} catch (InterruptedException unused) {
|
|
}
|
|
i++;
|
|
}
|
|
this.e = this.c.a(this, iAConfigManager.x.a(), str);
|
|
c0.a aVar2 = this.d;
|
|
if (aVar2 != null) {
|
|
aVar2.a("sdkGotServerResponse");
|
|
}
|
|
return this.e;
|
|
} catch (b e) {
|
|
IAlog.a("failed start network request", e, new Object[0]);
|
|
throw e;
|
|
} catch (x0 e2) {
|
|
IAlog.a("failed read network response", e2, new Object[0]);
|
|
throw e2;
|
|
} catch (Exception e3) {
|
|
IAlog.a("failed start network request", e3, new Object[0]);
|
|
throw e3;
|
|
}
|
|
}
|
|
|
|
public void c(long j) {
|
|
synchronized (this.n) {
|
|
try {
|
|
if (this.m) {
|
|
this.k = (int) ((j - this.i) + this.k);
|
|
this.m = false;
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final void a() {
|
|
try {
|
|
j jVar = this.e;
|
|
if (jVar != null) {
|
|
jVar.a();
|
|
}
|
|
this.c.a();
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final void a(T t, Exception exc, boolean z) {
|
|
if (!z) {
|
|
a(r0.RESOLVED);
|
|
}
|
|
com.fyber.inneractive.sdk.util.p.b.post(new a(t, exc, z));
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final void a(r0 r0Var) {
|
|
c0.a aVar;
|
|
this.f = r0Var;
|
|
if (r0Var != r0.QUEUED_FOR_RETRY || (aVar = this.d) == null) {
|
|
return;
|
|
}
|
|
aVar.a("sdkRequestEndedButWillBeRetried");
|
|
}
|
|
|
|
public final com.fyber.inneractive.sdk.response.e a(int i, n nVar, com.fyber.inneractive.sdk.bidder.adm.f fVar, com.fyber.inneractive.sdk.dv.g gVar) throws Exception {
|
|
try {
|
|
com.fyber.inneractive.sdk.response.a a2 = com.fyber.inneractive.sdk.response.a.a(i);
|
|
if (a2 == null) {
|
|
a2 = com.fyber.inneractive.sdk.response.a.RETURNED_ADTYPE_MRAID;
|
|
}
|
|
com.fyber.inneractive.sdk.factories.b bVar = b.a.a;
|
|
b.InterfaceC0070b interfaceC0070b = bVar.a.get(a2);
|
|
com.fyber.inneractive.sdk.response.b b = interfaceC0070b != null ? interfaceC0070b.b() : null;
|
|
if (b == null) {
|
|
IAlog.f("Received ad type %s does not have an appropriate parser!", Integer.valueOf(i));
|
|
if (bVar.a.size() == 0) {
|
|
Log.e("Inneractive_error", "Critical error raised while fetching an ad - please make sure you have added all the required fyber libraries (ia-mraid-kit, ia-video-kit) to your project");
|
|
}
|
|
throw new a0("Could not find parser for ad type " + i);
|
|
}
|
|
IAlog.a("Received ad type %s - Got parser! %s", Integer.valueOf(i), b);
|
|
if (fVar != null) {
|
|
b.c = fVar;
|
|
}
|
|
b.a = b.a();
|
|
if (nVar != null) {
|
|
b.c = new com.fyber.inneractive.sdk.response.k(nVar);
|
|
}
|
|
com.fyber.inneractive.sdk.response.e a3 = b.a(null);
|
|
a3.I = t();
|
|
if (gVar != null) {
|
|
a3.s = gVar;
|
|
}
|
|
c0.a aVar = this.d;
|
|
if (aVar != null) {
|
|
aVar.a("sdkParsedResponse");
|
|
}
|
|
return a3;
|
|
} catch (Exception e) {
|
|
IAlog.a("failed parse ad network request", e, new Object[0]);
|
|
throw new a0(e);
|
|
}
|
|
}
|
|
|
|
public f0(f0<T> f0Var) {
|
|
this.a = false;
|
|
this.f = r0.INITIAL;
|
|
this.i = 0L;
|
|
this.j = 0L;
|
|
this.k = 0;
|
|
this.l = false;
|
|
this.m = false;
|
|
this.n = new Object();
|
|
this.o = false;
|
|
this.b = f0Var.b;
|
|
this.c = f0Var.c;
|
|
this.g = UUID.randomUUID().toString();
|
|
this.h = f0Var.h;
|
|
this.k = f0Var.k;
|
|
this.i = f0Var.i;
|
|
this.j = f0Var.j;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public void a(long j) {
|
|
synchronized (this.n) {
|
|
try {
|
|
if (this.l) {
|
|
this.k = (int) ((j - this.j) + this.k);
|
|
this.l = false;
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
}
|