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

refactor(Tumblr): Use a common filter patch #3018

Merged
merged 7 commits into from
Oct 1, 2023
Merged

Conversation

leumasme
Copy link

Depends on ReVanced/revanced-integrations#479

Previously, we blocked tumblr timeline objects by replacing their expected "object_type" string that is returned from the api.
This was suboptimal for a few reasons:

  • It created a lot of boilerplate with finding and replacing strings
  • It didn't completely remove the objects from the timeline, they just failed to parse so they were objects. These are not visible, but still reserve space when the timeline is initially created, leading to layout shifting which was visible if the blocked timeline object was in view right away.

This PR adds a Timeline Filter Patch, which

  • Injects a call to the integration filter method in Timeline and PostsResponse which are used for the front page and the blog view (clicking on a blog to see only posts from this block) respectively.
  • Presents a addObjectTypeFilter(typename: String) method which injects the equivalent of
    if ("$typename".equals(elementType)) iterator.remove()
    into the integration filter function.

The two patches DisableTumblrLivePatch and DisableDashboardAdsPatch patch have also been updated to use the new timeline filtering.

Additionally, more blocked ad post types were added to DisableDashboardAds since some ads were still visible
Wait, why are some patch file names suffixed with Patch and some are not? I guess I will just leave it like this.

@oSumAtrIX oSumAtrIX changed the title feat(Tumblr): add timeline filter patch feat(Tumblr): Add timeline filter integrations Sep 23, 2023
@oSumAtrIX oSumAtrIX changed the title feat(Tumblr): Add timeline filter integrations feat(Tumblr): Add timeline filter Sep 23, 2023
@oSumAtrIX oSumAtrIX changed the title feat(Tumblr): Add timeline filter fix(Tumblr): Remove residues in layout from removing ads Sep 23, 2023
Copy link
Author

@leumasme leumasme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oSumAtrIX The refactor in your latest commit (oops, looks like I accidentally made a general review instead of against the lines I had selected) does not work. The two added instructions used different registers (p1 / p2) because the argument we need is in different positions in the two fingerprinted methods.

@oSumAtrIX
Copy link
Member

@leumasme Instead of an array you can map the fingerprints to the correct register and then use it in the forEach loop.

@leumasme
Copy link
Author

Made it work again and updated the injection method as requested. Should be ready to merge (together with the integrations pr).

@oSumAtrIX oSumAtrIX changed the title fix(Tumblr): Remove residues in layout from removing ads refactor(Tumblr): Use a common filter patch Oct 1, 2023
@oSumAtrIX oSumAtrIX merged commit 9b30c4b into ReVanced:dev Oct 1, 2023
1 check passed
Copy link
Author

@leumasme leumasme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oSumAtrIX This PR does not work anymore with the changes you added before merging. It currently fails both in apply-patch stage and in app-launch stage.

validcube pushed a commit to validcube/revanced-patches that referenced this pull request Aug 6, 2024
validcube pushed a commit to validcube/revanced-patches that referenced this pull request Aug 6, 2024
# [4.7.0-dev.6](ReVanced/revanced-patches@v4.7.0-dev.5...v4.7.0-dev.6) (2024-04-12)

### Features

* **YouTube - Hide Shorts components:** Hide `Shop`, `Location` and `Save sound to playlist` buttons ([ReVanced#3018](ReVanced/revanced-patches#3018)) ([5210ac4](ReVanced/revanced-patches@5210ac4))
validcube pushed a commit to validcube/revanced-patches that referenced this pull request Aug 6, 2024
# [4.7.0](ReVanced/revanced-patches@v4.6.0...v4.7.0) (2024-04-21)

### Bug Fixes

* **Tumblr - Fix old versions:** Improve reliability by removing remnances of Tumblr Live  ([#2988](ReVanced/revanced-patches#2988)) ([897b4db](ReVanced/revanced-patches@897b4db))
* **YouTube - GmsCore support:** Prompt to disable battery optimizations, if not done already ([#2958](ReVanced/revanced-patches#2958)) ([82acb84](ReVanced/revanced-patches@82acb84))
* **YouTube - Hide ads:** rename `Hide paid content` to `Hide paid promotion label` ([#3026](ReVanced/revanced-patches#3026)) ([17e4ac9](ReVanced/revanced-patches@17e4ac9))
* **YouTube - Hide load more button:** Include patch with `Hide layout components`, and hide button only in search feed  ([#2959](ReVanced/revanced-patches#2959)) ([b007e8e](ReVanced/revanced-patches@b007e8e))
* **YouTube - Hide Shorts components:** Correctly hide Shorts if navigation tab is changed using device back button ([#3007](ReVanced/revanced-patches#3007)) ([e5848e9](ReVanced/revanced-patches@e5848e9))
* **YouTube - Player flyout menu:** Add hide Lock screen menu ([#2985](ReVanced/revanced-patches#2985)) ([308de4a](ReVanced/revanced-patches@308de4a))
* **YouTube - Spoof device dimensions:** Warn about potential performance issues ([ReVanced#3039](ReVanced/revanced-patches#3039)) ([9d6f305](ReVanced/revanced-patches@9d6f305))
* **YouTube Music - Remove upgrade button:** Fix compatibility with latest versions ([#3045](ReVanced/revanced-patches#3045)) ([80de996](ReVanced/revanced-patches@80de996))

### Features

* Add `Hex` patch ([#3034](ReVanced/revanced-patches#3034)) ([3c95aac](ReVanced/revanced-patches@3c95aac))
* **Amazon:** Add `Always allow deep-linking` patch ([#3000](ReVanced/revanced-patches#3000)) ([a92b7fb](ReVanced/revanced-patches@a92b7fb))
* **Strava - Unlock subscription:** Remove compatible version constraint ([80a5599](ReVanced/revanced-patches@80a5599))
* **Twitter:** Add `Sanitize sharing links` patch ([#3003](ReVanced/revanced-patches#3003)) ([186b887](ReVanced/revanced-patches@186b887))
* **YouTube - Hide layout components:** Add option to hide horizontal shelves ([ReVanced#2951](ReVanced/revanced-patches#2951)) ([9ae0650](ReVanced/revanced-patches@9ae0650))
* **YouTube - Hide layout components:** Hide playables ([8423515](ReVanced/revanced-patches@8423515))
* **YouTube - Hide Shorts components:** Hide `Shop`, `Location` and `Save sound to playlist` buttons ([ReVanced#3018](ReVanced/revanced-patches#3018)) ([5210ac4](ReVanced/revanced-patches@5210ac4))
* **YouTube - Hide Shorts components:** Hide tagged products, hide search suggestions ([#3019](ReVanced/revanced-patches#3019)) ([e0d2fe5](ReVanced/revanced-patches@e0d2fe5))
* **YouTube - Swipe controls:** Save and restore brightness and add auto-brightness toggle ([#2996](ReVanced/revanced-patches#2996)) ([f6c3bc4](ReVanced/revanced-patches@f6c3bc4))
* **YouTube:** Add 'About' preference to settings menu ([#2981](ReVanced/revanced-patches#2981)) ([5abf894](ReVanced/revanced-patches@5abf894))
* **YouTube:** Match overlay icons style to YouTube ([ReVanced#3023](ReVanced/revanced-patches#3023)) ([6849393](ReVanced/revanced-patches@6849393))
* **YouTube:** Support version `19.09.38`, `19.10.39` and `19.11.43` ([#2971](ReVanced/revanced-patches#2971)) ([730f3e3](ReVanced/revanced-patches@730f3e3))
* **YT Music - Hide 'Get Music Premium' label:** Remove occurences of label in settings ([#3046](ReVanced/revanced-patches#3046)) ([10e170a](ReVanced/revanced-patches@10e170a))
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