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,28 @@
package com.fyber.inneractive.sdk.player.cache;
import java.io.File;
import java.util.HashMap;
/* loaded from: classes2.dex */
public final class a {
public File a;
public final String b;
public boolean c;
public final Object d = new Object();
public final HashMap e = new HashMap();
public volatile boolean f = false;
public a(String str, File file, boolean z) {
this.a = file;
this.b = str;
this.c = z;
}
public final File a() {
File file;
synchronized (this.d) {
file = this.a;
}
return file;
}
}

View File

@@ -0,0 +1,16 @@
package com.fyber.inneractive.sdk.player.cache;
import java.util.HashMap;
/* loaded from: classes2.dex */
public abstract class b {
public final HashMap a = new HashMap();
public enum a {
OK,
PARTIAL_CANNOT_VALIDATE,
INVALID
}
public abstract a a(com.fyber.inneractive.sdk.player.cache.a aVar);
}

View File

@@ -0,0 +1,644 @@
package com.fyber.inneractive.sdk.player.cache;
import com.fyber.inneractive.sdk.util.IAlog;
import com.ironsource.v8;
import csdk.gluads.Consts;
import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.concurrent.Callable;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
/* loaded from: classes2.dex */
public final class c implements Closeable {
public static final Pattern p = Pattern.compile("[a-z0-9_-]{1,120}");
public static final b q = new b();
public final File a;
public final File b;
public final File c;
public final File d;
public BufferedWriter i;
public int k;
public e l;
public long h = 0;
public final LinkedHashMap<String, d> j = new LinkedHashMap<>(0, 0.75f, true);
public long m = 0;
public final ThreadPoolExecutor n = new ThreadPoolExecutor(0, 1, 60, TimeUnit.SECONDS, new LinkedBlockingQueue());
public final a o = new a();
public final int e = 0;
public final int g = 1;
public final long f = 52428800;
public class a implements Callable<Void> {
public a() {
}
@Override // java.util.concurrent.Callable
public final Void call() throws Exception {
synchronized (c.this) {
try {
c cVar = c.this;
if (cVar.i == null) {
return null;
}
cVar.e();
c cVar2 = c.this;
int i = cVar2.k;
if (i >= 2000 && i >= cVar2.j.size()) {
c.this.d();
c.this.k = 0;
}
return null;
} finally {
}
}
}
}
public class b extends OutputStream {
@Override // java.io.OutputStream
public final void write(int i) throws IOException {
}
}
/* renamed from: com.fyber.inneractive.sdk.player.cache.c$c, reason: collision with other inner class name */
public final class C0081c {
public final d a;
public final boolean[] b;
public boolean c;
/* renamed from: com.fyber.inneractive.sdk.player.cache.c$c$a */
public class a extends FilterOutputStream {
@Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
public final void close() {
try {
((FilterOutputStream) this).out.close();
} catch (IOException unused) {
C0081c.this.c = true;
}
}
@Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Flushable
public final void flush() {
try {
((FilterOutputStream) this).out.flush();
} catch (IOException unused) {
C0081c.this.c = true;
}
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public final void write(int i) {
try {
((FilterOutputStream) this).out.write(i);
} catch (IOException unused) {
C0081c.this.c = true;
}
}
public a(FileOutputStream fileOutputStream) {
super(fileOutputStream);
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public final void write(byte[] bArr, int i, int i2) {
try {
((FilterOutputStream) this).out.write(bArr, i, i2);
} catch (IOException unused) {
C0081c.this.c = true;
}
}
}
public C0081c(d dVar) {
this.a = dVar;
this.b = dVar.c ? null : new boolean[c.this.g];
}
public final void a() throws IOException {
c.a(c.this, this, false);
}
public final OutputStream b() throws IOException {
FileOutputStream fileOutputStream;
a aVar;
c cVar = c.this;
if (cVar.g <= 0) {
throw new IllegalArgumentException("Expected index 0 to be greater than 0 and less than the maximum value count of " + c.this.g);
}
synchronized (cVar) {
try {
d dVar = this.a;
if (dVar.d != this) {
throw new IllegalStateException();
}
if (!dVar.c) {
this.b[0] = true;
}
File b = dVar.b(0);
try {
fileOutputStream = new FileOutputStream(b);
} catch (FileNotFoundException unused) {
c.this.a.mkdirs();
try {
fileOutputStream = new FileOutputStream(b);
} catch (FileNotFoundException unused2) {
return c.q;
}
}
aVar = new a(fileOutputStream);
} catch (Throwable th) {
throw th;
}
}
return aVar;
}
}
public final class d {
public final String a;
public final long[] b;
public boolean c;
public C0081c d;
public /* synthetic */ d() {
throw null;
}
public d(String str) {
this.a = str;
this.b = new long[c.this.g];
}
public final File b(int i) {
return new File(c.this.a, this.a + Consts.STRING_PERIOD + i + ".tmp");
}
public final File a(int i) {
return new File(c.this.a, this.a + Consts.STRING_PERIOD + i);
}
}
public interface e {
}
public final class f implements Closeable {
public final InputStream[] a;
public f(InputStream[] inputStreamArr) {
this.a = inputStreamArr;
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public final void close() {
for (InputStream inputStream : this.a) {
o.a(inputStream);
}
}
}
public c(File file) {
this.a = file;
this.b = new File(file, "journal");
this.c = new File(file, "journal.tmp");
this.d = new File(file, "journal.bkp");
}
public static c b(File file) throws IOException {
File file2 = new File(file, "journal.bkp");
if (file2.exists()) {
File file3 = new File(file, "journal");
if (file3.exists()) {
file2.delete();
} else if (!file2.renameTo(file3)) {
throw new IOException();
}
}
c cVar = new c(file);
if (cVar.b.exists()) {
try {
cVar.c();
cVar.b();
return cVar;
} catch (IOException e2) {
System.out.println("DiskLruCache " + file + " is corrupt: " + e2.getMessage() + ", removing");
IAlog.e("DiskLruCache delete cache", new Object[0]);
cVar.close();
o.a(cVar.a);
}
}
file.mkdirs();
c cVar2 = new c(file);
cVar2.d();
return cVar2;
}
public final void c() throws IOException {
n nVar = new n(new FileInputStream(this.b), o.a);
try {
String a2 = nVar.a();
String a3 = nVar.a();
String a4 = nVar.a();
String a5 = nVar.a();
String a6 = nVar.a();
if (!"libcore.io.DiskLruCache".equals(a2) || !"1".equals(a3) || !Integer.toString(this.e).equals(a4) || !Integer.toString(this.g).equals(a5) || !"".equals(a6)) {
throw new IOException("unexpected journal header: [" + a2 + ", " + a3 + ", " + a5 + ", " + a6 + v8.i.e);
}
int i = 0;
while (true) {
try {
c(nVar.a());
i++;
} catch (EOFException unused) {
this.k = i - this.j.size();
if (nVar.e == -1) {
d();
} else {
this.i = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.b, true), o.a));
}
o.a(nVar);
return;
}
}
} catch (Throwable th) {
o.a(nVar);
throw th;
}
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public final synchronized void close() throws IOException {
try {
if (this.i == null) {
return;
}
Iterator it = new ArrayList(this.j.values()).iterator();
while (it.hasNext()) {
C0081c c0081c = ((d) it.next()).d;
if (c0081c != null) {
c0081c.a();
}
}
e();
this.i.close();
this.i = null;
} catch (Throwable th) {
throw th;
}
}
public final synchronized void flush() throws IOException {
a();
e();
this.i.flush();
}
public static void a(c cVar, C0081c c0081c, boolean z) throws IOException {
int i;
synchronized (cVar) {
d dVar = c0081c.a;
if (dVar.d != c0081c) {
throw new IllegalStateException();
}
if (z && !dVar.c) {
for (int i2 = 0; i2 < cVar.g; i2++) {
if (!c0081c.b[i2]) {
c0081c.a();
throw new IllegalStateException("Newly created entry didn't create value for index " + i2);
}
if (!dVar.b(i2).exists()) {
c0081c.a();
return;
}
}
}
for (int i3 = 0; i3 < cVar.g; i3++) {
File b2 = dVar.b(i3);
if (!z) {
a(b2);
} else if (b2.exists()) {
File a2 = dVar.a(i3);
b2.renameTo(a2);
long j = dVar.b[i3];
long length = a2.length();
dVar.b[i3] = length;
cVar.h = (cVar.h - j) + length;
}
}
cVar.k++;
dVar.d = null;
if (dVar.c || z) {
dVar.c = true;
BufferedWriter bufferedWriter = cVar.i;
StringBuilder sb = new StringBuilder("CLEAN ");
sb.append(dVar.a);
StringBuilder sb2 = new StringBuilder();
for (long j2 : dVar.b) {
sb2.append(' ');
sb2.append(j2);
}
sb.append(sb2.toString());
sb.append('\n');
bufferedWriter.write(sb.toString());
if (z) {
cVar.m++;
}
} else {
cVar.j.remove(dVar.a);
cVar.i.write("REMOVE " + dVar.a + '\n');
}
cVar.i.flush();
if (cVar.h > cVar.f || ((i = cVar.k) >= 2000 && i >= cVar.j.size())) {
cVar.n.submit(cVar.o);
}
}
}
public final synchronized void d() throws IOException {
try {
BufferedWriter bufferedWriter = this.i;
if (bufferedWriter != null) {
bufferedWriter.close();
}
BufferedWriter bufferedWriter2 = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.c), o.a));
try {
bufferedWriter2.write("libcore.io.DiskLruCache");
bufferedWriter2.write("\n");
bufferedWriter2.write("1");
bufferedWriter2.write("\n");
bufferedWriter2.write(Integer.toString(this.e));
bufferedWriter2.write("\n");
bufferedWriter2.write(Integer.toString(this.g));
bufferedWriter2.write("\n");
bufferedWriter2.write("\n");
for (d dVar : this.j.values()) {
if (dVar.d != null) {
bufferedWriter2.write("DIRTY " + dVar.a + '\n');
} else {
StringBuilder sb = new StringBuilder();
sb.append("CLEAN ");
sb.append(dVar.a);
StringBuilder sb2 = new StringBuilder();
for (long j : dVar.b) {
sb2.append(' ');
sb2.append(j);
}
sb.append(sb2.toString());
sb.append('\n');
bufferedWriter2.write(sb.toString());
}
}
bufferedWriter2.close();
if (this.b.exists()) {
File file = this.b;
File file2 = this.d;
a(file2);
if (!file.renameTo(file2)) {
throw new IOException();
}
}
if (!this.c.renameTo(this.b)) {
throw new IOException();
}
this.d.delete();
this.i = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.b, true), o.a));
} catch (Throwable th) {
bufferedWriter2.close();
throw th;
}
} catch (Throwable th2) {
throw th2;
}
}
public final void e() throws IOException {
while (this.h > this.f) {
String key = this.j.entrySet().iterator().next().getKey();
e eVar = this.l;
if (eVar != null) {
Iterator it = ((p) eVar).d.iterator();
while (true) {
if (!it.hasNext()) {
d(key);
break;
}
if (((String) it.next()).equalsIgnoreCase(key)) {
boolean z = false;
for (String str : this.j.keySet()) {
Iterator it2 = ((p) this.l).d.iterator();
while (true) {
if (it2.hasNext()) {
if (((String) it2.next()).equalsIgnoreCase(str)) {
break;
}
} else {
z |= d(str);
break;
}
}
}
if (!z) {
return;
}
}
}
} else {
d(key);
}
}
}
public static void e(String str) {
if (p.matcher(str).matches()) {
return;
}
throw new IllegalArgumentException("keys must match regex [a-z0-9_-]{1,120}: \"" + str + "\"");
}
public final void b() throws IOException {
a(this.c);
Iterator<d> it = this.j.values().iterator();
while (it.hasNext()) {
d next = it.next();
int i = 0;
if (next.d == null) {
while (i < this.g) {
this.h += next.b[i];
i++;
}
} else {
next.d = null;
while (i < this.g) {
a(next.a(i));
a(next.b(i));
i++;
}
it.remove();
}
}
}
public final synchronized f b(String str) throws IOException {
InputStream inputStream;
a();
e(str);
d dVar = this.j.get(str);
if (dVar == null) {
return null;
}
if (!dVar.c) {
return null;
}
InputStream[] inputStreamArr = new InputStream[this.g];
for (int i = 0; i < this.g; i++) {
try {
inputStreamArr[i] = new FileInputStream(dVar.a(i));
} catch (FileNotFoundException unused) {
for (int i2 = 0; i2 < this.g && (inputStream = inputStreamArr[i2]) != null; i2++) {
o.a(inputStream);
}
return null;
}
}
this.k++;
this.i.append((CharSequence) ("READ " + str + '\n'));
int i3 = this.k;
if (i3 >= 2000 && i3 >= this.j.size()) {
this.n.submit(this.o);
}
return new f(inputStreamArr);
}
public final synchronized boolean d(String str) throws IOException {
try {
IAlog.e("DiskLruCache remove %s", str);
a();
e(str);
d dVar = this.j.get(str);
if (dVar != null && dVar.d == null) {
for (int i = 0; i < this.g; i++) {
File a2 = dVar.a(i);
if (a2.exists() && !a2.delete()) {
throw new IOException("failed to delete " + a2);
}
long j = this.h;
long[] jArr = dVar.b;
this.h = j - jArr[i];
jArr[i] = 0;
}
this.k++;
this.i.append((CharSequence) ("REMOVE " + str + '\n'));
this.j.remove(str);
int i2 = this.k;
if (i2 >= 2000 && i2 >= this.j.size()) {
this.n.submit(this.o);
}
return true;
}
return false;
} catch (Throwable th) {
throw th;
}
}
public final void c(String str) throws IOException {
String substring;
int indexOf = str.indexOf(32);
if (indexOf != -1) {
int i = indexOf + 1;
int indexOf2 = str.indexOf(32, i);
if (indexOf2 == -1) {
substring = str.substring(i);
if (indexOf == 6 && str.startsWith("REMOVE")) {
this.j.remove(substring);
return;
}
} else {
substring = str.substring(i, indexOf2);
}
d dVar = this.j.get(substring);
if (dVar == null) {
dVar = new d(substring);
this.j.put(substring, dVar);
}
if (indexOf2 != -1 && indexOf == 5 && str.startsWith("CLEAN")) {
String[] split = str.substring(indexOf2 + 1).split(" ");
dVar.c = true;
dVar.d = null;
if (split.length == c.this.g) {
for (int i2 = 0; i2 < split.length; i2++) {
try {
dVar.b[i2] = Long.parseLong(split[i2]);
} catch (NumberFormatException unused) {
throw new IOException("unexpected journal line: " + Arrays.toString(split));
}
}
return;
}
throw new IOException("unexpected journal line: " + Arrays.toString(split));
}
if (indexOf2 == -1 && indexOf == 5 && str.startsWith("DIRTY")) {
dVar.d = new C0081c(dVar);
return;
} else {
if (indexOf2 != -1 || indexOf != 4 || !str.startsWith("READ")) {
throw new IOException("unexpected journal line: ".concat(str));
}
return;
}
}
throw new IOException("unexpected journal line: ".concat(str));
}
public static void a(File file) throws IOException {
IAlog.e("DiskLruCache deleteIfExists - %s", file);
if (file.exists() && !file.delete()) {
throw new IOException();
}
}
public final C0081c a(String str) throws IOException {
synchronized (this) {
try {
a();
e(str);
d dVar = this.j.get(str);
if (dVar == null) {
dVar = new d(str);
this.j.put(str, dVar);
} else if (dVar.d != null) {
return null;
}
C0081c c0081c = new C0081c(dVar);
dVar.d = c0081c;
this.i.write("DIRTY " + str + '\n');
this.i.flush();
return c0081c;
} catch (Throwable th) {
throw th;
}
}
}
public final void a() {
if (this.i == null) {
throw new IllegalStateException("cache is closed");
}
}
}

View File

@@ -0,0 +1,348 @@
package com.fyber.inneractive.sdk.player.cache;
import android.net.Uri;
import android.os.HandlerThread;
import android.text.TextUtils;
import com.fyber.inneractive.sdk.config.IAConfigManager;
import com.fyber.inneractive.sdk.config.global.features.r;
import com.fyber.inneractive.sdk.config.global.s;
import com.fyber.inneractive.sdk.player.cache.j;
import com.fyber.inneractive.sdk.util.n0;
import com.fyber.inneractive.sdk.util.t;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import com.mbridge.msdk.foundation.download.Command;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.ByteBuffer;
import java.util.Locale;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
/* loaded from: classes2.dex */
public final class d implements com.fyber.inneractive.sdk.player.exoplayer2.upstream.f {
public com.fyber.inneractive.sdk.player.cache.a b;
public j c;
public Uri d;
public FileInputStream f;
public FileInputStream g;
public b h;
public c i;
public int j;
public s k;
public boolean a = false;
public long e = 0;
public class a implements j.g {
public final /* synthetic */ com.fyber.inneractive.sdk.util.i a;
public final /* synthetic */ AtomicReference b;
public final /* synthetic */ CountDownLatch c;
public a(com.fyber.inneractive.sdk.util.i iVar, AtomicReference atomicReference, CountDownLatch countDownLatch) {
this.a = iVar;
this.b = atomicReference;
this.c = countDownLatch;
}
}
public interface b {
}
public interface c {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final Uri a() {
return this.d;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final long a(com.fyber.inneractive.sdk.player.exoplayer2.upstream.i iVar) throws IOException {
com.fyber.inneractive.sdk.player.cache.b lVar;
r.d dVar;
if (this.b == null) {
CountDownLatch countDownLatch = new CountDownLatch(1);
AtomicReference atomicReference = new AtomicReference();
com.fyber.inneractive.sdk.util.i iVar2 = new com.fyber.inneractive.sdk.util.i();
Uri uri = iVar.a;
this.d = uri;
p pVar = p.f;
int i = this.j;
String uri2 = uri.toString();
s sVar = this.k;
a aVar = new a(iVar2, atomicReference, countDownLatch);
com.fyber.inneractive.sdk.player.cache.c cVar = pVar.b;
boolean a2 = IAConfigManager.L.t.b.a(false, "validateHasVideoTracks");
r rVar = sVar == null ? null : (r) sVar.a(r.class);
if (rVar != null) {
int[] iArr = j.b.a;
r.d dVar2 = r.d.LEGACY;
String a3 = rVar.a("v_type", dVar2.key);
r.d[] values = r.d.values();
int length = values.length;
int i2 = 0;
while (true) {
if (i2 >= length) {
dVar = dVar2;
break;
}
int i3 = length;
r.d dVar3 = values[i2];
r.d[] dVarArr = values;
if (TextUtils.equals(dVar3.key, a3.toLowerCase(Locale.US))) {
dVar = dVar3;
break;
}
i2++;
length = i3;
values = dVarArr;
}
int i4 = iArr[dVar.ordinal()];
lVar = i4 != 1 ? i4 != 2 ? new l(a2) : new k() : new m();
} else {
lVar = new l(a2);
}
j jVar = new j(cVar, uri2, lVar, i, sVar);
jVar.g = aVar;
pVar.d.add(jVar.a());
this.c = jVar;
jVar.q = iVar2;
jVar.o = true;
HandlerThread handlerThread = jVar.i;
if (handlerThread != null) {
handlerThread.start();
n0 n0Var = new n0(jVar.i.getLooper(), jVar);
jVar.j = n0Var;
n0Var.post(new f(jVar));
}
c cVar2 = this.i;
if (cVar2 != null) {
((com.fyber.inneractive.sdk.player.controller.d) cVar2).E.add(this.c);
}
try {
countDownLatch.await(7L, TimeUnit.SECONDS);
if (this.b == null) {
if (atomicReference.get() == null) {
throw new IOException("Cache has failed to download");
}
throw new IOException((Throwable) atomicReference.get());
}
} catch (InterruptedException e) {
j jVar2 = this.c;
jVar2.a(jVar2.o);
throw new IOException(e);
}
}
this.e = iVar.d;
com.fyber.inneractive.sdk.player.cache.a aVar2 = this.b;
String valueOf = aVar2.c ? (String) aVar2.e.get("http.file.length") : String.valueOf(aVar2.a().length());
if (valueOf == null || !TextUtils.isDigitsOnly(valueOf)) {
return -1L;
}
return Long.parseLong(valueOf);
}
/* JADX WARN: Removed duplicated region for block: B:35:0x0086 A[Catch: all -> 0x001f, TryCatch #1 {all -> 0x001f, blocks: (B:10:0x000c, B:12:0x0019, B:13:0x001d, B:15:0x0022, B:22:0x0032, B:23:0x0035, B:26:0x0042, B:27:0x0047, B:29:0x0048, B:31:0x004c, B:33:0x0082, B:35:0x0086, B:36:0x0088, B:39:0x0090, B:42:0x009b, B:43:0x00a2, B:44:0x00a3, B:45:0x00b1, B:48:0x005b, B:50:0x005f), top: B:9:0x000c, inners: #0 }] */
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final int read(byte[] r10, int r11, int r12) throws java.io.IOException {
/*
r9 = this;
com.fyber.inneractive.sdk.player.cache.a r0 = r9.b
if (r0 != 0) goto L6
r10 = -1
return r10
L6:
if (r12 != 0) goto L9
return r12
L9:
java.lang.Object r0 = r0.d
monitor-enter(r0)
com.fyber.inneractive.sdk.player.cache.a r1 = r9.b // Catch: java.lang.Throwable -> L1f
java.io.File r1 = r1.a() // Catch: java.lang.Throwable -> L1f
long r1 = r1.length() // Catch: java.lang.Throwable -> L1f
int r1 = (int) r1 // Catch: java.lang.Throwable -> L1f
if (r11 <= r1) goto L22
int r10 = r9.a(r10, r11, r12) // Catch: java.lang.Throwable -> L1f
monitor-exit(r0) // Catch: java.lang.Throwable -> L1f
return r10
L1f:
r10 = move-exception
goto Lb9
L22:
com.fyber.inneractive.sdk.player.cache.a r2 = r9.b // Catch: java.lang.Throwable -> L1f
boolean r2 = r2.c // Catch: java.lang.Throwable -> L1f
r3 = 0
r5 = 0
r6 = 1
if (r2 == 0) goto L5b
L2c:
int r2 = r1 - r11
if (r2 > 0) goto L48
r1 = 50
r9.wait(r3, r1) // Catch: java.lang.Throwable -> L1f java.lang.InterruptedException -> L41
com.fyber.inneractive.sdk.player.cache.a r1 = r9.b // Catch: java.lang.Throwable -> L1f
java.io.File r1 = r1.a() // Catch: java.lang.Throwable -> L1f
long r1 = r1.length() // Catch: java.lang.Throwable -> L1f
int r1 = (int) r1 // Catch: java.lang.Throwable -> L1f
goto L2c
L41:
r10 = move-exception
java.io.IOException r11 = new java.io.IOException // Catch: java.lang.Throwable -> L1f
r11.<init>(r10) // Catch: java.lang.Throwable -> L1f
throw r11 // Catch: java.lang.Throwable -> L1f
L48:
java.io.FileInputStream r2 = r9.g // Catch: java.lang.Throwable -> L1f
if (r2 != 0) goto L82
java.io.FileInputStream r2 = new java.io.FileInputStream // Catch: java.lang.Throwable -> L1f
com.fyber.inneractive.sdk.player.cache.a r5 = r9.b // Catch: java.lang.Throwable -> L1f
java.io.File r5 = r5.a() // Catch: java.lang.Throwable -> L1f
r2.<init>(r5) // Catch: java.lang.Throwable -> L1f
r9.g = r2 // Catch: java.lang.Throwable -> L1f
L59:
r5 = r6
goto L82
L5b:
java.io.FileInputStream r2 = r9.f // Catch: java.lang.Throwable -> L1f
if (r2 != 0) goto L82
java.lang.String r2 = "%s creating a single instance of fis"
java.lang.Object[] r7 = new java.lang.Object[r6] // Catch: java.lang.Throwable -> L1f
java.lang.String r8 = r9.toString() // Catch: java.lang.Throwable -> L1f
r7[r5] = r8 // Catch: java.lang.Throwable -> L1f
com.fyber.inneractive.sdk.util.IAlog.a(r2, r7) // Catch: java.lang.Throwable -> L1f
java.io.FileInputStream r2 = new java.io.FileInputStream // Catch: java.lang.Throwable -> L1f
com.fyber.inneractive.sdk.player.cache.a r5 = r9.b // Catch: java.lang.Throwable -> L1f
java.io.File r5 = r5.a() // Catch: java.lang.Throwable -> L1f
r2.<init>(r5) // Catch: java.lang.Throwable -> L1f
r9.f = r2 // Catch: java.lang.Throwable -> L1f
java.io.FileInputStream r2 = r9.g // Catch: java.lang.Throwable -> L1f
com.fyber.inneractive.sdk.util.t.b(r2) // Catch: java.lang.Throwable -> L1f
r2 = 0
r9.g = r2 // Catch: java.lang.Throwable -> L1f
goto L59
L82:
java.io.FileInputStream r2 = r9.f // Catch: java.lang.Throwable -> L1f
if (r2 != 0) goto L88
java.io.FileInputStream r2 = r9.g // Catch: java.lang.Throwable -> L1f
L88:
long r6 = r9.e // Catch: java.lang.Throwable -> L1f
int r3 = (r6 > r3 ? 1 : (r6 == r3 ? 0 : -1))
if (r3 <= 0) goto La3
if (r5 == 0) goto La3
long r3 = r2.skip(r6) // Catch: java.lang.Throwable -> L1f
long r5 = r9.e // Catch: java.lang.Throwable -> L1f
int r3 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))
if (r3 != 0) goto L9b
goto La3
L9b:
java.io.IOException r10 = new java.io.IOException // Catch: java.lang.Throwable -> L1f
java.lang.String r11 = "Failed to skip the stream"
r10.<init>(r11) // Catch: java.lang.Throwable -> L1f
throw r10 // Catch: java.lang.Throwable -> L1f
La3:
int r1 = r1 - r11
int r3 = r10.length // Catch: java.lang.Throwable -> L1f
int r1 = java.lang.Math.min(r3, r1) // Catch: java.lang.Throwable -> L1f
int r12 = java.lang.Math.min(r1, r12) // Catch: java.lang.Throwable -> L1f
int r10 = r2.read(r10, r11, r12) // Catch: java.lang.Throwable -> L1f
monitor-exit(r0) // Catch: java.lang.Throwable -> L1f
long r11 = r9.e
long r0 = (long) r10
long r11 = r11 + r0
r9.e = r11
return r10
Lb9:
monitor-exit(r0) // Catch: java.lang.Throwable -> L1f
throw r10
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.d.read(byte[], int, int):int");
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final void close() throws IOException {
this.a = true;
this.e = 0L;
t.b(this.f);
t.b(this.g);
this.f = null;
this.g = null;
}
public final int a(byte[] bArr, int i, int i2) throws IOException {
InputStream inputStream;
InputStream inputStream2;
InputStream inputStream3;
HttpURLConnection httpURLConnection;
String str = this.b.b;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bArr.length);
int i3 = (int) this.e;
ByteBuffer byteBuffer = (ByteBuffer) com.fyber.inneractive.sdk.util.g.b.a.poll();
if (byteBuffer == null) {
byteBuffer = ByteBuffer.allocateDirect(16384);
}
HttpURLConnection httpURLConnection2 = null;
try {
httpURLConnection = (HttpURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(new URL(str).openConnection()));
} catch (IOException e) {
e = e;
inputStream2 = null;
} catch (Throwable unused) {
inputStream = null;
}
try {
httpURLConnection.setRequestProperty(Command.HTTP_HEADER_RANGE, String.format(Locale.ENGLISH, "bytes=%d-", Integer.valueOf(i3)));
httpURLConnection.connect();
} catch (IOException e2) {
e = e2;
inputStream2 = null;
httpURLConnection2 = httpURLConnection;
try {
throw e;
} finally {
}
} catch (Throwable unused2) {
httpURLConnection2 = httpURLConnection;
inputStream = null;
if (httpURLConnection2 != null) {
try {
httpURLConnection2.disconnect();
} catch (Exception unused3) {
}
}
if (inputStream != null) {
inputStream3 = inputStream;
try {
inputStream3.close();
} catch (Exception unused4) {
}
}
System.arraycopy(byteArrayOutputStream.toByteArray(), 0, bArr, i, i2);
return i2;
}
if (httpURLConnection.getResponseCode() == 206) {
inputStream3 = httpURLConnection.getInputStream();
byte[] array = byteBuffer.array();
while (inputStream3.read(array) != -1) {
byteArrayOutputStream.write(array);
}
inputStream3.close();
httpURLConnection.disconnect();
try {
httpURLConnection.disconnect();
} catch (Exception unused5) {
}
inputStream3.close();
System.arraycopy(byteArrayOutputStream.toByteArray(), 0, bArr, i, i2);
return i2;
}
throw new IOException("Server did not reply with proper range.");
}
}

View File

@@ -0,0 +1,30 @@
package com.fyber.inneractive.sdk.player.cache;
import com.fyber.inneractive.sdk.config.global.s;
import com.fyber.inneractive.sdk.player.cache.d;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.f;
/* loaded from: classes2.dex */
public final class e implements f.a {
public final d.c a;
public final d.b b;
public final int c;
public final s d;
public e(d.b bVar, d.c cVar, int i, s sVar) {
this.b = bVar;
this.c = i;
this.a = cVar;
this.d = sVar;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f.a
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.f a() {
d dVar = new d();
dVar.h = this.b;
dVar.j = this.c;
dVar.k = this.d;
dVar.i = this.a;
return dVar;
}
}

View File

@@ -0,0 +1,56 @@
package com.fyber.inneractive.sdk.player.cache;
import com.fyber.inneractive.sdk.network.t;
import com.fyber.inneractive.sdk.player.cache.c;
import com.fyber.inneractive.sdk.player.cache.j;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.n0;
import java.io.IOException;
/* loaded from: classes2.dex */
public final class f implements Runnable {
public final /* synthetic */ j a;
public f(j jVar) {
this.a = jVar;
}
@Override // java.lang.Runnable
public final void run() {
try {
j jVar = this.a;
c.f b = jVar.b.b(jVar.a());
j jVar2 = this.a;
jVar2.c = b;
if (b == null) {
c.C0081c a = jVar2.b.a(jVar2.a());
if (a == null) {
this.a.n = true;
}
if (a != null) {
j jVar3 = this.a;
IAlog.e("%s | start | got an editor for %s", jVar3.a, jVar3.a());
a.a();
}
}
} catch (IOException e) {
j jVar4 = this.a;
IAlog.a(String.format("%s | Exception raised starting a new caching process for %s", jVar4.a, jVar4.a()), e, new Object[0]);
t.a("Exception raised starting a new caching process", e.getMessage(), null, null);
}
j jVar5 = this.a;
if (jVar5.c == null && !jVar5.n) {
j.d dVar = jVar5.h;
if (dVar != null) {
dVar.start();
return;
}
return;
}
g gVar = new g(jVar5);
n0 n0Var = jVar5.j;
if (n0Var != null) {
n0Var.postAtFrontOfQueue(gVar);
}
}
}

View File

@@ -0,0 +1,27 @@
package com.fyber.inneractive.sdk.player.cache;
/* loaded from: classes2.dex */
public final class g implements Runnable {
public final /* synthetic */ j a;
public g(j jVar) {
this.a = jVar;
}
/* JADX WARN: Removed duplicated region for block: B:13:0x005d */
/* JADX WARN: Removed duplicated region for block: B:33:0x0096 */
/* JADX WARN: Removed duplicated region for block: B:36:0x00ae A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:52:0x0098 */
@Override // java.lang.Runnable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void run() {
/*
Method dump skipped, instructions count: 256
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.g.run():void");
}
}

View File

@@ -0,0 +1,34 @@
package com.fyber.inneractive.sdk.player.cache;
import android.graphics.Bitmap;
import com.fyber.inneractive.sdk.player.cache.d;
import com.fyber.inneractive.sdk.player.cache.j;
/* loaded from: classes2.dex */
public final class h implements Runnable {
public final /* synthetic */ j a;
public h(j jVar) {
this.a = jVar;
}
@Override // java.lang.Runnable
public final void run() {
d.b bVar;
j jVar = this.a;
j.g gVar = jVar.g;
if (gVar != null) {
a aVar = jVar.f;
d.a aVar2 = (d.a) gVar;
d dVar = d.this;
if (!dVar.a) {
Bitmap bitmap = aVar2.a.b;
if (bitmap != null && (bVar = dVar.h) != null) {
((com.fyber.inneractive.sdk.player.controller.d) bVar).B = bitmap;
}
dVar.b = aVar;
}
aVar2.c.countDown();
}
}
}

View File

@@ -0,0 +1,41 @@
package com.fyber.inneractive.sdk.player.cache;
import android.graphics.Bitmap;
import com.fyber.inneractive.sdk.player.cache.d;
import com.fyber.inneractive.sdk.player.cache.j;
/* loaded from: classes2.dex */
public final class i implements Runnable {
public final /* synthetic */ Exception a;
public final /* synthetic */ j b;
public i(j jVar, Exception exc) {
this.b = jVar;
this.a = exc;
}
@Override // java.lang.Runnable
public final void run() {
d.b bVar;
j jVar = this.b;
j.g gVar = jVar.g;
if (gVar != null) {
a aVar = jVar.f;
Exception exc = this.a;
d.a aVar2 = (d.a) gVar;
d dVar = d.this;
if (!dVar.a) {
if (exc == null) {
Bitmap bitmap = aVar2.a.b;
if (bitmap != null && (bVar = dVar.h) != null) {
((com.fyber.inneractive.sdk.player.controller.d) bVar).B = bitmap;
}
dVar.b = aVar;
} else {
aVar2.b.set(exc);
}
}
aVar2.c.countDown();
}
}
}

View File

@@ -0,0 +1,290 @@
package com.fyber.inneractive.sdk.player.cache;
import android.os.HandlerThread;
import android.os.Message;
import android.webkit.MimeTypeMap;
import com.fyber.inneractive.sdk.config.global.features.r;
import com.fyber.inneractive.sdk.config.global.s;
import com.fyber.inneractive.sdk.player.cache.b;
import com.fyber.inneractive.sdk.player.cache.c;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.n0;
import com.fyber.inneractive.sdk.util.o0;
import com.mbridge.msdk.foundation.tools.SameMD5;
import com.unity3d.ads.core.data.datasource.AndroidStaticDeviceInfoDataSource;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes2.dex */
public final class j implements o0 {
public final com.fyber.inneractive.sdk.player.cache.c b;
public c.f c;
public final com.fyber.inneractive.sdk.player.cache.b d;
public final String e;
public com.fyber.inneractive.sdk.player.cache.a f;
public g g;
public d h;
public n0 j;
public final String l;
public f q;
public final s r;
public final String a = "MediaDownloader-" + hashCode();
public final Object k = new Object();
public volatile boolean m = false;
public boolean n = false;
public boolean o = false;
public String p = null;
public final HandlerThread i = new HandlerThread(String.format("MediaDownloader-%s-A", a()));
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public final void run() {
j.this.a(false);
}
}
public static /* synthetic */ class b {
public static final /* synthetic */ int[] a;
static {
int[] iArr = new int[r.d.values().length];
a = iArr;
try {
iArr[r.d.NONE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[r.d.EXTRACTOR.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[r.d.LEGACY.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
public static class c extends Exception {
public c(String str) {
super(str);
}
}
public class d extends Thread {
public final AtomicBoolean a;
public InputStream b;
public boolean c;
public boolean d;
public long e;
public long f;
public c.C0081c g;
public final int h;
public final int i;
public final int j;
public final int k;
/* JADX WARN: Removed duplicated region for block: B:45:0x0133 */
/* JADX WARN: Removed duplicated region for block: B:79:0x01d9 A[EDGE_INSN: B:79:0x01d9->B:78:0x01d9 BREAK A[LOOP:0: B:43:0x012a->B:66:0x01d5], SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.net.HttpURLConnection a(java.io.OutputStream r18, java.net.URL r19, java.nio.ByteBuffer r20, long r21, int r23) throws java.io.IOException, com.fyber.inneractive.sdk.player.cache.j.c {
/*
Method dump skipped, instructions count: 506
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.j.d.a(java.io.OutputStream, java.net.URL, java.nio.ByteBuffer, long, int):java.net.HttpURLConnection");
}
public d(String str, int i) {
super(str);
this.a = new AtomicBoolean(false);
this.c = false;
this.d = false;
this.e = -1L;
this.f = 0L;
this.h = i;
this.i = j.this.r != null ? ((r) j.this.r.a(r.class)).e() : 10;
this.j = j.this.r != null ? ((r) j.this.r.a(r.class)).f() : 500;
this.k = j.this.r != null ? ((r) j.this.r.a(r.class)).i() : 25;
}
/* JADX WARN: Code restructure failed: missing block: B:109:0x020f, code lost:
if (r15 == null) goto L96;
*/
/* JADX WARN: Code restructure failed: missing block: B:75:0x01d6, code lost:
if (r15 != null) goto L114;
*/
/* JADX WARN: Code restructure failed: missing block: B:79:0x0211, code lost:
r15.disconnect();
*/
/* JADX WARN: Finally extract failed */
@Override // java.lang.Thread, java.lang.Runnable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void run() {
/*
Method dump skipped, instructions count: 556
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.j.d.run():void");
}
}
public static class e extends c {
public e(String str) {
super(str);
}
}
public interface f {
}
public interface g {
}
public j(com.fyber.inneractive.sdk.player.cache.c cVar, String str, com.fyber.inneractive.sdk.player.cache.b bVar, int i, s sVar) {
this.b = cVar;
this.e = str;
this.l = MimeTypeMap.getSingleton().getMimeTypeFromExtension(MimeTypeMap.getFileExtensionFromUrl(str).toLowerCase(Locale.US));
this.d = bVar;
this.r = sVar;
this.h = new d(String.format("MediaDownloader-%s-A", a()), i);
}
@Override // com.fyber.inneractive.sdk.util.o0
public final void handleMessage(Message message) {
if (message.what == 4 && !this.f.f) {
synchronized (this.k) {
try {
IAlog.e("%s | reading from cache 1 - %s", this.a, a());
b.a a2 = this.d.a(this.f);
if (a2 == b.a.INVALID) {
com.fyber.inneractive.sdk.util.p.b.post(new i(this, new c("Failed cache validation")));
a(true);
} else if (a2 == b.a.PARTIAL_CANNOT_VALIDATE) {
this.m = true;
} else {
this.f.f = true;
a(this.f);
this.f.e.putAll(this.d.a);
com.fyber.inneractive.sdk.util.p.b.post(new h(this));
}
} finally {
}
}
return;
}
int i = message.what;
if (i == 1) {
Object obj = message.obj;
if (obj instanceof Exception) {
com.fyber.inneractive.sdk.util.p.b.post(new i(this, (Exception) obj));
} else {
com.fyber.inneractive.sdk.util.p.b.post(new i(this, new c("download failed")));
}
a(false);
return;
}
if (i == 2) {
if (this.m) {
synchronized (this.k) {
try {
IAlog.e("%s | reading from cache 2 - %s", this.a, a());
if (this.d.a(this.f) == b.a.INVALID) {
com.fyber.inneractive.sdk.util.p.b.post(new i(this, new c("Failed cache validation after downloading complete file")));
a(true);
} else {
a(this.f);
this.f.e.putAll(this.d.a);
com.fyber.inneractive.sdk.util.p.b.post(new h(this));
}
} finally {
}
}
} else {
com.fyber.inneractive.sdk.util.p.b.post(new a());
}
IAlog.e("%s | Download success for cache key %s", this.a, a());
}
}
public final void a(boolean z) {
d dVar = this.h;
if (dVar != null) {
dVar.a.compareAndSet(false, true);
this.h = null;
}
HandlerThread handlerThread = this.i;
if (handlerThread != null) {
handlerThread.quit();
}
this.j = null;
if (z) {
try {
this.b.d(a());
} catch (IOException e2) {
IAlog.a("failed to remove cache key", e2, new Object[0]);
}
}
}
public final String a() {
String str = "";
if (this.p == null) {
String str2 = this.e;
try {
try {
MessageDigest messageDigest = MessageDigest.getInstance(AndroidStaticDeviceInfoDataSource.ALGORITHM_SHA1);
messageDigest.update(str2.getBytes());
byte[] digest = messageDigest.digest();
StringBuffer stringBuffer = new StringBuffer();
for (byte b2 : digest) {
stringBuffer.append(Integer.toHexString((b2 & 255) | 256).substring(1));
}
str = stringBuffer.toString();
} catch (NoSuchAlgorithmException unused) {
str = str2.replaceAll("\\W+", "");
}
} catch (NullPointerException unused2) {
} catch (NoSuchAlgorithmException unused3) {
MessageDigest messageDigest2 = MessageDigest.getInstance(SameMD5.TAG);
messageDigest2.update(str2.getBytes());
byte[] digest2 = messageDigest2.digest();
StringBuffer stringBuffer2 = new StringBuffer();
for (byte b3 : digest2) {
stringBuffer2.append(Integer.toHexString((b3 & 255) | 256).substring(1));
}
str = stringBuffer2.toString();
}
this.p = str;
}
return this.p;
}
public final void a(com.fyber.inneractive.sdk.player.cache.a aVar) {
f fVar;
if (aVar == null || (fVar = this.q) == null) {
return;
}
File a2 = aVar.a();
File file = ((com.fyber.inneractive.sdk.util.i) fVar).a;
if (file == null || a2 == null || !file.getAbsolutePath().equals(a2.getAbsolutePath())) {
((com.fyber.inneractive.sdk.util.i) this.q).a(aVar.a());
}
}
}

View File

@@ -0,0 +1,29 @@
package com.fyber.inneractive.sdk.player.cache;
import android.media.MediaExtractor;
import com.fyber.inneractive.sdk.player.cache.b;
/* loaded from: classes2.dex */
public final class k extends b {
@Override // com.fyber.inneractive.sdk.player.cache.b
public final b.a a(a aVar) {
b.a aVar2 = b.a.INVALID;
MediaExtractor mediaExtractor = new MediaExtractor();
try {
mediaExtractor.setDataSource(aVar.a().getAbsolutePath());
for (int i = 0; i < mediaExtractor.getTrackCount(); i++) {
String string = mediaExtractor.getTrackFormat(i).getString("mime");
if (string != null && string.startsWith("video/")) {
aVar2 = b.a.OK;
break;
}
}
} catch (Throwable unused) {
}
try {
mediaExtractor.release();
} catch (Throwable unused2) {
}
return aVar2;
}
}

View File

@@ -0,0 +1,133 @@
package com.fyber.inneractive.sdk.player.cache;
/* loaded from: classes2.dex */
public final class l extends b {
public final boolean b;
public l(boolean z) {
this.b = z;
}
/* JADX WARN: Removed duplicated region for block: B:43:0x00ac A[Catch: all -> 0x00c4, TryCatch #0 {all -> 0x00c4, blocks: (B:40:0x009b, B:41:0x00a6, B:43:0x00ac, B:45:0x00b8), top: B:39:0x009b }] */
@Override // com.fyber.inneractive.sdk.player.cache.b
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final com.fyber.inneractive.sdk.player.cache.b.a a(com.fyber.inneractive.sdk.player.cache.a r8) {
/*
r7 = this;
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.INVALID
android.media.MediaPlayer r1 = new android.media.MediaPlayer
r1.<init>()
java.io.File r2 = r8.a
r3 = 0
if (r2 == 0) goto L89
boolean r2 = r2.exists()
if (r2 == 0) goto L89
java.io.FileInputStream r2 = new java.io.FileInputStream // Catch: java.lang.Throwable -> L6e
java.io.File r4 = r8.a() // Catch: java.lang.Throwable -> L6e
r2.<init>(r4) // Catch: java.lang.Throwable -> L6e
java.io.File r4 = r8.a() // Catch: java.lang.Throwable -> L5c
java.lang.String r4 = r4.getAbsolutePath() // Catch: java.lang.Throwable -> L5c
r1.setDataSource(r4) // Catch: java.lang.Throwable -> L5c
r1.prepare() // Catch: java.lang.Throwable -> L5c
int r4 = r1.getDuration() // Catch: java.lang.Throwable -> L5c
if (r4 <= 0) goto L81
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.OK // Catch: java.lang.Throwable -> L5c
int r4 = r1.getVideoWidth() // Catch: java.lang.Throwable -> L5c
if (r4 <= 0) goto L5e
int r4 = r1.getVideoHeight() // Catch: java.lang.Throwable -> L5c
if (r4 <= 0) goto L5e
java.lang.String r4 = "video.width"
int r5 = r1.getVideoWidth() // Catch: java.lang.Throwable -> L5c
java.lang.String r5 = java.lang.String.valueOf(r5) // Catch: java.lang.Throwable -> L5c
java.util.HashMap r6 = r7.a // Catch: java.lang.Throwable -> L5c
r6.put(r4, r5) // Catch: java.lang.Throwable -> L5c
java.lang.String r4 = "video.height"
int r5 = r1.getVideoHeight() // Catch: java.lang.Throwable -> L5c
java.lang.String r5 = java.lang.String.valueOf(r5) // Catch: java.lang.Throwable -> L5c
java.util.HashMap r6 = r7.a // Catch: java.lang.Throwable -> L5c
r6.put(r4, r5) // Catch: java.lang.Throwable -> L5c
goto L5e
L5c:
r4 = move-exception
goto L71
L5e:
java.lang.String r4 = "video.duration"
int r5 = r1.getDuration() // Catch: java.lang.Throwable -> L5c
java.lang.String r5 = java.lang.String.valueOf(r5) // Catch: java.lang.Throwable -> L5c
java.util.HashMap r6 = r7.a // Catch: java.lang.Throwable -> L5c
r6.put(r4, r5) // Catch: java.lang.Throwable -> L5c
goto L81
L6e:
r2 = move-exception
r4 = r2
r2 = 0
L71:
java.lang.String r5 = "Exception raised while trying to open a cache candidate"
java.lang.Object[] r6 = new java.lang.Object[r3] // Catch: java.lang.Throwable -> L7f
com.fyber.inneractive.sdk.util.IAlog.a(r5, r4, r6) // Catch: java.lang.Throwable -> L7f
boolean r4 = r8.c // Catch: java.lang.Throwable -> L7f
if (r4 == 0) goto L81
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.PARTIAL_CANNOT_VALIDATE // Catch: java.lang.Throwable -> L7f
goto L81
L7f:
r8 = move-exception
goto L85
L81:
com.fyber.inneractive.sdk.player.cache.o.a(r2)
goto L89
L85:
com.fyber.inneractive.sdk.player.cache.o.a(r2)
throw r8
L89:
r1.release() // Catch: java.lang.Throwable -> L8c
L8c:
boolean r1 = r7.b
r2 = 1
r1 = r1 ^ r2
if (r1 != 0) goto Lc9
com.fyber.inneractive.sdk.player.cache.b$a r4 = com.fyber.inneractive.sdk.player.cache.b.a.OK
if (r0 != r4) goto Lc9
android.media.MediaExtractor r4 = new android.media.MediaExtractor
r4.<init>()
java.io.File r5 = r8.a() // Catch: java.lang.Throwable -> Lc4
java.lang.String r5 = r5.getAbsolutePath() // Catch: java.lang.Throwable -> Lc4
r4.setDataSource(r5) // Catch: java.lang.Throwable -> Lc4
La6:
int r5 = r4.getTrackCount() // Catch: java.lang.Throwable -> Lc4
if (r3 >= r5) goto Lc4
android.media.MediaFormat r5 = r4.getTrackFormat(r3) // Catch: java.lang.Throwable -> Lc4
java.lang.String r6 = "mime"
java.lang.String r5 = r5.getString(r6) // Catch: java.lang.Throwable -> Lc4
if (r5 == 0) goto Lc1
java.lang.String r6 = "video/"
boolean r5 = r5.startsWith(r6) // Catch: java.lang.Throwable -> Lc4
if (r5 == 0) goto Lc1
goto Lc5
Lc1:
int r3 = r3 + 1
goto La6
Lc4:
r2 = r1
Lc5:
r4.release() // Catch: java.lang.Throwable -> Lc8
Lc8:
r1 = r2
Lc9:
com.fyber.inneractive.sdk.player.cache.b$a r2 = com.fyber.inneractive.sdk.player.cache.b.a.OK
if (r0 != r2) goto Ld8
if (r1 != 0) goto Ld8
boolean r8 = r8.c
if (r8 == 0) goto Ld6
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.PARTIAL_CANNOT_VALIDATE
goto Ld8
Ld6:
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.INVALID
Ld8:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.l.a(com.fyber.inneractive.sdk.player.cache.a):com.fyber.inneractive.sdk.player.cache.b$a");
}
}

View File

@@ -0,0 +1,11 @@
package com.fyber.inneractive.sdk.player.cache;
import com.fyber.inneractive.sdk.player.cache.b;
/* loaded from: classes2.dex */
public final class m extends b {
@Override // com.fyber.inneractive.sdk.player.cache.b
public final b.a a(a aVar) {
return b.a.OK;
}
}

View File

@@ -0,0 +1,131 @@
package com.fyber.inneractive.sdk.player.cache;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
/* loaded from: classes2.dex */
public final class n implements Closeable {
public final InputStream a;
public final Charset b;
public byte[] c;
public int d;
public int e;
public class a extends ByteArrayOutputStream {
public a(int i) {
super(i);
}
@Override // java.io.ByteArrayOutputStream
public final String toString() {
int i = ((ByteArrayOutputStream) this).count;
if (i > 0) {
int i2 = i - 1;
if (((ByteArrayOutputStream) this).buf[i2] == 13) {
i = i2;
}
}
try {
return new String(((ByteArrayOutputStream) this).buf, 0, i, n.this.b.name());
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
}
}
public n(FileInputStream fileInputStream, Charset charset) {
charset.getClass();
if (!charset.equals(o.a)) {
throw new IllegalArgumentException("Unsupported encoding");
}
this.a = fileInputStream;
this.b = charset;
this.c = new byte[8192];
}
public final String a() throws IOException {
int i;
synchronized (this.a) {
try {
byte[] bArr = this.c;
if (bArr == null) {
throw new IOException("LineReader is closed");
}
if (this.d >= this.e) {
int read = this.a.read(bArr, 0, bArr.length);
if (read == -1) {
throw new EOFException();
}
this.d = 0;
this.e = read;
}
for (int i2 = this.d; i2 != this.e; i2++) {
byte[] bArr2 = this.c;
if (bArr2[i2] == 10) {
int i3 = this.d;
if (i2 != i3) {
i = i2 - 1;
if (bArr2[i] == 13) {
String str = new String(bArr2, i3, i - i3, this.b.name());
this.d = i2 + 1;
return str;
}
}
i = i2;
String str2 = new String(bArr2, i3, i - i3, this.b.name());
this.d = i2 + 1;
return str2;
}
}
a aVar = new a((this.e - this.d) + 80);
while (true) {
byte[] bArr3 = this.c;
int i4 = this.d;
aVar.write(bArr3, i4, this.e - i4);
this.e = -1;
InputStream inputStream = this.a;
byte[] bArr4 = this.c;
int read2 = inputStream.read(bArr4, 0, bArr4.length);
if (read2 == -1) {
throw new EOFException();
}
this.d = 0;
this.e = read2;
for (int i5 = 0; i5 != this.e; i5++) {
byte[] bArr5 = this.c;
if (bArr5[i5] == 10) {
int i6 = this.d;
if (i5 != i6) {
aVar.write(bArr5, i6, i5 - i6);
}
this.d = i5 + 1;
return aVar.toString();
}
}
}
} catch (Throwable th) {
throw th;
}
}
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public final void close() throws IOException {
synchronized (this.a) {
try {
if (this.c != null) {
this.c = null;
this.a.close();
}
} catch (Throwable th) {
throw th;
}
}
}
}

View File

@@ -0,0 +1,41 @@
package com.fyber.inneractive.sdk.player.cache;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
/* loaded from: classes2.dex */
public final class o {
public static final Charset a = Charset.forName("US-ASCII");
static {
Charset.forName("UTF-8");
}
public static void a(File file) throws IOException {
File[] listFiles = file.listFiles();
if (listFiles == null) {
throw new IOException("not a readable directory: " + file);
}
for (File file2 : listFiles) {
if (file2.isDirectory()) {
a(file2);
}
if (!file2.delete()) {
throw new IOException("failed to delete file: " + file2);
}
}
}
public static void a(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception unused) {
}
}
}
}

View File

@@ -0,0 +1,86 @@
package com.fyber.inneractive.sdk.player.cache;
import android.content.Context;
import android.os.Environment;
import android.text.TextUtils;
import com.fyber.inneractive.sdk.network.t;
import com.fyber.inneractive.sdk.player.cache.c;
import com.fyber.inneractive.sdk.util.IAlog;
import java.io.File;
import java.util.concurrent.CopyOnWriteArrayList;
/* loaded from: classes2.dex */
public final class p implements c.e {
public static final p f = new p();
public Context a;
public c b;
public boolean c = false;
public final CopyOnWriteArrayList d = new CopyOnWriteArrayList();
public final a e = new a();
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public final void run() {
long j;
File a = p.a(p.this.a, "fyb.vamp.vid.cache");
if (a != null) {
try {
IAlog.a("VideoCache opening the cache in directory - %s", a);
p.this.b = c.b(a);
c cVar = p.this.b;
cVar.getClass();
IAlog.e("DiskLruCache delete cache", new Object[0]);
cVar.close();
o.a(cVar.a);
p.this.b = c.b(a);
Object[] objArr = new Object[2];
objArr[0] = a;
c cVar2 = p.this.b;
synchronized (cVar2) {
j = cVar2.h;
}
objArr[1] = Long.valueOf(j);
IAlog.a("VideoCache opened the cache in directory - %s current size is %d", objArr);
p pVar = p.this;
pVar.b.l = pVar;
pVar.c = true;
} catch (Throwable th) {
t.a("Failed to open cache directory", th.getMessage(), null, null);
IAlog.a("Failed to open cache directory", th, new Object[0]);
}
}
}
}
public static File a(Context context, String str) {
String str2;
File externalCacheDir;
String str3 = "";
if (context != null && !TextUtils.isEmpty(str)) {
if (com.fyber.inneractive.sdk.util.o.a != null && com.fyber.inneractive.sdk.util.o.b("android.permission.WRITE_EXTERNAL_STORAGE")) {
try {
str2 = Environment.getExternalStorageState();
} catch (Throwable unused) {
str2 = "";
}
if ("mounted".equals(str2)) {
try {
str3 = Environment.getExternalStorageState();
} catch (Throwable unused2) {
}
if (("mounted".equals(str3) || "mounted_ro".equals(str3)) && (externalCacheDir = context.getExternalCacheDir()) != null && externalCacheDir.getFreeSpace() > 52428800) {
return new File(context.getExternalCacheDir(), str);
}
}
}
File cacheDir = context.getCacheDir();
if (cacheDir != null && cacheDir.getFreeSpace() > 52428800) {
return new File(context.getCacheDir(), str);
}
}
return null;
}
}