mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-24 19:56:00 +00:00
Support for multi-device.
1) In addition to the Recipient interface, there is now RecipientDevice. A Recipient can have multiple corresponding RecipientDevices. All addressing is done to a Recipient, but crypto sessions and transport delivery are done to RecipientDevice. 2) The Push transport handles the discovery and session setup of additional Recipient devices. 3) Some internal rejiggering of Groups.
This commit is contained in:
@@ -67,12 +67,10 @@ public class IdentityDatabase extends Database {
|
||||
}
|
||||
|
||||
public boolean isValidIdentity(MasterSecret masterSecret,
|
||||
Recipient recipient,
|
||||
long recipientId,
|
||||
IdentityKey theirIdentity)
|
||||
{
|
||||
SQLiteDatabase database = databaseHelper.getReadableDatabase();
|
||||
String number = recipient.getNumber();
|
||||
long recipientId = DatabaseFactory.getAddressDatabase(context).getCanonicalAddress(number);
|
||||
MasterCipher masterCipher = new MasterCipher(masterSecret);
|
||||
Cursor cursor = null;
|
||||
|
||||
@@ -114,11 +112,9 @@ public class IdentityDatabase extends Database {
|
||||
}
|
||||
}
|
||||
|
||||
public void saveIdentity(MasterSecret masterSecret, Recipient recipient, IdentityKey identityKey)
|
||||
public void saveIdentity(MasterSecret masterSecret, long recipientId, IdentityKey identityKey)
|
||||
{
|
||||
SQLiteDatabase database = databaseHelper.getWritableDatabase();
|
||||
String number = recipient.getNumber();
|
||||
long recipientId = DatabaseFactory.getAddressDatabase(context).getCanonicalAddress(number);
|
||||
MasterCipher masterCipher = new MasterCipher(masterSecret);
|
||||
String identityKeyString = Base64.encodeBytes(identityKey.serialize());
|
||||
String macString = Base64.encodeBytes(masterCipher.getMacFor(recipientId +
|
||||
|
||||
Reference in New Issue
Block a user