Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Add support for provisioning and basic synchronisation #21

Closed
wants to merge 9 commits into from

Conversation

Turakar
Copy link

@Turakar Turakar commented Mar 29, 2016

There a two new methods introduced to the public part of the API:

  • getNewDeviceUuid()
  • finishNewDeviceRegistration()

The user first calls getNewDeviceUuid() and uses this uuid and a public key from a randomly generated IdentityKeyPair to create a QR code with the text:

tsdevice:/?uuid=[uuid]&pub_key=[public key Base64 encoded and URL safe]

Then the user calls finishNewDeviceRegistration() which blocks until the device is verified(that means scanned by the app). After that he can continue with setPreKeys().

The API is now also capable of serializing RequestMessages and deserializing the reply (contacts, groups and blocked lists). As contacts and group syncs are attachments, the code for reading them has to be written by your own. This can be done using the DeviceContactsInputStream or DeviceGroupsInputStream. I also fixed bugs regarding the library not being the primary device.

Tested and working:

  • registration
  • uploading of prekeys
  • sending a message to somebody else and to the master device
  • receiving messages from somebody else or the master device
  • requesting and receiving a contacts list
  • requesting and receiving a groups list
  • requesting and receiving a blocked list
  • using the library from the primary device

If you think that this is ready, I can sign the CLA.

@Turakar Turakar changed the title [feature] Add support for provisioning Add support for provisioning Mar 29, 2016
- Use SignalServiceAddress.DEFAULT_DEVICE_ID as default deviceId instead of -1 to indicate master device
- Enable sending messages to your own from a device other than the master device
@Turakar Turakar changed the title Add support for provisioning Add support for provisioning and basic synchronisation Apr 11, 2016
@ayoub-benali
Copy link

ayoub-benali commented Nov 16, 2016

Hi, getNewDeviceUuid is very handy.

Is there a reason that this PR is not merged @moxie0 ?

@moxie0
Copy link
Contributor

moxie0 commented Jan 2, 2017

Thanks for your interest @Turakar but a 1k line diff is a little big for your first contribution to the project. I'd suggest starting with smaller contributions to get a feel for the project, we'd ultimately like to implement this functionality another way. Thanks again.

@moxie0 moxie0 closed this Jan 2, 2017
@Trolldemorted
Copy link

i am working on fixing signalapp/Signal-Android#5102 (could you unlock the conversation, btw? it would be great to have a place to ask for reviews and opinions) and rely on the features implemented by this PR. Can we convince you somehow to have a second look? This diff is not that huge, if you ignore changed import statements.

@moxie0
Copy link
Contributor

moxie0 commented Jan 2, 2017

Thanks @Trolldemorted but I think that's a bigger PR than we'd merge at this point. I'd recommend focusing on getting smaller PRs in first, getting a better feel for the code base, and getting a better understanding of all the complexities.

@micw
Copy link

micw commented Jun 8, 2021

we'd ultimately like to implement this functionality another way

@moxie0 (How) was this functionally implemented meanwhile?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants