-
-
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
[YouTube] PoToken implementation with HtmlUnit #12027
base: dev
Are you sure you want to change the base?
Conversation
HtmlUnit is a Java library that simulates a very basic browser environment and executes JavaScript using Gecko
It seems the solution to the build issue is to disable Instant Run. |
What is the benefit of using HtmlUnit compared to the WebView? |
HtmlUnit would be a platform-independent solution that does not rely on the system webview. It could be an alternative for those phones where the WebView implementation is broken or results in invalid poTokens. However, this is mostly an experimental PR, since there are a few problems highlighted above with no clear solution, plus the HtmlUnit library would increase the APK size. |
The system webview is updatable starting with Android 5.0, so this PR might not be necessary. |
That is true in theory, but we all know device manufacturers tend to mess with default Android components more than they should... But yeah this might not be worth it. |
The WebView by Google is now Android 8.0+, so other devices are stuck with old WebViews and websites may break on them sooner or later. |
In that case, it might be a good idea to bump the app's minimum SDK version to 26. |
Personally I'm strongly against it, special for this app. |
What is it?
Description of the changes in your PR
This is an experimental PR that aims to provide an alternative
PoTokenProvider
implementation that does not rely on the system WebView. HtmlUnit is apparently able to simulate a browser well enough, and the generated poTokens work, however there are a couple of problems:minSdk
is increased to26
due to this issue. The APK built by this PR hasminSdk
increased to26
for testing purposes, but this is obviously not the solution.minifyEnabled
seems to create issues for release builds.APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Release APK built at commit 768db9f with
minifyEnabled=false
(otherwise it wouldn't build); it might be faster than the debug version: app-release.zipDue diligence