- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
159 lines
5.3 KiB
Java
159 lines
5.3 KiB
Java
package com.ironsource;
|
|
|
|
import android.util.Log;
|
|
import com.ironsource.d9;
|
|
import com.ironsource.sdk.utils.IronSourceStorageUtils;
|
|
import com.ironsource.sdk.utils.SDKUtils;
|
|
import kotlin.Result;
|
|
import kotlin.Unit;
|
|
import kotlin.io.FilesKt__UtilsKt;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.FunctionReferenceImpl;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.text.Regex;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class f9 implements ae {
|
|
private final c9 a;
|
|
private final Function1 b;
|
|
private final de c;
|
|
private final k9 d;
|
|
private final String e;
|
|
private zf f;
|
|
private long g;
|
|
private final vn h;
|
|
private String i;
|
|
|
|
public /* synthetic */ class a extends FunctionReferenceImpl implements Function1 {
|
|
public a(Object obj) {
|
|
super(1, obj, f9.class, "onHtmlDownloadFinished", "onHtmlDownloadFinished(Ljava/lang/Object;)V", 0);
|
|
}
|
|
|
|
public final void a(Object obj) {
|
|
((f9) this.receiver).b(obj);
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
|
|
a(((Result) obj).m4067unboximpl());
|
|
return Unit.INSTANCE;
|
|
}
|
|
}
|
|
|
|
public /* synthetic */ class b extends FunctionReferenceImpl implements Function1 {
|
|
public b(Object obj) {
|
|
super(1, obj, f9.class, "onAbTestDownloadFinished", "onAbTestDownloadFinished(Ljava/lang/Object;)V", 0);
|
|
}
|
|
|
|
public final void a(Object obj) {
|
|
((f9) this.receiver).a(obj);
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
|
|
a(((Result) obj).m4067unboximpl());
|
|
return Unit.INSTANCE;
|
|
}
|
|
}
|
|
|
|
public f9(c9 config, Function1 onFinish, de downloadManager, k9 currentTimeProvider) {
|
|
Intrinsics.checkNotNullParameter(config, "config");
|
|
Intrinsics.checkNotNullParameter(onFinish, "onFinish");
|
|
Intrinsics.checkNotNullParameter(downloadManager, "downloadManager");
|
|
Intrinsics.checkNotNullParameter(currentTimeProvider, "currentTimeProvider");
|
|
this.a = config;
|
|
this.b = onFinish;
|
|
this.c = downloadManager;
|
|
this.d = currentTimeProvider;
|
|
this.e = f9.class.getSimpleName();
|
|
this.f = new zf(config.b(), "mobileController_0.html");
|
|
this.g = currentTimeProvider.a();
|
|
this.h = new vn(config.c());
|
|
this.i = "";
|
|
}
|
|
|
|
private final e9 a(String str) {
|
|
return new e9(new bu(this.h, str), this.a.b() + "/mobileController_" + str + ".html", this.c, new a(this));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public final void a(Object obj) {
|
|
e9 a2;
|
|
if (Result.m4064isFailureimpl(obj)) {
|
|
obj = null;
|
|
}
|
|
JSONObject jSONObject = (JSONObject) obj;
|
|
if (jSONObject == null || Intrinsics.areEqual(jSONObject.optString("htmlBuildNumber"), "")) {
|
|
a2 = a("0");
|
|
} else {
|
|
SDKUtils.updateControllerConfig("abTestMap", jSONObject);
|
|
String string = jSONObject.getString("htmlBuildNumber");
|
|
Intrinsics.checkNotNullExpressionValue(string, "abTestMapAsJson.getString(\"htmlBuildNumber\")");
|
|
this.i = string;
|
|
a2 = a(string);
|
|
if (a2.h()) {
|
|
zf j = a2.j();
|
|
this.f = j;
|
|
this.b.invoke(j);
|
|
return;
|
|
}
|
|
}
|
|
a2.l();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public final void b(Object obj) {
|
|
if (Result.m4065isSuccessimpl(obj)) {
|
|
zf zfVar = (zf) (Result.m4064isFailureimpl(obj) ? null : obj);
|
|
if (!Intrinsics.areEqual(zfVar != null ? zfVar.getAbsolutePath() : null, this.f.getAbsolutePath())) {
|
|
try {
|
|
IronSourceStorageUtils.deleteFile(this.f);
|
|
Intrinsics.checkNotNull(zfVar);
|
|
FilesKt__UtilsKt.copyTo$default(zfVar, this.f, true, 0, 4, null);
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
Log.e(this.e, "Unable to copy downloaded mobileController.html to cache folder: " + e.getMessage());
|
|
}
|
|
Intrinsics.checkNotNull(zfVar);
|
|
this.f = zfVar;
|
|
}
|
|
new d9.b(this.a.d(), this.g, this.d).a();
|
|
} else {
|
|
new d9.a(this.a.d()).a();
|
|
}
|
|
Function1 function1 = this.b;
|
|
if (Result.m4064isFailureimpl(obj)) {
|
|
obj = null;
|
|
}
|
|
function1.invoke(obj);
|
|
}
|
|
|
|
@Override // com.ironsource.ae
|
|
public void a() {
|
|
this.g = this.d.a();
|
|
new c(new d(this.h), this.a.b() + "/temp", this.c, new b(this)).l();
|
|
}
|
|
|
|
@Override // com.ironsource.ae
|
|
public boolean a(zf file) {
|
|
Intrinsics.checkNotNullParameter(file, "file");
|
|
String name = file.getName();
|
|
Intrinsics.checkNotNullExpressionValue(name, "file.name");
|
|
return new Regex("mobileController(_\\d+)?\\.html").matches(name);
|
|
}
|
|
|
|
@Override // com.ironsource.ae
|
|
public zf b() {
|
|
return this.f;
|
|
}
|
|
|
|
public final k9 c() {
|
|
return this.d;
|
|
}
|
|
|
|
public final Function1 d() {
|
|
return this.b;
|
|
}
|
|
}
|