mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-14 04:37:37 +00:00
Fix padding problem.
This commit is contained in:
@@ -32,7 +32,7 @@ public class PushTransportDetails implements TransportDetails {
|
||||
|
||||
@Override
|
||||
public byte[] getStrippedPaddingMessageBody(byte[] messageWithPadding) {
|
||||
if (messageVersion < 2) throw new AssertionError("Unknown version: " + messageVersion);
|
||||
if (messageVersion < 2) throw new AssertionError("Unknown version: " + messageVersion);
|
||||
else if (messageVersion == 2) return messageWithPadding;
|
||||
|
||||
int paddingStart = 0;
|
||||
@@ -47,7 +47,7 @@ public class PushTransportDetails implements TransportDetails {
|
||||
}
|
||||
}
|
||||
|
||||
byte[] strippedMessage = new byte[messageWithPadding.length - paddingStart];
|
||||
byte[] strippedMessage = new byte[paddingStart];
|
||||
System.arraycopy(messageWithPadding, 0, strippedMessage, 0, strippedMessage.length);
|
||||
|
||||
return strippedMessage;
|
||||
|
Reference in New Issue
Block a user