Show backup UI in release builds if backup is enabled.

This commit is contained in:
Matthew Chen 2018-03-20 12:26:17 -04:00
parent 2cb9677c91
commit d215499435
2 changed files with 21 additions and 5 deletions

View File

@ -7,6 +7,7 @@
#import "AdvancedSettingsTableViewController.h"
#import "DebugUITableViewController.h"
#import "NotificationSettingsViewController.h"
#import "OWSBackup.h"
#import "OWSBackupSettingsViewController.h"
#import "OWSLinkedDevicesTableViewController.h"
#import "OWSNavigationController.h"
@ -188,13 +189,26 @@
actionBlock:^{
[weakSelf showAdvanced];
}]];
// Show backup UI in debug builds OR if backup has already been enabled.
//
// NOTE: Backup format is not yet finalized and backups are not yet
// properly encrypted, so these debug backups should only be
// done on test devices and will not be usable if/when we ship
// backup to production.
//
// TODO: Always show backup when we go to production.
BOOL isBackupEnabled = [OWSBackup.sharedManager isBackupEnabled];
BOOL showBackup = isBackupEnabled;
#ifdef DEBUG
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BACKUP",
@"Label for the backup view in app settings.")
actionBlock:^{
[weakSelf showBackup];
}]];
showBackup = YES;
#endif
if (showBackup) {
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BACKUP",
@"Label for the backup view in app settings.")
actionBlock:^{
[weakSelf showBackup];
}]];
}
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ABOUT", @"")
actionBlock:^{
[weakSelf showAbout];

View File

@ -10,6 +10,8 @@ import CloudKit
// If we change the record types, we need to ensure indices
// are configured properly in the CloudKit dashboard.
//
// TODO: Change the record types when we ship to production.
static let signalBackupRecordType = "signalBackup"
static let manifestRecordName = "manifest"
static let payloadKey = "payload"