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

feat(YouTube): Bump compatibility to 18.37.36 #3028

Merged
merged 9 commits into from
Sep 27, 2023
Merged

Conversation

oSumAtrIX
Copy link
Member

@oSumAtrIX oSumAtrIX commented Sep 25, 2023

Depends on ReVanced/revanced-integrations#483

TODO

  • Remember video quality: Fix class cast exception (likely offset issue)
  • Return YouTube Dislike: Failing fingerprint TextComponentAtomicReferenceFingerprint
  • Return YouTube Dislike: Add support for new shorts player UI (dislikes do not appear in shorts)
  • Return YouTube Dislike: Fix shorts player not showing dislikes on first video loaded Edit: problem is unrelated to 18.37.36
  • Disable auto captions: Fix patching null pointer exception
  • Hide endscreen cards: Failing fingerprint LayoutIconFingerprint
  • Hide Shorts components: Add support for new shorts UI components (patch does not function)

@oSumAtrIX oSumAtrIX marked this pull request as draft September 25, 2023 15:16
…37.36` -- Needs additional fix for new shorts UI, and needs small fix for old layout too (first short opened does not show dislikes) --
@LisoUseInAIKyrios
Copy link

I partially fixed RYD and it works with regular videos.

But, it's broken with Shorts in two ways:

  1. The shorts UI now is different. The existing shorts layout patch points are not called, and layout inspector shows the shorts buttons are now litho component hosts. That means both RYD and the hide shorts patch needs updates.
  2. When spoofing to 18.20.39 or older, the old shorts layout is used and dislikes are displayed, but for some reason it doesn't show dislikes on the first short loaded. It's fetching the dislikes correctly, but somewhere after that it's getting confused and ignoring the dislike fetch. I have not looked into why it's doing this, but this did not happen previously.

@oSumAtrIX
Copy link
Member Author

shorts layout patch

Do you mean the Hide Shorts components patch? In case the buttons are now built by Litho, we should be able to filter them using the Litho filter patch. Do they appear in the logs?

That means both RYD...

If the shorts dislike button is built by Litho, a TextSpec component should be used for the "Dislike" label. This means the same hook can be used as the normal player dislike button to filter the correct TextSpec component using the path builder object.

@LisoUseInAIKyrios
Copy link

Do you mean the Hide Shorts components patch? In case the buttons are now built by Litho, we should be able to filter them using the Litho filter patch. Do they appear in the logs?

Yes hide shorts components. No I haven't checked the litho logs yet.

If the shorts dislike button is built by Litho, a TextSpec component should be used for the "Dislike" label. This means the same hook can be used as the normal player dislike button to filter the correct TextSpec component using the path builder object.

I haven't checked that either. If it is possible to fix that way, hopefully it doesn't block the video playback or cause the UI to be unresponsive. Will try later.

@oSumAtrIX
Copy link
Member Author

I have confirmed that the shorts components now show up in the logs and can be blocked, I'll push a fix for them but constrain the compatibility of this patch to the latest version to get rid of legacy code.

@LisoUseInAIKyrios
Copy link

Would it make sense to keep the legacy code for app spoofing? If the patch later acts up could remove it then, but right now it still works.

@oSumAtrIX
Copy link
Member Author

Alright, I'll try to keep it.

@oSumAtrIX
Copy link
Member Author

@LisoUseInAIKyrios It may be possible to filter properly through protobufBufferArray. The abstract class Filter has two fields:

image

But this class is missing a field for ByteArrayFilterGroupList. Is there a specific reason for this?
Also, the inline docs say:

If you have more than 1 filter patterns, then all instances of this class should filtered using {@link ByteArrayFilterGroupList#check(byte[])},

Do you mean filter patterns in the sense of ByteArrayAsStringFilterGroup or the actual filters inside that group? If I have two or more ByteArrayAsStringFilterGroup, should ByteArrayFilterGroupList#check(byte[]) be used in this case, or when I have ByteArrayAsStringFilterGroup with multiple filters?

@LisoUseInAIKyrios
Copy link

LisoUseInAIKyrios commented Sep 26, 2023

But this class is missing a field for ByteArrayFilterGroupList. Is there a specific reason for this?

The abstract class group lists are always searched for, all the time, for every litho item.

The buffer can contain free form text which includes user comments, video descriptions, and more. So it's theoretically possible to match bogus text if the buffer is always searched for each litho item without first checking if the identifier/path is correct. There's also performance issues with always searching the buffer, because the buffer can get enormous in some situations and the overhead is noticable.

Surely there must be an identifier or path that can be matched first, and then the buffer is searched inside the patch? That way its certain the buffer is for the item in question, and performance is good because it's only searching the buffer when needed (and most importantly, no false matches on comments or other junk). The patch would have it's own byte filter list that it searches after an identifier/path is matched (like how the hide actions buttons patch works. It has its own buffer search that is checked only after an action button identifier/path is matched).

If I have two or more ByteArrayAsStringFilterGroup, should ByteArrayFilterGroupList#check(byte[]) be used in this case, or when I have ByteArrayAsStringFilterGroup with multiple filter

Both cases should use ByteArrayFilterGroupList#check(byte[])

If there is more than 1 pattern (regardless if it's in a single group or multiple groups), then it should always be filtered using a group list. The individual FilterGroup#check() should only be used if there is a single pattern to search for (an example is the hide mix playlist patch, which uses one group with just 1 pattern).

@oSumAtrIX
Copy link
Member Author

All todos are now ticked. I am not yet entirely sure about the spoof to old version issue as I was not able to reproduce it with the latest commits. Once you give me the green light with ReVanced/revanced-integrations#483 (comment) we should be able to merge.

@LisoUseInAIKyrios
Copy link

There's a new small issue with the new shorts player that's caused by the way litho text is patched.

Since the creating and updating of litho components blocks until the RYD fetch is completed, occasionally shorts will either:

  • show a frozen video while the audio plays (happens most often on the first short opened on cold start)
  • video and audio plays correctly, but the UI momentarily is not shown and the UI is unresponsive until RYD fetch completes

A possible fix is to handle this the same way as the old native shorts buttons: get a reference to the dislike litho button on creation, don't block the litho thread, and then update the dislike button asynchronously after RYD fetch completes.

For now a temporary fix is to spoof to 18.20.39 which uses the old shorts player.

@oSumAtrIX
Copy link
Member Author

Does the video desync with audio or sync after the request is finished? If it desyncs, it may be better to set a shorter timeout.

@LisoUseInAIKyrios
Copy link

When the video unfreezes its in sync with the audio and everything is ok.

Previously RYD had this same issue before it was changed to handle shorts asynchronously. So the old issue is basically back but now it's with litho.

@oSumAtrIX
Copy link
Member Author

Unfortunately, we do not know any hook that would allow us to get a reference that we can pass via a callback to the future to edit the text, so this is gonna be a limitation.

@LisoUseInAIKyrios
Copy link

I can't find any noticeable differences between 18.37.36 and the current target version.

Could merge this after dev to main is merged, so this change will have more time on dev branch before it's eventually merged to main.

@oSumAtrIX
Copy link
Member Author

Each patch is constrained to versions. The patches with issues can remain as is (as long as they are compatible with all the previous versions) while the other working patches can be bumped. This branch can then be merged to dev and main. ReVanced Manager will continue to suggest the current version as most patches support it, while being able to patch the latest version either including the patches that do not yet work reliably (toggling in the settings) or without them (default).

@LisoUseInAIKyrios
Copy link

Ok sure. I can't find any other issues and I guess this is ready to go now.

@oSumAtrIX
Copy link
Member Author

I've been also testing this version and it works fine, I can personally not reproduce blocking thread issue, but I suppose it occurs on slow networks. Once I'm home, I'll append the new compatible version to the annotation field and merge

@oSumAtrIX
Copy link
Member Author

RYD patch lost compatibility with the current supported version. Either we have to revert the changes for RYD patch in this PR or we have to constrain it to the currently working version (with the present issue).

@LisoUseInAIKyrios
Copy link

The current issue won't be fixed anytime soon (add support to alter litho asynchronously).

The app can be spoofed to 18.20.39 and that fixes any RYD shorts issues.

I think keep the RYD changes and merge.

@oSumAtrIX oSumAtrIX marked this pull request as ready for review September 27, 2023 23:28
@oSumAtrIX oSumAtrIX merged commit eda28e5 into dev Sep 27, 2023
revanced-bot pushed a commit that referenced this pull request Sep 27, 2023
@oSumAtrIX oSumAtrIX deleted the feat/yt_18.37.36 branch September 27, 2023 23:49
@cyberboh
Copy link

Missing something:

INFO: Decoding app manifest
WARNING: Player flyout menu is incompatible with version 18.37.36. This patch is only compatible with version com.google.android.youtube: 18.16.37, 18.19.35, 18.20.39, 18.23.35, 18.29.38, 18.32.39

@LisoUseInAIKyrios
Copy link

@cyberboh will be fixed in next dev release. Use -f flag to force patching for now.

revanced-bot pushed a commit that referenced this pull request Oct 4, 2023
# [2.191.0](ReVanced/revanced-patches@v2.190.0...v2.191.0) (2023-10-04)

### Bug Fixes

* Add hooks to existing hook set ([5655067](ReVanced/revanced-patches@5655067))
* **Duolingo - Unlock Super:** Get correct instruction offset ([#3023](ReVanced/revanced-patches#3023)) ([5146de8](ReVanced/revanced-patches@5146de8))
* **Google Recorder - Remove device restrictions:** Clarify limitation ([094f57b](ReVanced/revanced-patches@094f57b))
* **Infinity for Reddit - Spoof client:** Constrain patch to last working versions ([#2944](ReVanced/revanced-patches#2944)) ([ee975de](ReVanced/revanced-patches@ee975de))
* **Relay - Spoof client:** Restore OAuth login ([96e01f7](ReVanced/revanced-patches@96e01f7))
* **Slide - Spoof client:** Use correct patch name ([f355dbf](ReVanced/revanced-patches@f355dbf))
* **Sync for Reddit:** Do not throw an error when not necessary ([ef644e4](ReVanced/revanced-patches@ef644e4))
* **TikTok - Hide ads:** Constrain to last working version ([56e45a6](ReVanced/revanced-patches@56e45a6))
* **Twitch - Audio ads:** Support missing version `16.1.0` ([#2928](ReVanced/revanced-patches#2928)) ([688d8fa](ReVanced/revanced-patches@688d8fa))
* Use consistent toggle description ([#2983](ReVanced/revanced-patches#2983)) ([ceaa512](ReVanced/revanced-patches@ceaa512))
* Use correct instruction ([246cf2c](ReVanced/revanced-patches@246cf2c))
* **YouTube - Client spoof:** adjust settings text ([#3035](ReVanced/revanced-patches#3035)) ([59a2e96](ReVanced/revanced-patches@59a2e96))
* **YouTube - Client spoof:** Display seekbar thumbnails in high quality ([5e8a2d3](ReVanced/revanced-patches@5e8a2d3))
* **YouTube - Client spoof:** Do not record feed videos to history by default ([#3017](ReVanced/revanced-patches#3017)) ([5ccbf1b](ReVanced/revanced-patches@5ccbf1b))
* **YouTube - Client spoof:** Removed unused code ([#3030](ReVanced/revanced-patches#3030)) ([15e27bf](ReVanced/revanced-patches@15e27bf))
* **YouTube - Client spoof:** Restore seekbar thumbnails ([bf4a115](ReVanced/revanced-patches@bf4a115))
* **YouTube - Client spoof:** Show seekbar thumbnail for age restricted and paid videos ([1a79300](ReVanced/revanced-patches@1a79300))
* **YouTube - Custom filter:** Use new lines between components instead of commas ([#2952](ReVanced/revanced-patches#2952)) ([ecb2e32](ReVanced/revanced-patches@ecb2e32))
* **YouTube - Hide "Load more" button:** Use correct names ([569c3cd](ReVanced/revanced-patches@569c3cd))
* **YouTube - Hide info cards:** Fix info cards not hiding for some users ([#3039](ReVanced/revanced-patches#3039)) ([cb38637](ReVanced/revanced-patches@cb38637))
* **YouTube - Hide layout components:** Always hide redundant 'player audio track' button ([#2951](ReVanced/revanced-patches#2951)) ([ca632bd](ReVanced/revanced-patches@ca632bd))
* **YouTube - Hide shorts components:** Fix hiding navigation bar ([2de51e6](ReVanced/revanced-patches@2de51e6))
* **YouTube - Premium heading:** Correct inverted logic ([#3042](ReVanced/revanced-patches#3042)) ([b33ed75](ReVanced/revanced-patches@b33ed75))
* **YouTube - ReturnYouTubeDislike:** Revert support for 18.37.36 ([#3041](ReVanced/revanced-patches#3041)) ([3761073](ReVanced/revanced-patches@3761073))
* **YouTube - SponsorBlock:** Adjust import/export UI text ([#3063](ReVanced/revanced-patches#3063)) ([4e5513e](ReVanced/revanced-patches@4e5513e))
* **YouTube - Video Id:** Fix video id not showing the currently playing video ([#3038](ReVanced/revanced-patches#3038)) ([f6f226b](ReVanced/revanced-patches@f6f226b))
* **YouTube:** Restore functionality of `Old video quality menu` and `Custom speeds` on tablets ([#2999](ReVanced/revanced-patches#2999)) ([238bed1](ReVanced/revanced-patches@238bed1))

### Features

* Add notice for thumbnails for age restricted or paid videos ([f7cf70b](ReVanced/revanced-patches@f7cf70b))
* **Duolingo:** Remove `Unlock Duolingo Super` patch ([b4b9746](ReVanced/revanced-patches@b4b9746))
* **SPB Serviceportal Bund:** Add `Remove root detection` patch ([#3049](ReVanced/revanced-patches#3049)) ([481bf58](ReVanced/revanced-patches@481bf58))
* **Strava:** Add `Disable subscription suggestions` patch ([#2997](ReVanced/revanced-patches#2997)) ([af02175](ReVanced/revanced-patches@af02175))
* **Sync for Reddit - Client spoof:** Restore upload functionality ([9344c8a](ReVanced/revanced-patches@9344c8a))
* **TikTok - Hide ads:** Constrain to last working version ([516e8a1](ReVanced/revanced-patches@516e8a1))
* **TU Dortmund:** Add `Show on lockscreen` patch ([#2947](ReVanced/revanced-patches#2947)) ([9a18326](ReVanced/revanced-patches@9a18326))
* **Tumblr:** Add `Disable blog notification reminder` patch ([29f19b9](ReVanced/revanced-patches@29f19b9))
* **Tumblr:** Add `Disable dashboard ads` patch ([#2979](ReVanced/revanced-patches#2979)) ([07c267a](ReVanced/revanced-patches@07c267a))
* **Tumblr:** Add `Disable gift message popup` patch ([a4d6b4e](ReVanced/revanced-patches@a4d6b4e))
* **Tumblr:** Add `Disable in-app update` patch ([#3058](ReVanced/revanced-patches#3058)) ([5e8076b](ReVanced/revanced-patches@5e8076b))
* **Tumblr:** Add `Disable Tumblr Live` patch ([#2987](ReVanced/revanced-patches#2987)) ([bf1f9dc](ReVanced/revanced-patches@bf1f9dc))
* **Twitch - Block embedded ads:** Switch from `ttv.lol` to `luminous.dev` ([0fe115e](ReVanced/revanced-patches@0fe115e))
* Use properties file for `Client spoof` patches ([e5d548c](ReVanced/revanced-patches@e5d548c))
* **YouTube - Hide layout components:** Hide "Join" button ([1b71f89](ReVanced/revanced-patches@1b71f89))
* **YouTube - Hide layout components:** Hide "Notify me" button ([3027c15](ReVanced/revanced-patches@3027c15))
* **YouTube - Hide layout components:** Hide search result shelf header ([f4eda8c](ReVanced/revanced-patches@f4eda8c))
* **YouTube - Hide layout components:** Hide timed reactions ([d0a775d](ReVanced/revanced-patches@d0a775d))
* **YouTube - Premium heading:** Allow using default heading ([#3029](ReVanced/revanced-patches#3029)) ([d5ab35a](ReVanced/revanced-patches@d5ab35a))
* **YouTube - Spoof app version:** add version 18.20.39 ([#3001](ReVanced/revanced-patches#3001)) ([f14c5e7](ReVanced/revanced-patches@f14c5e7))
* **YouTube:** Add `Bypass URL redirects` patch ([125cac5](ReVanced/revanced-patches@125cac5))
* **YouTube:** Bump compatibility to `18.37.36` ([#3028](ReVanced/revanced-patches#3028)) ([eda28e5](ReVanced/revanced-patches@eda28e5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants