Enable sharing text to Aegis

This commit is contained in:
elena 2022-08-11 21:32:33 +01:00
parent 85e230c46a
commit 5bb32a982b
3 changed files with 20 additions and 2 deletions

View file

@ -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);