- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
63 lines
2.0 KiB
Java
63 lines
2.0 KiB
Java
package com.applovin.impl.sdk;
|
|
|
|
import android.os.Process;
|
|
import com.applovin.impl.la;
|
|
import com.applovin.impl.sdk.utils.CollectionUtils;
|
|
import com.applovin.impl.sj;
|
|
import com.ironsource.v8;
|
|
import java.lang.Thread;
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class AppLovinExceptionHandler implements Thread.UncaughtExceptionHandler {
|
|
private static final AppLovinExceptionHandler d = new AppLovinExceptionHandler();
|
|
private final Set a = new HashSet(2);
|
|
private final AtomicBoolean b = new AtomicBoolean();
|
|
private Thread.UncaughtExceptionHandler c;
|
|
|
|
public static AppLovinExceptionHandler shared() {
|
|
return d;
|
|
}
|
|
|
|
public void addSdk(j jVar) {
|
|
if (this.a.contains(jVar)) {
|
|
return;
|
|
}
|
|
this.a.add(jVar);
|
|
}
|
|
|
|
public void enable() {
|
|
if (this.b.compareAndSet(false, true)) {
|
|
this.c = Thread.getDefaultUncaughtExceptionHandler();
|
|
Thread.setDefaultUncaughtExceptionHandler(this);
|
|
}
|
|
}
|
|
|
|
@Override // java.lang.Thread.UncaughtExceptionHandler
|
|
public void uncaughtException(Thread thread, Throwable th) {
|
|
long j = 500;
|
|
for (j jVar : this.a) {
|
|
jVar.J();
|
|
if (n.a()) {
|
|
jVar.J().a("AppLovinExceptionHandler", "Detected unhandled exception");
|
|
}
|
|
jVar.E().a(la.J, CollectionUtils.map("top_main_method", th.toString()));
|
|
jVar.A().trackEventSynchronously(v8.h.e0);
|
|
j = ((Long) jVar.a(sj.F3)).longValue();
|
|
}
|
|
try {
|
|
Thread.sleep(j);
|
|
} catch (InterruptedException unused) {
|
|
}
|
|
Thread.UncaughtExceptionHandler uncaughtExceptionHandler = this.c;
|
|
if (uncaughtExceptionHandler != null) {
|
|
uncaughtExceptionHandler.uncaughtException(thread, th);
|
|
} else {
|
|
Process.killProcess(Process.myPid());
|
|
System.exit(1);
|
|
}
|
|
}
|
|
}
|