signalingKey needs to be set at register phase, otherwise loading of JSON would fail at verify step, because the key is not contained in JSON there.

This commit is contained in:
Juraj Bednar 2015-07-05 19:53:15 +02:00
parent 27c08a56fe
commit eb38734452

View file

@ -117,6 +117,7 @@ public class Manager {
public void register() throws IOException { public void register() throws IOException {
password = Util.getSecret(18); password = Util.getSecret(18);
signalingKey = Util.getSecret(52);
accountManager = new TextSecureAccountManager(URL, TRUST_STORE, username, password); accountManager = new TextSecureAccountManager(URL, TRUST_STORE, username, password);
@ -126,7 +127,6 @@ public class Manager {
public void verifyAccount(String verificationCode) throws IOException { public void verifyAccount(String verificationCode) throws IOException {
verificationCode = verificationCode.replace("-", ""); verificationCode = verificationCode.replace("-", "");
signalingKey = Util.getSecret(52);
accountManager.verifyAccount(verificationCode, signalingKey, false, axolotlStore.getLocalRegistrationId()); accountManager.verifyAccount(verificationCode, signalingKey, false, axolotlStore.getLocalRegistrationId());
//accountManager.setGcmId(Optional.of(GoogleCloudMessaging.getInstance(this).register(REGISTRATION_ID))); //accountManager.setGcmId(Optional.of(GoogleCloudMessaging.getInstance(this).register(REGISTRATION_ID)));