Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't check if intent is declared by app before launch #17571

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Nov 20, 2024

What does the pull request do?

In general, on newer android apps, Google recommends that any intent an app will launch be declared at build time in the apps manifest. Apps then check availability of app that can handle that intent before launching. This avoids having to write exception handlers to catch failed intents.
This works fine for normal apps with limited scope. But for a general purpose app framework like Avalonia, it limits the types of applications it can create. File managers, browsers and text editors may not know at build time all the possible intents a Uri could support. In this case, simply starting the intent, catching any exception that may be thrown from missing activities and hoping the user has an app to handle it is more preferable.

For security reasons, it's still recommended for apps to declare intents they use when they can.

What is the current behavior?

What is the updated/expected behavior with this PR?

No longer try to resolve whether an intent can be handled by an activity, but instead try to start an activity anyway and catch expected errors from wrong intents or missing activity.

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #17265

@emmauss emmauss requested a review from maxkatz6 November 20, 2024 15:16
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053481-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added bug os-android backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Nov 20, 2024
@maxkatz6 maxkatz6 added this pull request to the merge queue Nov 20, 2024
Merged via the queue into master with commit 9beefa3 Nov 20, 2024
12 checks passed
@maxkatz6 maxkatz6 deleted the android_launch_uri branch November 20, 2024 21:40
@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Launch URIs on Android without declaring intent queries
3 participants