mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-16 15:02:54 +00:00
Enable sharing text to Aegis
This commit is contained in:
parent
85e230c46a
commit
5bb32a982b
3 changed files with 20 additions and 2 deletions
|
@ -493,12 +493,28 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
}
|
||||
break;
|
||||
case Intent.ACTION_SEND:
|
||||
uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
if (uri != null) {
|
||||
if (intent.hasExtra(Intent.EXTRA_STREAM)) {
|
||||
uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
intent.setAction(null);
|
||||
intent.removeExtra(Intent.EXTRA_STREAM);
|
||||
startDecodeQrCodeImages(Collections.singletonList(uri));
|
||||
}
|
||||
if (intent.hasExtra(Intent.EXTRA_TEXT)) {
|
||||
String stringExtra = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
intent.setAction(null);
|
||||
intent.removeExtra(Intent.EXTRA_TEXT);
|
||||
|
||||
GoogleAuthInfo info;
|
||||
try {
|
||||
info = GoogleAuthInfo.parseUri(stringExtra);
|
||||
} catch (GoogleAuthInfoException e) {
|
||||
Dialogs.showErrorDialog(this, R.string.unable_to_process_shared_text, e);
|
||||
break;
|
||||
}
|
||||
|
||||
VaultEntry entry = new VaultEntry(info);
|
||||
startEditEntryActivityForNew(CODE_ADD_ENTRY, entry);
|
||||
}
|
||||
break;
|
||||
case Intent.ACTION_SEND_MULTIPLE:
|
||||
List<Uri> uris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue