Fixed Android 7.0- compatibility

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

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

Loading…
Cancel
Save