From 1abae04cda368409b54c7b3d0b3b8401040ef39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 10 Aug 2014 20:27:34 +0200 Subject: Fix compression setting for encryption of files --- .../org/sufficientlysecure/keychain/ui/EncryptActivity.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 94f828b48..ab26d539a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -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; -- cgit v1.2.3