]> nmode's Git Repositories - signal-cli/commitdiff
Disable registration lock before removing pin
authorAsamK <asamk@gmx.de>
Sun, 10 Jan 2021 16:07:26 +0000 (17:07 +0100)
committerAsamK <asamk@gmx.de>
Sun, 10 Jan 2021 17:16:26 +0000 (18:16 +0100)
CHANGELOG.md
src/main/java/org/asamk/signal/manager/helper/PinHelper.java

index e6eb3c397e31df744763478aa449c8a76438122c..df9aa47ff648795cd7a6e71cbbfac0405176c3d5 100644 (file)
@@ -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)
index 47ee6b408f8596a6b20b6dd7964f7dbfe4d3ad4d..b4fa04c45bc0089b79a4c91970737758ea62b9f6 100644 (file)
@@ -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) {