Proxy Master v3.4.9版本的 MD5 值为:14d0aa2468d13530c8f6e96bcc114bf5
以下内容为反编译后的 by.java 源代码,内容仅作参考
package com.flurry.sdk;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Pair;
import com.flurry.android.FlurryConfigListener;
import com.flurry.sdk.bw;
import com.flurry.sdk.cb;
import com.flurry.sdk.eq;
import com.google.android.exoplayer2.C;
import io.appmetrica.analytics.coreutils.internal.StringUtils;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.json.JSONObject;
public final class by extends f {
private static volatile by f5788b;
private static final Object f5789k = new Object();
private static ck f5790p;
public bz f5791a;
private bv f5792d;
private cd f5793e;
private cj f5794f;
private cp f5795g;
private Handler f5796h;
private final Map<FlurryConfigListener, Pair<cf, WeakReference<Handler>>> f5797i;
private final Map<cf, Pair<Boolean, Boolean>> f5798j;
private volatile boolean f5799l;
private volatile boolean f5800m;
private volatile boolean f5801n;
private a f5802o;
public static class AnonymousClass6 {
static final int[] f5812a;
static {
int[] iArr = new int[a.values().length];
f5812a = iArr;
try {
iArr[a.None.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
f5812a[a.Complete.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
f5812a[a.CompleteNoChange.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
f5812a[a.Fail.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
}
}
public enum a {
Complete("Complete", 3),
CompleteNoChange("No Change", 2),
Fail("Fail", 1),
None("None", 0);
int f5818e;
private String f5819f;
a(String str, int i10) {
this.f5819f = str;
this.f5818e = i10;
}
@Override
public final String toString() {
return this.f5819f;
}
}
private by() {
this((byte) 0);
}
private by(byte b6) {
super("ConfigManager", eq.a(eq.a.CONFIG));
this.f5797i = new ConcurrentHashMap();
this.f5798j = new HashMap();
this.f5799l = false;
this.f5800m = false;
this.f5801n = false;
this.f5802o = a.None;
f5790p = null;
for (cf cfVar : cf.b()) {
Map<cf, Pair<Boolean, Boolean>> map = this.f5798j;
Boolean bool = Boolean.FALSE;
map.put(cfVar, new Pair<>(bool, bool));
}
this.f5793e = new cd();
this.f5794f = new cj();
this.f5791a = new bz();
this.f5795g = new cp();
this.f5796h = new Handler(Looper.getMainLooper());
runAsync(new ea() {
@Override
public final void a() {
try {
try {
String b10 = cq.b(b.a());
cx.a("ConfigManager", "Cached Data: ".concat(String.valueOf(b10)));
if (b10 != null) {
bz unused = by.this.f5791a;
String d10 = bz.d();
bz unused2 = by.this.f5791a;
if (cq.a(d10, b10, ex.b("lastRSA", (String) null))) {
try {
by.this.f5794f.a(ca.a(new JSONObject(b10)));
} catch (Exception e10) {
cx.b("VariantsManager", "Cached variants parsing error: ", e10);
}
if (by.b() != null) {
by.b();
throw null;
}
} else {
cx.b("ConfigManager", "Incorrect signature for cache.");
cq.c(b.a());
by.this.f5791a.c();
}
}
by.c(by.this);
if (by.this.f5794f.e() > 0) {
for (cf cfVar2 : by.this.f5794f.d()) {
by.this.f5798j.put(cfVar2, new Pair(Boolean.TRUE, Boolean.FALSE));
by.this.a(cfVar2, true);
}
}
} catch (Throwable th) {
by.c(by.this);
if (by.this.f5794f.e() > 0) {
for (cf cfVar3 : by.this.f5794f.d()) {
by.this.f5798j.put(cfVar3, new Pair(Boolean.TRUE, Boolean.FALSE));
by.this.a(cfVar3, true);
}
}
throw th;
}
} catch (Exception e11) {
cx.b("ConfigManager", "Exception!", e11);
by.c(by.this);
if (by.this.f5794f.e() > 0) {
for (cf cfVar4 : by.this.f5794f.d()) {
by.this.f5798j.put(cfVar4, new Pair(Boolean.TRUE, Boolean.FALSE));
by.this.a(cfVar4, true);
}
}
}
}
});
}
public static synchronized by a() {
by f10;
synchronized (by.class) {
f10 = f();
}
return f10;
}
public static ck b() {
return f5790p;
}
public static void b(by byVar, final a aVar) {
synchronized (byVar.f5797i) {
for (Map.Entry<FlurryConfigListener, Pair<cf, WeakReference<Handler>>> entry : byVar.f5797i.entrySet()) {
final FlurryConfigListener key = entry.getKey();
Handler handler = (Handler) ((WeakReference) entry.getValue().second).get();
ea eaVar = new ea() {
@Override
public final void a() {
int i10 = AnonymousClass6.f5812a[aVar.ordinal()];
if (i10 == 2) {
key.onFetchSuccess();
} else if (i10 == 3) {
key.onFetchNoChange();
} else if (i10 != 4) {
} else {
key.onFetchError(by.this.f5800m);
}
}
};
if (handler == null) {
byVar.f5796h.post(eaVar);
} else {
handler.post(eaVar);
}
}
}
}
public static void c(by byVar) {
Object obj = f5789k;
synchronized (obj) {
byVar.f5799l = true;
obj.notifyAll();
}
}
public static boolean e(by byVar) {
byVar.f5800m = false;
return false;
}
private static synchronized by f() {
by byVar;
synchronized (by.class) {
if (f5788b == null) {
f5788b = new by((byte) 0);
}
byVar = f5788b;
}
return byVar;
}
private void g() {
Object obj = f5789k;
synchronized (obj) {
if (!this.f5799l) {
try {
obj.wait(C.DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS);
} catch (InterruptedException e10) {
cx.b("ConfigManager", "Interrupted Exception!", e10);
}
}
}
}
public final void a(FlurryConfigListener flurryConfigListener) {
if (flurryConfigListener == null) {
return;
}
synchronized (this.f5797i) {
this.f5797i.remove(flurryConfigListener);
}
}
public final void a(FlurryConfigListener flurryConfigListener, cf cfVar, Handler handler) {
if (flurryConfigListener == null) {
return;
}
synchronized (this.f5797i) {
if (this.f5797i.containsKey(flurryConfigListener)) {
cx.a(5, "ConfigManager", "The listener is already registered");
return;
}
this.f5797i.put(flurryConfigListener, new Pair<>(cfVar, new WeakReference(handler)));
int i10 = AnonymousClass6.f5812a[this.f5802o.ordinal()];
if (i10 == 2) {
flurryConfigListener.onFetchSuccess();
} else if (i10 == 3) {
flurryConfigListener.onFetchNoChange();
} else if (i10 == 4) {
flurryConfigListener.onFetchError(this.f5800m);
}
if (this.f5798j.containsKey(cfVar)) {
Pair<Boolean, Boolean> pair = this.f5798j.get(cfVar);
if (((Boolean) pair.first).booleanValue() || ((Boolean) pair.second).booleanValue()) {
flurryConfigListener.onActivateComplete(!((Boolean) pair.second).booleanValue());
}
} else {
Map<cf, Pair<Boolean, Boolean>> map = this.f5798j;
Boolean bool = Boolean.FALSE;
map.put(cfVar, new Pair<>(bool, bool));
}
}
}
public final void a(cf cfVar, final boolean z6) {
synchronized (this.f5797i) {
for (Map.Entry<FlurryConfigListener, Pair<cf, WeakReference<Handler>>> entry : this.f5797i.entrySet()) {
if (cfVar == null || cfVar == entry.getValue().first) {
final FlurryConfigListener key = entry.getKey();
Handler handler = (Handler) ((WeakReference) entry.getValue().second).get();
ea eaVar = new ea() {
@Override
public final void a() {
key.onActivateComplete(z6);
}
};
if (handler == null) {
this.f5796h.post(eaVar);
} else {
handler.post(eaVar);
}
}
}
}
}
public final boolean a(cf cfVar) {
if (this.f5801n) {
boolean z6 = true;
if (cfVar == null) {
boolean z9 = false;
for (Map.Entry<cf, Pair<Boolean, Boolean>> entry : this.f5798j.entrySet()) {
Pair<Boolean, Boolean> value = entry.getValue();
if (!((Boolean) value.second).booleanValue()) {
entry.setValue(new Pair<>((Boolean) value.first, Boolean.TRUE));
z9 = true;
}
}
z6 = z9;
} else {
Pair<Boolean, Boolean> pair = this.f5798j.get(cfVar);
if (pair == null || !((Boolean) pair.second).booleanValue()) {
this.f5798j.put(cfVar, new Pair<>(Boolean.valueOf(pair == null ? false : ((Boolean) pair.first).booleanValue()), Boolean.TRUE));
} else {
z6 = false;
}
}
if (z6) {
this.f5794f.a(cfVar);
a(cfVar, false);
}
return z6;
}
return false;
}
public final bv c() {
if (this.f5792d == null) {
g();
this.f5792d = new bv(this.f5793e, this.f5794f);
}
return this.f5792d;
}
public final void d() {
if (this.f5800m) {
cx.a(3, "ConfigManager", "Preventing re-entry...");
return;
}
this.f5800m = true;
cx.a(3, "ConfigManager", "Fetch started");
for (bw bwVar : cc.a(cp.a(b.a(), "https://cfg.flurry.com/sdk/v1/config"), new bw.a() {
@Override
public final void a(cb cbVar, boolean z6) {
a aVar;
if (!z6) {
by.e(by.this);
}
cb.a aVar2 = cbVar.f5827d;
if (aVar2 == cb.a.SUCCEED) {
cx.a("ConfigManager", "Fetch succeeded.");
aVar = a.Complete;
by.this.f5801n = true;
for (cf cfVar : cf.b()) {
by.this.f5798j.put(cfVar, new Pair(Boolean.valueOf(by.this.f5798j.containsKey(cfVar) ? ((Boolean) ((Pair) by.this.f5798j.get(cfVar)).first).booleanValue() : false), Boolean.FALSE));
}
} else if (aVar2 == cb.a.NO_CHANGE) {
cx.a("ConfigManager", "Fetch finished.");
aVar = a.CompleteNoChange;
} else {
cx.a("ConfigManager", "Error occured while fetching: ".concat(String.valueOf(cbVar)));
aVar = a.Fail;
}
if (by.this.f5802o.f5818e <= aVar.f5818e) {
by.this.f5802o = aVar;
}
by.b(by.this, aVar);
}
}, this.f5791a, this.f5794f)) {
bwVar.a();
}
}
public final List<ci> e() {
cj cjVar = this.f5794f;
if (cjVar != null) {
return cjVar.b();
}
return null;
}
public final String toString() {
g();
ArrayList arrayList = new ArrayList();
List<ci> e10 = e();
if (e10 == null || e10.isEmpty()) {
return "No variants were found!";
}
for (ci ciVar : e10) {
arrayList.add(ciVar.toString());
}
return TextUtils.join(StringUtils.COMMA, arrayList);
}
}