mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-03 06:04:20 +01:00
Disable registration lock before removing pin
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
- Disable registration lock before removing the PIN
|
||||
|
||||
## [0.7.2] - 2020-12-31
|
||||
### Added
|
||||
- Implement new registration lock PIN with `setPin` and `removePin` (with KBS)
|
||||
|
||||
@@ -33,12 +33,12 @@ public class PinHelper {
|
||||
|
||||
public void removeRegistrationLockPin() throws IOException, UnauthenticatedResponseException {
|
||||
final KeyBackupService.PinChangeSession pinChangeSession = keyBackupService.newPinChangeSession();
|
||||
pinChangeSession.disableRegistrationLock();
|
||||
pinChangeSession.removePin();
|
||||
}
|
||||
|
||||
public KbsPinData getRegistrationLockData(
|
||||
String pin,
|
||||
LockedException e
|
||||
String pin, LockedException e
|
||||
) throws IOException, KeyBackupSystemNoDataException, KeyBackupServicePinException {
|
||||
String basicStorageCredentials = e.getBasicStorageCredentials();
|
||||
if (basicStorageCredentials == null) {
|
||||
@@ -49,8 +49,7 @@ public class PinHelper {
|
||||
}
|
||||
|
||||
private KbsPinData getRegistrationLockData(
|
||||
String pin,
|
||||
String basicStorageCredentials
|
||||
String pin, String basicStorageCredentials
|
||||
) throws IOException, KeyBackupSystemNoDataException, KeyBackupServicePinException {
|
||||
TokenResponse tokenResponse = keyBackupService.getToken(basicStorageCredentials);
|
||||
if (tokenResponse == null || tokenResponse.getTries() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user