Cyber Surfer v5.2.5版本的 MD5 值为:db13c5fce988de393e52d2679f934b22
以下内容为反编译后的 r.java 源代码,内容仅作参考
package com.applovin.impl.sdk;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import androidx.browser.trusted.sharing.ShareTarget;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.sdk.AppLovinSdk;
import com.appsflyer.ServerParameters;
import com.google.android.gms.measurement.AppMeasurement;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.safedk.android.internal.partials.AppLovinNetworkBridge;
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.Collections;
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 aEw = (int) TimeUnit.SECONDS.toMillis(30);
private final ExecutorService aEx;
private final Map<a, Long> aEy = Collections.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.BL();
this.aEx = Executors.newFixedThreadPool(1, new ThreadFactory() {
@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.aQF)).intValue());
thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread2, Throwable th) {
nVar.BL();
if (x.Fk()) {
nVar.BL().c("ErrorReporter", "Caught unhandled exception", th);
}
}
});
return thread;
}
});
}
private boolean a(a aVar, long j) {
Long l = this.aEy.get(aVar);
return System.currentTimeMillis() - (l != null ? l.longValue() : -1L) < j;
}
public void d(a aVar, Map<String, String> map) {
if (x.Fk()) {
x xVar = this.logger;
xVar.f("ErrorReporter", "Reporting " + aVar.tU() + " error...");
}
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) c(aVar, map).openConnection();
int i = aEw;
httpURLConnection.setConnectTimeout(i);
httpURLConnection.setReadTimeout(i);
httpURLConnection.setDefaultUseCaches(false);
httpURLConnection.setAllowUserInteraction(false);
httpURLConnection.setUseCaches(false);
httpURLConnection.setInstanceFollowRedirects(true);
httpURLConnection.setDoOutput(false);
httpURLConnection.setRequestMethod(ShareTarget.METHOD_POST);
int httpUrlConnectionGetResponseCode = AppLovinNetworkBridge.httpUrlConnectionGetResponseCode(httpURLConnection);
if (x.Fk()) {
x xVar2 = this.logger;
xVar2.f("ErrorReporter", aVar.tU() + " reported with code " + httpUrlConnectionGetResponseCode);
}
this.aEy.put(aVar, Long.valueOf(System.currentTimeMillis()));
} catch (Throwable th) {
if (x.Fk()) {
x xVar3 = this.logger;
xVar3.b("ErrorReporter", "Failed to report " + aVar.tU(), th);
}
}
}
private URL c(a aVar, Map<String, String> map) throws MalformedURLException, UnsupportedEncodingException {
StringBuilder sb = 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");
sb.append(encode);
sb.append("=");
sb.append(encode2);
if (it.hasNext()) {
sb.append("&");
}
}
return new URL(sb.toString());
}
private Map<String, String> d(String str, Map<String, String> map) {
HashMap hashMap = new HashMap();
hashMap.put("type", str);
if (this.sdk.BT() != null) {
hashMap.put("platform", this.sdk.BS().Ea());
} else {
hashMap.put("platform", this.sdk.BQ().CU());
}
hashMap.put("applovin_random_token", this.sdk.Bz());
hashMap.put("compass_random_token", this.sdk.By());
hashMap.put(ServerParameters.MODEL, Build.MODEL);
hashMap.put(ServerParameters.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.aKy)));
hashMap.put("mei", String.valueOf(this.sdk.a(com.applovin.impl.sdk.c.b.aKz)));
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(CampaignEx.JSON_KEY_PACKAGE_NAME, str);
map.put("app_version", packageInfo != null ? packageInfo.versionName : "");
map.put(ServerParameters.APP_VERSION_CODE, String.valueOf(packageInfo != null ? packageInfo.versionCode : 0));
}
map.put(CampaignEx.JSON_KEY_PACKAGE_NAME, str);
map.put("app_version", packageInfo != null ? packageInfo.versionName : "");
map.put(ServerParameters.APP_VERSION_CODE, String.valueOf(packageInfo != null ? packageInfo.versionCode : 0));
}
private void j(Map<String, String> map) {
Object Fa = this.sdk.Cd().Fa();
if (Fa 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) Fa).getAdIdNumber()));
} else if (!(Fa 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) Fa;
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(final a aVar, final Map<String, String> map, long j) {
if (a(aVar, j)) {
return;
}
try {
if (com.applovin.impl.sdk.utils.u.Lv()) {
this.aEx.execute(new Runnable() {
@Override
public final void run() {
r.this.d(aVar, map);
}
});
} else {
d(aVar, map);
}
} catch (Throwable th) {
if (x.Fk()) {
x xVar = this.logger;
xVar.b("ErrorReporter", "Failed to report " + aVar.tU(), th);
}
}
}
public void b(String str, String str2, int i) {
if (i < 400) {
return;
}
HashMap hashMap = new HashMap(3);
hashMap.put("source", str2);
hashMap.put("details", StringUtils.emptyIfNull(str));
hashMap.put("top_main_method", String.valueOf(i));
a(a.NETWORK_ERROR, hashMap);
}
public void d(String str, String str2, Throwable th) {
HashMap hashMap = new HashMap(3);
hashMap.put("source", str);
hashMap.put("details", StringUtils.emptyIfNull(str2));
hashMap.put("top_main_method", th.toString());
a(a.CAUGHT_EXCEPTION, hashMap);
}
public void g(String str, Throwable th) {
d(str, null, th);
}
}