mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 20:18:36 +00:00
Inline SVR2 feature flag.
This commit is contained in:
committed by
Cody Henthorne
parent
2737e5613c
commit
fa27531c00
@@ -12,7 +12,6 @@ import org.thoughtcrime.securesms.jobmanager.JsonJobData
|
|||||||
import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint
|
import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint
|
||||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||||
import org.thoughtcrime.securesms.pin.SvrRepository
|
import org.thoughtcrime.securesms.pin.SvrRepository
|
||||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.NonSuccessfulResponseCodeException
|
import org.whispersystems.signalservice.api.push.exceptions.NonSuccessfulResponseCodeException
|
||||||
import org.whispersystems.signalservice.api.svr.SecureValueRecovery.BackupResponse
|
import org.whispersystems.signalservice.api.svr.SecureValueRecovery.BackupResponse
|
||||||
import org.whispersystems.signalservice.api.svr.SecureValueRecovery.PinChangeSession
|
import org.whispersystems.signalservice.api.svr.SecureValueRecovery.PinChangeSession
|
||||||
@@ -67,11 +66,6 @@ class Svr2MirrorJob private constructor(parameters: Parameters, private var seri
|
|||||||
return Result.success()
|
return Result.success()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FeatureFlags.svr2()) {
|
|
||||||
Log.w(TAG, "SVR2 was disabled! SKipping.")
|
|
||||||
return Result.success()
|
|
||||||
}
|
|
||||||
|
|
||||||
val svr2: SecureValueRecoveryV2 = AppDependencies.signalServiceAccountManager.getSecureValueRecoveryV2(BuildConfig.SVR2_MRENCLAVE)
|
val svr2: SecureValueRecoveryV2 = AppDependencies.signalServiceAccountManager.getSecureValueRecoveryV2(BuildConfig.SVR2_MRENCLAVE)
|
||||||
|
|
||||||
val session: PinChangeSession = serializedChangeSession?.let { session ->
|
val session: PinChangeSession = serializedChangeSession?.let { session ->
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import org.thoughtcrime.securesms.keyvalue.SignalStore
|
|||||||
import org.thoughtcrime.securesms.lock.v2.PinKeyboardType
|
import org.thoughtcrime.securesms.lock.v2.PinKeyboardType
|
||||||
import org.thoughtcrime.securesms.megaphone.Megaphones
|
import org.thoughtcrime.securesms.megaphone.Megaphones
|
||||||
import org.thoughtcrime.securesms.registration.viewmodel.SvrAuthCredentialSet
|
import org.thoughtcrime.securesms.registration.viewmodel.SvrAuthCredentialSet
|
||||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
|
||||||
import org.whispersystems.signalservice.api.SvrNoDataException
|
import org.whispersystems.signalservice.api.SvrNoDataException
|
||||||
import org.whispersystems.signalservice.api.kbs.MasterKey
|
import org.whispersystems.signalservice.api.kbs.MasterKey
|
||||||
import org.whispersystems.signalservice.api.svr.SecureValueRecovery
|
import org.whispersystems.signalservice.api.svr.SecureValueRecovery
|
||||||
@@ -154,6 +153,7 @@ object SvrRepository {
|
|||||||
.enqueueAndBlockUntilCompletion(TimeUnit.SECONDS.toMillis(10))
|
.enqueueAndBlockUntilCompletion(TimeUnit.SECONDS.toMillis(10))
|
||||||
stopwatch.split("contact-restore")
|
stopwatch.split("contact-restore")
|
||||||
|
|
||||||
|
// TODO [svr3]
|
||||||
if (implementation != svr2) {
|
if (implementation != svr2) {
|
||||||
AppDependencies.jobManager.add(Svr2MirrorJob())
|
AppDependencies.jobManager.add(Svr2MirrorJob())
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,6 @@ object SvrRepository {
|
|||||||
val masterKey: MasterKey = SignalStore.svr().getOrCreateMasterKey()
|
val masterKey: MasterKey = SignalStore.svr().getOrCreateMasterKey()
|
||||||
|
|
||||||
val responses: List<BackupResponse> = writeImplementations
|
val responses: List<BackupResponse> = writeImplementations
|
||||||
.filter { it != svr2 || FeatureFlags.svr2() }
|
|
||||||
.map { it.setPin(userPin, masterKey) }
|
.map { it.setPin(userPin, masterKey) }
|
||||||
.map { it.execute() }
|
.map { it.execute() }
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ public final class FeatureFlags {
|
|||||||
private static final String MAX_ATTACHMENT_COUNT = "android.attachments.maxCount";
|
private static final String MAX_ATTACHMENT_COUNT = "android.attachments.maxCount";
|
||||||
private static final String MAX_ATTACHMENT_RECEIVE_SIZE_BYTES = "global.attachments.maxReceiveBytes";
|
private static final String MAX_ATTACHMENT_RECEIVE_SIZE_BYTES = "global.attachments.maxReceiveBytes";
|
||||||
private static final String MAX_ATTACHMENT_SIZE_BYTES = "global.attachments.maxBytes";
|
private static final String MAX_ATTACHMENT_SIZE_BYTES = "global.attachments.maxBytes";
|
||||||
private static final String SVR2_KILLSWITCH = "android.svr2.killSwitch";
|
|
||||||
private static final String CDS_DISABLE_COMPAT_MODE = "cds.disableCompatibilityMode";
|
private static final String CDS_DISABLE_COMPAT_MODE = "cds.disableCompatibilityMode";
|
||||||
private static final String FCM_MAY_HAVE_MESSAGES_KILL_SWITCH = "android.fcmNotificationFallbackKillSwitch";
|
private static final String FCM_MAY_HAVE_MESSAGES_KILL_SWITCH = "android.fcmNotificationFallbackKillSwitch";
|
||||||
public static final String PROMPT_FOR_NOTIFICATION_LOGS = "android.logs.promptNotifications";
|
public static final String PROMPT_FOR_NOTIFICATION_LOGS = "android.logs.promptNotifications";
|
||||||
@@ -185,7 +184,6 @@ public final class FeatureFlags {
|
|||||||
MAX_ATTACHMENT_RECEIVE_SIZE_BYTES,
|
MAX_ATTACHMENT_RECEIVE_SIZE_BYTES,
|
||||||
MAX_ATTACHMENT_SIZE_BYTES,
|
MAX_ATTACHMENT_SIZE_BYTES,
|
||||||
AD_HOC_CALLING,
|
AD_HOC_CALLING,
|
||||||
SVR2_KILLSWITCH,
|
|
||||||
CDS_DISABLE_COMPAT_MODE,
|
CDS_DISABLE_COMPAT_MODE,
|
||||||
FCM_MAY_HAVE_MESSAGES_KILL_SWITCH,
|
FCM_MAY_HAVE_MESSAGES_KILL_SWITCH,
|
||||||
PROMPT_FOR_NOTIFICATION_LOGS,
|
PROMPT_FOR_NOTIFICATION_LOGS,
|
||||||
@@ -271,7 +269,6 @@ public final class FeatureFlags {
|
|||||||
MAX_ATTACHMENT_COUNT,
|
MAX_ATTACHMENT_COUNT,
|
||||||
MAX_ATTACHMENT_RECEIVE_SIZE_BYTES,
|
MAX_ATTACHMENT_RECEIVE_SIZE_BYTES,
|
||||||
MAX_ATTACHMENT_SIZE_BYTES,
|
MAX_ATTACHMENT_SIZE_BYTES,
|
||||||
SVR2_KILLSWITCH,
|
|
||||||
CDS_DISABLE_COMPAT_MODE,
|
CDS_DISABLE_COMPAT_MODE,
|
||||||
FCM_MAY_HAVE_MESSAGES_KILL_SWITCH,
|
FCM_MAY_HAVE_MESSAGES_KILL_SWITCH,
|
||||||
PROMPT_FOR_NOTIFICATION_LOGS,
|
PROMPT_FOR_NOTIFICATION_LOGS,
|
||||||
@@ -297,7 +294,6 @@ public final class FeatureFlags {
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final Set<String> STICKY = SetUtil.newHashSet(
|
static final Set<String> STICKY = SetUtil.newHashSet(
|
||||||
VERIFY_V2,
|
VERIFY_V2,
|
||||||
SVR2_KILLSWITCH,
|
|
||||||
FCM_MAY_HAVE_MESSAGES_KILL_SWITCH
|
FCM_MAY_HAVE_MESSAGES_KILL_SWITCH
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -906,14 +902,6 @@ public final class FeatureFlags {
|
|||||||
return getInteger(MESSAGE_PROCESSOR_DELAY, 300);
|
return getInteger(MESSAGE_PROCESSOR_DELAY, 300);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether or not SVR2 should be used at all. Defaults to true. In practice this is reserved as a killswitch.
|
|
||||||
*/
|
|
||||||
public static boolean svr2() {
|
|
||||||
// Despite us always inverting the value, it's important that this defaults to false so that the STICKY property works as intended
|
|
||||||
return !getBoolean(SVR2_KILLSWITCH, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private enum VersionFlag {
|
private enum VersionFlag {
|
||||||
/** The flag is no set */
|
/** The flag is no set */
|
||||||
OFF,
|
OFF,
|
||||||
|
|||||||
Reference in New Issue
Block a user