mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-24 07:58:50 -05:00
Fix share to encrypt text
This commit is contained in:
parent
7d41800e57
commit
d73ea5f612
@ -452,27 +452,11 @@ public class EncryptFileActivity extends DrawerActivity implements EncryptActivi
|
||||
* Android's Action
|
||||
*/
|
||||
|
||||
// When sending to OpenKeychain Encrypt via share menu
|
||||
if (Intent.ACTION_SEND.equals(action) && type != null) {
|
||||
// When sending to OpenKeychain Encrypt via share menu
|
||||
/* if ("text/plain".equals(type)) {
|
||||
// TODO handle, maybe forward to "encrypt text" activity?
|
||||
|
||||
Plain text
|
||||
String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
if (sharedText != null) {
|
||||
// handle like normal text encryption, override action and extras to later
|
||||
// executeServiceMethod ACTION_ENCRYPT_TEXT in main actions
|
||||
extras.putString(EXTRA_TEXT, sharedText);
|
||||
extras.putBoolean(EXTRA_ASCII_ARMOR, true);
|
||||
action = ACTION_ENCRYPT_TEXT;
|
||||
}
|
||||
|
||||
} else */
|
||||
{
|
||||
// Files via content provider, override uri and action
|
||||
uris.clear();
|
||||
uris.add(intent.<Uri>getParcelableExtra(Intent.EXTRA_STREAM));
|
||||
}
|
||||
// Files via content provider, override uri and action
|
||||
uris.clear();
|
||||
uris.add(intent.<Uri>getParcelableExtra(Intent.EXTRA_STREAM));
|
||||
}
|
||||
|
||||
if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null) {
|
||||
|
@ -409,16 +409,29 @@ public class EncryptTextActivity extends DrawerActivity implements EncryptActivi
|
||||
private void handleActions(Intent intent) {
|
||||
String action = intent.getAction();
|
||||
Bundle extras = intent.getExtras();
|
||||
// Should always be text/plain
|
||||
// String type = intent.getType();
|
||||
ArrayList<Uri> uris = new ArrayList<Uri>();
|
||||
String type = intent.getType();
|
||||
|
||||
if (extras == null) {
|
||||
extras = new Bundle();
|
||||
}
|
||||
|
||||
if (intent.getData() != null) {
|
||||
uris.add(intent.getData());
|
||||
/*
|
||||
* Android's Action
|
||||
*/
|
||||
|
||||
// When sending to OpenKeychain Encrypt via share menu
|
||||
if (Intent.ACTION_SEND.equals(action) && type != null) {
|
||||
// When sending to OpenKeychain Encrypt via share menu
|
||||
if ("text/plain".equals(type)) {
|
||||
String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
if (sharedText != null) {
|
||||
// handle like normal text encryption, override action and extras to later
|
||||
// executeServiceMethod ACTION_ENCRYPT_TEXT in main actions
|
||||
extras.putString(EXTRA_TEXT, sharedText);
|
||||
action = ACTION_ENCRYPT_TEXT;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
String textData = extras.getString(EXTRA_TEXT);
|
||||
|
Loading…
Reference in New Issue
Block a user