mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-05-22 13:54:19 +00:00
parent
8cd8016c3d
commit
88ea61e28f
@ -61,6 +61,7 @@ import java.nio.channels.Channels;
|
|||||||
import java.nio.channels.ClosedChannelException;
|
import java.nio.channels.ClosedChannelException;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.nio.channels.FileLock;
|
import java.nio.channels.FileLock;
|
||||||
|
import java.security.SecureRandom;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -244,8 +245,8 @@ public class SignalAccount implements Closeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void clearAllPreKeys() {
|
private void clearAllPreKeys() {
|
||||||
this.preKeyIdOffset = 0;
|
this.preKeyIdOffset = new SecureRandom().nextInt(Medium.MAX_VALUE);
|
||||||
this.nextSignedPreKeyId = 0;
|
this.nextSignedPreKeyId = new SecureRandom().nextInt(Medium.MAX_VALUE);
|
||||||
this.preKeyStore.removeAllPreKeys();
|
this.preKeyStore.removeAllPreKeys();
|
||||||
this.signedPreKeyStore.removeAllSignedPreKeys();
|
this.signedPreKeyStore.removeAllSignedPreKeys();
|
||||||
save();
|
save();
|
||||||
@ -1020,6 +1021,7 @@ public class SignalAccount implements Closeable {
|
|||||||
this.lastReceiveTimestamp = 0;
|
this.lastReceiveTimestamp = 0;
|
||||||
save();
|
save();
|
||||||
|
|
||||||
|
clearAllPreKeys();
|
||||||
getSessionStore().archiveAllSessions();
|
getSessionStore().archiveAllSessions();
|
||||||
senderKeyStore.deleteAll();
|
senderKeyStore.deleteAll();
|
||||||
final var recipientId = getRecipientStore().resolveRecipientTrusted(getSelfAddress());
|
final var recipientId = getRecipientStore().resolveRecipientTrusted(getSelfAddress());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user