package ඓ.ῲ.K.ᕣ.ᨨ.ト;

import android.util.Log;
import java.io.File;
import java.io.IOException;
import ඓ.ῲ.K.ᕣ.AbstractC1029;
import ඓ.ῲ.K.ᕣ.ᨨ.C0940;
import ඓ.ῲ.K.ᕣ.ᨨ.ト.AbstractC0993;
import ඓ.ῲ.K.ᨨ.C1155;

/* renamed from: ඓ.ῲ.K.ᕣ.ᨨ.ト.ඓ  reason: contains not printable characters */
/* compiled from: DiskLruCacheWrapper */
public class C0985 implements AbstractC0993 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final long f4372;

    /* renamed from: ඓ  reason: contains not printable characters */
    public C1155 f4373;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final File f4374;

    /* renamed from: K  reason: contains not printable characters */
    public final C0986 f4375;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final C0982 f4376 = new C0982();

    @Deprecated
    public C0985(File file, long j) {
        this.f4374 = file;
        this.f4372 = j;
        this.f4375 = new C0986();
    }

    /* renamed from: K  reason: contains not printable characters */
    public final synchronized C1155 m2792() throws IOException {
        if (this.f4373 == null) {
            this.f4373 = C1155.m3083(this.f4374, 1, 1, this.f4372);
        }
        return this.f4373;
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.ト.AbstractC0993
    /* renamed from: K  reason: contains not printable characters */
    public File m2791(AbstractC1029 r5) {
        String r0 = this.f4375.m2794(r5);
        if (Log.isLoggable("DiskLruCacheWrapper", 2)) {
            Log.v("DiskLruCacheWrapper", "Get: Obtained: " + r0 + " for for Key: " + r5);
        }
        try {
            C1155.C1157 r02 = m2792().m3092(r0);
            if (r02 != null) {
                return r02.f4655[0];
            }
            return null;
        } catch (IOException e) {
            if (!Log.isLoggable("DiskLruCacheWrapper", 5)) {
                return null;
            }
            Log.w("DiskLruCacheWrapper", "Unable to get from disk cache", e);
            return null;
        }
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.ト.AbstractC0993
    /* renamed from: K  reason: contains not printable characters */
    public void m2793(AbstractC1029 r6, AbstractC0993.AbstractC0994 r7) {
        String r1 = this.f4375.m2794(r6);
        this.f4376.m2788(r1);
        try {
            if (Log.isLoggable("DiskLruCacheWrapper", 2)) {
                Log.v("DiskLruCacheWrapper", "Put: Obtained: " + r1 + " for for Key: " + r6);
            }
            try {
                C1155 r62 = m2792();
                if (r62.m3092(r1) == null) {
                    C1155.C1156 r63 = r62.m3093(r1, -1);
                    if (r63 != null) {
                        try {
                            C0940 r72 = (C0940) r7;
                            if (r72.f4254.m2847(r72.f4253, r63.m3099(0), r72.f4252)) {
                                C1155.this.m3094(r63, true);
                                r63.f4651 = true;
                            }
                            if (!r63.f4651) {
                                try {
                                    r63.m3100();
                                } catch (IOException unused) {
                                }
                            }
                        } catch (Throwable th) {
                            if (!r63.f4651) {
                                try {
                                    r63.m3100();
                                } catch (IOException unused2) {
                                }
                            }
                            throw th;
                        }
                    } else {
                        throw new IllegalStateException("Had two simultaneous puts for: " + r1);
                    }
                }
            } catch (IOException e) {
                if (Log.isLoggable("DiskLruCacheWrapper", 5)) {
                    Log.w("DiskLruCacheWrapper", "Unable to put to disk cache", e);
                }
            }
        } finally {
            this.f4376.m2787(r1);
        }
    }
}
