- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
126 lines
4.2 KiB
Java
126 lines
4.2 KiB
Java
package com.fyber.inneractive.sdk.network;
|
|
|
|
import android.os.Environment;
|
|
import android.text.TextUtils;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import csdk.gluads.Consts;
|
|
import java.io.File;
|
|
import java.io.FileOutputStream;
|
|
import java.io.InputStream;
|
|
import java.net.URI;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class l0 extends f0<String> {
|
|
public final String p;
|
|
|
|
public l0(com.fyber.inneractive.sdk.web.q qVar, String str, com.fyber.inneractive.sdk.config.global.s sVar) {
|
|
super(qVar, x.a().b(), sVar);
|
|
this.p = str;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final b0 a(j jVar, Map<String, List<String>> map, int i) throws Exception {
|
|
FileOutputStream fileOutputStream;
|
|
b0 b0Var = new b0();
|
|
FileOutputStream fileOutputStream2 = null;
|
|
T t = 0;
|
|
fileOutputStream2 = null;
|
|
try {
|
|
try {
|
|
InputStream inputStream = jVar.c;
|
|
File file = new File(Environment.getExternalStorageDirectory(), "Pictures");
|
|
file.mkdirs();
|
|
String a = a(URI.create(this.p), map);
|
|
if (TextUtils.isEmpty(a)) {
|
|
fileOutputStream = null;
|
|
} else {
|
|
File file2 = new File(file, a);
|
|
String file3 = file2.toString();
|
|
fileOutputStream = new FileOutputStream(file2);
|
|
try {
|
|
try {
|
|
com.fyber.inneractive.sdk.util.t.a(inputStream, fileOutputStream);
|
|
t = file3;
|
|
} catch (Exception unused) {
|
|
fileOutputStream2 = fileOutputStream;
|
|
IAlog.a("failed to download and save the image file.", new Object[0]);
|
|
fileOutputStream = fileOutputStream2;
|
|
com.fyber.inneractive.sdk.util.t.b(fileOutputStream);
|
|
return b0Var;
|
|
}
|
|
} catch (Throwable th) {
|
|
th = th;
|
|
com.fyber.inneractive.sdk.util.t.b(fileOutputStream);
|
|
throw th;
|
|
}
|
|
}
|
|
try {
|
|
b0Var.a = t;
|
|
} catch (Throwable th2) {
|
|
th = th2;
|
|
fileOutputStream2 = fileOutputStream;
|
|
fileOutputStream = fileOutputStream2;
|
|
com.fyber.inneractive.sdk.util.t.b(fileOutputStream);
|
|
throw th;
|
|
}
|
|
} catch (Exception unused2) {
|
|
}
|
|
com.fyber.inneractive.sdk.util.t.b(fileOutputStream);
|
|
return b0Var;
|
|
} catch (Throwable th3) {
|
|
th = th3;
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final p0 d() {
|
|
return p0.LOW;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final boolean g() {
|
|
return false;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final z getMethod() {
|
|
return z.GET;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final String getUrl() {
|
|
return this.p;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.network.c0
|
|
public final int s() {
|
|
return 0;
|
|
}
|
|
|
|
public static String a(URI uri, Map map) {
|
|
String path = uri.getPath();
|
|
if (path == null) {
|
|
return null;
|
|
}
|
|
String name = new File(path).getName();
|
|
List list = map != null ? (List) map.get("Content-Type") : null;
|
|
String str = list != null ? (String) list.get(0) : null;
|
|
if (str == null) {
|
|
return name;
|
|
}
|
|
for (String str2 : str.split(";")) {
|
|
if (str2.contains("image/")) {
|
|
String str3 = Consts.STRING_PERIOD + str2.split("/")[1];
|
|
if (name.endsWith(str3)) {
|
|
return name;
|
|
}
|
|
return name + str3;
|
|
}
|
|
}
|
|
return name;
|
|
}
|
|
}
|