Reject opening intents with file data schemes.

This commit is contained in:
wolfbeast 2018-02-05 19:11:11 +01:00 committed by Roy Tam
commit ab541cba98

View file

@ -287,6 +287,12 @@ public final class IntentHelper implements GeckoEventListener,
return null;
}
final Uri data = intent.getData();
if (data != null && "file".equals(data.normalizeScheme().getScheme())) {
Log.w(LOGTAG, "Blocked intent with \"file://\" data scheme.");
return null;
}
// Only open applications which can accept arbitrary data from a browser.
intent.addCategory(Intent.CATEGORY_BROWSABLE);