private static boolean allParsePushIntentReceiversInternal() { Iterator localIterator = ManifestInfo.getIntentReceivers(new String[] { "com.parse.push.intent.RECEIVE", "com.parse.push.intent.DELETE", "com.parse.push.intent.OPEN" }).iterator(); while (localIterator.hasNext()) { if (nextactivityInfo.exported) { return false; } } return true; }
/** * Checks that each of the receivers associated with the three actions defined in * ParsePushBroadcastReceiver (ACTION_PUSH_RECEIVE, ACTION_PUSH_OPEN, ACTION_PUSH_DELETE) has * their exported attributes set to false. If this is the case for each of the receivers * registered in the AndroidManifest.xml or if no receivers are registered (because we will be * registering the default implementation of ParsePushBroadcastReceiver in PushService) then true * is returned. Note: the reason for iterating through lists, is because you can define different * receivers in the manifest that respond to the same intents and both all of the receivers will * be triggered. So we want to make sure all them have the exported attribute set to false. */ private static boolean allParsePushIntentReceiversInternal() { List<ResolveInfo> intentReceivers = ManifestInfo.getIntentReceivers( ParsePushBroadcastReceiver.ACTION_PUSH_RECEIVE, ParsePushBroadcastReceiver.ACTION_PUSH_DELETE, ParsePushBroadcastReceiver.ACTION_PUSH_OPEN); for (ResolveInfo resolveInfo : intentReceivers) { if (resolveInfo.activityInfo.exported) { return false; } } return true; }