Rabbit-R1/android (non root)/java/sources/io/flutter/util/PathUtils.java
2024-05-21 17:08:36 -04:00

38 lines
1.1 KiB
Java

package io.flutter.util;
import android.content.Context;
import java.io.File;
/* loaded from: classes3.dex */
public final class PathUtils {
public static String getFilesDir(Context context) {
File filesDir = context.getFilesDir();
if (filesDir == null) {
filesDir = new File(getDataDirPath(context), "files");
}
return filesDir.getPath();
}
public static String getDataDirectory(Context context) {
File dir = context.getDir("flutter", 0);
if (dir == null) {
dir = new File(getDataDirPath(context), "app_flutter");
}
return dir.getPath();
}
public static String getCacheDirectory(Context context) {
File codeCacheDir = context.getCodeCacheDir();
if (codeCacheDir == null) {
codeCacheDir = context.getCacheDir();
}
if (codeCacheDir == null) {
codeCacheDir = new File(getDataDirPath(context), "cache");
}
return codeCacheDir.getPath();
}
private static String getDataDirPath(Context context) {
return context.getDataDir().getPath();
}
}