|
|
@ -2837,14 +2837,18 @@ public class Helper {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void secureDelete(File file) {
|
|
|
|
static void secureDelete(File file) {
|
|
|
|
if (file.exists()) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
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()));
|
|
|
|
Files.delete(Paths.get(file.getAbsolutePath()));
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (IOException ex) {
|
|
|
|
} catch (IOException ex) {
|
|
|
|
Log.e(ex);
|
|
|
|
Log.e(ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static long getAvailableStorageSpace() {
|
|
|
|
static long getAvailableStorageSpace() {
|
|
|
|
StatFs stats = new StatFs(Environment.getDataDirectory().getAbsolutePath());
|
|
|
|
StatFs stats = new StatFs(Environment.getDataDirectory().getAbsolutePath());
|
|
|
|