parent
d813275f42
commit
70c2a863cc
2 changed files with 3 additions and 5 deletions
|
@ -52,7 +52,7 @@ public class LocalBackupJob extends ContextJob {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String backupPassword = TextSecurePreferences.getBackupPassphrase(context);
|
String backupPassword = TextSecurePreferences.getBackupPassphrase(context);
|
||||||
File backupDirectory = StorageUtil.getBackupCacheDirectory(context);
|
File backupDirectory = StorageUtil.getBackupDirectory(context);
|
||||||
String timestamp = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US).format(new Date());
|
String timestamp = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US).format(new Date());
|
||||||
String fileName = String.format("signal-%s.backup", timestamp);
|
String fileName = String.format("signal-%s.backup", timestamp);
|
||||||
File backupFile = new File(backupDirectory, fileName);
|
File backupFile = new File(backupDirectory, fileName);
|
||||||
|
@ -65,7 +65,7 @@ public class LocalBackupJob extends ContextJob {
|
||||||
throw new IOException("Backup password is null");
|
throw new IOException("Backup password is null");
|
||||||
}
|
}
|
||||||
|
|
||||||
File tempFile = File.createTempFile("backup", "tmp", context.getExternalCacheDir());
|
File tempFile = File.createTempFile("backup", "tmp", StorageUtil.getBackupCacheDirectory(context));
|
||||||
|
|
||||||
FullBackupExporter.export(context,
|
FullBackupExporter.export(context,
|
||||||
AttachmentSecretProvider.getInstance(context).getOrCreateAttachmentSecret(),
|
AttachmentSecretProvider.getInstance(context).getOrCreateAttachmentSecret(),
|
||||||
|
|
|
@ -12,8 +12,7 @@ import org.thoughtcrime.securesms.database.NoExternalStorageException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public class StorageUtil
|
public class StorageUtil {
|
||||||
{
|
|
||||||
|
|
||||||
public static File getBackupDirectory(Context context) throws NoExternalStorageException {
|
public static File getBackupDirectory(Context context) throws NoExternalStorageException {
|
||||||
File storage = null;
|
File storage = null;
|
||||||
|
@ -43,7 +42,6 @@ public class StorageUtil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return backups;
|
return backups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue