From 6ea89a08920250822857200acd3f6d447ef589ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 15 Oct 2015 16:48:24 +0200 Subject: Open decrypted application/pgp-keys only in OpenKeychain --- .../org/sufficientlysecure/keychain/ui/DecryptListFragment.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java index 13838e77c..4bce76beb 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java @@ -378,8 +378,8 @@ public class DecryptListFragment // noinspection deprecation, this should be called from Context, but not available in minSdk icon = getResources().getDrawable(R.drawable.ic_chat_black_24dp); } else if (ClipDescription.compareMimeTypes(type, "application/pgp-keys")) { - // noinspection deprecation, this should be called from Context, but not available in minSdk - icon = getResources().getDrawable(R.drawable.ic_key_plus_grey600_24dp); + // noinspection deprecation, this should be called from Context, but not available in minSdk + icon = getResources().getDrawable(R.drawable.ic_key_plus_grey600_24dp); } else if (ClipDescription.compareMimeTypes(type, "image/*")) { int px = FormattingUtils.dpToPx(context, 32); Bitmap bitmap = FileHelper.getThumbnail(context, outputUri, new Point(px, px)); @@ -533,6 +533,11 @@ public class DecryptListFragment } else { intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(outputUri, metadata.getMimeType()); + + if ("application/pgp-keys".equals(metadata.getMimeType())) { + // bind Intent to this OpenKeychain, don't allow other apps to intercept here! + intent.setPackage(getActivity().getPackageName()); + } } intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); -- cgit v1.2.3