mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-27 05:03:28 +00:00
Migrate to new SVR2 enclave.
This commit is contained in:
@@ -184,9 +184,10 @@ public class ApplicationMigrations {
|
||||
static final int E164_FORMATTING_2 = 140;
|
||||
static final int E164_FORMATTING_3 = 141;
|
||||
static final int STORAGE_LOCAL_UNKNOWNS_FIX_2 = 142;
|
||||
static final int SVR2_ENCLAVE_UPDATE_4 = 143;
|
||||
}
|
||||
|
||||
public static final int CURRENT_VERSION = 142;
|
||||
public static final int CURRENT_VERSION = 143;
|
||||
|
||||
/**
|
||||
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
|
||||
@@ -849,6 +850,10 @@ public class ApplicationMigrations {
|
||||
jobs.put(Version.STORAGE_LOCAL_UNKNOWNS_FIX_2, new StorageFixLocalUnknownMigrationJob());
|
||||
}
|
||||
|
||||
if (lastSeenVersion < Version.SVR2_ENCLAVE_UPDATE_4) {
|
||||
jobs.put(Version.SVR2_ENCLAVE_UPDATE_4, new Svr2MirrorMigrationJob());
|
||||
}
|
||||
|
||||
return jobs;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ object SvrRepository {
|
||||
|
||||
val TAG = Log.tag(SvrRepository::class.java)
|
||||
|
||||
private val svr2LegacyLegacy: SecureValueRecovery = AppDependencies.signalServiceAccountManager.getSecureValueRecoveryV2(BuildConfig.SVR2_MRENCLAVE_LEGACY_LEGACY)
|
||||
private val svr2Legacy: SecureValueRecovery = AppDependencies.signalServiceAccountManager.getSecureValueRecoveryV2(BuildConfig.SVR2_MRENCLAVE_LEGACY)
|
||||
private val svr2: SecureValueRecovery = AppDependencies.signalServiceAccountManager.getSecureValueRecoveryV2(BuildConfig.SVR2_MRENCLAVE)
|
||||
private val svr3: SecureValueRecovery = AppDependencies.signalServiceAccountManager.getSecureValueRecoveryV3(AppDependencies.libsignalNetwork)
|
||||
@@ -52,7 +53,7 @@ object SvrRepository {
|
||||
private val readImplementations: List<SecureValueRecovery> = if (Svr3Migration.shouldReadFromSvr3) {
|
||||
listOf(svr3, svr2)
|
||||
} else {
|
||||
listOf(svr2, svr2Legacy)
|
||||
listOf(svr2, svr2Legacy, svr2LegacyLegacy)
|
||||
}
|
||||
|
||||
/** An ordered list of SVR implementations to write to. They should be in priority order, with the most important one listed first. */
|
||||
@@ -65,6 +66,7 @@ object SvrRepository {
|
||||
if (Svr3Migration.shouldWriteToSvr2) {
|
||||
implementations += svr2
|
||||
implementations += svr2Legacy
|
||||
implementations += svr2LegacyLegacy
|
||||
}
|
||||
return implementations
|
||||
}
|
||||
@@ -102,7 +104,8 @@ object SvrRepository {
|
||||
} else {
|
||||
listOf(
|
||||
svr2 to { restoreMasterKeyPreRegistrationFromV2(svr2, credentials.svr2, userPin) },
|
||||
svr2Legacy to { restoreMasterKeyPreRegistrationFromV2(svr2Legacy, credentials.svr2, userPin) }
|
||||
svr2Legacy to { restoreMasterKeyPreRegistrationFromV2(svr2Legacy, credentials.svr2, userPin) },
|
||||
svr2LegacyLegacy to { restoreMasterKeyPreRegistrationFromV2(svr2LegacyLegacy, credentials.svr2, userPin) }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user