Installer IntentFilters must also match on host and port

Without this rule, two https:// URLs with the same path and APK name would
both match.  With multiple repo and swap support, this could easily happen.
This commit is contained in:
Hans-Christoph Steiner 2016-06-01 22:00:48 +02:00
parent 738a92f5d2
commit 07cadd862a

View File

@ -300,6 +300,7 @@ public abstract class Installer {
intentFilter.addAction(Installer.ACTION_INSTALL_INTERRUPTED);
intentFilter.addAction(Installer.ACTION_INSTALL_USER_INTERACTION);
intentFilter.addDataScheme(uri.getScheme());
intentFilter.addDataAuthority(uri.getHost(), String.valueOf(uri.getPort()));
intentFilter.addDataPath(uri.getPath(), PatternMatcher.PATTERN_LITERAL);
return intentFilter;
}