diff --git a/libsignal-service/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java b/libsignal-service/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java index 7fbefa24a0..b5757026fe 100644 --- a/libsignal-service/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java +++ b/libsignal-service/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java @@ -200,11 +200,6 @@ public class SignalServiceAccountManager { } } - public Single> checkBackupAuthCredentials(@Nonnull String e164, @Nonnull List usernamePasswords) { - - return pushServiceSocket.checkSvr2AuthCredentials(new BackupAuthCheckRequest(e164, usernamePasswords), DefaultResponseMapper.getDefault(BackupV2AuthCheckResponse.class)); - } - /** * Request a push challenge. A number will be pushed to the GCM (FCM) id. This can then be used * during SMS/call requests to bypass the CAPTCHA. @@ -217,109 +212,6 @@ public class SignalServiceAccountManager { pushServiceSocket.requestPushChallenge(sessionId, gcmRegistrationId); } - public ServiceResponse createRegistrationSession(@Nullable String fcmToken, @Nullable String mcc, @Nullable String mnc) { - try { - final RegistrationSessionMetadataResponse response = pushServiceSocket.createVerificationSession(fcmToken, mcc, mnc); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - - public ServiceResponse getRegistrationSession(String sessionId) { - try { - final RegistrationSessionMetadataResponse response = pushServiceSocket.getSessionStatus(sessionId); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - - public ServiceResponse submitPushChallengeToken(String sessionId, String pushChallengeToken) { - try { - final RegistrationSessionMetadataResponse response = pushServiceSocket.patchVerificationSession(sessionId, null, null, null, null, pushChallengeToken); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - - public ServiceResponse submitCaptchaToken(String sessionId, @Nullable String captchaToken) { - try { - final RegistrationSessionMetadataResponse response = pushServiceSocket.patchVerificationSession(sessionId, null, null, null, captchaToken, null); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - - /** - * Request an SMS verification code. On success, the server will send - * an SMS verification code to this Signal user. - * - * @param androidSmsRetrieverSupported - */ - public ServiceResponse requestSmsVerificationCode(String sessionId, Locale locale, boolean androidSmsRetrieverSupported) { - try { - final RegistrationSessionMetadataResponse response = pushServiceSocket.requestVerificationCode(sessionId, locale, androidSmsRetrieverSupported, PushServiceSocket.VerificationCodeTransport.SMS); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - - /** - * Request a Voice verification code. On success, the server will - * make a voice call to this Signal user. - * - * @param locale - */ - public ServiceResponse requestVoiceVerificationCode(String sessionId, Locale locale, boolean androidSmsRetrieverSupported) { - try { - final RegistrationSessionMetadataResponse response = pushServiceSocket.requestVerificationCode(sessionId, locale, androidSmsRetrieverSupported, PushServiceSocket.VerificationCodeTransport.VOICE); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - - /** - * Verify a Signal Service account with a received SMS or voice verification code. - * - * @param verificationCode The verification code received via SMS or Voice - * (see {@link #requestSmsVerificationCode} and - * {@link #requestVoiceVerificationCode}). - * @param sessionId The ID of the current registration session. - * @return The UUID of the user that was registered. - * @throws IOException for various HTTP and networking errors - */ - public ServiceResponse verifyAccount(@Nonnull String verificationCode, @Nonnull String sessionId) { - try { - RegistrationSessionMetadataResponse response = pushServiceSocket.submitVerificationCode(sessionId, verificationCode); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - - public @Nonnull ServiceResponse registerAccount(@Nullable String sessionId, @Nullable String recoveryPassword, AccountAttributes attributes, PreKeyCollection aciPreKeys, PreKeyCollection pniPreKeys, String fcmToken, boolean skipDeviceTransfer) { - try { - VerifyAccountResponse response = pushServiceSocket.submitRegistrationRequest(sessionId, recoveryPassword, attributes, aciPreKeys, pniPreKeys, fcmToken, skipDeviceTransfer); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - - public @Nonnull ServiceResponse changeNumber(@Nonnull ChangePhoneNumberRequest changePhoneNumberRequest) { - try { - VerifyAccountResponse response = this.pushServiceSocket.changeNumber(changePhoneNumberRequest); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - /** * Refresh account attributes with server. * @@ -670,15 +562,6 @@ public class SignalServiceAccountManager { this.pushServiceSocket.sendProvisioningMessage(deviceIdentifier, ciphertext); } - public ServiceResponse distributePniKeys(PniKeyDistributionRequest request) { - try { - VerifyAccountResponse response = this.pushServiceSocket.distributePniKeys(request); - return ServiceResponse.forResult(response, 200, null); - } catch (IOException e) { - return ServiceResponse.forUnknownError(e); - } - } - public List getDevices() throws IOException { return this.pushServiceSocket.getDevices(); } @@ -845,19 +728,6 @@ public class SignalServiceAccountManager { this.pushServiceSocket.cancelInFlightRequests(); } - private String createDirectoryServerToken(String e164number, boolean urlSafe) { - try { - MessageDigest digest = MessageDigest.getInstance("SHA1"); - byte[] token = Util.trim(digest.digest(e164number.getBytes()), 10); - String encoded = Base64.encodeWithoutPadding(token); - - if (urlSafe) return encoded.replace('+', '-').replace('/', '_'); - else return encoded; - } catch (NoSuchAlgorithmException e) { - throw new AssertionError(e); - } - } - public GroupsV2Api getGroupsV2Api() { return new GroupsV2Api(pushServiceSocket, groupsV2Operations); }