-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Improve NewPipe's sharing and fix crash when opening content in browser on some devices #5129
Conversation
thank you for the pull request! It looks like you messed up the git history. please drop 074987f and rebase your branch on our |
@TobiGr Done |
Does someone know where is the code to open links from descriptions and comments? I can't found it so my improvements aren't applied to those links. And also, how to apply they to the app update notification? |
Some OEMs changed the app chooser where there is not default browser, for example "com.huawei.android.internal.app" instead of "android" on EMUI devices. NewPipe crashed on those devices because it thinks that it's a browser. I catched the exception and I updated the comments to explain this.
…et on all devices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
Please open a separate PR for unrelated changes next time. That speeds the reviewing process up.
Update Invidious URL list in the manifest
Fix some typos
@TobiGr Changes applied |
Some OEMs changed the app chooser where there is not default browser, for example "com.huawei.android.internal.app" instead of "android" on EMUI devices. NewPipe crashed on those devices because it thinks that it's a browser. I catched the exception and I updated the comments to explain this.
…et on all devices
…R/NewPipe into fix-crash-open-in-browser
It seems like there is still something wrong with the commit history of this PR. |
@Stypox I'll look at this the next weekend |
@TiA4f8R don't worry, we have all been new to git once ;-) |
What is it?
Description of the changes in your PR
This PR fixes the crash when no browser is set as default on some devices (NewPipe thinks that the system app chooser is a browser because its package ID isn't "android" due to some OEM's system customizations) by catching the ActivityNotFound exception and uses the openInDefaultApp method. I also made improvements in NewPipe's sharing by trying to use Android's system share sheet instead of using OEM's share sheet (I used this last as a fallback if this first has been removed) and also made it for opening content in browser. Here is the difference between the original code and my changes (my device is an Honor 9X, running EMUI 10):
I also updated NewPipe's URLs (API and links in AboutActivity) with the new domain name.
Fixes the following issue(s)
Fixes #3925
APK testing
NewPipe fix-crash-open-in-browser.apk.zip
Due diligence
Important note: I am not an Android / Java developer so please be indulgent with me.