Fix compression setting for encryption of files

This commit is contained in:
Dominik Schürmann 2014-08-10 20:27:34 +02:00
parent 65fd0de7e1
commit 1abae04cda

View File

@ -264,24 +264,27 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
// fill values for this action
Bundle data = new Bundle();
int compressionId;
if (isContentMessage()) {
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_BYTES);
data.putByteArray(KeychainIntentService.ENCRYPT_MESSAGE_BYTES, mMessage.getBytes());
compressionId = Preferences.getPreferences(this).getDefaultMessageCompression();
} else {
data.putInt(KeychainIntentService.SOURCE, KeychainIntentService.IO_URIS);
data.putParcelableArrayList(KeychainIntentService.ENCRYPT_INPUT_URIS, mInputUris);
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_URIS);
data.putParcelableArrayList(KeychainIntentService.ENCRYPT_OUTPUT_URIS, mOutputUris);
compressionId = Preferences.getPreferences(this).getDefaultFileCompression();
}
data.putInt(KeychainIntentService.ENCRYPT_COMPRESSION_ID, compressionId);
// Always use armor for messages
data.putBoolean(KeychainIntentService.ENCRYPT_USE_ASCII_ARMOR, mUseArmor || isContentMessage());
// TODO: Only default compression right now...
int compressionId = Preferences.getPreferences(this).getDefaultMessageCompression();
data.putInt(KeychainIntentService.ENCRYPT_COMPRESSION_ID, compressionId);
if (isModeSymmetric()) {
Log.d(Constants.TAG, "Symmetric encryption enabled!");
String passphrase = mPassphrase;