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,266 @@
package com.vungle.ads.internal.downloader;
import java.io.File;
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 interface AssetDownloadListener {
void onError(DownloadError downloadError, DownloadRequest downloadRequest);
void onSuccess(File file, DownloadRequest downloadRequest);
public static final class DownloadError {
public static final Companion Companion = new Companion(null);
public static final int DEFAULT_SERVER_CODE = -1;
private final Throwable cause;
@ErrorReason
private final int reason;
private final int serverCode;
public final Throwable getCause() {
return this.cause;
}
public final int getReason() {
return this.reason;
}
public final int getServerCode() {
return this.serverCode;
}
public DownloadError(int i, Throwable cause, int i2) {
Intrinsics.checkNotNullParameter(cause, "cause");
this.serverCode = i;
this.cause = cause;
this.reason = i2;
}
@Retention(RetentionPolicy.RUNTIME)
public @interface ErrorReason {
public static final Companion Companion = Companion.$$INSTANCE;
public static final class Companion {
private static int CONNECTION_ERROR;
static final /* synthetic */ Companion $$INSTANCE = new Companion();
private static int REQUEST_ERROR = 1;
private static int DISK_ERROR = 2;
private static int FILE_NOT_FOUND_ERROR = 3;
private static int INTERNAL_ERROR = 4;
public final int getCONNECTION_ERROR() {
return CONNECTION_ERROR;
}
public final int getDISK_ERROR() {
return DISK_ERROR;
}
public final int getFILE_NOT_FOUND_ERROR() {
return FILE_NOT_FOUND_ERROR;
}
public final int getINTERNAL_ERROR() {
return INTERNAL_ERROR;
}
public final int getREQUEST_ERROR() {
return REQUEST_ERROR;
}
public final void setCONNECTION_ERROR(int i) {
CONNECTION_ERROR = i;
}
public final void setDISK_ERROR(int i) {
DISK_ERROR = i;
}
public final void setFILE_NOT_FOUND_ERROR(int i) {
FILE_NOT_FOUND_ERROR = i;
}
public final void setINTERNAL_ERROR(int i) {
INTERNAL_ERROR = i;
}
public final void setREQUEST_ERROR(int i) {
REQUEST_ERROR = i;
}
private Companion() {
}
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}
public static final class Progress {
public static final Companion Companion = new Companion(null);
private int progressPercent;
private long sizeBytes;
private long startBytes;
private int status;
private long timestampDownloadStart;
@ProgressStatus
public static /* synthetic */ void getStatus$annotations() {
}
public final int getProgressPercent() {
return this.progressPercent;
}
public final long getSizeBytes() {
return this.sizeBytes;
}
public final long getStartBytes() {
return this.startBytes;
}
public final int getStatus() {
return this.status;
}
public final long getTimestampDownloadStart() {
return this.timestampDownloadStart;
}
public final void setProgressPercent(int i) {
this.progressPercent = i;
}
public final void setSizeBytes(long j) {
this.sizeBytes = j;
}
public final void setStartBytes(long j) {
this.startBytes = j;
}
public final void setStatus(int i) {
this.status = i;
}
public final void setTimestampDownloadStart(long j) {
this.timestampDownloadStart = j;
}
@Retention(RetentionPolicy.RUNTIME)
public @interface ProgressStatus {
public static final Companion Companion = Companion.$$INSTANCE;
public static final class Companion {
private static int STARTED;
static final /* synthetic */ Companion $$INSTANCE = new Companion();
private static int IN_PROGRESS = 1;
private static int PAUSED = 2;
private static int CANCELLED = 3;
private static int DONE = 4;
private static int LOST_CONNECTION = 5;
private static int STATE_CHANGED = 6;
private static int ERROR = 7;
public final int getCANCELLED() {
return CANCELLED;
}
public final int getDONE() {
return DONE;
}
public final int getERROR() {
return ERROR;
}
public final int getIN_PROGRESS() {
return IN_PROGRESS;
}
public final int getLOST_CONNECTION() {
return LOST_CONNECTION;
}
public final int getPAUSED() {
return PAUSED;
}
public final int getSTARTED() {
return STARTED;
}
public final int getSTATE_CHANGED() {
return STATE_CHANGED;
}
public final void setCANCELLED(int i) {
CANCELLED = i;
}
public final void setDONE(int i) {
DONE = i;
}
public final void setERROR(int i) {
ERROR = i;
}
public final void setIN_PROGRESS(int i) {
IN_PROGRESS = i;
}
public final void setLOST_CONNECTION(int i) {
LOST_CONNECTION = i;
}
public final void setPAUSED(int i) {
PAUSED = i;
}
public final void setSTARTED(int i) {
STARTED = i;
}
public final void setSTATE_CHANGED(int i) {
STATE_CHANGED = i;
}
private Companion() {
}
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final Progress copy(Progress progress) {
Intrinsics.checkNotNullParameter(progress, "progress");
Progress progress2 = new Progress();
progress2.setStatus(progress.getStatus());
progress2.setProgressPercent(progress.getProgressPercent());
progress2.setTimestampDownloadStart(progress.getTimestampDownloadStart());
progress2.setSizeBytes(progress.getSizeBytes());
progress2.setStartBytes(progress.getStartBytes());
return progress2;
}
}
}
}

View File

@@ -0,0 +1,208 @@
package com.vungle.ads.internal.downloader;
import com.vungle.ads.AnalyticsClient;
import com.vungle.ads.OutOfMemory;
import com.vungle.ads.internal.ConfigManager;
import com.vungle.ads.internal.downloader.AssetDownloadListener;
import com.vungle.ads.internal.executor.VungleThreadPoolExecutor;
import com.vungle.ads.internal.task.PriorityRunnable;
import com.vungle.ads.internal.util.Logger;
import com.vungle.ads.internal.util.PathProvider;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
import okhttp3.Cache;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okhttp3.internal.http.RealResponseBody;
import okio.GzipSource;
import okio.Okio;
/* loaded from: classes4.dex */
public final class AssetDownloader implements Downloader {
private static final String CONTENT_ENCODING = "Content-Encoding";
private static final String CONTENT_TYPE = "Content-Type";
public static final Companion Companion = new Companion(null);
private static final int DOWNLOAD_CHUNK_SIZE = 2048;
private static final String GZIP = "gzip";
private static final String IDENTITY = "identity";
private static final int MINIMUM_SPACE_REQUIRED_MB = 20971520;
private static final String TAG = "AssetDownloader";
private static final int TIMEOUT = 30;
private final VungleThreadPoolExecutor downloadExecutor;
private OkHttpClient okHttpClient;
private final PathProvider pathProvider;
private final List<DownloadRequest> transitioning;
public AssetDownloader(VungleThreadPoolExecutor downloadExecutor, PathProvider pathProvider) {
Intrinsics.checkNotNullParameter(downloadExecutor, "downloadExecutor");
Intrinsics.checkNotNullParameter(pathProvider, "pathProvider");
this.downloadExecutor = downloadExecutor;
this.pathProvider = pathProvider;
this.transitioning = new ArrayList();
OkHttpClient.Builder builder = new OkHttpClient.Builder();
TimeUnit timeUnit = TimeUnit.SECONDS;
OkHttpClient.Builder followSslRedirects = builder.readTimeout(30L, timeUnit).connectTimeout(30L, timeUnit).cache(null).followRedirects(true).followSslRedirects(true);
ConfigManager configManager = ConfigManager.INSTANCE;
if (configManager.isCleverCacheEnabled()) {
long cleverCacheDiskSize = configManager.getCleverCacheDiskSize();
int cleverCacheDiskPercentage = configManager.getCleverCacheDiskPercentage();
String absolutePath = pathProvider.getCleverCacheDir().getAbsolutePath();
Intrinsics.checkNotNullExpressionValue(absolutePath, "pathProvider.getCleverCacheDir().absolutePath");
long min = Long.min(cleverCacheDiskSize, (pathProvider.getAvailableBytes(absolutePath) * cleverCacheDiskPercentage) / 100);
if (min > 0) {
followSslRedirects.cache(new Cache(pathProvider.getCleverCacheDir(), min));
} else {
Logger.Companion.w(TAG, "cache disk capacity size <=0, no clever cache active.");
}
}
this.okHttpClient = followSslRedirects.build();
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
@Override // com.vungle.ads.internal.downloader.Downloader
public void download(final DownloadRequest downloadRequest, final AssetDownloadListener assetDownloadListener) {
if (downloadRequest == null) {
return;
}
this.transitioning.add(downloadRequest);
this.downloadExecutor.execute(new PriorityRunnable() { // from class: com.vungle.ads.internal.downloader.AssetDownloader$download$1
@Override // java.lang.Runnable
public void run() {
AssetDownloader.this.launchRequest(downloadRequest, assetDownloadListener);
}
@Override // com.vungle.ads.internal.task.PriorityRunnable
public int getPriority() {
return downloadRequest.getPriority();
}
}, new Runnable() { // from class: com.vungle.ads.internal.downloader.AssetDownloader$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
AssetDownloader.m3883download$lambda0(AssetDownloader.this, downloadRequest, assetDownloadListener);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: download$lambda-0, reason: not valid java name */
public static final void m3883download$lambda0(AssetDownloader this$0, DownloadRequest downloadRequest, AssetDownloadListener assetDownloadListener) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.deliverError(downloadRequest, assetDownloadListener, new AssetDownloadListener.DownloadError(-1, new OutOfMemory("Cannot complete " + downloadRequest + " : Out of Memory"), AssetDownloadListener.DownloadError.ErrorReason.Companion.getINTERNAL_ERROR()));
}
private final void deliverError(DownloadRequest downloadRequest, AssetDownloadListener assetDownloadListener, AssetDownloadListener.DownloadError downloadError) {
if (assetDownloadListener != null) {
assetDownloadListener.onError(downloadError, downloadRequest);
}
}
@Override // com.vungle.ads.internal.downloader.Downloader
public void cancel(DownloadRequest downloadRequest) {
if (downloadRequest == null || downloadRequest.isCancelled()) {
return;
}
downloadRequest.cancel();
}
@Override // com.vungle.ads.internal.downloader.Downloader
public void cancelAll() {
Iterator<T> it = this.transitioning.iterator();
while (it.hasNext()) {
cancel((DownloadRequest) it.next());
}
this.transitioning.clear();
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:105:0x0598 A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:52:0x05d2 A[Catch: all -> 0x06a5, TRY_ENTER, TRY_LEAVE, TryCatch #3 {all -> 0x06a5, blocks: (B:50:0x058b, B:52:0x05d2, B:101:0x05da), top: B:49:0x058b }] */
/* JADX WARN: Removed duplicated region for block: B:59:0x0617 */
/* JADX WARN: Removed duplicated region for block: B:61:0x0620 */
/* JADX WARN: Removed duplicated region for block: B:65:0x062d */
/* JADX WARN: Removed duplicated region for block: B:68:0x065d */
/* JADX WARN: Removed duplicated region for block: B:72:0x0671 */
/* JADX WARN: Removed duplicated region for block: B:77:0x0686 */
/* JADX WARN: Removed duplicated region for block: B:79:0x061c */
/* JADX WARN: Removed duplicated region for block: B:84:0x06aa */
/* JADX WARN: Removed duplicated region for block: B:86:0x06b2 */
/* JADX WARN: Removed duplicated region for block: B:90:0x06bf */
/* JADX WARN: Removed duplicated region for block: B:93:0x06f0 */
/* JADX WARN: Type inference failed for: r0v108, types: [com.vungle.ads.internal.util.FileUtility] */
/* JADX WARN: Type inference failed for: r18v10 */
/* JADX WARN: Type inference failed for: r18v11 */
/* JADX WARN: Type inference failed for: r18v12 */
/* JADX WARN: Type inference failed for: r18v13 */
/* JADX WARN: Type inference failed for: r18v14 */
/* JADX WARN: Type inference failed for: r18v15 */
/* JADX WARN: Type inference failed for: r18v16 */
/* JADX WARN: Type inference failed for: r18v17 */
/* JADX WARN: Type inference failed for: r18v18 */
/* JADX WARN: Type inference failed for: r18v19 */
/* JADX WARN: Type inference failed for: r18v20 */
/* JADX WARN: Type inference failed for: r18v21 */
/* JADX WARN: Type inference failed for: r18v4, types: [okhttp3.Call] */
/* JADX WARN: Type inference failed for: r18v5, types: [okhttp3.Call] */
/* JADX WARN: Type inference failed for: r18v8, types: [okhttp3.Call] */
/* JADX WARN: Type inference failed for: r4v37, types: [java.io.Closeable, okio.BufferedSink] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void launchRequest(com.vungle.ads.internal.downloader.DownloadRequest r45, com.vungle.ads.internal.downloader.AssetDownloadListener r46) {
/*
Method dump skipped, instructions count: 1818
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.vungle.ads.internal.downloader.AssetDownloader.launchRequest(com.vungle.ads.internal.downloader.DownloadRequest, com.vungle.ads.internal.downloader.AssetDownloadListener):void");
}
private final ResponseBody decodeGzipIfNeeded(Response response) {
boolean equals;
ResponseBody body = response.body();
equals = StringsKt__StringsJVMKt.equals(GZIP, Response.header$default(response, "Content-Encoding", null, 2, null), true);
if (!equals || body == null) {
return body;
}
return new RealResponseBody(Response.header$default(response, "Content-Type", null, 2, null), -1L, Okio.buffer(new GzipSource(body.source())));
}
private final void deliverSuccess(File file, DownloadRequest downloadRequest, AssetDownloadListener assetDownloadListener) {
Logger.Companion.d(TAG, "On success " + downloadRequest);
if (assetDownloadListener != null) {
assetDownloadListener.onSuccess(file, downloadRequest);
}
}
private final boolean checkSpaceAvailable() {
PathProvider pathProvider = this.pathProvider;
String absolutePath = pathProvider.getVungleDir().getAbsolutePath();
Intrinsics.checkNotNullExpressionValue(absolutePath, "pathProvider.getVungleDir().absolutePath");
long availableBytes = pathProvider.getAvailableBytes(absolutePath);
if (availableBytes >= 20971520) {
return true;
}
AnalyticsClient.INSTANCE.logError$vungle_ads_release(126, "Insufficient space " + availableBytes, (r13 & 4) != 0 ? null : null, (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : null);
return false;
}
private final boolean isValidUrl(String str) {
return (str == null || str.length() == 0 || HttpUrl.Companion.parse(str) == null) ? false : true;
}
}

View File

@@ -0,0 +1,117 @@
package com.vungle.ads.internal.downloader;
import com.vungle.ads.AnalyticsClient;
import com.vungle.ads.TimeIntervalMetric;
import com.vungle.ads.internal.Constants;
import com.vungle.ads.internal.model.AdAsset;
import com.vungle.ads.internal.model.AdPayload;
import com.vungle.ads.internal.protos.Sdk;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class DownloadRequest {
private final AdAsset asset;
private final AtomicBoolean cancelled;
private final String creativeId;
private TimeIntervalMetric downloadDuration;
private final String eventId;
private final String placementId;
private final Priority priority;
public final AdAsset getAsset() {
return this.asset;
}
public final String getCreativeId() {
return this.creativeId;
}
public final String getEventId() {
return this.eventId;
}
public final String getPlacementId() {
return this.placementId;
}
/* renamed from: getPriority, reason: collision with other method in class */
public final Priority m3884getPriority() {
return this.priority;
}
public DownloadRequest(Priority priority, AdAsset asset, String str, String str2, String str3) {
Intrinsics.checkNotNullParameter(priority, "priority");
Intrinsics.checkNotNullParameter(asset, "asset");
this.priority = priority;
this.asset = asset;
this.placementId = str;
this.creativeId = str2;
this.eventId = str3;
this.cancelled = new AtomicBoolean(false);
}
public /* synthetic */ DownloadRequest(Priority priority, AdAsset adAsset, String str, String str2, String str3, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(priority, adAsset, (i & 4) != 0 ? null : str, (i & 8) != 0 ? null : str2, (i & 16) != 0 ? null : str3);
}
public final boolean isTemplate() {
return this.asset.getFileType() == AdAsset.FileType.ZIP || isHtmlTemplate();
}
public final boolean isHtmlTemplate() {
return Intrinsics.areEqual(this.asset.getAdIdentifier(), AdPayload.KEY_VM);
}
public final boolean isMainVideo() {
return Intrinsics.areEqual(this.asset.getAdIdentifier(), Constants.KEY_MAIN_VIDEO);
}
public String toString() {
return "DownloadRequest{, priority=" + this.priority + ", url='" + this.asset.getServerPath() + "', path='" + this.asset.getLocalPath() + "', cancelled=" + this.cancelled + ", placementId=" + this.placementId + ", creativeId=" + this.creativeId + ", eventId=" + this.eventId + '}';
}
public enum Priority {
CRITICAL(-2147483647),
HIGHEST(0),
HIGH(1),
LOWEST(Integer.MAX_VALUE);
private final int priority;
public final int getPriority() {
return this.priority;
}
Priority(int i) {
this.priority = i;
}
}
public final void cancel() {
this.cancelled.set(true);
}
public final boolean isCancelled() {
return this.cancelled.get();
}
public final int getPriority() {
return this.priority.getPriority();
}
public final void startRecord() {
TimeIntervalMetric timeIntervalMetric = new TimeIntervalMetric(Sdk.SDKMetric.SDKMetricType.TEMPLATE_DOWNLOAD_DURATION_MS);
this.downloadDuration = timeIntervalMetric;
timeIntervalMetric.markStart();
}
public final void stopRecord() {
TimeIntervalMetric timeIntervalMetric = this.downloadDuration;
if (timeIntervalMetric != null) {
timeIntervalMetric.markEnd();
AnalyticsClient.INSTANCE.logMetric$vungle_ads_release(timeIntervalMetric, this.placementId, this.creativeId, this.eventId, this.asset.getServerPath());
}
}
}

View File

@@ -0,0 +1,58 @@
package com.vungle.ads.internal.downloader;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/* loaded from: classes4.dex */
public interface Downloader {
void cancel(DownloadRequest downloadRequest);
void cancelAll();
void download(DownloadRequest downloadRequest, AssetDownloadListener assetDownloadListener);
@Retention(RetentionPolicy.RUNTIME)
public @interface NetworkType {
public static final Companion Companion = Companion.$$INSTANCE;
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
private static int CELLULAR = 1;
private static int WIFI = 2;
private static int ANY = 1 | 2;
public final int getANY() {
return ANY;
}
public final int getCELLULAR() {
return CELLULAR;
}
public final int getWIFI() {
return WIFI;
}
public final void setANY(int i) {
ANY = i;
}
public final void setCELLULAR(int i) {
CELLULAR = i;
}
public final void setWIFI(int i) {
WIFI = i;
}
private Companion() {
}
}
}
public static final class RequestException extends Exception {
public RequestException(String str) {
super(str);
}
}
}