Weather Tracker v1.0.0版本的 MD5 值为:3edef27647e42a8ea0e7c0d2dbf56f97
以下内容为反编译后的 f.java 源代码,内容仅作参考
package sg.bigo.ads.controller.a.a;
import android.os.Parcel;
import android.text.TextUtils;
import android.webkit.URLUtil;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.tp.common.Constants;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONObject;
import sg.bigo.ads.common.d;
import sg.bigo.ads.common.i;
import sg.bigo.ads.common.utils.k;
import sg.bigo.ads.controller.a.j;
public final class f extends g implements sg.bigo.ads.common.d {
public static final long a = TimeUnit.HOURS.toMillis(2);
private long e;
private List<a> d = c();
private long f7721b = a;
public static class a extends sg.bigo.ads.controller.a.a.a {
private static final d.a<a> e = new d.a<a>() {
@Override
public final a a() {
return new a();
}
};
private String f;
public a() {
}
public a(String str, String str2, boolean z, String str3) {
super(str, str2, z);
this.f = str3;
}
@Override
public final void a(@NonNull Parcel parcel) {
super.a(parcel);
parcel.writeString(this.f);
}
@Override
public final void b(@NonNull Parcel parcel) {
super.b(parcel);
this.f = i.a(parcel, "");
}
}
@Nullable
private j b(final String str) {
synchronized (this) {
if (k.a((Collection) this.d)) {
return null;
}
a aVar = (a) g.a(k.a(this.d, new Comparable<a>() {
@Override
public final int compareTo(a aVar2) {
a aVar3 = aVar2;
return (aVar3 == null || !aVar3.d || aVar3.f7735b || !TextUtils.equals(aVar3.f, str)) ? 0 : 1;
}
}));
if (aVar != null) {
return aVar;
}
List a2 = k.a(this.d, new Comparable<a>() {
@Override
public final int compareTo(a aVar2) {
a aVar3 = aVar2;
return (aVar3 != null && aVar3.d && aVar3.f7735b && TextUtils.equals(aVar3.f, str)) ? 1 : 0;
}
});
if (!k.a((Collection) a2)) {
return g.a(a2);
}
List a3 = k.a(this.d, new Comparable<a>() {
@Override
public final int compareTo(a aVar2) {
a aVar3 = aVar2;
return (aVar3 == null || !aVar3.d || aVar3.f7735b) ? 0 : 1;
}
});
if (!k.a((Collection) a3)) {
return g.a(a3);
}
a aVar2 = (a) g.a(k.a(this.d, new Comparable<a>() {
@Override
public final int compareTo(a aVar3) {
a aVar4 = aVar3;
return (aVar4 != null && aVar4.d && aVar4.f7735b) ? 1 : 0;
}
}));
if (aVar2 != null) {
return aVar2;
}
return null;
}
}
private static List<a> c() {
ArrayList arrayList = new ArrayList();
arrayList.add(new a("AWS", "https://ad-host-backup-asia.s3.ap-southeast-1.amazonaws.com/uni/v2/au.pj", true, "asia"));
arrayList.add(new a("AWS", "https://ad-host-backup-europe.s3.eu-central-1.amazonaws.com/uni/v2/au.pj", true, "europe"));
arrayList.add(new a("AWS", "https://ad-host-backup-america.s3.us-west-1.amazonaws.com/uni/v2/au.pj", true, "america"));
return arrayList;
}
@Override
@Nullable
public final j a(String str) {
if (k.a((Collection) this.d)) {
return null;
}
return b(sg.bigo.ads.controller.a.h.a(str));
}
@Override
public final void a(@NonNull Parcel parcel) {
synchronized (this) {
parcel.writeLong(this.f7721b);
i.a(parcel, this.d);
parcel.writeLong(this.e);
}
}
public final void a(@NonNull JSONObject jSONObject) {
synchronized (this) {
long max = Math.max(jSONObject.optLong("interval", a / 1000) * 1000, g.c);
List<a> c = c();
JSONArray optJSONArray = jSONObject.optJSONArray(Constants.VIDEO_TRACKING_URLS_KEY);
if (optJSONArray != null) {
for (int i = 0; i < optJSONArray.length(); i++) {
JSONObject optJSONObject = optJSONArray.optJSONObject(i);
String optString = optJSONObject.optString("name", "");
String optString2 = optJSONObject.optString("url", "");
String optString3 = optJSONObject.optString("region", "");
if (URLUtil.isNetworkUrl(optString2)) {
c.add(new a(optString, optString2, false, optString3));
}
}
}
this.f7721b = max;
this.d = c;
}
}
public final boolean a() {
return Math.abs(System.currentTimeMillis() - this.e) > this.f7721b;
}
public final void b() {
this.e = System.currentTimeMillis();
synchronized (this) {
if (k.a((Collection) this.d)) {
return;
}
for (a aVar : this.d) {
aVar.d = true;
}
}
}
@Override
public final void b(@NonNull Parcel parcel) {
synchronized (this) {
this.f7721b = i.a(parcel, a);
List<a> a2 = i.a(parcel, a.e);
this.d = a2;
if (k.a((Collection) a2)) {
this.d = c();
}
this.e = i.a(parcel, 0L);
}
}
}