Currency Plus v2.10.8版本的 MD5 值为:8586f74edd9ace5aa261a19c9da51484
以下内容为反编译后的 r.java 源代码,内容仅作参考
package com.applovin.impl.sdk;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import com.amazon.device.ads.DtbDeviceData;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.sdk.AppLovinSdk;
import com.google.ads.mediation.inmobi.InMobiNetworkValues;
import com.google.android.gms.measurement.AppMeasurement;
import j$.util.DesugarCollections;
import java.io.UnsupportedEncodingException;
import java.lang.Thread;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
public class r {
private static final int aEA = (int) TimeUnit.SECONDS.toMillis(30);
private final ExecutorService aEB;
private final Map<a, Long> aEC = DesugarCollections.synchronizedMap(new HashMap());
protected final x logger;
protected final n sdk;
public enum a {
ANR("anr"),
BLACK_VIEW("black_view"),
CRASH(AppMeasurement.CRASH_ORIGIN),
TASK_EXCEPTION("task_exception"),
CAUGHT_EXCEPTION("caught_exception"),
WEB_VIEW_ERROR("web_view_error"),
INTEGRATION_ERROR("integration_error"),
TEMPLATE_ERROR("template_error"),
FILE_ERROR("file_error"),
NETWORK_ERROR("network_error");
private final String Jn;
a(String str) {
this.Jn = str;
}
public String tU() {
return this.Jn;
}
}
public r(final n nVar) {
this.sdk = nVar;
this.logger = nVar.BN();
this.aEB = Executors.newFixedThreadPool(1, new ThreadFactory() {
{
r.this = this;
}
@Override
public Thread newThread(Runnable runnable) {
Thread thread = new Thread(runnable, "AppLovinSdk:error_reporter");
thread.setDaemon(true);
thread.setPriority(((Integer) nVar.a(com.applovin.impl.sdk.c.b.aQK)).intValue());
thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
{
AnonymousClass1.this = this;
}
@Override
public void uncaughtException(Thread thread2, Throwable th2) {
nVar.BN();
if (x.Fn()) {
nVar.BN().c("ErrorReporter", "Caught unhandled exception", th2);
}
}
});
return thread;
}
});
}
private boolean a(a aVar, long j10) {
Long l10 = this.aEC.get(aVar);
return System.currentTimeMillis() - (l10 != null ? l10.longValue() : -1L) < j10;
}
public void d(a aVar, Map<String, String> map) {
if (x.Fn()) {
x xVar = this.logger;
xVar.f("ErrorReporter", "Reporting " + aVar.tU() + " error...");
}
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) c(aVar, map).openConnection();
int i10 = aEA;
httpURLConnection.setConnectTimeout(i10);
httpURLConnection.setReadTimeout(i10);
httpURLConnection.setDefaultUseCaches(false);
httpURLConnection.setAllowUserInteraction(false);
httpURLConnection.setUseCaches(false);
httpURLConnection.setInstanceFollowRedirects(true);
httpURLConnection.setDoOutput(false);
httpURLConnection.setRequestMethod("POST");
int responseCode = httpURLConnection.getResponseCode();
if (x.Fn()) {
x xVar2 = this.logger;
xVar2.f("ErrorReporter", aVar.tU() + " reported with code " + responseCode);
}
this.aEC.put(aVar, Long.valueOf(System.currentTimeMillis()));
} catch (Throwable th2) {
if (x.Fn()) {
x xVar3 = this.logger;
xVar3.b("ErrorReporter", "Failed to report " + aVar.tU(), th2);
}
}
}
private URL c(a aVar, Map<String, String> map) throws MalformedURLException, UnsupportedEncodingException {
StringBuilder sb2 = new StringBuilder("https://ms.applovin.com/1.0/sdk/error?");
Iterator<Map.Entry<String, String>> it = d(aVar.tU(), map).entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, String> next = it.next();
String encode = URLEncoder.encode(next.getKey(), "UTF-8");
String encode2 = URLEncoder.encode(next.getValue(), "UTF-8");
sb2.append(encode);
sb2.append("=");
sb2.append(encode2);
if (it.hasNext()) {
sb2.append("&");
}
}
return new URL(sb2.toString());
}
private Map<String, String> d(String str, Map<String, String> map) {
HashMap hashMap = new HashMap();
hashMap.put(xa.c.TYPE, str);
if (this.sdk.BV() != null) {
hashMap.put("platform", this.sdk.BU().Ed());
} else {
hashMap.put("platform", this.sdk.BS().CX());
}
hashMap.put("applovin_random_token", this.sdk.BB());
hashMap.put("compass_random_token", this.sdk.BA());
hashMap.put(DtbDeviceData.DEVICE_DATA_MODEL_KEY, 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("sdk_version", String.valueOf(AppLovinSdk.VERSION));
hashMap.put("aei", String.valueOf(this.sdk.a(com.applovin.impl.sdk.c.b.aKC)));
hashMap.put("mei", String.valueOf(this.sdk.a(com.applovin.impl.sdk.c.b.aKD)));
i(hashMap);
j(hashMap);
if (map != null) {
hashMap.putAll(map);
}
return hashMap;
}
private void i(Map<String, String> map) {
String str;
PackageInfo packageInfo;
PackageManager packageManager;
try {
packageManager = n.getApplicationContext().getPackageManager();
str = n.getApplicationContext().getPackageName();
} catch (Throwable unused) {
str = "";
}
try {
packageInfo = packageManager.getPackageInfo(str, 0);
} catch (Throwable unused2) {
packageInfo = null;
map.put(InMobiNetworkValues.PACKAGE_NAME, str);
map.put("app_version", packageInfo != null ? packageInfo.versionName : "");
map.put("app_version_code", String.valueOf(packageInfo != null ? packageInfo.versionCode : 0));
}
map.put(InMobiNetworkValues.PACKAGE_NAME, str);
map.put("app_version", packageInfo != null ? packageInfo.versionName : "");
map.put("app_version_code", String.valueOf(packageInfo != null ? packageInfo.versionCode : 0));
}
private void j(Map<String, String> map) {
Object Fd = this.sdk.Cf().Fd();
if (Fd instanceof com.applovin.impl.sdk.ad.e) {
map.put("fs_ad_network", "AppLovin");
map.put("fs_ad_creative_id", Long.toString(((com.applovin.impl.sdk.ad.e) Fd).getAdIdNumber()));
} else if (!(Fd instanceof com.applovin.impl.mediation.b.a)) {
map.put("fs_ad_network", "None");
map.put("fs_ad_creative_id", "None");
} else {
com.applovin.impl.mediation.b.a aVar = (com.applovin.impl.mediation.b.a) Fd;
map.put("fs_ad_network", aVar.getNetworkName());
map.put("fs_ad_creative_id", aVar.getCreativeId());
}
}
public void a(a aVar, String str, String str2) {
HashMap hashMap = new HashMap(2);
hashMap.put("source", str);
hashMap.put("details", StringUtils.emptyIfNull(str2));
a(aVar, hashMap);
}
public void a(a aVar, Map<String, String> map) {
a(aVar, map, 0L);
}
public void a(a aVar, Map<String, String> map, long j10) {
if (a(aVar, j10)) {
return;
}
try {
if (com.applovin.impl.sdk.utils.u.Lx()) {
this.aEB.execute(new a0(this, 5, aVar, map));
} else {
d(aVar, map);
}
} catch (Throwable th2) {
if (x.Fn()) {
x xVar = this.logger;
xVar.b("ErrorReporter", "Failed to report " + aVar.tU(), th2);
}
}
}
public void b(String str, String str2, int i10) {
if (i10 < 400) {
return;
}
HashMap hashMap = new HashMap(3);
hashMap.put("source", str2);
hashMap.put("details", StringUtils.emptyIfNull(str));
hashMap.put("top_main_method", String.valueOf(i10));
a(a.NETWORK_ERROR, hashMap);
}
public void d(String str, String str2, Throwable th2) {
HashMap hashMap = new HashMap(3);
hashMap.put("source", str);
hashMap.put("details", StringUtils.emptyIfNull(str2));
hashMap.put("top_main_method", th2.toString());
a(a.CAUGHT_EXCEPTION, hashMap);
}
public void g(String str, Throwable th2) {
d(str, null, th2);
}
}