discord-jadx/app/src/main/java/c/i/a/f/i/b/w4.java

259 lines
10 KiB
Java

package c.i.a.f.i.b;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import c.i.a.f.e.o.d;
import c.i.a.f.e.p.b;
import c.i.a.f.h.l.a9;
import c.i.a.f.h.l.ea;
import c.i.a.f.h.l.t8;
import com.google.android.gms.internal.measurement.zzae;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class w4 implements Runnable {
public final /* synthetic */ y5 i;
public final /* synthetic */ u4 j;
public w4(u4 u4Var, y5 y5Var) {
this.j = u4Var;
this.i = y5Var;
}
/* JADX WARNING: Code restructure failed: missing block: B:103:0x0317, code lost:
if (android.text.TextUtils.isEmpty(r1.l) == false) goto L_0x0319;
*/
/* JADX WARNING: Code restructure failed: missing block: B:134:0x0485, code lost:
if (android.text.TextUtils.isEmpty(r1.l) == false) goto L_0x0487;
*/
/* JADX WARNING: Code restructure failed: missing block: B:52:0x01bd, code lost:
if (r1.equals(c.i.a.f.i.b.d.a) == false) goto L_0x01c2;
*/
@Override // java.lang.Runnable
public final void run() {
d dVar;
String str;
s3 s3Var;
u4 u4Var = this.j;
y5 y5Var = this.i;
u4Var.f().b();
j jVar = new j(u4Var);
jVar.p();
u4Var.v = jVar;
n3 n3Var = new n3(u4Var, y5Var.f);
n3Var.u();
u4Var.w = n3Var;
m3 m3Var = new m3(u4Var);
m3Var.u();
u4Var.t = m3Var;
q7 q7Var = new q7(u4Var);
q7Var.u();
u4Var.u = q7Var;
u4Var.m.q();
u4Var.i.q();
u4Var.f1197x = new m4(u4Var);
n3 n3Var2 = u4Var.w;
if (!n3Var2.b) {
n3Var2.w();
n3Var2.a.G.incrementAndGet();
boolean z2 = true;
n3Var2.b = true;
u4Var.g().l.b("App measurement initialized, version", 33025L);
u4Var.g().l.a("To enable debug logging run: adb shell setprop log.tag.FA VERBOSE");
n3Var.t();
String str2 = n3Var.f1172c;
if (TextUtils.isEmpty(u4Var.f1195c)) {
if (u4Var.t().s0(str2)) {
s3Var = u4Var.g().l;
str = "Faster debug mode event logging enabled. To disable, run:\n adb shell setprop debug.firebase.analytics.app .none.";
} else {
s3 s3Var2 = u4Var.g().l;
String valueOf = String.valueOf(str2);
str = valueOf.length() != 0 ? "To enable faster debug mode event logging run:\n adb shell setprop debug.firebase.analytics.app ".concat(valueOf) : new String("To enable faster debug mode event logging run:\n adb shell setprop debug.firebase.analytics.app ");
s3Var = s3Var2;
}
s3Var.a(str);
}
u4Var.g().m.a("Debug-level message logging enabled");
if (u4Var.F != u4Var.G.get()) {
u4Var.g().f.c("Not all components initialized", Integer.valueOf(u4Var.F), Integer.valueOf(u4Var.G.get()));
}
u4Var.f1198y = true;
u4 u4Var2 = this.j;
zzae zzae = this.i.g;
u4Var2.f().b();
if (t8.b() && u4Var2.h.o(p.H0)) {
d y2 = u4Var2.o().y();
d4 o = u4Var2.o();
o.b();
int i = o.w().getInt("consent_source", 100);
int i2 = 40;
if (u4Var2.h.o(p.I0)) {
c cVar = u4Var2.h;
Objects.requireNonNull(cVar);
Boolean w = (!t8.b() || !cVar.o(p.I0)) ? null : cVar.w("google_analytics_default_allow_ad_storage");
c cVar2 = u4Var2.h;
Objects.requireNonNull(cVar2);
Boolean w2 = (!t8.b() || !cVar2.o(p.I0)) ? null : cVar2.w("google_analytics_default_allow_analytics_storage");
if (!(w == null && w2 == null) && u4Var2.o().t(20)) {
dVar = new d(w, w2);
i2 = 20;
} else {
n3 z3 = u4Var2.z();
z3.t();
if (!TextUtils.isEmpty(z3.k) && (i == 30 || i == 40)) {
u4Var2.s().A(d.a, 20, u4Var2.H);
} else if (!(zzae == null || zzae.o == null || !u4Var2.o().t(40))) {
dVar = d.g(zzae.o);
}
dVar = null;
i2 = 0;
}
if (dVar != null) {
u4Var2.s().A(dVar, i2, u4Var2.H);
}
u4Var2.s().z(y2);
} else {
if (!(zzae == null || zzae.o == null || !u4Var2.o().t(40))) {
dVar = d.g(zzae.o);
if (!dVar.equals(d.a)) {
u4Var2.s().A(dVar, 40, u4Var2.H);
}
}
u4Var2.s().z(y2);
}
y2 = dVar;
u4Var2.s().z(y2);
}
if (u4Var2.o().f.a() == 0) {
h4 h4Var = u4Var2.o().f;
Objects.requireNonNull((d) u4Var2.o);
h4Var.b(System.currentTimeMillis());
}
if (Long.valueOf(u4Var2.o().k.a()).longValue() == 0) {
u4Var2.g().n.b("Persisting first open", Long.valueOf(u4Var2.H));
u4Var2.o().k.b(u4Var2.H);
}
if (u4Var2.h.o(p.D0)) {
y9 y9Var = u4Var2.s().n;
if (y9Var.c() && y9Var.b()) {
y9Var.a.o().B.b(null);
}
}
if (u4Var2.m()) {
n3 z4 = u4Var2.z();
z4.t();
if (TextUtils.isEmpty(z4.k)) {
n3 z5 = u4Var2.z();
z5.t();
}
u4Var2.t();
n3 z6 = u4Var2.z();
z6.t();
String str3 = z6.k;
d4 o2 = u4Var2.o();
o2.b();
String string = o2.w().getString("gmp_app_id", null);
n3 z7 = u4Var2.z();
z7.t();
String str4 = z7.l;
d4 o3 = u4Var2.o();
o3.b();
if (t9.d0(str3, string, str4, o3.w().getString("admob_app_id", null))) {
u4Var2.g().l.a("Rechecking which service to use due to a GMP App Id change");
d4 o4 = u4Var2.o();
o4.b();
Boolean x2 = o4.x();
SharedPreferences.Editor edit = o4.w().edit();
edit.clear();
edit.apply();
if (x2 != null) {
o4.s(x2);
}
u4.p(u4Var2.t);
u4Var2.t.y();
u4Var2.u.D();
u4Var2.u.C();
u4Var2.o().k.b(u4Var2.H);
u4Var2.o().m.b(null);
}
d4 o5 = u4Var2.o();
n3 z8 = u4Var2.z();
z8.t();
String str5 = z8.k;
o5.b();
SharedPreferences.Editor edit2 = o5.w().edit();
edit2.putString("gmp_app_id", str5);
edit2.apply();
d4 o6 = u4Var2.o();
n3 z9 = u4Var2.z();
z9.t();
String str6 = z9.l;
o6.b();
SharedPreferences.Editor edit3 = o6.w().edit();
edit3.putString("admob_app_id", str6);
edit3.apply();
if (t8.b() && u4Var2.h.o(p.H0) && !u4Var2.o().y().k()) {
u4Var2.o().m.b(null);
}
u4Var2.s().g.set(u4Var2.o().m.a());
if (a9.b() && u4Var2.h.o(p.p0)) {
t9 t = u4Var2.t();
Objects.requireNonNull(t);
try {
t.a.b.getClassLoader().loadClass("com.google.firebase.remoteconfig.FirebaseRemoteConfig");
} catch (ClassNotFoundException unused) {
z2 = false;
}
if (!z2 && !TextUtils.isEmpty(u4Var2.o().A.a())) {
u4Var2.g().i.a("Remote config removed with active feature rollouts");
u4Var2.o().A.b(null);
}
}
n3 z10 = u4Var2.z();
z10.t();
if (TextUtils.isEmpty(z10.k)) {
n3 z11 = u4Var2.z();
z11.t();
}
boolean d = u4Var2.d();
if (!u4Var2.o().d.contains("deferred_analytics_collection") && !u4Var2.h.x()) {
u4Var2.o().v(!d);
}
if (d) {
u4Var2.s().N();
}
u4Var2.r().d.a();
u4Var2.x().A(new AtomicReference<>());
if (ea.b() && u4Var2.h.o(p.z0)) {
q7 x3 = u4Var2.x();
Bundle a = u4Var2.o().D.a();
x3.b();
x3.t();
x3.z(new a8(x3, a, x3.I(false)));
}
} else if (u4Var2.d()) {
if (!u4Var2.t().p0("android.permission.INTERNET")) {
u4Var2.g().f.a("App is missing INTERNET permission");
}
if (!u4Var2.t().p0("android.permission.ACCESS_NETWORK_STATE")) {
u4Var2.g().f.a("App is missing ACCESS_NETWORK_STATE permission");
}
if (!b.a(u4Var2.b).c() && !u4Var2.h.C()) {
if (!n4.a(u4Var2.b)) {
u4Var2.g().f.a("AppMeasurementReceiver not registered/enabled");
}
if (!t9.U(u4Var2.b)) {
u4Var2.g().f.a("AppMeasurementService not registered/enabled");
}
}
u4Var2.g().f.a("Uploading is not possible. App measurement disabled");
}
u4Var2.o().u.a(u4Var2.h.o(p.Y));
return;
}
throw new IllegalStateException("Can't initialize twice");
}
}