YourPorn v1.2.4版本的 MD5 值为:25af0cc492747d0d721ef41054943bde

以下内容为反编译后的 Cif.java 源代码,内容仅作参考


package a6;

import a6.Cdo;
import android.content.Context;
import android.net.Uri;
import android.text.TextUtils;
import com.shuyu.gsyvideoplayer.utils.CommonUtil;
import com.shuyu.gsyvideoplayer.utils.FileUtils;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.Executors;
import tv.danmaku.ijk.media.player.IMediaPlayer;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
import w2.Ccase;
import w2.Cconst;
import w2.Celse;
import w2.Cfor;
import w2.Cthrow;

public class Cif implements Cdo, w2.Cif {

    public static Cif f87class;

    public Cdo.InterfaceC0008do f88break;

    public Cfor f89catch = new Cfor();

    public Ccase f90else;

    public File f91goto;

    public boolean f92this;

    public static synchronized Cif m70for() {
        Cif cif;
        synchronized (Cif.class) {
            if (f87class == null) {
                f87class = new Cif();
            }
            cif = f87class;
        }
        return cif;
    }

    public static Ccase m71if(Context context, File file) {
        if (file == null) {
            Ccase ccase = m70for().f90else;
            if (ccase != null) {
                return ccase;
            }
            Cif m70for = m70for();
            Cif m70for2 = m70for();
            Objects.requireNonNull(m70for2);
            Context applicationContext = context.getApplicationContext();
            z2.Cdo cdo = new z2.Cdo(applicationContext);
            File m4104do = Cthrow.m4104do(applicationContext);
            Executors.newSingleThreadExecutor();
            i.Cdo cdo2 = new i.Cdo();
            Cfor cfor = m70for2.f89catch;
            Objects.requireNonNull(cfor);
            Ccase ccase2 = new Ccase(new Cfor(m4104do, cdo2, new x2.Ccase(IjkMediaMeta.AV_CH_STEREO_LEFT), cdo, cfor, null, null), null);
            m70for.f90else = ccase2;
            return ccase2;
        }
        if (m70for().f91goto != null && !m70for().f91goto.getAbsolutePath().equals(file.getAbsolutePath())) {
            Ccase ccase3 = m70for().f90else;
            if (ccase3 != null) {
                b.Cdo.m581throws("Shutdown proxy server");
                synchronized (ccase3.f9658do) {
                    for (Celse celse : ccase3.f9660for.values()) {
                        celse.f9684for.clear();
                        if (celse.f9682case != null) {
                            celse.f9682case.f9717catch = null;
                            celse.f9682case.m4088case();
                            celse.f9682case = null;
                        }
                        celse.f9683do.set(0);
                    }
                    ccase3.f9660for.clear();
                }
                ccase3.f9659else.f9695new.release();
                ccase3.f9657case.interrupt();
                try {
                    if (!ccase3.f9663new.isClosed()) {
                        ccase3.f9663new.close();
                    }
                } catch (IOException e10) {
                    ccase3.m4085try(new Cconst("Error shutting down proxy server", e10));
                }
            }
            Cif m70for3 = m70for();
            Ccase m73new = m70for().m73new(context, file);
            m70for3.f90else = m73new;
            return m73new;
        }
        Ccase ccase4 = m70for().f90else;
        if (ccase4 != null) {
            return ccase4;
        }
        Cif m70for4 = m70for();
        Ccase m73new2 = m70for().m73new(context, file);
        m70for4.f90else = m73new2;
        return m73new2;
    }

    @Override
    public boolean cachePreview(Context context, File file, String str) {
        return !m71if(context.getApplicationContext(), file).m4082for(str).startsWith("http");
    }

    @Override
    public void clearCache(Context context, File file, String str) {
        if (TextUtils.isEmpty(str)) {
            if (file == null) {
                FileUtils.deleteFiles(new File(Cthrow.m4104do(context.getApplicationContext()).getAbsolutePath()));
                return;
            } else {
                FileUtils.deleteFiles(file);
                return;
            }
        }
        String mo2692new = new i.Cdo().mo2692new(str);
        if (file != null) {
            StringBuilder sb = new StringBuilder();
            sb.append(file.getAbsolutePath());
            String str2 = File.separator;
            sb.append(str2);
            sb.append(mo2692new);
            sb.append(".download");
            String sb2 = sb.toString();
            String str3 = file.getAbsolutePath() + str2 + mo2692new;
            CommonUtil.deleteFile(sb2);
            CommonUtil.deleteFile(str3);
            return;
        }
        StringBuilder sb3 = new StringBuilder();
        sb3.append(Cthrow.m4104do(context.getApplicationContext()).getAbsolutePath());
        String str4 = File.separator;
        sb3.append(str4);
        sb3.append(mo2692new);
        sb3.append(".download");
        String sb4 = sb3.toString();
        String str5 = Cthrow.m4104do(context.getApplicationContext()).getAbsolutePath() + str4 + mo2692new;
        CommonUtil.deleteFile(sb4);
        CommonUtil.deleteFile(str5);
    }

    @Override
    public void mo72do(File file, String str, int i10) {
        Cdo.InterfaceC0008do interfaceC0008do = this.f88break;
        if (interfaceC0008do != null) {
            ((y5.Cdo) interfaceC0008do).f9868const = i10;
        }
    }

    @Override
    public void doCacheLogic(Context context, IMediaPlayer iMediaPlayer, String str, Map<String, String> map, File file) {
        Map<String, String> map2 = Cfor.f86else;
        ((HashMap) map2).clear();
        if (map != null) {
            ((HashMap) map2).putAll(map);
        }
        if (str.startsWith("http") && !str.contains("127.0.0.1") && !str.contains(".m3u8")) {
            Ccase m71if = m71if(context.getApplicationContext(), file);
            String m4082for = m71if.m4082for(str);
            boolean z9 = !m4082for.startsWith("http");
            this.f92this = z9;
            if (!z9) {
                Object[] objArr = {this, str};
                for (int i10 = 0; i10 < 2; i10++) {
                    Objects.requireNonNull(objArr[i10]);
                }
                synchronized (m71if.f9658do) {
                    try {
                        m71if.m4080do(str).f9684for.add(this);
                    } catch (Cconst e10) {
                        b.Cdo.m575default("Error registering cache listener", e10.getMessage());
                    }
                }
            }
            str = m4082for;
        } else if (!str.startsWith("http") && !str.startsWith("rtmp") && !str.startsWith("rtsp") && !str.contains(".m3u8")) {
            this.f92this = true;
        }
        try {
            iMediaPlayer.setDataSource(context, Uri.parse(str), map);
        } catch (IOException e11) {
            e11.printStackTrace();
        }
    }

    @Override
    public boolean hadCached() {
        return this.f92this;
    }

    public Ccase m73new(Context context, File file) {
        if (!file.exists()) {
            file.mkdirs();
        }
        z2.Cdo cdo = new z2.Cdo(context);
        Cthrow.m4104do(context);
        Executors.newSingleThreadExecutor();
        if (IjkMediaMeta.AV_CH_STEREO_LEFT > 0) {
            i.Cdo cdo2 = new i.Cdo();
            x2.Ccase ccase = new x2.Ccase(IjkMediaMeta.AV_CH_STEREO_LEFT);
            Cfor cfor = this.f89catch;
            Objects.requireNonNull(cfor);
            this.f91goto = file;
            return new Ccase(new Cfor(file, cdo2, ccase, cdo, cfor, null, null), null);
        }
        throw new IllegalArgumentException("Max size must be positive number!");
    }

    @Override
    public void release() {
        Ccase ccase = this.f90else;
        if (ccase != null) {
            try {
                ccase.m4081else(this);
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    @Override
    public void setCacheAvailableListener(Cdo.InterfaceC0008do interfaceC0008do) {
        this.f88break = interfaceC0008do;
    }
}