Verify backup can be decrypted as part of creation flow.

This commit is contained in:
Cody Henthorne
2022-08-08 12:28:10 -04:00
parent 5212b33b47
commit cfebd0eeb9
16 changed files with 430 additions and 253 deletions

View File

@@ -12,8 +12,8 @@ import org.greenrobot.eventbus.ThreadMode;
import org.signal.core.util.logging.Log;
import org.signal.devicetransfer.ServerTask;
import org.thoughtcrime.securesms.AppInitialization;
import org.thoughtcrime.securesms.backup.BackupEvent;
import org.thoughtcrime.securesms.backup.BackupPassphrase;
import org.thoughtcrime.securesms.backup.FullBackupBase;
import org.thoughtcrime.securesms.backup.FullBackupImporter;
import org.thoughtcrime.securesms.crypto.AttachmentSecretProvider;
import org.thoughtcrime.securesms.database.SignalDatabase;
@@ -70,10 +70,10 @@ final class NewDeviceServerTask implements ServerTask {
}
@Subscribe(threadMode = ThreadMode.POSTING)
public void onEvent(FullBackupBase.BackupEvent event) {
if (event.getType() == FullBackupBase.BackupEvent.Type.PROGRESS) {
public void onEvent(BackupEvent event) {
if (event.getType() == BackupEvent.Type.PROGRESS) {
EventBus.getDefault().post(new Status(event.getCount(), Status.State.IN_PROGRESS));
} else if (event.getType() == FullBackupBase.BackupEvent.Type.FINISHED) {
} else if (event.getType() == BackupEvent.Type.FINISHED) {
EventBus.getDefault().post(new Status(event.getCount(), Status.State.SUCCESS));
}
}

View File

@@ -9,7 +9,7 @@ import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.signal.core.util.logging.Log;
import org.signal.devicetransfer.ClientTask;
import org.thoughtcrime.securesms.backup.FullBackupBase;
import org.thoughtcrime.securesms.backup.BackupEvent;
import org.thoughtcrime.securesms.backup.FullBackupExporter;
import org.thoughtcrime.securesms.crypto.AttachmentSecretProvider;
import org.thoughtcrime.securesms.database.SignalDatabase;
@@ -56,8 +56,8 @@ final class OldDeviceClientTask implements ClientTask {
}
@Subscribe(threadMode = ThreadMode.POSTING)
public void onEvent(FullBackupBase.BackupEvent event) {
if (event.getType() == FullBackupBase.BackupEvent.Type.PROGRESS) {
public void onEvent(BackupEvent event) {
if (event.getType() == BackupEvent.Type.PROGRESS) {
if (System.currentTimeMillis() > lastProgressUpdate + PROGRESS_UPDATE_THROTTLE) {
EventBus.getDefault().post(new Status(event.getCount(), event.getEstimatedTotalCount(), event.getCompletionPercentage(), false));
lastProgressUpdate = System.currentTimeMillis();