package L6;

import P6.g;
import X6.e;
import com.google.android.gms.internal.measurement.X1;
import java.io.File;

/* JADX INFO: loaded from: classes.dex */
public abstract class a extends X1 {
    public static File k0(File file) {
        int length;
        int iS;
        File file2 = new File("image_cache");
        String path = file2.getPath();
        g.d(path, "getPath(...)");
        char c3 = File.separatorChar;
        int iS2 = e.S(path, c3, 0, 4);
        if (iS2 != 0) {
            length = (iS2 <= 0 || path.charAt(iS2 + (-1)) != ':') ? (iS2 == -1 && e.P(path, ':')) ? path.length() : 0 : iS2 + 1;
        } else if (path.length() <= 1 || path.charAt(1) != c3 || (iS = e.S(path, c3, 2, 4)) < 0) {
            length = 1;
        } else {
            int iS3 = e.S(path, c3, iS + 1, 4);
            length = iS3 >= 0 ? iS3 + 1 : path.length();
        }
        if (length > 0) {
            return file2;
        }
        String string = file.toString();
        g.d(string, "toString(...)");
        if ((string.length() == 0) || e.P(string, c3)) {
            return new File(string + file2);
        }
        return new File(string + c3 + file2);
    }
}
