Change default GZIP behavior on Base64.decode(String).
Remove only reference to Base64.decode(byte[]).master
parent
03cbee0277
commit
14557d3dc1
|
@ -1,34 +0,0 @@
|
|||
/**
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.thoughtcrime.securesms.mms;
|
||||
|
||||
import org.thoughtcrime.securesms.util.Base64;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class TextTransport {
|
||||
|
||||
public byte[] getDecodedMessage(byte[] encodedMessageBytes) throws IOException {
|
||||
return Base64.decode(encodedMessageBytes);
|
||||
}
|
||||
|
||||
public byte[] getEncodedMessage(byte[] messageWithMac) {
|
||||
return Base64.encodeBytes(messageWithMac).getBytes();
|
||||
}
|
||||
}
|
|
@ -1232,8 +1232,8 @@ public class Base64
|
|||
|
||||
|
||||
/**
|
||||
* Decodes data from Base64 notation, automatically
|
||||
* detecting gzip-compressed data and decompressing it.
|
||||
* Signal modified:
|
||||
* Decodes data from Base64 notation, it does not detect gzip-compressed data.
|
||||
*
|
||||
* @param s the string to decode
|
||||
* @return the decoded data
|
||||
|
@ -1241,7 +1241,9 @@ public class Base64
|
|||
* @since 1.4
|
||||
*/
|
||||
public static byte[] decode( String s ) throws java.io.IOException {
|
||||
return decode( s, NO_OPTIONS );
|
||||
// Signal: We never use gzip, avoid trying to unzip.
|
||||
// return decode( s, NO_OPTIONS );
|
||||
return decode( s, DONT_GUNZIP );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue