mirror of
https://github.com/signalapp/libsignal.git
synced 2026-05-11 17:36:25 +02:00
Remove SessionState from Java interface
With https://github.com/signalapp/Signal-Android-Private/pull/1279 merged, Android no longer uses SessionState
This commit is contained in:
@@ -215,7 +215,6 @@ public final class Native {
|
||||
public static native byte[] SessionRecord_GetRemoteIdentityKeyPublic(long handle);
|
||||
public static native int SessionRecord_GetRemoteRegistrationId(long handle);
|
||||
public static native byte[] SessionRecord_GetSenderChainKeyValue(long handle);
|
||||
public static native long SessionRecord_GetSessionState(long sessionRecord);
|
||||
public static native int SessionRecord_GetSessionVersion(long handle);
|
||||
public static native boolean SessionRecord_HasSenderChain(long handle);
|
||||
public static native long SessionRecord_InitializeAliceSession(long identityKeyPrivate, long identityKeyPublic, long basePrivate, long basePublic, long theirIdentityKey, long theirSignedPrekey, long theirRatchetKey);
|
||||
@@ -223,12 +222,6 @@ public final class Native {
|
||||
public static native long SessionRecord_NewFresh();
|
||||
public static native byte[] SessionRecord_Serialize(long handle);
|
||||
|
||||
public static native long SessionState_Deserialize(byte[] data);
|
||||
public static native void SessionState_Destroy(long handle);
|
||||
public static native int SessionState_GetSessionVersion(long handle);
|
||||
public static native boolean SessionState_HasSenderChain(long handle);
|
||||
public static native byte[] SessionState_Serialized(long handle);
|
||||
|
||||
public static native long SignalMessage_Deserialize(byte[] data);
|
||||
public static native void SignalMessage_Destroy(long handle);
|
||||
public static native byte[] SignalMessage_GetBody(long handle);
|
||||
|
||||
@@ -44,9 +44,8 @@ public class SessionRecord {
|
||||
}
|
||||
|
||||
/**
|
||||
* Move the current {@link SessionState} into the list of "previous" session states, and replace
|
||||
* the current {@link org.whispersystems.libsignal.state.SessionState} with a fresh reset
|
||||
* instance.
|
||||
* Move the current SessionState into the list of "previous" session states, and replace
|
||||
* the current SessionState with a fresh reset instance.
|
||||
*/
|
||||
public void archiveCurrentState() {
|
||||
Native.SessionRecord_ArchiveCurrentState(this.handle);
|
||||
@@ -98,10 +97,6 @@ public class SessionRecord {
|
||||
|
||||
// Following functions are for internal or testing use and may be removed in the future:
|
||||
|
||||
public SessionState getSessionState() {
|
||||
return new SessionState(Native.SessionRecord_GetSessionState(this.handle));
|
||||
}
|
||||
|
||||
public byte[] getReceiverChainKeyValue(ECPublicKey senderEphemeral) {
|
||||
return Native.SessionRecord_GetReceiverChainKeyValue(
|
||||
this.handle, senderEphemeral.nativeHandle());
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
||||
*
|
||||
* Licensed according to the LICENSE file in this repository.
|
||||
*/
|
||||
|
||||
package org.whispersystems.libsignal.state;
|
||||
|
||||
import org.signal.client.internal.Native;
|
||||
import java.io.IOException;
|
||||
|
||||
public class SessionState {
|
||||
private long handle;
|
||||
|
||||
@Override
|
||||
protected void finalize() {
|
||||
Native.SessionState_Destroy(this.handle);
|
||||
}
|
||||
|
||||
public SessionState(byte[] serialized) throws IOException {
|
||||
this.handle = Native.SessionState_Deserialize(serialized);
|
||||
}
|
||||
|
||||
SessionState(long handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
// Used by Android
|
||||
public int getSessionVersion() {
|
||||
return Native.SessionState_GetSessionVersion(this.handle);
|
||||
}
|
||||
|
||||
// Used by Android
|
||||
public boolean hasSenderChain() {
|
||||
return Native.SessionState_HasSenderChain(this.handle);
|
||||
}
|
||||
|
||||
public byte[] serialize() {
|
||||
return Native.SessionState_Serialized(this.handle);
|
||||
}
|
||||
|
||||
long nativeHandle() {
|
||||
return this.handle;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user