Disable backup auth if backups aren't enabled.

This commit is contained in:
Greyson Parrelli
2025-02-13 11:52:17 -05:00
parent 754d759d7d
commit 71abbe9fb1

View File

@@ -1448,7 +1448,9 @@ object BackupRepository {
* prevents early initialization with incorrect keys before we have restored them.
*/
private fun initBackupAndFetchAuth(): NetworkResult<ArchiveServiceAccessPair> {
return if (SignalStore.backup.backupsInitialized) {
return if (!RemoteConfig.messageBackups) {
NetworkResult.StatusCodeError(555, null, null, NonSuccessfulResponseCodeException(555, "Backups disabled!"))
} else if (SignalStore.backup.backupsInitialized) {
getArchiveServiceAccessPair().runOnStatusCodeError(resetInitializedStateErrorAction)
} else if (isPreRestoreDuringRegistration()) {
Log.w(TAG, "Requesting/using auth credentials in pre-restore state", Throwable())