mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Fix saving username link components
This commit is contained in:
parent
9f6b6cb657
commit
e78146eb67
2 changed files with 23 additions and 4 deletions
|
@ -1128,7 +1128,7 @@
|
|||
"allDeclaredFields":true,
|
||||
"queryAllDeclaredMethods":true,
|
||||
"queryAllDeclaredConstructors":true,
|
||||
"methods":[{"name":"<init>","parameterTypes":["int","java.lang.String","boolean","java.lang.String","java.lang.String","java.lang.String","int","boolean","java.lang.String","org.asamk.signal.manager.storage.SignalAccount$Storage$AccountData","org.asamk.signal.manager.storage.SignalAccount$Storage$AccountData","java.lang.String","java.lang.String","java.lang.String","java.lang.String"] }, {"name":"aciAccountData","parameterTypes":[] }, {"name":"deviceId","parameterTypes":[] }, {"name":"encryptedDeviceName","parameterTypes":[] }, {"name":"isMultiDevice","parameterTypes":[] }, {"name":"number","parameterTypes":[] }, {"name":"password","parameterTypes":[] }, {"name":"pinMasterKey","parameterTypes":[] }, {"name":"pniAccountData","parameterTypes":[] }, {"name":"profileKey","parameterTypes":[] }, {"name":"registered","parameterTypes":[] }, {"name":"registrationLockPin","parameterTypes":[] }, {"name":"serviceEnvironment","parameterTypes":[] }, {"name":"storageKey","parameterTypes":[] }, {"name":"username","parameterTypes":[] }, {"name":"version","parameterTypes":[] }]
|
||||
"methods":[{"name":"<init>","parameterTypes":["int","java.lang.String","boolean","java.lang.String","java.lang.String","java.lang.String","int","boolean","java.lang.String","org.asamk.signal.manager.storage.SignalAccount$Storage$AccountData","org.asamk.signal.manager.storage.SignalAccount$Storage$AccountData","java.lang.String","java.lang.String","java.lang.String","java.lang.String"] }, {"name":"<init>","parameterTypes":["int","java.lang.String","boolean","java.lang.String","java.lang.String","java.lang.String","int","boolean","java.lang.String","org.asamk.signal.manager.storage.SignalAccount$Storage$AccountData","org.asamk.signal.manager.storage.SignalAccount$Storage$AccountData","java.lang.String","java.lang.String","java.lang.String","java.lang.String","java.lang.String","java.lang.String"] }, {"name":"aciAccountData","parameterTypes":[] }, {"name":"deviceId","parameterTypes":[] }, {"name":"encryptedDeviceName","parameterTypes":[] }, {"name":"isMultiDevice","parameterTypes":[] }, {"name":"number","parameterTypes":[] }, {"name":"password","parameterTypes":[] }, {"name":"pinMasterKey","parameterTypes":[] }, {"name":"pniAccountData","parameterTypes":[] }, {"name":"profileKey","parameterTypes":[] }, {"name":"registered","parameterTypes":[] }, {"name":"registrationLockPin","parameterTypes":[] }, {"name":"serviceEnvironment","parameterTypes":[] }, {"name":"storageKey","parameterTypes":[] }, {"name":"username","parameterTypes":[] }, {"name":"usernameLinkEntropy","parameterTypes":[] }, {"name":"usernameLinkServerId","parameterTypes":[] }, {"name":"version","parameterTypes":[] }]
|
||||
},
|
||||
{
|
||||
"name":"org.asamk.signal.manager.storage.SignalAccount$Storage$AccountData",
|
||||
|
@ -2383,6 +2383,13 @@
|
|||
"queryAllDeclaredMethods":true,
|
||||
"queryAllDeclaredConstructors":true
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.push.ConfirmUsernameResponse",
|
||||
"allDeclaredFields":true,
|
||||
"queryAllDeclaredMethods":true,
|
||||
"queryAllDeclaredConstructors":true,
|
||||
"methods":[{"name":"<init>","parameterTypes":["java.lang.String","java.util.UUID"] }, {"name":"<init>","parameterTypes":["java.lang.String","java.util.UUID","int","kotlin.jvm.internal.DefaultConstructorMarker"] }]
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.push.DeviceCode",
|
||||
"allDeclaredFields":true,
|
||||
|
@ -2722,6 +2729,10 @@
|
|||
"name":"org.whispersystems.signalservice.internal.storage.protos.AccountRecord$PinnedConversation$Contact",
|
||||
"fields":[{"name":"e164_"}, {"name":"serviceId_"}, {"name":"uuid_"}]
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.storage.protos.AccountRecord$UsernameLink",
|
||||
"allDeclaredFields":true
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.storage.protos.ContactRecord",
|
||||
"allDeclaredFields":true
|
||||
|
|
|
@ -102,6 +102,7 @@ import java.util.Comparator;
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
@ -499,7 +500,10 @@ public class SignalAccount implements Closeable {
|
|||
e);
|
||||
}
|
||||
}
|
||||
|
||||
if (storage.usernameLinkEntropy != null && storage.usernameLinkServerId != null) {
|
||||
usernameLink = new UsernameLinkComponents(base64.decode(storage.usernameLinkEntropy),
|
||||
UUID.fromString(storage.usernameLinkServerId));
|
||||
}
|
||||
}
|
||||
|
||||
if (migratedLegacyConfig) {
|
||||
|
@ -964,7 +968,9 @@ public class SignalAccount implements Closeable {
|
|||
registrationLockPin,
|
||||
pinMasterKey == null ? null : base64.encodeToString(pinMasterKey.serialize()),
|
||||
storageKey == null ? null : base64.encodeToString(storageKey.serialize()),
|
||||
profileKey == null ? null : base64.encodeToString(profileKey.serialize()));
|
||||
profileKey == null ? null : base64.encodeToString(profileKey.serialize()),
|
||||
usernameLink == null ? null : base64.encodeToString(usernameLink.getEntropy()),
|
||||
usernameLink == null ? null : usernameLink.getServerId().toString());
|
||||
try {
|
||||
try (var output = new ByteArrayOutputStream()) {
|
||||
// Write to memory first to prevent corrupting the file in case of serialization errors
|
||||
|
@ -1853,7 +1859,9 @@ public class SignalAccount implements Closeable {
|
|||
String registrationLockPin,
|
||||
String pinMasterKey,
|
||||
String storageKey,
|
||||
String profileKey
|
||||
String profileKey,
|
||||
String usernameLinkEntropy,
|
||||
String usernameLinkServerId
|
||||
) {
|
||||
|
||||
public record AccountData(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue