Move API around a little, eliminate TransportDetails interface.

This commit is contained in:
Moxie Marlinspike
2014-11-08 13:37:57 -08:00
parent cafe03a70a
commit ae178fc4ec
18 changed files with 22 additions and 88 deletions

View File

@@ -1,5 +1,6 @@
/**
* Copyright (C) 2011 Whisper Systems
* Copyright (C) 2014 Open Whisper Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,29 +19,15 @@ package org.thoughtcrime.securesms.mms;
import java.io.IOException;
import org.whispersystems.textsecure.crypto.TransportDetails;
import org.whispersystems.textsecure.util.Base64;
public class TextTransport implements TransportDetails {
public class TextTransport {
@Override
public byte[] getDecodedMessage(byte[] encodedMessageBytes) throws IOException {
return Base64.decode(encodedMessageBytes);
}
@Override
public byte[] getEncodedMessage(byte[] messageWithMac) {
return Base64.encodeBytes(messageWithMac).getBytes();
}
@Override
public byte[] getPaddedMessageBody(byte[] messageBody) {
return messageBody;
}
@Override
public byte[] getStrippedPaddingMessageBody(byte[] messageWithPadding) {
return messageWithPadding;
}
}