Modify KeychainIntentService to support I/O with URIs, allow input and output to/from different types (eg. encrypt file and return byte array)

This commit is contained in:
mar-v-in
2014-06-08 21:30:11 +02:00
parent 90f9646f25
commit 08d63340c9
5 changed files with 109 additions and 176 deletions

View File

@@ -170,7 +170,7 @@ public class DecryptFileFragment extends DecryptFragment {
intent.setAction(KeychainIntentService.ACTION_DECRYPT_VERIFY);
// data
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.TARGET_URI);
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_FILE);
Log.d(Constants.TAG, "mInputFilename=" + mInputFilename + ", mOutputFilename="
+ mOutputFilename);

View File

@@ -129,7 +129,7 @@ public class DecryptMessageFragment extends DecryptFragment {
intent.setAction(KeychainIntentService.ACTION_DECRYPT_VERIFY);
// data
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.TARGET_BYTES);
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_BYTES);
data.putByteArray(KeychainIntentService.DECRYPT_CIPHERTEXT_BYTES, mCiphertext.getBytes());
data.putString(KeychainIntentService.DECRYPT_PASSPHRASE, passphrase);

View File

@@ -280,7 +280,7 @@ public class EncryptFileFragment extends Fragment {
// fill values for this action
Bundle data = new Bundle();
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.TARGET_URI);
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_FILE);
if (mEncryptInterface.isModeSymmetric()) {
Log.d(Constants.TAG, "Symmetric encryption enabled!");

View File

@@ -177,7 +177,7 @@ public class EncryptMessageFragment extends Fragment {
// fill values for this action
Bundle data = new Bundle();
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.TARGET_BYTES);
data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_BYTES);
String message = mMessage.getText().toString();