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>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,160 @@
package com.vungle.ads.internal.task;
import android.content.Context;
import android.os.Bundle;
import com.vungle.ads.BuildConfig;
import com.vungle.ads.ServiceLocator;
import com.vungle.ads.internal.persistence.FilePreferences;
import com.vungle.ads.internal.util.FileUtility;
import com.vungle.ads.internal.util.Logger;
import com.vungle.ads.internal.util.PathProvider;
import csdk.gluads.Consts;
import java.io.File;
import java.io.IOException;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.LazyThreadSafetyMode;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class CleanupJob implements Job {
private static final String AD_ID_KEY = "AD_ID_KEY";
public static final Companion Companion = new Companion(null);
public static final String TAG = "CleanupJob";
private final Context context;
private final PathProvider pathProvider;
public final Context getContext() {
return this.context;
}
public final PathProvider getPathProvider() {
return this.pathProvider;
}
public CleanupJob(Context context, PathProvider pathProvider) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(pathProvider, "pathProvider");
this.context = context;
this.pathProvider = pathProvider;
}
@Override // com.vungle.ads.internal.task.Job
public int onRunJob(Bundle bundle, JobRunner jobRunner) {
File file;
Intrinsics.checkNotNullParameter(bundle, "bundle");
Intrinsics.checkNotNullParameter(jobRunner, "jobRunner");
File downloadDir = this.pathProvider.getDownloadDir();
String string = bundle.getString(AD_ID_KEY);
if (string == null || (file = this.pathProvider.getDownloadsDirForAd(string)) == null) {
file = downloadDir;
}
Logger.Companion.d(TAG, "CleanupJob: Current directory snapshot");
try {
if (Intrinsics.areEqual(file, downloadDir)) {
checkIfSdkUpgraded();
FileUtility.deleteContents(file);
return 0;
}
FileUtility.delete(file);
return 0;
} catch (IOException unused) {
return 1;
}
}
private final void dropV6Data() {
Logger.Companion.d(TAG, "CleanupJob: drop old files data");
File file = new File(this.context.getNoBackupFilesDir(), "vungle_db");
if (file.exists()) {
FileUtility.delete(file);
FileUtility.delete(new File(file.getPath() + "-journal"));
} else {
this.context.deleteDatabase("vungle_db");
}
String string = this.context.getSharedPreferences("com.vungle.sdk", 0).getString("cache_path", null);
this.context.deleteSharedPreferences("com.vungle.sdk");
File noBackupFilesDir = this.context.getNoBackupFilesDir();
Intrinsics.checkNotNullExpressionValue(noBackupFilesDir, "{\n context.noBackupFilesDir\n }");
FileUtility.delete(new File(noBackupFilesDir, "vungle_settings"));
if (string != null) {
FileUtility.delete(new File(string));
}
}
private final void dropV700Data() {
FileUtility.delete(new File(this.context.getApplicationInfo().dataDir, Consts.SDK_VUNGLE));
}
private final void dropV730TempData() {
try {
FileUtility.delete(new File(this.pathProvider.getSharedPrefsDir(), "vungleSettings"));
FileUtility.delete(new File(this.pathProvider.getSharedPrefsDir(), "failedTpatSet"));
} catch (Exception e) {
Logger.Companion.e(TAG, "Failed to delete temp data", e);
}
}
private final void checkIfSdkUpgraded() {
Lazy lazy;
ServiceLocator.Companion companion = ServiceLocator.Companion;
final Context context = this.context;
lazy = LazyKt__LazyJVMKt.lazy(LazyThreadSafetyMode.SYNCHRONIZED, new Function0() { // from class: com.vungle.ads.internal.task.CleanupJob$checkIfSdkUpgraded$$inlined$inject$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(0);
}
/* JADX WARN: Type inference failed for: r0v2, types: [com.vungle.ads.internal.persistence.FilePreferences, java.lang.Object] */
@Override // kotlin.jvm.functions.Function0
public final FilePreferences invoke() {
return ServiceLocator.Companion.getInstance(context).getService(FilePreferences.class);
}
});
int i = m3973checkIfSdkUpgraded$lambda3(lazy).getInt("VERSION_CODE", -1);
if (i < 70401) {
if (i < 70000) {
dropV6Data();
}
if (i < 70100) {
dropV700Data();
}
if (i < 70301) {
dropV730TempData();
}
m3973checkIfSdkUpgraded$lambda3(lazy).put("VERSION_CODE", BuildConfig.VERSION_CODE).apply();
}
}
/* renamed from: checkIfSdkUpgraded$lambda-3, reason: not valid java name */
private static final FilePreferences m3973checkIfSdkUpgraded$lambda3(Lazy lazy) {
return (FilePreferences) lazy.getValue();
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public static /* synthetic */ JobInfo makeJobInfo$default(Companion companion, String str, int i, Object obj) {
if ((i & 1) != 0) {
str = null;
}
return companion.makeJobInfo(str);
}
public final JobInfo makeJobInfo(String str) {
JobInfo priority = new JobInfo(CleanupJob.TAG).setPriority(0);
Bundle bundle = new Bundle();
if (str != null) {
bundle.putString(CleanupJob.AD_ID_KEY, str);
}
return priority.setExtras(bundle).setUpdateCurrent(str == null);
}
}
}

View File

@@ -0,0 +1,7 @@
package com.vungle.ads.internal.task;
/* loaded from: classes4.dex */
public final class CleanupJobKt {
private static final int NO_VALUE = -1;
private static final String VERSION_CODE_KEY = "VERSION_CODE";
}

View File

@@ -0,0 +1,28 @@
package com.vungle.ads.internal.task;
import android.os.Bundle;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/* loaded from: classes4.dex */
public interface Job {
int onRunJob(Bundle bundle, JobRunner jobRunner);
@Retention(RetentionPolicy.SOURCE)
public @interface Result {
public static final Companion Companion = Companion.$$INSTANCE;
public static final int FAILURE = 1;
public static final int RESCHEDULE = 2;
public static final int SUCCESS = 0;
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
public static final int FAILURE = 1;
public static final int RESCHEDULE = 2;
public static final int SUCCESS = 0;
private Companion() {
}
}
}
}

View File

@@ -0,0 +1,6 @@
package com.vungle.ads.internal.task;
/* loaded from: classes4.dex */
public interface JobCreator {
Job create(String str) throws UnknownTagException;
}

View File

@@ -0,0 +1,191 @@
package com.vungle.ads.internal.task;
import android.os.Bundle;
import com.vungle.ads.internal.util.Logger;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class JobInfo implements Cloneable {
public static final Companion Companion = new Companion(null);
private static final String TAG = "JobInfo";
private long delay;
private Bundle extras;
private final String jobTag;
private long nextRescheduleTimeout;
private int priority;
private int requiredNetworkType;
private int reschedulePolicy;
private long rescheduleTimeout;
private boolean updateCurrent;
public static /* synthetic */ void getPriority$annotations() {
}
@NetworkType
public static /* synthetic */ void getRequiredNetworkType$annotations() {
}
private static /* synthetic */ void getReschedulePolicy$annotations() {
}
public final long getDelay() {
return this.delay;
}
public final Bundle getExtras() {
return this.extras;
}
public final String getJobTag() {
return this.jobTag;
}
public final int getPriority() {
return this.priority;
}
public final int getRequiredNetworkType() {
return this.requiredNetworkType;
}
public final boolean getUpdateCurrent() {
return this.updateCurrent;
}
public final long makeNextRescedule() {
long j = this.rescheduleTimeout;
if (j == 0) {
return 0L;
}
long j2 = this.nextRescheduleTimeout;
if (j2 == 0) {
this.nextRescheduleTimeout = j;
} else if (this.reschedulePolicy == 1) {
this.nextRescheduleTimeout = j2 * 2;
}
return this.nextRescheduleTimeout;
}
public final JobInfo setDelay(long j) {
this.delay = j;
return this;
}
public final JobInfo setExtras(Bundle extras) {
Intrinsics.checkNotNullParameter(extras, "extras");
this.extras = extras;
return this;
}
public final JobInfo setPriority(int i) {
this.priority = i;
return this;
}
public final JobInfo setRequiredNetworkType(@NetworkType int i) {
this.requiredNetworkType = i;
return this;
}
public final JobInfo setReschedulePolicy(long j, int i) {
this.rescheduleTimeout = j;
this.reschedulePolicy = i;
return this;
}
public final JobInfo setUpdateCurrent(boolean z) {
this.updateCurrent = z;
return this;
}
public JobInfo(String jobTag) {
Intrinsics.checkNotNullParameter(jobTag, "jobTag");
this.jobTag = jobTag;
this.extras = new Bundle();
this.reschedulePolicy = 1;
this.priority = 2;
}
public Object clone() {
return super.clone();
}
public final JobInfo copy() {
try {
Object clone = super.clone();
Intrinsics.checkNotNull(clone, "null cannot be cast to non-null type com.vungle.ads.internal.task.JobInfo");
return (JobInfo) clone;
} catch (CloneNotSupportedException e) {
Logger.Companion.e(TAG, "Cannot copy JobInfo " + this, e);
return null;
}
}
@Retention(RetentionPolicy.SOURCE)
public @interface ReschedulePolicy {
public static final Companion Companion = Companion.$$INSTANCE;
public static final int EXPONENTIAL = 1;
public static final int LINEAR = 0;
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
public static final int EXPONENTIAL = 1;
public static final int LINEAR = 0;
private Companion() {
}
}
}
@Retention(RetentionPolicy.SOURCE)
public @interface Priority {
public static final int CRITICAL = 5;
public static final Companion Companion = Companion.$$INSTANCE;
public static final int HIGH = 3;
public static final int HIGHEST = 4;
public static final int LOW = 1;
public static final int LOWEST = 0;
public static final int NORMAL = 2;
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
public static final int CRITICAL = 5;
public static final int HIGH = 3;
public static final int HIGHEST = 4;
public static final int LOW = 1;
public static final int LOWEST = 0;
public static final int NORMAL = 2;
private Companion() {
}
}
}
@Retention(RetentionPolicy.RUNTIME)
public @interface NetworkType {
public static final int ANY = 0;
public static final int CONNECTED = 1;
public static final Companion Companion = Companion.$$INSTANCE;
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
public static final int ANY = 0;
public static final int CONNECTED = 1;
private Companion() {
}
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,89 @@
package com.vungle.ads.internal.task;
import android.os.Bundle;
import android.os.Process;
import com.vungle.ads.internal.util.Logger;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class JobRunnable extends PriorityRunnable {
public static final Companion Companion = new Companion(null);
private static final String TAG = JobRunnable.class.getSimpleName();
private final JobCreator creator;
private final JobRunner jobRunner;
private final JobInfo jobinfo;
private final ThreadPriorityHelper threadPriorityHelper;
public static /* synthetic */ void getPriority$annotations() {
}
public JobRunnable(JobInfo jobinfo, JobCreator creator, JobRunner jobRunner, ThreadPriorityHelper threadPriorityHelper) {
Intrinsics.checkNotNullParameter(jobinfo, "jobinfo");
Intrinsics.checkNotNullParameter(creator, "creator");
Intrinsics.checkNotNullParameter(jobRunner, "jobRunner");
this.jobinfo = jobinfo;
this.creator = creator;
this.jobRunner = jobRunner;
this.threadPriorityHelper = threadPriorityHelper;
}
@Override // com.vungle.ads.internal.task.PriorityRunnable
public int getPriority() {
return this.jobinfo.getPriority();
}
@Override // java.lang.Runnable
public void run() {
ThreadPriorityHelper threadPriorityHelper = this.threadPriorityHelper;
if (threadPriorityHelper != null) {
try {
int makeAndroidThreadPriority = threadPriorityHelper.makeAndroidThreadPriority(this.jobinfo);
Process.setThreadPriority(makeAndroidThreadPriority);
Logger.Companion companion = Logger.Companion;
String TAG2 = TAG;
Intrinsics.checkNotNullExpressionValue(TAG2, "TAG");
companion.d(TAG2, "Setting process thread prio = " + makeAndroidThreadPriority + " for " + this.jobinfo.getJobTag());
} catch (Throwable unused) {
Logger.Companion companion2 = Logger.Companion;
String TAG3 = TAG;
Intrinsics.checkNotNullExpressionValue(TAG3, "TAG");
companion2.e(TAG3, "Error on setting process thread priority");
}
}
try {
String jobTag = this.jobinfo.getJobTag();
Bundle extras = this.jobinfo.getExtras();
Logger.Companion companion3 = Logger.Companion;
String TAG4 = TAG;
Intrinsics.checkNotNullExpressionValue(TAG4, "TAG");
companion3.d(TAG4, "Start job " + jobTag + "Thread " + Thread.currentThread().getName());
int onRunJob = this.creator.create(jobTag).onRunJob(extras, this.jobRunner);
Intrinsics.checkNotNullExpressionValue(TAG4, "TAG");
companion3.d(TAG4, "On job finished " + jobTag + " with result " + onRunJob);
if (onRunJob == 2) {
long makeNextRescedule = this.jobinfo.makeNextRescedule();
if (makeNextRescedule > 0) {
this.jobinfo.setDelay(makeNextRescedule);
this.jobRunner.execute(this.jobinfo);
Intrinsics.checkNotNullExpressionValue(TAG4, "TAG");
companion3.d(TAG4, "Rescheduling " + jobTag + " in " + makeNextRescedule);
}
}
} catch (Exception e) {
Logger.Companion companion4 = Logger.Companion;
String TAG5 = TAG;
Intrinsics.checkNotNullExpressionValue(TAG5, "TAG");
companion4.e(TAG5, "Cannot create job" + e.getLocalizedMessage());
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,8 @@
package com.vungle.ads.internal.task;
/* loaded from: classes4.dex */
public interface JobRunner {
void cancelPendingJob(String str);
void execute(JobInfo jobInfo);
}

View File

@@ -0,0 +1,12 @@
package com.vungle.ads.internal.task;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class JobRunnerThreadPriorityHelper implements ThreadPriorityHelper {
@Override // com.vungle.ads.internal.task.ThreadPriorityHelper
public int makeAndroidThreadPriority(JobInfo jobInfo) {
Intrinsics.checkNotNullParameter(jobInfo, "jobInfo");
return Math.min(19, Math.abs(Math.min(0, jobInfo.getPriority() - 2)) + 10);
}
}

View File

@@ -0,0 +1,18 @@
package com.vungle.ads.internal.task;
import com.vungle.ads.internal.executor.VungleThreadPoolExecutor;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public abstract class PriorityRunnable implements VungleThreadPoolExecutor.ComparableRunnable {
public abstract int getPriority();
@Override // java.lang.Comparable
public int compareTo(Object other) {
Intrinsics.checkNotNullParameter(other, "other");
if (!(other instanceof PriorityRunnable)) {
return -1;
}
return Intrinsics.compare(((PriorityRunnable) other).getPriority(), getPriority());
}
}

View File

@@ -0,0 +1,99 @@
package com.vungle.ads.internal.task;
import android.content.Context;
import android.os.Bundle;
import com.vungle.ads.ServiceLocator;
import com.vungle.ads.internal.executor.Executors;
import com.vungle.ads.internal.network.TpatSender;
import com.vungle.ads.internal.network.VungleApiClient;
import com.vungle.ads.internal.util.PathProvider;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.LazyThreadSafetyMode;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class ResendTpatJob implements Job {
public static final Companion Companion = new Companion(null);
public static final String TAG = "ResendTpatJob";
private final Context context;
private final PathProvider pathProvider;
public final Context getContext() {
return this.context;
}
public final PathProvider getPathProvider() {
return this.pathProvider;
}
public ResendTpatJob(Context context, PathProvider pathProvider) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(pathProvider, "pathProvider");
this.context = context;
this.pathProvider = pathProvider;
}
/* renamed from: onRunJob$lambda-0, reason: not valid java name */
private static final VungleApiClient m3974onRunJob$lambda0(Lazy lazy) {
return (VungleApiClient) lazy.getValue();
}
@Override // com.vungle.ads.internal.task.Job
public int onRunJob(Bundle bundle, JobRunner jobRunner) {
Lazy lazy;
Lazy lazy2;
Intrinsics.checkNotNullParameter(bundle, "bundle");
Intrinsics.checkNotNullParameter(jobRunner, "jobRunner");
ServiceLocator.Companion companion = ServiceLocator.Companion;
final Context context = this.context;
LazyThreadSafetyMode lazyThreadSafetyMode = LazyThreadSafetyMode.SYNCHRONIZED;
lazy = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.vungle.ads.internal.task.ResendTpatJob$onRunJob$$inlined$inject$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(0);
}
/* JADX WARN: Type inference failed for: r0v2, types: [com.vungle.ads.internal.network.VungleApiClient, java.lang.Object] */
@Override // kotlin.jvm.functions.Function0
public final VungleApiClient invoke() {
return ServiceLocator.Companion.getInstance(context).getService(VungleApiClient.class);
}
});
final Context context2 = this.context;
lazy2 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.vungle.ads.internal.task.ResendTpatJob$onRunJob$$inlined$inject$2
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(0);
}
/* JADX WARN: Type inference failed for: r0v2, types: [com.vungle.ads.internal.executor.Executors, java.lang.Object] */
@Override // kotlin.jvm.functions.Function0
public final Executors invoke() {
return ServiceLocator.Companion.getInstance(context2).getService(Executors.class);
}
});
new TpatSender(m3974onRunJob$lambda0(lazy), null, null, null, m3975onRunJob$lambda1(lazy2).getIoExecutor(), this.pathProvider, null, 64, null).resendStoredTpats$vungle_ads_release(m3975onRunJob$lambda1(lazy2).getJobExecutor());
return 0;
}
/* renamed from: onRunJob$lambda-1, reason: not valid java name */
private static final Executors m3975onRunJob$lambda1(Lazy lazy) {
return (Executors) lazy.getValue();
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final JobInfo makeJobInfo() {
return new JobInfo(ResendTpatJob.TAG).setPriority(0).setUpdateCurrent(true);
}
}
}

View File

@@ -0,0 +1,6 @@
package com.vungle.ads.internal.task;
/* loaded from: classes4.dex */
public interface ThreadPriorityHelper {
int makeAndroidThreadPriority(JobInfo jobInfo);
}

View File

@@ -0,0 +1,8 @@
package com.vungle.ads.internal.task;
/* loaded from: classes4.dex */
public final class UnknownTagException extends Exception {
public UnknownTagException(String str) {
super(str);
}
}

View File

@@ -0,0 +1,41 @@
package com.vungle.ads.internal.task;
import android.content.Context;
import com.vungle.ads.internal.util.PathProvider;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class VungleJobCreator implements JobCreator {
private final Context context;
private final PathProvider pathProvider;
public final Context getContext() {
return this.context;
}
public final PathProvider getPathProvider() {
return this.pathProvider;
}
public VungleJobCreator(Context context, PathProvider pathProvider) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(pathProvider, "pathProvider");
this.context = context;
this.pathProvider = pathProvider;
}
@Override // com.vungle.ads.internal.task.JobCreator
public Job create(String tag) throws UnknownTagException {
Intrinsics.checkNotNullParameter(tag, "tag");
if (tag.length() == 0) {
throw new UnknownTagException("Job tag is null");
}
if (Intrinsics.areEqual(tag, CleanupJob.TAG)) {
return new CleanupJob(this.context, this.pathProvider);
}
if (Intrinsics.areEqual(tag, ResendTpatJob.TAG)) {
return new ResendTpatJob(this.context, this.pathProvider);
}
throw new UnknownTagException("Unknown Job Type " + tag);
}
}

View File

@@ -0,0 +1,173 @@
package com.vungle.ads.internal.task;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import androidx.annotation.VisibleForTesting;
import com.vungle.ads.internal.util.Logger;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class VungleJobRunner implements JobRunner {
private final JobCreator creator;
private final Executor executor;
private long nextCheck;
private final List<PendingJob> pendingJobs;
private final Runnable pendingRunnable;
private final ThreadPriorityHelper threadPriorityHelper;
public static final Companion Companion = new Companion(null);
private static final Handler handler = new Handler(Looper.getMainLooper());
private static final String TAG = VungleJobRunner.class.getSimpleName();
public VungleJobRunner(JobCreator creator, Executor executor, ThreadPriorityHelper threadPriorityHelper) {
Intrinsics.checkNotNullParameter(creator, "creator");
Intrinsics.checkNotNullParameter(executor, "executor");
this.creator = creator;
this.executor = executor;
this.threadPriorityHelper = threadPriorityHelper;
this.nextCheck = Long.MAX_VALUE;
this.pendingJobs = new CopyOnWriteArrayList();
this.pendingRunnable = new PendingRunnable(new WeakReference(this));
}
public static final class PendingJob {
private JobInfo info;
private final long uptimeMillis;
public final JobInfo getInfo() {
return this.info;
}
public final long getUptimeMillis() {
return this.uptimeMillis;
}
public final void setInfo(JobInfo jobInfo) {
this.info = jobInfo;
}
public PendingJob(long j, JobInfo jobInfo) {
this.uptimeMillis = j;
this.info = jobInfo;
}
}
public static final class PendingRunnable implements Runnable {
private WeakReference<VungleJobRunner> runner;
public final WeakReference<VungleJobRunner> getRunner() {
return this.runner;
}
public final void setRunner(WeakReference<VungleJobRunner> weakReference) {
Intrinsics.checkNotNullParameter(weakReference, "<set-?>");
this.runner = weakReference;
}
public PendingRunnable(WeakReference<VungleJobRunner> runner) {
Intrinsics.checkNotNullParameter(runner, "runner");
this.runner = runner;
}
@Override // java.lang.Runnable
public void run() {
VungleJobRunner vungleJobRunner = this.runner.get();
if (vungleJobRunner != null) {
vungleJobRunner.executePendingJobs();
}
}
}
@Override // com.vungle.ads.internal.task.JobRunner
public synchronized void execute(JobInfo jobInfo) {
try {
Intrinsics.checkNotNullParameter(jobInfo, "jobInfo");
JobInfo copy = jobInfo.copy();
if (copy != null) {
String jobTag = copy.getJobTag();
long delay = copy.getDelay();
copy.setDelay(0L);
if (copy.getUpdateCurrent()) {
for (PendingJob pendingJob : this.pendingJobs) {
JobInfo info = pendingJob.getInfo();
if (Intrinsics.areEqual(info != null ? info.getJobTag() : null, jobTag)) {
Logger.Companion companion = Logger.Companion;
String TAG2 = TAG;
Intrinsics.checkNotNullExpressionValue(TAG2, "TAG");
companion.d(TAG2, "replacing pending job with new " + jobTag);
this.pendingJobs.remove(pendingJob);
}
}
}
this.pendingJobs.add(new PendingJob(SystemClock.uptimeMillis() + delay, copy));
executePendingJobs();
}
} catch (Throwable th) {
throw th;
}
}
@VisibleForTesting
public final int getPendingJobSize$vungle_ads_release() {
return this.pendingJobs.size();
}
@Override // com.vungle.ads.internal.task.JobRunner
public synchronized void cancelPendingJob(String tag) {
try {
Intrinsics.checkNotNullParameter(tag, "tag");
ArrayList arrayList = new ArrayList();
for (PendingJob pendingJob : this.pendingJobs) {
JobInfo info = pendingJob.getInfo();
if (Intrinsics.areEqual(info != null ? info.getJobTag() : null, tag)) {
arrayList.add(pendingJob);
}
}
this.pendingJobs.removeAll(arrayList);
} catch (Throwable th) {
throw th;
}
}
/* JADX INFO: Access modifiers changed from: private */
public final synchronized void executePendingJobs() {
try {
long uptimeMillis = SystemClock.uptimeMillis();
long j = Long.MAX_VALUE;
for (PendingJob pendingJob : this.pendingJobs) {
if (uptimeMillis >= pendingJob.getUptimeMillis()) {
this.pendingJobs.remove(pendingJob);
JobInfo info = pendingJob.getInfo();
if (info != null) {
this.executor.execute(new JobRunnable(info, this.creator, this, this.threadPriorityHelper));
}
} else {
j = Math.min(j, pendingJob.getUptimeMillis());
}
}
if (j != Long.MAX_VALUE && j != this.nextCheck) {
Handler handler2 = handler;
handler2.removeCallbacks(this.pendingRunnable);
handler2.postAtTime(this.pendingRunnable, TAG, j);
}
this.nextCheck = j;
} catch (Throwable th) {
throw th;
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}