正在查看: All File Recovery v1.0.2 应用的 AbstractC0737z1.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: All File Recovery v1.0.2 应用的 AbstractC0737z1.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.applovin.impl;
import android.os.Build;
import android.text.TextUtils;
import com.applovin.impl.C0729y1;
import com.applovin.impl.sdk.C0672k;
import com.applovin.impl.sdk.C0676o;
import com.applovin.impl.sdk.SessionTracker;
import com.applovin.impl.sdk.ad.AbstractC0662b;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.sdk.AppLovinEventTypes;
import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkUtils;
import com.facebook.internal.C0774x;
import java.io.OutputStream;
import java.lang.Thread;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONObject;
public abstract class AbstractC0737z1 {
private static volatile ExecutorService g;
protected final C0672k a;
protected final C0676o b;
private final C0729y1.b c;
private final Map d = androidx.fragment.app.L.a();
private final Set e = Collections.synchronizedSet(new HashSet());
private static final int f = (int) TimeUnit.SECONDS.toMillis(30);
private static final Object h = new Object();
public class a implements ThreadFactory {
public class C0112a implements Thread.UncaughtExceptionHandler {
public C0112a() {
}
@Override
public void uncaughtException(Thread thread, Throwable th) {
AbstractC0737z1.this.a.O();
if (C0676o.a()) {
AbstractC0737z1.this.a.O().a("HealthEventsReporter", "Caught unhandled exception", th);
}
}
}
public a() {
}
@Override
public Thread newThread(Runnable runnable) {
Thread thread = new Thread(runnable, "AppLovinSdk:health_events_reporter");
thread.setDaemon(true);
thread.setPriority(((Integer) AbstractC0737z1.this.a.a(C0577l4.Q)).intValue());
thread.setUncaughtExceptionHandler(new C0112a());
return thread;
}
}
public AbstractC0737z1(C0672k c0672k, C0729y1.b bVar) {
this.a = c0672k;
this.b = c0672k.O();
this.c = bVar;
a();
}
private void c(C0729y1 c0729y1, List list) {
HttpURLConnection httpURLConnection;
Throwable th;
if (c0729y1.a() == C0729y1.b.AD || c0729y1.a() == C0729y1.b.MEDIATED_AD || c0729y1.a() == C0729y1.b.USER_SESSION || !AbstractC0742z6.a(((Integer) this.a.a(C0577l4.z)).intValue())) {
return;
}
Iterator it = list.iterator();
while (it.hasNext()) {
Map map = (Map) it.next();
try {
httpURLConnection = (HttpURLConnection) a(c0729y1, map).openConnection();
try {
int i = f;
httpURLConnection.setConnectTimeout(i);
httpURLConnection.setReadTimeout(i);
httpURLConnection.setDefaultUseCaches(false);
httpURLConnection.setAllowUserInteraction(false);
httpURLConnection.setUseCaches(false);
httpURLConnection.setInstanceFollowRedirects(true);
httpURLConnection.setDoOutput(false);
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setRequestProperty("AppLovin-Event-Type", c0729y1.b());
int responseCode = httpURLConnection.getResponseCode();
if (C0676o.a()) {
this.b.a("HealthEventsReporter", c0729y1.b() + " reported with code " + responseCode + " and extra parameters " + map);
}
this.d.put(c0729y1, Long.valueOf(System.currentTimeMillis()));
} catch (Throwable th2) {
th = th2;
try {
if (C0676o.a()) {
this.b.d("HealthEventsReporter", "Failed to report " + c0729y1.b() + " with extra parameters " + map, th);
}
AbstractC0742z6.a(httpURLConnection, this.a);
} finally {
AbstractC0742z6.a(httpURLConnection, this.a);
}
}
} catch (Throwable th3) {
httpURLConnection = null;
th = th3;
}
}
}
public void d(C0729y1 c0729y1, Map map) {
a(c0729y1, map, 0L);
}
private void a() {
if (g != null) {
return;
}
synchronized (h) {
try {
if (g != null) {
return;
}
g = Executors.newFixedThreadPool(1, new a());
} catch (Throwable th) {
throw th;
}
}
}
private void d(final C0729y1 c0729y1, List list) {
final String str = (String) this.a.a(C0577l4.A);
if (TextUtils.isEmpty(str)) {
return;
}
double a2 = c0729y1.a(this.a);
if (AbstractC0742z6.a(a2)) {
if (((Boolean) this.a.a(C0577l4.G)).booleanValue()) {
a(str, c0729y1, a(c0729y1, a2, list));
return;
}
Iterator it = list.iterator();
while (it.hasNext()) {
final JSONObject a3 = a(c0729y1, a2, Collections.singletonList((Map) it.next()));
g.execute(new Runnable() {
@Override
public final void run() {
AbstractC0737z1.this.a(str, c0729y1, a3);
}
});
}
}
}
public void a(String str, C0729y1 c0729y1, JSONObject jSONObject) {
byte[] bytes;
HttpURLConnection httpURLConnection;
HttpURLConnection httpURLConnection2 = null;
try {
URL url = new URL(str);
bytes = jSONObject.toString().getBytes("UTF-8");
httpURLConnection = (HttpURLConnection) url.openConnection();
} catch (Throwable th) {
th = th;
}
try {
int i = f;
httpURLConnection.setConnectTimeout(i);
httpURLConnection.setReadTimeout(i);
httpURLConnection.setRequestProperty(com.facebook.T.x, "application/json; charset=utf-8");
httpURLConnection.setDefaultUseCaches(false);
httpURLConnection.setAllowUserInteraction(false);
httpURLConnection.setUseCaches(false);
httpURLConnection.setInstanceFollowRedirects(true);
httpURLConnection.setDoOutput(true);
httpURLConnection.setFixedLengthStreamingMode(bytes.length);
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setRequestProperty("AppLovin-Event-Type", c0729y1.b());
OutputStream outputStream = httpURLConnection.getOutputStream();
outputStream.write(bytes);
outputStream.close();
int responseCode = httpURLConnection.getResponseCode();
if (C0676o.a()) {
this.b.a("HealthEventsReporter", c0729y1.b() + " reported with code " + responseCode);
}
this.d.put(c0729y1, Long.valueOf(System.currentTimeMillis()));
AbstractC0742z6.a(httpURLConnection, this.a);
} catch (Throwable th2) {
th = th2;
httpURLConnection2 = httpURLConnection;
try {
if (C0676o.a()) {
this.b.d("HealthEventsReporter", "Failed to report " + c0729y1.b(), th);
}
} finally {
AbstractC0742z6.a(httpURLConnection2, this.a);
}
}
}
public void a(C0729y1 c0729y1, String str) {
a(c0729y1, str, new HashMap());
}
public void a(C0729y1 c0729y1, String str, Map map) {
map.put("source", str);
d(c0729y1, map);
}
public void a(C0729y1 c0729y1, String str, Map map, String str2) {
if (!StringUtils.isValidString(str2) || this.e.add(str2)) {
map.put("source", str);
a(c0729y1, str, map);
}
}
public void a(C0729y1 c0729y1, Map map, long j) {
ArrayList arrayList = new ArrayList();
arrayList.add(map);
a(c0729y1, arrayList, j);
}
public void a(final C0729y1 c0729y1, final List list, long j) {
if (a(c0729y1, j)) {
return;
}
try {
if (AbstractC0742z6.h()) {
g.execute(new Runnable() {
@Override
public final void run() {
AbstractC0737z1.this.b(c0729y1, list);
}
});
} else {
b(c0729y1, list);
}
} catch (Throwable th) {
if (C0676o.a()) {
this.b.d("HealthEventsReporter", "Failed to report " + c0729y1.b() + " with extra parameters collection " + list, th);
}
}
}
public void b(C0729y1 c0729y1, List list) {
if (AppLovinSdkUtils.isEmulator()) {
return;
}
if (C0676o.a()) {
this.b.a("HealthEventsReporter", "Reporting " + c0729y1.b() + " with extra parameters collection " + list);
}
if (this.c != c0729y1.a()) {
AbstractC0534g1.a("Health event " + c0729y1.b() + " category: " + c0729y1.a() + " does not match the reporter category: " + this.c, new Object[0]);
}
c(c0729y1, list);
d(c0729y1, list);
}
private Map c(C0729y1 c0729y1, Map map) {
HashMap hashMap = new HashMap(map);
if (c0729y1 == C0729y1.s0) {
hashMap.remove("details");
}
return hashMap;
}
private Map b(C0729y1 c0729y1, Map map) {
HashMap hashMap = new HashMap();
hashMap.put("type", c0729y1.b());
if (c0729y1 == C0729y1.o0 || c0729y1 == C0729y1.D0 || c0729y1 == C0729y1.B0) {
if (((Boolean) this.a.a(C0577l4.f418d4)).booleanValue()) {
CollectionUtils.putStringIfValid("wvvc", String.valueOf(z7.d()), hashMap);
CollectionUtils.putStringIfValid("wvv", z7.c(), hashMap);
CollectionUtils.putStringIfValid("wvpn", z7.b(), hashMap);
}
CollectionUtils.putStringIfValid("oglv", this.a.B().I(), hashMap);
}
Map L = this.a.B().L();
hashMap.put(C0774x.j, String.valueOf(L.get(C0774x.j)));
hashMap.put("country_code", String.valueOf(L.get("country_code")));
hashMap.put("cc", this.a.w().getCountryCode());
hashMap.put("applovin_random_token", this.a.h0());
hashMap.put("compass_random_token", this.a.v());
hashMap.put("model", Build.MODEL);
hashMap.put("brand", Build.MANUFACTURER);
hashMap.put("brand_name", Build.BRAND);
hashMap.put("hardware", Build.HARDWARE);
hashMap.put("revision", Build.DEVICE);
hashMap.put("os", Build.VERSION.RELEASE);
hashMap.put("api_level", String.valueOf(Build.VERSION.SDK_INT));
hashMap.put(C0774x.k, String.valueOf(AppLovinSdk.VERSION));
CollectionUtils.putStringIfValid("ad_review_sdk_version", C0548i.b(), hashMap);
hashMap.put("md", (String) this.a.a(C0577l4.t));
b(hashMap);
a(hashMap);
if (map != null) {
hashMap.putAll(c(c0729y1, map));
}
return hashMap;
}
private URL a(C0729y1 c0729y1, Map map) {
StringBuilder sb = new StringBuilder("https://ms.applovin.com/1.0/sdk/error?");
Iterator it = b(c0729y1, map).entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
String encode = URLEncoder.encode((String) entry.getKey(), "UTF-8");
String encode2 = URLEncoder.encode((String) entry.getValue(), "UTF-8");
sb.append(encode);
sb.append("=");
sb.append(encode2);
if (it.hasNext()) {
sb.append("&");
}
}
return new URL(sb.toString());
}
private JSONObject a(C0729y1 c0729y1, double d, List list) {
JSONObject jSONObject = new JSONObject();
JsonUtils.putLong(jSONObject, "ts_ms", System.currentTimeMillis());
if (c0729y1 == C0729y1.o0 || c0729y1 == C0729y1.D0 || c0729y1 == C0729y1.B0) {
if (((Boolean) this.a.a(C0577l4.f418d4)).booleanValue()) {
JsonUtils.putStringIfValid(jSONObject, "wvvc", String.valueOf(z7.d()));
JsonUtils.putStringIfValid(jSONObject, "wvv", z7.c());
JsonUtils.putStringIfValid(jSONObject, "wvpn", z7.b());
}
JsonUtils.putStringIfValid(jSONObject, "oglv", this.a.B().I());
}
JSONObject jSONObject2 = new JSONObject();
Map L = this.a.B().L();
JsonUtils.putObject(jSONObject2, C0774x.j, L.get(C0774x.j));
JsonUtils.putObject(jSONObject2, "os", L.get("os"));
JsonUtils.putObject(jSONObject2, "brand", L.get("brand"));
JsonUtils.putObject(jSONObject2, "model", L.get("model"));
JsonUtils.putObject(jSONObject2, "revision", L.get("revision"));
JsonUtils.putObject(jSONObject2, "country_code", L.get("country_code"));
JsonUtils.putObject(jSONObject2, "cc", this.a.w().getCountryCode());
JsonUtils.putObject(jSONObject2, "applovin_random_token", this.a.h0());
JsonUtils.putObject(jSONObject2, "ad_review_sdk_version", StringUtils.emptyIfNull(C0548i.b()));
Map D = this.a.B().D();
JsonUtils.putObject(jSONObject2, C0774x.k, D.get(C0774x.k));
JsonUtils.putObject(jSONObject2, "plugin_version", this.a.a(C0577l4.f348B3));
JsonUtils.putObject(jSONObject2, "app_version", D.get("app_version"));
JsonUtils.putObject(jSONObject2, "package_name", D.get("package_name"));
JsonUtils.putObject(jSONObject2, "first_install", Boolean.toString(Boolean.TRUE.equals((Boolean) D.get("first_install_v2"))));
JsonUtils.putObject(jSONObject2, "md", this.a.a(C0577l4.t));
JsonUtils.putObject(jSONObject2, "mediation_provider", this.a.V());
SessionTracker m0 = this.a.m0();
JsonUtils.putObject(jSONObject2, "app_state", m0.getCurrentApplicationState().b());
JsonUtils.putObject(jSONObject2, "app_state_duration_ms", Long.valueOf(m0.getCurrentApplicationStateDurationMillis()));
JsonUtils.putObject(jSONObject2, "session_id", m0.getSessionId());
JsonUtils.putObject(jSONObject2, "session_duration_ms", Long.valueOf(System.currentTimeMillis() - C0672k.n()));
JsonUtils.putObject(jSONObject, "shared_fields", jSONObject2);
JSONArray jSONArray = new JSONArray();
Iterator it = list.iterator();
while (it.hasNext()) {
Map map = (Map) it.next();
JSONObject jSONObject3 = new JSONObject();
JsonUtils.putDouble(jSONObject3, "ts_ms", System.currentTimeMillis());
JsonUtils.putString(jSONObject3, "type", c0729y1.b());
JsonUtils.putDouble(jSONObject3, "weight", d);
JsonUtils.putString(jSONObject3, AppLovinEventTypes.USER_COMPLETED_LEVEL, "DEBUG");
a(map);
JsonUtils.putAll(jSONObject3, (Map<String, ?>) map);
jSONArray.put(jSONObject3);
}
JsonUtils.putObject(jSONObject, "events", jSONArray);
return jSONObject;
}
private void b(java.util.Map r6) {
throw new UnsupportedOperationException("Method not decompiled: com.applovin.impl.AbstractC0737z1.b(java.util.Map):void");
}
private void a(Map map) {
if (map == null) {
return;
}
Object a2 = this.a.I().a();
if (a2 instanceof AbstractC0662b) {
map.put("fs_ad_network", "AppLovin");
map.put("fs_ad_creative_id", Long.toString(((AbstractC0662b) a2).getAdIdNumber()));
} else if (a2 instanceof AbstractC0640q2) {
AbstractC0640q2 abstractC0640q2 = (AbstractC0640q2) a2;
map.put("fs_ad_network", abstractC0640q2.getNetworkName());
map.put("fs_ad_creative_id", abstractC0640q2.getCreativeId());
} else {
map.put("fs_ad_network", "None");
map.put("fs_ad_creative_id", "None");
}
}
private boolean a(C0729y1 c0729y1, long j) {
Long l = (Long) this.d.get(c0729y1);
return System.currentTimeMillis() - (l != null ? l.longValue() : -1L) < j;
}
}