From b678d83afd9cc2b2423696cd015688e3f1d23b78 Mon Sep 17 00:00:00 2001 From: fkloft Date: Mon, 4 Nov 2013 18:09:00 +0100 Subject: [PATCH] Set exported to "false" again and include a fix for wrong PackageManager queries --- mobile/AndroidManifest.xml | 2 +- .../src/com/cradle/iitc_mobile/share/IntentListView.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index f63e3dae..93066966 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -100,7 +100,7 @@ android:name=".share.SendToClipboard" android:enabled="true" android:excludeFromRecents="true" - android:exported="true" + android:exported="false" android:icon="@drawable/copy" android:label="@string/activity_share_to_clipboard" android:noHistory="false"> diff --git a/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java b/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java index 621f023c..235701bf 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java +++ b/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java @@ -152,11 +152,19 @@ public class IntentListView extends ListView { ResolveInfo info = activityList.get(i); ActivityInfo activity = info.activityInfo; + // fix bug in PackageManager - a replaced package name might cause non-exported intents to appear + if (activity.exported == false && !activity.packageName.equals(packageName)) { + activityList.remove(i); + i--; + continue; + } + // remove all IITCm intents, except for SendToClipboard in case Drive is not installed if (activity.packageName.equals(packageName)) { if (hasCopyIntent || !activity.name.equals(SendToClipboard.class.getCanonicalName())) { activityList.remove(i); i--; + continue; } } }