Cyber Surfer v5.2.5版本的 MD5 值为:db13c5fce988de393e52d2679f934b22
以下内容为反编译后的 a.java 源代码,内容仅作参考
package sg.bigo.ads.controller.a;
import android.content.Context;
import android.os.Parcel;
import android.text.TextUtils;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import sg.bigo.ads.common.d;
import sg.bigo.ads.common.h;
import sg.bigo.ads.common.l.g;
import sg.bigo.ads.common.utils.j;
import sg.bigo.ads.common.utils.o;
import sg.bigo.ads.common.utils.p;
import sg.bigo.ads.controller.a.b;
public final class a implements sg.bigo.ads.common.l.a {
final AtomicBoolean f16007a = new AtomicBoolean(false);
final C0485a f16008b;
List<String> c;
private final Context d;
private final b e;
private final sg.bigo.ads.controller.b.b f;
public static class C0485a extends sg.bigo.ads.common.c implements d.a<sg.bigo.ads.controller.a.b> {
long f16011b;
long c;
private final Map<String, sg.bigo.ads.controller.a.b> d;
public C0485a(Context context) {
super(context);
this.d = new HashMap();
this.f16011b = 0L;
}
@Override
public final sg.bigo.ads.controller.a.b a() {
return new sg.bigo.ads.controller.a.b();
}
final sg.bigo.ads.controller.a.b a(String str) {
sg.bigo.ads.controller.a.b bVar;
synchronized (this.d) {
bVar = this.d.get(str);
if (bVar == null) {
bVar = new sg.bigo.ads.controller.a.b();
this.d.put(str, bVar);
}
}
return bVar;
}
@Override
public final void a(Parcel parcel) {
synchronized (this.d) {
h.a(parcel, this.d);
parcel.writeLong(this.f16011b);
parcel.writeLong(this.c);
}
}
final sg.bigo.ads.controller.a.b b(String str) {
sg.bigo.ads.controller.a.b bVar;
synchronized (this.d) {
bVar = this.d.get(str);
}
return bVar;
}
@Override
public final void b(Parcel parcel) {
Map<? extends String, ? extends sg.bigo.ads.controller.a.b> b2 = h.b(parcel, this);
this.f16011b = parcel.readLong();
this.c = parcel.readLong();
if (b2.isEmpty()) {
return;
}
synchronized (this.d) {
this.d.putAll(b2);
}
}
@Override
public final String j() {
return "bigoad_antiban.dat";
}
@Override
public final String k() {
return "AntiBan";
}
public final String toString() {
return "items:" + j.a(this.d) + ", lastFetchNetDiskBeginTs:" + this.f16011b + ", lastFetchNetDiskSuccessTs:" + this.c;
}
}
public interface b {
String a();
}
public a(Context context, sg.bigo.ads.controller.b.b bVar, b bVar2) {
this.d = context;
this.e = bVar2;
this.f16008b = new C0485a(context);
this.f = bVar;
}
static void a(a aVar, String str) {
String str2;
String str3;
String a2 = aVar.e.a();
if (TextUtils.isEmpty(a2)) {
str3 = "country is empty";
} else {
JSONObject a3 = c.a(str, "FEFFFFFFFFFAFFFDCBFFFFFFFFFFFF4F");
if (a3 == null) {
str3 = "netDiskJson is null";
} else {
JSONObject optJSONObject = a3.optJSONObject(a2);
if (optJSONObject != null) {
Iterator<String> keys = optJSONObject.keys();
while (keys != null && keys.hasNext()) {
String next = keys.next();
JSONArray optJSONArray = optJSONObject.optJSONArray(next);
if (optJSONArray == null || optJSONArray.length() == 0) {
sg.bigo.ads.common.k.a.a("AntiBan", "originHost=" + next + " has not any backup hosts.");
} else {
ArrayList arrayList = new ArrayList();
for (int i = 0; i < optJSONArray.length(); i++) {
String optString = optJSONArray.optString(i);
if (c.a(optString)) {
arrayList.add(optString);
}
}
if (TextUtils.isEmpty(next)) {
str2 = "addBackupHosts fail, originHost is empty.";
} else if (j.a(arrayList)) {
str2 = "addBackupHosts fail, hosts is empty.";
} else if (aVar.f16008b.a(next).a(arrayList)) {
aVar.f16008b.o();
}
sg.bigo.ads.common.k.a.a(0, "AntiBan", str2);
}
}
return;
}
str3 = "countryHostJson is null";
}
}
sg.bigo.ads.common.k.a.a(0, "AntiBan", str3);
}
private sg.bigo.ads.controller.a.b c(sg.bigo.ads.common.l.b.c cVar) {
String str;
String str2;
String str3 = "";
try {
URL url = new URL(cVar.d);
URL url2 = new URL(cVar.f());
str = url.getHost();
try {
str3 = url2.getHost();
} catch (MalformedURLException e) {
e = e;
e.printStackTrace();
if (TextUtils.isEmpty(str)) {
}
str2 = "matchedItem return null, host or latestHost is null, host=" + str + ", latestHost=" + str3;
sg.bigo.ads.common.k.a.a(0, 3, "AntiBan", str2);
return null;
}
} catch (MalformedURLException e2) {
e = e2;
str = "";
}
if (!TextUtils.isEmpty(str) || TextUtils.isEmpty(str3)) {
str2 = "matchedItem return null, host or latestHost is null, host=" + str + ", latestHost=" + str3;
} else {
sg.bigo.ads.controller.a.b b2 = this.f16008b.b(str);
if (b2 == null) {
str2 = "matchedItem return null, antiBanItem is null.";
} else {
String a2 = o.a(b2.d);
if (TextUtils.isEmpty(a2) || TextUtils.equals(a2, str3)) {
return b2;
}
str2 = "matchedItem return null, curHost is not equals, curHost=" + a2 + ", latestHost=" + str3;
}
}
sg.bigo.ads.common.k.a.a(0, 3, "AntiBan", str2);
return null;
}
@Override
public final String a(String str) {
if (TextUtils.isEmpty(str)) {
sg.bigo.ads.common.k.a.a(0, "AntiBan", "getPreHost fail, host is empty.");
return "";
}
sg.bigo.ads.controller.a.b b2 = this.f16008b.b(str);
return b2 != null ? o.a(b2.c) : "";
}
@Override
public final URL a(URL url) {
String host = url.getHost();
if (TextUtils.isEmpty(host)) {
sg.bigo.ads.common.k.a.a(0, 3, "AntiBan", "markReqFailure fail, host is empty, url=".concat(String.valueOf(url)));
return null;
}
sg.bigo.ads.controller.a.b b2 = this.f16008b.b(host);
if (b2 != null) {
try {
b.a a2 = b2.a(url);
if (a2.f16015b) {
this.f16008b.o();
}
return a2.f16014a;
} catch (Exception e) {
sg.bigo.ads.common.k.a.a(0, "AntiBan", "processUrl fail, e=".concat(String.valueOf(e)));
}
} else {
sg.bigo.ads.common.k.a.a(0, 3, "AntiBan", "processUrl fail, antiBanItem is null, url=".concat(String.valueOf(url)));
}
return url;
}
@Override
public final void a() {
this.f16008b.n();
}
final void a(final List<String> list) {
if (list == null || list.size() == 0) {
sg.bigo.ads.common.k.a.a(0, 3, "TAG", "[net disk] stop fetching net disk url");
this.f16007a.set(false);
return;
}
final String remove = list.remove(0);
if (TextUtils.isEmpty(remove)) {
return;
}
sg.bigo.ads.common.k.a.a(0, 3, "TAG", "[net disk] fetching net disk url: ".concat(String.valueOf(remove)));
this.f16008b.f16011b = p.b();
g.a(new sg.bigo.ads.common.l.b.a(remove), new sg.bigo.ads.common.l.b<sg.bigo.ads.common.l.b.a, sg.bigo.ads.common.l.c.d>() {
@Override
public final sg.bigo.ads.common.l.c.d a(sg.bigo.ads.common.l.c.a aVar) {
return new sg.bigo.ads.common.l.c.d(aVar);
}
@Override
public final void a(sg.bigo.ads.common.l.b.a aVar, sg.bigo.ads.common.l.c.d dVar) {
sg.bigo.ads.common.k.a.a(0, 3, "TAG", "[net disk] succeed to fetch net disk url: " + remove);
a.this.c = list;
a.this.f16007a.set(false);
a.this.f16008b.c = p.b();
a.a(a.this, dVar.a());
}
@Override
public final void a(sg.bigo.ads.common.l.b.a aVar, sg.bigo.ads.common.l.h hVar) {
sg.bigo.ads.common.k.a.a(0, 3, "TAG", "[net disk] try another net disk url due to failed to fetch net disk url: " + remove);
a.this.a(list);
}
});
}
@Override
public final void a(sg.bigo.ads.common.l.b.c cVar) {
String str;
boolean z;
ArrayList arrayList;
JSONArray jSONArray;
if (cVar == null) {
str = "markReqFailure return, request is null.";
} else if (sg.bigo.ads.common.p.c.a(this.d)) {
sg.bigo.ads.controller.a.b c = c(cVar);
if (c == null) {
str = "markReqFailure return, antiBanItem is null.";
} else {
if (c.c()) {
this.f16008b.o();
}
if (!c.a() || !c.b() || !j.a(c.f16012a) || !TextUtils.isEmpty(c.f16013b)) {
return;
}
C0485a c0485a = this.f16008b;
if (c0485a.f16011b != c0485a.c) {
int i = (c0485a.f16011b > c0485a.c ? 1 : (c0485a.f16011b == c0485a.c ? 0 : -1));
long b2 = p.b();
if (i <= 0 ? Math.abs(b2 - c0485a.c) <= b.a.h.d.c : Math.abs(b2 - c0485a.f16011b) <= 1800000) {
z = false;
if (z) {
return;
}
sg.bigo.ads.common.k.a.a(0, 3, "TAG", "[net disk] try to start fetch net disk urls");
if (this.f16007a.compareAndSet(false, true)) {
sg.bigo.ads.common.k.a.a(0, 3, "TAG", "[net disk] start fetch net disk urls");
List<String> list = this.c;
if (list == null || list.size() <= 0) {
arrayList = null;
} else {
arrayList = new ArrayList(this.c);
sg.bigo.ads.common.k.a.a(0, 3, "TAG", "[net disk] using old net disk urls, size = " + arrayList.size());
}
if (arrayList == null) {
arrayList = new ArrayList();
sg.bigo.ads.controller.b.b bVar = this.f;
try {
jSONArray = new JSONArray(bVar == null ? null : bVar.a("net_disk_urls").toString());
} catch (JSONException e) {
e.printStackTrace();
jSONArray = null;
}
if (jSONArray != null) {
for (int i2 = 0; i2 < jSONArray.length(); i2++) {
arrayList.add(jSONArray.optString(i2));
}
}
arrayList.add("https://drive.google.com/uc?export=download&id=1GONwHA_2awwNyOoYj3qvaryaYl9RBBpS");
sg.bigo.ads.common.k.a.a(0, 3, "TAG", "[net disk] create net disk urls, size = " + arrayList.size());
}
this.c = null;
a(arrayList);
return;
}
return;
}
}
z = true;
if (z) {
}
}
} else {
str = "markReqFailure failure weak net";
}
sg.bigo.ads.common.k.a.a(0, 3, "AntiBan", str);
}
@Override
public final boolean a(String str, String str2) {
if (TextUtils.isEmpty(str)) {
sg.bigo.ads.common.k.a.a(0, "AntiBan", "updateConfig fail, originHost is empty.");
return false;
}
return this.f16008b.a(str).a(str2);
}
@Override
public final void b() {
this.f16008b.m();
}
@Override
public final void b(sg.bigo.ads.common.l.b.c cVar) {
if (cVar == null) {
sg.bigo.ads.common.k.a.a(0, "AntiBan", "clearReqFailureInfo fail, request is null.");
return;
}
sg.bigo.ads.controller.a.b c = c(cVar);
if (c == null || !c.d()) {
return;
}
this.f16008b.o();
}
@Override
public final boolean b(String str, String str2) {
if (TextUtils.isEmpty(str)) {
sg.bigo.ads.common.k.a.a(0, "AntiBan", "updateConfig fail, originHost is empty.");
return false;
} else if (this.f16008b.b(str) == null) {
this.f16008b.a(str).a(str2);
return true;
} else {
return true;
}
}
public final String toString() {
return this.f16008b.toString();
}
}