Android 14+ FIX

This commit is contained in:
Epic Studios 2024-04-18 23:28:41 +02:00
parent 4ec46836e8
commit 80ee0d58b2
2 changed files with 10 additions and 1 deletions

View file

@ -81,7 +81,7 @@ public class SplashActivity extends AppCompatActivity implements Runnable {
String filesDir = activity.getFilesDir().getAbsolutePath();
String nativeLibDir = activity.getApplicationInfo().nativeLibraryDir;
File tmpDir = new File(context.getFilesDir(), "tmp");
File tmpDir = new File(activity.getFilesDir(), "tmp");
if (!tmpDir.isDirectory()) {
tmpDir.mkdirs();
FileUtils.chmod(tmpDir, 0771);

View file

@ -11,6 +11,8 @@ import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.provider.OpenableColumns;
import android.system.ErrnoException;
import android.system.Os;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.MimeTypeMap;
@ -59,6 +61,13 @@ public class FileUtils {
return new File(Environment.getExternalStorageDirectory(), "Documents/VectrasVM");
}
public static void chmod(File file, int mode) {
try {
Os.chmod(file.getAbsolutePath(), mode);
}
catch (ErrnoException e) {}
}
private static Uri contentUri = null;
@SuppressLint("NewApi")