正在查看: All File Recovery v1.0.2 应用的 AbstractC2997z1.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: All File Recovery v1.0.2 应用的 AbstractC2997z1.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.applovin.impl;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.text.TextUtils;
import com.applovin.impl.C2989y1;
import com.applovin.impl.sdk.C2932k;
import com.applovin.impl.sdk.C2936o;
import com.applovin.impl.sdk.SessionTracker;
import com.applovin.impl.sdk.ad.AbstractC2922b;
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.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkUtils;
import com.facebook.internal.C4928x;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import h6.C5609a;
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;
import z0.C7910c;
public abstract class AbstractC2997z1 {
private static volatile ExecutorService f43569g;
protected final C2932k f43571a;
protected final C2936o f43572b;
private final C2989y1.b f43573c;
private final Map f43574d = androidx.fragment.app.L.a();
private final Set f43575e = Collections.synchronizedSet(new HashSet());
private static final int f43568f = (int) TimeUnit.SECONDS.toMillis(30);
private static final Object f43570h = new Object();
public class a implements ThreadFactory {
public class C0463a implements Thread.UncaughtExceptionHandler {
public C0463a() {
}
@Override
public void uncaughtException(Thread thread, Throwable th) {
AbstractC2997z1.this.f43571a.O();
if (C2936o.a()) {
AbstractC2997z1.this.f43571a.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) AbstractC2997z1.this.f43571a.a(C2837l4.f41219Q)).intValue());
thread.setUncaughtExceptionHandler(new C0463a());
return thread;
}
}
public AbstractC2997z1(C2932k c2932k, C2989y1.b bVar) {
this.f43571a = c2932k;
this.f43572b = c2932k.O();
this.f43573c = bVar;
a();
}
private void c(C2989y1 c2989y1, List list) {
HttpURLConnection httpURLConnection;
Throwable th;
if (c2989y1.a() == C2989y1.b.AD || c2989y1.a() == C2989y1.b.MEDIATED_AD || c2989y1.a() == C2989y1.b.USER_SESSION || !AbstractC3002z6.a(((Integer) this.f43571a.a(C2837l4.f41487z)).intValue())) {
return;
}
Iterator it = list.iterator();
while (it.hasNext()) {
Map map = (Map) it.next();
try {
httpURLConnection = (HttpURLConnection) a(c2989y1, map).openConnection();
try {
int i10 = f43568f;
httpURLConnection.setConnectTimeout(i10);
httpURLConnection.setReadTimeout(i10);
httpURLConnection.setDefaultUseCaches(false);
httpURLConnection.setAllowUserInteraction(false);
httpURLConnection.setUseCaches(false);
httpURLConnection.setInstanceFollowRedirects(true);
httpURLConnection.setDoOutput(false);
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setRequestProperty("AppLovin-Event-Type", c2989y1.b());
int responseCode = httpURLConnection.getResponseCode();
if (C2936o.a()) {
this.f43572b.a("HealthEventsReporter", c2989y1.b() + " reported with code " + responseCode + " and extra parameters " + map);
}
this.f43574d.put(c2989y1, Long.valueOf(System.currentTimeMillis()));
} catch (Throwable th2) {
th = th2;
try {
if (C2936o.a()) {
this.f43572b.d("HealthEventsReporter", "Failed to report " + c2989y1.b() + " with extra parameters " + map, th);
}
AbstractC3002z6.a(httpURLConnection, this.f43571a);
} finally {
AbstractC3002z6.a(httpURLConnection, this.f43571a);
}
}
} catch (Throwable th3) {
httpURLConnection = null;
th = th3;
}
}
}
public void d(C2989y1 c2989y1, Map map) {
a(c2989y1, map, 0L);
}
private void a() {
if (f43569g != null) {
return;
}
synchronized (f43570h) {
try {
if (f43569g != null) {
return;
}
f43569g = Executors.newFixedThreadPool(1, new a());
} catch (Throwable th) {
throw th;
}
}
}
private void d(final C2989y1 c2989y1, List list) {
final String str = (String) this.f43571a.a(C2837l4.f41099A);
if (TextUtils.isEmpty(str)) {
return;
}
double a10 = c2989y1.a(this.f43571a);
if (AbstractC3002z6.a(a10)) {
if (((Boolean) this.f43571a.a(C2837l4.f41147G)).booleanValue()) {
a(str, c2989y1, a(c2989y1, a10, list));
return;
}
Iterator it = list.iterator();
while (it.hasNext()) {
final JSONObject a11 = a(c2989y1, a10, Collections.singletonList((Map) it.next()));
f43569g.execute(new Runnable() {
@Override
public final void run() {
AbstractC2997z1.this.a(str, c2989y1, a11);
}
});
}
}
}
public void a(String str, C2989y1 c2989y1, 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 i10 = f43568f;
httpURLConnection.setConnectTimeout(i10);
httpURLConnection.setReadTimeout(i10);
httpURLConnection.setRequestProperty("Content-Type", "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", c2989y1.b());
OutputStream outputStream = httpURLConnection.getOutputStream();
outputStream.write(bytes);
outputStream.close();
int responseCode = httpURLConnection.getResponseCode();
if (C2936o.a()) {
this.f43572b.a("HealthEventsReporter", c2989y1.b() + " reported with code " + responseCode);
}
this.f43574d.put(c2989y1, Long.valueOf(System.currentTimeMillis()));
AbstractC3002z6.a(httpURLConnection, this.f43571a);
} catch (Throwable th2) {
th = th2;
httpURLConnection2 = httpURLConnection;
try {
if (C2936o.a()) {
this.f43572b.d("HealthEventsReporter", "Failed to report " + c2989y1.b(), th);
}
} finally {
AbstractC3002z6.a(httpURLConnection2, this.f43571a);
}
}
}
public void a(C2989y1 c2989y1, String str) {
a(c2989y1, str, new HashMap());
}
public void a(C2989y1 c2989y1, String str, Map map) {
map.put("source", str);
d(c2989y1, map);
}
public void a(C2989y1 c2989y1, String str, Map map, String str2) {
if (!StringUtils.isValidString(str2) || this.f43575e.add(str2)) {
map.put("source", str);
a(c2989y1, str, map);
}
}
public void a(C2989y1 c2989y1, Map map, long j10) {
ArrayList arrayList = new ArrayList();
arrayList.add(map);
a(c2989y1, arrayList, j10);
}
public void a(final C2989y1 c2989y1, final List list, long j10) {
if (a(c2989y1, j10)) {
return;
}
try {
if (AbstractC3002z6.h()) {
f43569g.execute(new Runnable() {
@Override
public final void run() {
AbstractC2997z1.this.b(c2989y1, list);
}
});
} else {
b(c2989y1, list);
}
} catch (Throwable th) {
if (C2936o.a()) {
this.f43572b.d("HealthEventsReporter", "Failed to report " + c2989y1.b() + " with extra parameters collection " + list, th);
}
}
}
public void b(C2989y1 c2989y1, List list) {
if (AppLovinSdkUtils.isEmulator()) {
return;
}
if (C2936o.a()) {
this.f43572b.a("HealthEventsReporter", "Reporting " + c2989y1.b() + " with extra parameters collection " + list);
}
if (this.f43573c != c2989y1.a()) {
AbstractC2794g1.a("Health event " + c2989y1.b() + " category: " + c2989y1.a() + " does not match the reporter category: " + this.f43573c, new Object[0]);
}
c(c2989y1, list);
d(c2989y1, list);
}
private Map c(C2989y1 c2989y1, Map map) {
HashMap hashMap = new HashMap(map);
if (c2989y1 == C2989y1.f43500s0) {
hashMap.remove("details");
}
return hashMap;
}
private Map b(C2989y1 c2989y1, Map map) {
HashMap hashMap = new HashMap();
hashMap.put("type", c2989y1.b());
if (c2989y1 == C2989y1.f43492o0 || c2989y1 == C2989y1.f43442D0 || c2989y1 == C2989y1.f43438B0) {
if (((Boolean) this.f43571a.a(C2837l4.f41316d4)).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.f43571a.B().I(), hashMap);
}
Map L10 = this.f43571a.B().L();
hashMap.put("platform", String.valueOf(L10.get("platform")));
hashMap.put("country_code", String.valueOf(L10.get("country_code")));
hashMap.put(C7910c.f102127f, this.f43571a.w().getCountryCode());
hashMap.put("applovin_random_token", this.f43571a.h0());
hashMap.put("compass_random_token", this.f43571a.v());
hashMap.put("model", Build.MODEL);
hashMap.put("brand", Build.MANUFACTURER);
hashMap.put("brand_name", Build.BRAND);
hashMap.put(T6.d.f17666v, 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(C4928x.f53338k, String.valueOf(AppLovinSdk.VERSION));
CollectionUtils.putStringIfValid("ad_review_sdk_version", C2808i.b(), hashMap);
hashMap.put("md", (String) this.f43571a.a(C2837l4.f41439t));
b(hashMap);
a(hashMap);
if (map != null) {
hashMap.putAll(c(c2989y1, map));
}
return hashMap;
}
private URL a(C2989y1 c2989y1, Map map) {
StringBuilder sb2 = new StringBuilder("https://ms.applovin.com/1.0/sdk/error?");
Iterator it = b(c2989y1, 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");
sb2.append(encode);
sb2.append("=");
sb2.append(encode2);
if (it.hasNext()) {
sb2.append("&");
}
}
return new URL(sb2.toString());
}
private JSONObject a(C2989y1 c2989y1, double d10, List list) {
JSONObject jSONObject = new JSONObject();
JsonUtils.putLong(jSONObject, "ts_ms", System.currentTimeMillis());
if (c2989y1 == C2989y1.f43492o0 || c2989y1 == C2989y1.f43442D0 || c2989y1 == C2989y1.f43438B0) {
if (((Boolean) this.f43571a.a(C2837l4.f41316d4)).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.f43571a.B().I());
}
JSONObject jSONObject2 = new JSONObject();
Map L10 = this.f43571a.B().L();
JsonUtils.putObject(jSONObject2, "platform", L10.get("platform"));
JsonUtils.putObject(jSONObject2, "os", L10.get("os"));
JsonUtils.putObject(jSONObject2, "brand", L10.get("brand"));
JsonUtils.putObject(jSONObject2, "model", L10.get("model"));
JsonUtils.putObject(jSONObject2, "revision", L10.get("revision"));
JsonUtils.putObject(jSONObject2, "country_code", L10.get("country_code"));
JsonUtils.putObject(jSONObject2, C7910c.f102127f, this.f43571a.w().getCountryCode());
JsonUtils.putObject(jSONObject2, "applovin_random_token", this.f43571a.h0());
JsonUtils.putObject(jSONObject2, "ad_review_sdk_version", StringUtils.emptyIfNull(C2808i.b()));
Map D10 = this.f43571a.B().D();
JsonUtils.putObject(jSONObject2, C4928x.f53338k, D10.get(C4928x.f53338k));
JsonUtils.putObject(jSONObject2, "plugin_version", this.f43571a.a(C2837l4.f41111B3));
JsonUtils.putObject(jSONObject2, "app_version", D10.get("app_version"));
JsonUtils.putObject(jSONObject2, CampaignEx.JSON_KEY_PACKAGE_NAME, D10.get(CampaignEx.JSON_KEY_PACKAGE_NAME));
JsonUtils.putObject(jSONObject2, "first_install", Boolean.toString(Boolean.TRUE.equals((Boolean) D10.get("first_install_v2"))));
JsonUtils.putObject(jSONObject2, "md", this.f43571a.a(C2837l4.f41439t));
JsonUtils.putObject(jSONObject2, "mediation_provider", this.f43571a.V());
SessionTracker m02 = this.f43571a.m0();
JsonUtils.putObject(jSONObject2, "app_state", m02.getCurrentApplicationState().b());
JsonUtils.putObject(jSONObject2, "app_state_duration_ms", Long.valueOf(m02.getCurrentApplicationStateDurationMillis()));
JsonUtils.putObject(jSONObject2, C5609a.f76298p, m02.getSessionId());
JsonUtils.putObject(jSONObject2, "session_duration_ms", Long.valueOf(System.currentTimeMillis() - C2932k.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", c2989y1.b());
JsonUtils.putDouble(jSONObject3, "weight", d10);
JsonUtils.putString(jSONObject3, "level", "DEBUG");
a(map);
JsonUtils.putAll(jSONObject3, (Map<String, ?>) map);
jSONArray.put(jSONObject3);
}
JsonUtils.putObject(jSONObject, "events", jSONArray);
return jSONObject;
}
private void b(Map map) {
String str;
PackageInfo packageInfo;
PackageManager packageManager;
String str2 = "";
try {
packageManager = C2932k.o().getPackageManager();
str = C2932k.o().getPackageName();
} catch (Throwable unused) {
str = "";
}
try {
packageInfo = packageManager.getPackageInfo(str, 0);
} catch (Throwable unused2) {
packageInfo = null;
map.put(CampaignEx.JSON_KEY_PACKAGE_NAME, str);
if (packageInfo != null) {
}
map.put("app_version", str2);
map.put("app_version_code", String.valueOf(packageInfo != null ? packageInfo.versionCode : 0));
}
map.put(CampaignEx.JSON_KEY_PACKAGE_NAME, str);
if (packageInfo != null) {
str2 = packageInfo.versionName;
}
map.put("app_version", str2);
map.put("app_version_code", String.valueOf(packageInfo != null ? packageInfo.versionCode : 0));
}
private void a(Map map) {
if (map == null) {
return;
}
Object a10 = this.f43571a.I().a();
if (a10 instanceof AbstractC2922b) {
map.put("fs_ad_network", "AppLovin");
map.put("fs_ad_creative_id", Long.toString(((AbstractC2922b) a10).getAdIdNumber()));
} else if (a10 instanceof AbstractC2900q2) {
AbstractC2900q2 abstractC2900q2 = (AbstractC2900q2) a10;
map.put("fs_ad_network", abstractC2900q2.getNetworkName());
map.put("fs_ad_creative_id", abstractC2900q2.getCreativeId());
} else {
map.put("fs_ad_network", "None");
map.put("fs_ad_creative_id", "None");
}
}
private boolean a(C2989y1 c2989y1, long j10) {
Long l10 = (Long) this.f43574d.get(c2989y1);
return System.currentTimeMillis() - (l10 != null ? l10.longValue() : -1L) < j10;
}
}