mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Store account file version after migration
This commit is contained in:
parent
a25043e5d4
commit
9d534dc7bb
1 changed files with 5 additions and 1 deletions
|
@ -509,6 +509,8 @@ public class SignalAccount implements Closeable {
|
||||||
rootNode = jsonProcessor.readTree(Channels.newInputStream(fileChannel));
|
rootNode = jsonProcessor.readTree(Channels.newInputStream(fileChannel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var migratedLegacyConfig = false;
|
||||||
|
|
||||||
if (rootNode.hasNonNull("version")) {
|
if (rootNode.hasNonNull("version")) {
|
||||||
var accountVersion = rootNode.get("version").asInt(1);
|
var accountVersion = rootNode.get("version").asInt(1);
|
||||||
if (accountVersion > CURRENT_STORAGE_VERSION) {
|
if (accountVersion > CURRENT_STORAGE_VERSION) {
|
||||||
|
@ -517,6 +519,9 @@ public class SignalAccount implements Closeable {
|
||||||
throw new IOException("Config file was created by a no longer supported older version!");
|
throw new IOException("Config file was created by a no longer supported older version!");
|
||||||
}
|
}
|
||||||
previousStorageVersion = accountVersion;
|
previousStorageVersion = accountVersion;
|
||||||
|
if (accountVersion < CURRENT_STORAGE_VERSION) {
|
||||||
|
migratedLegacyConfig = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
number = Utils.getNotNullNode(rootNode, "username").asText();
|
number = Utils.getNotNullNode(rootNode, "username").asText();
|
||||||
|
@ -616,7 +621,6 @@ public class SignalAccount implements Closeable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var migratedLegacyConfig = false;
|
|
||||||
final var legacySignalProtocolStore = rootNode.hasNonNull("axolotlStore")
|
final var legacySignalProtocolStore = rootNode.hasNonNull("axolotlStore")
|
||||||
? jsonProcessor.convertValue(Utils.getNotNullNode(rootNode, "axolotlStore"),
|
? jsonProcessor.convertValue(Utils.getNotNullNode(rootNode, "axolotlStore"),
|
||||||
LegacyJsonSignalProtocolStore.class)
|
LegacyJsonSignalProtocolStore.class)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue