Signal-Windows
Signal-Windows copied to clipboard
Does anyone knows how to implement Device linking?
I try to add device linking (as master device) to this client. But I'm not sure how the API works.
I suspect that profileKey is the SignalingKey in the App.Handle.Store and that the identityKeyPair I need is the App.Handle.Store.IdentityKeyPair.
I also think I decode the uri correctly.
public async Task AddDevice(Uri uri)
{
var code = await App.Handle.AccountManager.GetNewDeviceVerificationCodeAsync();
var toAdd = DeviceProtocoll.FromUri(uri);
// is the SignalingKey the profileKey???
var profileKey = Base64.Decode(App.Handle.Store.SignalingKey);
var identityKeyPair = new IdentityKeyPair(Base64.Decode(App.Handle.Store.IdentityKeyPair));
try
{
// I'm not sure where which parameter goes...
// but it failes when the QR code is to old, so the first two are propably correct...
await App.Handle.AccountManager.AddDeviceAsync(toAdd.Uuid, toAdd.PublicKey,
identityKeyPair,
profileKey,
code);
}
catch (libsignalservice.push.exceptions.NotFoundException)
{
// ToDo: Handle Divice not found
}
}
The Android code doesn't do much more, besides enabling MultiDevice. Which I can't find anywhere...
Still nothing happens on my WindowsPhone when I scan its code. An error is also not raised (unless the QR code is to old).
You can also see the pullrequest #232
I try to add device linking (as master device) to this client. But I'm not sure how the API works.
I suspect that
profileKeyis theSignalingKeyin theApp.Handle.Storeand that the identityKeyPair I need is theApp.Handle.Store.IdentityKeyPair.I also think I decode the uri correctly.
public async Task AddDevice(Uri uri) { var code = await App.Handle.AccountManager.GetNewDeviceVerificationCodeAsync(); var toAdd = DeviceProtocoll.FromUri(uri); // is the SignalingKey the profileKey??? var profileKey = Base64.Decode(App.Handle.Store.SignalingKey); var identityKeyPair = new IdentityKeyPair(Base64.Decode(App.Handle.Store.IdentityKeyPair)); try { // I'm not sure where which parameter goes... // but it failes when the QR code is to old, so the first two are propably correct... await App.Handle.AccountManager.AddDeviceAsync(toAdd.Uuid, toAdd.PublicKey, identityKeyPair, profileKey, code); } catch (libsignalservice.push.exceptions.NotFoundException) { // ToDo: Handle Divice not found } }The Android code doesn't do much more, besides enabling MultiDevice. Which I can't find anywhere...
Still nothing happens on my WindowsPhone when I scan its code. An error is also not raised (unless the QR code is to old).
You can also see the pullrequest #232
I noticed that you forked this lost (but not archived yet) Signal-Sharp project/solution too (12 month ago). But why the issues disabled (on your side)?
I think the whole solution "refresh" needed. I mean including the sub-projects (protocol, metadata, etc.) into your solution. The goal is some additional debugging...
Also you may to "pseudo-port" (automatically convert) Android's original solution from Java to C#.... After it, compare data models, api calls, etc...
I disabled it because I didn't want to maintain the project, I don't mind to makeing some pull requestes when I have time but maintaining a messenger, I just don't have the time :(