From 2e2a9bc967399b6adc353b1b34d3c7ed981e68f4 Mon Sep 17 00:00:00 2001 From: Miroojin Bakshi Date: Fri, 7 Mar 2014 21:16:58 +0530 Subject: [PATCH] Add option for sharing encrypted file. --- .../keychain/ui/EncryptActivity.java | 11 +++++++++++ .../src/main/res/layout/encrypt_activity.xml | 13 +++++++++++++ OpenPGP-Keychain/src/main/res/values/strings.xml | 2 ++ 3 files changed, 26 insertions(+) diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java index faac9b157..88a29cee9 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -108,6 +108,7 @@ public class EncryptActivity extends DrawerActivity { private EditText mFilename = null; private CheckBox mDeleteAfter = null; + private CheckBox mShareAfter = null; private BootstrapButton mBrowse = null; private String mInputFilename = null; @@ -650,6 +651,15 @@ public class EncryptActivity extends DrawerActivity { .newInstance(mInputFilename); deleteFileDialog.show(getSupportFragmentManager(), "deleteDialog"); } + + if (mShareAfter.isChecked()) { + // Share encrypted file + Intent sendFileIntent = new Intent(Intent.ACTION_SEND); + sendFileIntent.setType("*/*"); + sendFileIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(mOutputFilename)); + startActivity(Intent.createChooser(sendFileIntent, + getString(R.string.title_send_file))); + } break; default: @@ -809,6 +819,7 @@ public class EncryptActivity extends DrawerActivity { } mDeleteAfter = (CheckBox) findViewById(R.id.deleteAfterEncryption); + mShareAfter = (CheckBox) findViewById(R.id.shareAfterEncryption); mAsciiArmor = (CheckBox) findViewById(R.id.asciiArmour); mAsciiArmor.setChecked(Preferences.getPreferences(this).getDefaultAsciiArmour()); diff --git a/OpenPGP-Keychain/src/main/res/layout/encrypt_activity.xml b/OpenPGP-Keychain/src/main/res/layout/encrypt_activity.xml index 27e29eddb..419a8f2ad 100644 --- a/OpenPGP-Keychain/src/main/res/layout/encrypt_activity.xml +++ b/OpenPGP-Keychain/src/main/res/layout/encrypt_activity.xml @@ -285,6 +285,19 @@ android:text="@string/label_delete_after_encryption" /> + + + + + Change Passphrase Set Passphrase "Send Mail…" + "Send File…" Encrypt To File Decrypt To File Import Keys @@ -110,6 +111,7 @@ Recipients Delete After Encryption Delete After Decryption + Share After Encryption Encryption Algorithm Hash Algorithm Public Key