暗网解密 v2.0.4版本的 MD5 值为:d3a04548fef88e775cbe4c3c6e7d81ad
以下内容为反编译后的 by.java 源代码,内容仅作参考
package com.flurry.sdk;
import android.content.SharedPreferences;
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 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 f7105b;
private static final Object k = new Object();
private static ck p;
public bz f7106a;
private bv f7107d;
private cd f7108e;
private cj f7109f;
private cp f7110g;
private Handler f7111h;
private final Map<FlurryConfigListener, Pair<cf, WeakReference<Handler>>> i;
private final Map<cf, Pair<Boolean, Boolean>> j;
private volatile boolean l;
private volatile boolean m;
private volatile boolean n;
private a o;
public static class AnonymousClass6 {
public static final int[] f7121a;
static {
int[] iArr = new int[a.values().length];
f7121a = iArr;
try {
iArr[a.None.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
f7121a[a.Complete.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
f7121a[a.CompleteNoChange.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
f7121a[a.Fail.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
}
}
public enum a {
Complete("Complete", 3),
CompleteNoChange("No Change", 2),
Fail("Fail", 1),
None("None", 0);
public int f7127e;
private String f7128f;
a(String str, int i) {
this.f7128f = str;
this.f7127e = i;
}
@Override
public final String toString() {
return this.f7128f;
}
}
private by() {
this((byte) 0);
}
public static boolean e(by byVar) {
byVar.m = false;
return false;
}
public final bv c() {
if (this.f7107d == null) {
g();
this.f7107d = new bv(this.f7108e, this.f7109f);
}
return this.f7107d;
}
public final String toString() {
g();
ArrayList arrayList = new ArrayList();
List<ci> e2 = e();
if (e2 == null || e2.isEmpty()) {
return "No variants were found!";
}
for (ci ciVar : e2) {
arrayList.add(ciVar.toString());
}
return TextUtils.join(",", arrayList);
}
private by(byte b2) {
super("ConfigManager", eq.a(eq.a.CONFIG));
this.i = new ConcurrentHashMap();
this.j = new HashMap();
this.l = false;
this.m = false;
this.n = false;
this.o = a.None;
p = null;
for (cf cfVar : cf.b()) {
Map<cf, Pair<Boolean, Boolean>> map = this.j;
Boolean bool = Boolean.FALSE;
map.put(cfVar, new Pair<>(bool, bool));
}
this.f7108e = new cd();
this.f7109f = new cj();
this.f7106a = new bz();
this.f7110g = new cp();
this.f7111h = new Handler(Looper.getMainLooper());
runAsync(new ea() {
@Override
public final void a() {
try {
try {
String b3 = cq.b(b.a());
cx.a("ConfigManager", "Cached Data: ".concat(String.valueOf(b3)));
if (b3 != null) {
String d2 = by.this.f7106a.d();
SharedPreferences sharedPreferences = by.this.f7106a.f7129a;
if (cq.a(d2, b3, sharedPreferences != null ? sharedPreferences.getString("lastRSA", null) : null)) {
try {
by.this.f7109f.a(ca.a(new JSONObject(b3)));
} catch (Exception e2) {
cx.b("VariantsManager", "Cached variants parsing error: ", e2);
}
if (by.b() != null) {
by.b();
throw null;
}
} else {
cx.b("ConfigManager", "Incorrect signature for cache.");
cq.c(b.a());
by.this.f7106a.c();
}
}
by.c(by.this);
if (by.this.f7109f.e() > 0) {
for (cf cfVar2 : by.this.f7109f.d()) {
by.this.j.put(cfVar2, new Pair(Boolean.TRUE, Boolean.FALSE));
by.this.a(cfVar2, true);
}
}
} catch (Exception e3) {
cx.b("ConfigManager", "Exception!", e3);
by.c(by.this);
if (by.this.f7109f.e() > 0) {
for (cf cfVar3 : by.this.f7109f.d()) {
by.this.j.put(cfVar3, new Pair(Boolean.TRUE, Boolean.FALSE));
by.this.a(cfVar3, true);
}
}
}
} catch (Throwable th) {
by.c(by.this);
if (by.this.f7109f.e() > 0) {
for (cf cfVar4 : by.this.f7109f.d()) {
by.this.j.put(cfVar4, new Pair(Boolean.TRUE, Boolean.FALSE));
by.this.a(cfVar4, true);
}
}
throw th;
}
}
});
}
public static ck b() {
return p;
}
private static synchronized by f() {
by byVar;
synchronized (by.class) {
if (f7105b == null) {
f7105b = new by((byte) 0);
}
byVar = f7105b;
}
return byVar;
}
private void g() {
synchronized (k) {
while (!this.l) {
try {
k.wait();
} catch (InterruptedException e2) {
cx.b("ConfigManager", "Interrupted Exception!", e2);
}
}
}
}
public final void d() {
if (this.m) {
cx.a(3, "ConfigManager", "Preventing re-entry...");
return;
}
this.m = 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 z) {
a aVar;
if (!z) {
by.e(by.this);
}
cb.a aVar2 = cbVar.f7137d;
if (aVar2 == cb.a.SUCCEED) {
cx.a("ConfigManager", "Fetch succeeded.");
aVar = a.Complete;
by.this.n = true;
for (cf cfVar : cf.b()) {
boolean z2 = false;
if (by.this.j.containsKey(cfVar)) {
z2 = ((Boolean) ((Pair) by.this.j.get(cfVar)).first).booleanValue();
}
by.this.j.put(cfVar, new Pair(Boolean.valueOf(z2), 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.o.f7127e <= aVar.f7127e) {
by.this.o = aVar;
}
by.b(by.this, aVar);
}
}, this.f7106a, this.f7109f)) {
bwVar.a();
}
}
public final List<ci> e() {
cj cjVar = this.f7109f;
if (cjVar != null) {
return cjVar.b();
}
return null;
}
public static void b(by byVar, final a aVar) {
synchronized (byVar.i) {
for (Map.Entry<FlurryConfigListener, Pair<cf, WeakReference<Handler>>> entry : byVar.i.entrySet()) {
final FlurryConfigListener key = entry.getKey();
Handler handler = (Handler) ((WeakReference) entry.getValue().second).get();
ea eaVar = new ea() {
@Override
public final void a() {
int i = AnonymousClass6.f7121a[aVar.ordinal()];
if (i == 2) {
key.onFetchSuccess();
} else if (i == 3) {
key.onFetchNoChange();
} else if (i != 4) {
} else {
key.onFetchError(by.this.m);
}
}
};
if (handler == null) {
byVar.f7111h.post(eaVar);
} else {
handler.post(eaVar);
}
}
}
}
public static synchronized by a() {
by f2;
synchronized (by.class) {
f2 = f();
}
return f2;
}
public static void c(by byVar) {
Object obj = k;
synchronized (obj) {
byVar.l = true;
obj.notifyAll();
}
}
public final void a(FlurryConfigListener flurryConfigListener, cf cfVar, Handler handler) {
if (flurryConfigListener == null) {
return;
}
synchronized (this.i) {
if (this.i.containsKey(flurryConfigListener)) {
cx.a(5, "ConfigManager", "The listener is already registered");
return;
}
this.i.put(flurryConfigListener, new Pair<>(cfVar, new WeakReference(handler)));
int i = AnonymousClass6.f7121a[this.o.ordinal()];
if (i == 2) {
flurryConfigListener.onFetchSuccess();
} else if (i == 3) {
flurryConfigListener.onFetchNoChange();
} else if (i == 4) {
flurryConfigListener.onFetchError(this.m);
}
if (this.j.containsKey(cfVar)) {
Pair<Boolean, Boolean> pair = this.j.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.j;
Boolean bool = Boolean.FALSE;
map.put(cfVar, new Pair<>(bool, bool));
}
}
}
public final void a(FlurryConfigListener flurryConfigListener) {
if (flurryConfigListener == null) {
return;
}
synchronized (this.i) {
this.i.remove(flurryConfigListener);
}
}
public final void a(cf cfVar, final boolean z) {
synchronized (this.i) {
for (Map.Entry<FlurryConfigListener, Pair<cf, WeakReference<Handler>>> entry : this.i.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(z);
}
};
if (handler == null) {
this.f7111h.post(eaVar);
} else {
handler.post(eaVar);
}
}
}
}
}
public final boolean a(cf cfVar) {
if (this.n) {
boolean z = true;
if (cfVar == null) {
boolean z2 = false;
for (Map.Entry<cf, Pair<Boolean, Boolean>> entry : this.j.entrySet()) {
Pair<Boolean, Boolean> value = entry.getValue();
if (!((Boolean) value.second).booleanValue()) {
entry.setValue(new Pair<>((Boolean) value.first, Boolean.TRUE));
z2 = true;
}
}
z = z2;
} else {
Pair<Boolean, Boolean> pair = this.j.get(cfVar);
if (pair == null || !((Boolean) pair.second).booleanValue()) {
this.j.put(cfVar, new Pair<>(Boolean.valueOf(pair == null ? false : ((Boolean) pair.first).booleanValue()), Boolean.TRUE));
} else {
z = false;
}
}
if (z) {
this.f7109f.a(cfVar);
a(cfVar, false);
}
return z;
}
return false;
}
}