mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 10:20:25 +01:00
Update registration to allow PIN entry.
This commit is contained in:
@@ -28,6 +28,8 @@ public final class KbsValues {
|
||||
|
||||
/**
|
||||
* Deliberately does not clear the {@link #MASTER_KEY}.
|
||||
*
|
||||
* Should only be called by {@link org.thoughtcrime.securesms.pin.PinState}
|
||||
*/
|
||||
public void clearRegistrationLockAndPin() {
|
||||
store.beginWrite()
|
||||
@@ -37,6 +39,7 @@ public final class KbsValues {
|
||||
.commit();
|
||||
}
|
||||
|
||||
/** Should only be set by {@link org.thoughtcrime.securesms.pin.PinState}. */
|
||||
public synchronized void setKbsMasterKey(@NonNull KbsPinData pinData, @NonNull String localPinHash) {
|
||||
MasterKey masterKey = pinData.getMasterKey();
|
||||
String tokenResponse;
|
||||
@@ -53,6 +56,7 @@ public final class KbsValues {
|
||||
.commit();
|
||||
}
|
||||
|
||||
/** Should only be set by {@link org.thoughtcrime.securesms.pin.PinState}. */
|
||||
public synchronized void setV2RegistrationLockEnabled(boolean enabled) {
|
||||
store.beginWrite().putBoolean(V2_LOCK_ENABLED, enabled).apply();
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ public final class PinValues {
|
||||
return PinKeyboardType.fromCode(store.getString(KEYBOARD_TYPE, null));
|
||||
}
|
||||
|
||||
/** Should only be set by {@link org.thoughtcrime.securesms.pin.PinState} */
|
||||
public void setPinState(@NonNull String pinState) {
|
||||
store.beginWrite().putString(PIN_STATE, pinState).commit();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ import java.security.SecureRandom;
|
||||
|
||||
public class StorageServiceValues {
|
||||
|
||||
private static final String LAST_SYNC_TIME = "storage.last_sync_time";
|
||||
private static final String LAST_SYNC_TIME = "storage.last_sync_time";
|
||||
private static final String NEEDS_ACCOUNT_RESTORE = "storage.needs_account_restore";
|
||||
|
||||
private final KeyValueStore store;
|
||||
|
||||
@@ -29,4 +30,12 @@ public class StorageServiceValues {
|
||||
public void onSyncCompleted() {
|
||||
store.beginWrite().putLong(LAST_SYNC_TIME, System.currentTimeMillis()).apply();
|
||||
}
|
||||
|
||||
public boolean needsAccountRestore() {
|
||||
return store.getBoolean(NEEDS_ACCOUNT_RESTORE, false);
|
||||
}
|
||||
|
||||
public void setNeedsAccountRestore(boolean value) {
|
||||
store.beginWrite().putBoolean(NEEDS_ACCOUNT_RESTORE, value).apply();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user