discord-jadx/app/src/main/java/c/i/a/f/h/l/l2.java

135 lines
5.7 KiB
Java

package c.i.a.f.h.l;
import android.net.Uri;
import android.util.Log;
import c.i.a.f.e.o.f;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public abstract class l2<T> {
public static final Object a = new Object();
public static volatile t2 b;
/* renamed from: c reason: collision with root package name */
public static u2 f1139c = new u2(n2.a);
public static final AtomicInteger d = new AtomicInteger();
public final q2 e;
public final String f;
public final T g;
public volatile int h = -1;
public volatile T i;
public final boolean j;
static {
new AtomicReference();
}
/* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: java.lang.Object */
/* JADX WARN: Multi-variable type inference failed */
public l2(q2 q2Var, String str, Object obj, boolean z2, m2 m2Var) {
if (q2Var.a != null) {
this.e = q2Var;
this.f = str;
this.g = obj;
this.j = z2;
return;
}
throw new IllegalArgumentException("Must pass a valid SharedPreferences file name or ContentProvider URI");
}
public abstract T a(Object obj);
public final String b(String str) {
if (str != null && str.isEmpty()) {
return this.f;
}
String valueOf = String.valueOf(str);
String valueOf2 = String.valueOf(this.f);
return valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf);
}
public final String c() {
Objects.requireNonNull(this.e);
return b("");
}
/* JADX WARNING: Removed duplicated region for block: B:41:0x00c1 */
/* JADX WARNING: Removed duplicated region for block: B:42:0x00c2 */
/* JADX WARNING: Removed duplicated region for block: B:51:0x00f6 */
public final T d() {
T t;
x2<h2> a2;
Object g;
boolean z2 = true;
if (!this.j) {
u2 u2Var = f1139c;
String str = this.f;
Objects.requireNonNull(u2Var);
Objects.requireNonNull(str, "flagName must not be null");
f.X1(true, "Attempt to access PhenotypeFlag not via codegen. All new PhenotypeFlags must be accessed through codegen APIs. If you believe you are seeing this error by mistake, you can add your flag to the exemption list located at //java/com/google/android/libraries/phenotype/client/lockdown/flags.textproto. Send the addition CL to ph-reviews@. See go/phenotype-android-codegen for information about generated code. See go/ph-lockdown for more information about this error.");
}
int i = d.get();
if (this.h < i) {
synchronized (this) {
if (this.h < i) {
t2 t2Var = b;
f.X1(t2Var != null, "Must call PhenotypeFlag.init() first");
String str2 = (String) c2.a(t2Var.a()).g("gms:phenotype:phenotype_flag:debug_bypass_phenotype");
if (str2 == null || !u1.f1170c.matcher(str2).matches()) {
z2 = false;
}
String str3 = null;
if (!z2) {
b2 a3 = this.e.a != null ? j2.a(t2Var.a(), this.e.a) ? y1.a(t2Var.a().getContentResolver(), this.e.a) : null : s2.a(t2Var.a());
if (!(a3 == null || (g = a3.g(c())) == null)) {
t = a(g);
if (t != null) {
c2 a4 = c2.a(t2Var.a());
Objects.requireNonNull(this.e);
Object g2 = a4.g(b(""));
t = g2 != null ? a(g2) : null;
if (t == null) {
t = this.g;
}
}
a2 = t2Var.b().a();
if (a2.b()) {
h2 c2 = a2.c();
q2 q2Var = this.e;
Uri uri = q2Var.a;
Objects.requireNonNull(q2Var);
String str4 = this.f;
Objects.requireNonNull(c2);
if (uri != null) {
Map<String, String> map = c2.a.get(uri.toString());
if (map != null) {
String valueOf = String.valueOf(str4);
str3 = map.get(valueOf.length() != 0 ? "".concat(valueOf) : new String(""));
}
}
t = str3 == null ? this.g : a(str3);
}
this.i = t;
this.h = i;
}
} else if (Log.isLoggable("PhenotypeFlag", 3)) {
String valueOf2 = String.valueOf(c());
Log.d("PhenotypeFlag", valueOf2.length() != 0 ? "Bypass reading Phenotype values for flag: ".concat(valueOf2) : new String("Bypass reading Phenotype values for flag: "));
}
t = null;
if (t != null) {
}
a2 = t2Var.b().a();
if (a2.b()) {
}
this.i = t;
this.h = i;
}
}
}
return this.i;
}
}