mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Disable registration lock before removing pin
This commit is contained in:
parent
0c7da68d98
commit
9244d1e8a8
2 changed files with 6 additions and 4 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Disable registration lock before removing the PIN
|
||||||
|
|
||||||
## [0.7.2] - 2020-12-31
|
## [0.7.2] - 2020-12-31
|
||||||
### Added
|
### Added
|
||||||
- Implement new registration lock PIN with `setPin` and `removePin` (with KBS)
|
- Implement new registration lock PIN with `setPin` and `removePin` (with KBS)
|
||||||
|
|
|
@ -33,12 +33,12 @@ public class PinHelper {
|
||||||
|
|
||||||
public void removeRegistrationLockPin() throws IOException, UnauthenticatedResponseException {
|
public void removeRegistrationLockPin() throws IOException, UnauthenticatedResponseException {
|
||||||
final KeyBackupService.PinChangeSession pinChangeSession = keyBackupService.newPinChangeSession();
|
final KeyBackupService.PinChangeSession pinChangeSession = keyBackupService.newPinChangeSession();
|
||||||
|
pinChangeSession.disableRegistrationLock();
|
||||||
pinChangeSession.removePin();
|
pinChangeSession.removePin();
|
||||||
}
|
}
|
||||||
|
|
||||||
public KbsPinData getRegistrationLockData(
|
public KbsPinData getRegistrationLockData(
|
||||||
String pin,
|
String pin, LockedException e
|
||||||
LockedException e
|
|
||||||
) throws IOException, KeyBackupSystemNoDataException, KeyBackupServicePinException {
|
) throws IOException, KeyBackupSystemNoDataException, KeyBackupServicePinException {
|
||||||
String basicStorageCredentials = e.getBasicStorageCredentials();
|
String basicStorageCredentials = e.getBasicStorageCredentials();
|
||||||
if (basicStorageCredentials == null) {
|
if (basicStorageCredentials == null) {
|
||||||
|
@ -49,8 +49,7 @@ public class PinHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
private KbsPinData getRegistrationLockData(
|
private KbsPinData getRegistrationLockData(
|
||||||
String pin,
|
String pin, String basicStorageCredentials
|
||||||
String basicStorageCredentials
|
|
||||||
) throws IOException, KeyBackupSystemNoDataException, KeyBackupServicePinException {
|
) throws IOException, KeyBackupSystemNoDataException, KeyBackupServicePinException {
|
||||||
TokenResponse tokenResponse = keyBackupService.getToken(basicStorageCredentials);
|
TokenResponse tokenResponse = keyBackupService.getToken(basicStorageCredentials);
|
||||||
if (tokenResponse == null || tokenResponse.getTries() == 0) {
|
if (tokenResponse == null || tokenResponse.getTries() == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue