Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c227c2f1 authored by Christopher Tate's avatar Christopher Tate Committed by syphyr
Browse files

Verify all possible hosts that match web nav

Even if an <intent-filter> matches non-web schemes in addition to http
or https, make sure to include its cited hosts in the autoVerify
evaluation.

Bug: 150038428
Test: atest OsHostTests#testIntentFilterHostValidation
Change-Id: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
Merged-In: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
(cherry picked from commit 1fba0f89)
(cherry picked from commit a481c86c)
parent 0cd8f186
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -15610,7 +15610,9 @@ public class PackageManagerService extends IPackageManager.Stub {
                final int verificationId = mIntentFilterVerificationToken++;
                final int verificationId = mIntentFilterVerificationToken++;
                for (PackageParser.Activity a : pkg.activities) {
                for (PackageParser.Activity a : pkg.activities) {
                    for (ActivityIntentInfo filter : a.intents) {
                    for (ActivityIntentInfo filter : a.intents) {
                        if (filter.handlesWebUris(true) && needsNetworkVerificationLPr(filter)) {
                        // Run verification against hosts mentioned in any web-nav intent filter,
                        // even if the filter matches non-web schemes as well
                        if (filter.handlesWebUris(false) && needsNetworkVerificationLPr(filter)) {
                            if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG,
                            if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG,
                                    "Verification needed for IntentFilter:" + filter.toString());
                                    "Verification needed for IntentFilter:" + filter.toString());
                            mIntentFilterVerifier.addOneIntentFilterVerification(
                            mIntentFilterVerifier.addOneIntentFilterVerification(