Fixed Android 7.0- compatibility

pull/214/head
M66B 8 months ago
parent 620e82aedc
commit b09ec10cd3

@ -2837,12 +2837,16 @@ public class Helper {
}
static void secureDelete(File file) {
if (file.exists()) {
try {
Files.delete(Paths.get(file.getAbsolutePath()));
} catch (IOException ex) {
Log.e(ex);
try {
if (file.exists()) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
if (!file.delete())
throw new FileNotFoundException(file.getAbsolutePath());
} else
Files.delete(Paths.get(file.getAbsolutePath()));
}
} catch (IOException ex) {
Log.e(ex);
}
}

Loading…
Cancel
Save