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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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!");
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user