Files
rr3-apk/decompiled/sources/com/applovin/impl/v4.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

165 lines
4.8 KiB
Java

package com.applovin.impl;
import android.os.Handler;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
/* loaded from: classes.dex */
public final class v4 {
private final com.applovin.impl.sdk.n a;
private final Handler b;
private final Set c = new HashSet();
private final AtomicInteger d = new AtomicInteger();
public interface b {
void a();
boolean b();
}
public void c() {
if (com.applovin.impl.sdk.n.a()) {
this.a.a("CountdownManager", "Stopping countdowns...");
}
this.d.incrementAndGet();
this.b.removeCallbacksAndMessages(null);
}
public v4(Handler handler, com.applovin.impl.sdk.j jVar) {
if (handler == null) {
throw new IllegalArgumentException("No handler specified.");
}
if (jVar != null) {
this.b = handler;
this.a = jVar.J();
return;
}
throw new IllegalArgumentException("No sdk specified.");
}
public void a(String str, long j, b bVar) {
if (j <= 0) {
throw new IllegalArgumentException("Invalid step specified.");
}
if (this.b != null) {
if (com.applovin.impl.sdk.n.a()) {
this.a.a("CountdownManager", "Adding countdown: " + str);
}
this.c.add(new c(str, j, bVar));
return;
}
throw new IllegalArgumentException("No handler specified.");
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void b(c cVar, int i) {
b a2 = cVar.a();
if (a2.b()) {
if (this.d.get() == i) {
try {
a2.a();
a(cVar, i);
return;
} catch (Throwable th) {
if (com.applovin.impl.sdk.n.a()) {
this.a.a("CountdownManager", "Encountered error on countdown step for: " + cVar.c(), th);
}
a();
return;
}
}
if (com.applovin.impl.sdk.n.a()) {
this.a.k("CountdownManager", "Killing duplicate countdown from previous generation: " + cVar.c());
return;
}
return;
}
if (com.applovin.impl.sdk.n.a()) {
this.a.a("CountdownManager", "Ending countdown for " + cVar.c());
}
}
public static class c {
private final String a;
private final b b;
private final long c;
/* JADX INFO: Access modifiers changed from: private */
public b a() {
return this.b;
}
/* JADX INFO: Access modifiers changed from: private */
public long b() {
return this.c;
}
/* JADX INFO: Access modifiers changed from: private */
public String c() {
return this.a;
}
public String toString() {
return "CountdownProxy{identifier='" + this.a + "', countdownStepMillis=" + this.c + '}';
}
private c(String str, long j, b bVar) {
this.a = str;
this.c = j;
this.b = bVar;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof c)) {
return false;
}
String str = this.a;
String str2 = ((c) obj).a;
return str != null ? str.equalsIgnoreCase(str2) : str2 == null;
}
public int hashCode() {
String str = this.a;
if (str != null) {
return str.hashCode();
}
return 0;
}
}
public void b() {
HashSet<c> hashSet = new HashSet(this.c);
if (com.applovin.impl.sdk.n.a()) {
this.a.a("CountdownManager", "Starting " + hashSet.size() + " countdowns...");
}
int incrementAndGet = this.d.incrementAndGet();
for (c cVar : hashSet) {
if (com.applovin.impl.sdk.n.a()) {
this.a.a("CountdownManager", "Starting countdown: " + cVar.c() + " for generation " + incrementAndGet + "...");
}
a(cVar, incrementAndGet);
}
}
private void a(final c cVar, final int i) {
this.b.postDelayed(new Runnable() { // from class: com.applovin.impl.v4$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
v4.this.b(cVar, i);
}
}, cVar.b());
}
public void a() {
if (com.applovin.impl.sdk.n.a()) {
this.a.a("CountdownManager", "Removing all countdowns...");
}
c();
this.c.clear();
}
}