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): Hide Shop tag near the more button #2758

Closed
3 tasks done
ILoveOpenSourceApplications opened this issue Feb 21, 2024 · 25 comments
Closed
3 tasks done

feat (YouTube): Hide Shop tag near the more button #2758

ILoveOpenSourceApplications opened this issue Feb 21, 2024 · 25 comments
Labels
Feature request Requesting a new feature that's not implemented yet

Comments

@ILoveOpenSourceApplications
Copy link
Contributor

Feature description

There's already a patch which hides the shopping links in video description, but as a residue there's still the Shop tag which remains on the video.

The Shop tag:

Screenshot_20240221_185200_YouTube

Motivation

Hiding it can be a part of the Hide Shopping Links in Video Description patch which then removes all remains of a shopping link ever being there in the description in the first place.

Acknowledgements

  • This issue is not a duplicate of an existing feature request.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
@ILoveOpenSourceApplications ILoveOpenSourceApplications added the Feature request Requesting a new feature that's not implemented yet label Feb 21, 2024
@oSumAtrIX
Copy link
Member

This won't happen unless we know how to modify Litho components properly. The view is flattened and not worth the effort to figure out just to hide this.

@oSumAtrIX oSumAtrIX closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2024
@ILoveOpenSourceApplications
Copy link
Contributor Author

It would have been nice but if it's a task which is too difficult, I understand.

@ILoveOpenSourceApplications
Copy link
Contributor Author

@LisoUseInAIKyrios, can the method you mentioned in this comment be used to hide this component?
image

@LisoUseInAIKyrios
Copy link
Contributor

Possibly. Someone would need to spend time to research it.

@ILoveOpenSourceApplications
Copy link
Contributor Author

Research if this method of hiding is possible or not/ if this metadata_badgewill hide it or not?

@LisoUseInAIKyrios
Copy link
Contributor

Research if that litho component has a custom android class that backs it. Android Studio layout inspector can be used for that (must also patch with Enable Android debugging). If there is any Android layout names or classes with the ui icon component, then can try to find where that is with JadX.

Want to help? 🙂

@ILoveOpenSourceApplications
Copy link
Contributor Author

Is this something a novice can do without any background knowledge?

@LisoUseInAIKyrios
Copy link
Contributor

No coding skills are needed. It's a matter of trying to identify where UI components are loaded in the code and it's more time consuming than skill related.

@ILoveOpenSourceApplications
Copy link
Contributor Author

No coding skills are needed. It's a matter of trying to identify where UI components are loaded in the code and it's more time consuming than skill related.

Okay. Is there a guide which I can follow for this? If so, when I have time, I'll try giving it a shot.

@LisoUseInAIKyrios
Copy link
Contributor

There probably is guides for Android layout inspector. But for jadx it's more of figuring it out. Maybe there is some dev skills for this.

@ILoveOpenSourceApplications
Copy link
Contributor Author

Am I doing something wrong here or is this as far as I can go?
Screenshot 2024-04-28 150306

@LisoUseInAIKyrios
Copy link
Contributor

That looks as far as you can go. The shop button must be entirely litho without any custom classes.

@ILoveOpenSourceApplications
Copy link
Contributor Author

So that means hiding it is impossoble or possible?

@LisoUseInAIKyrios
Copy link
Contributor

hiding using the strategy I mentioned that you quoted seems unlikely.

@ILoveOpenSourceApplications
Copy link
Contributor Author

hiding using the strategy I mentioned that you quoted seems unlikely.

Ah, I see. Any new strategies available which we can try?

@LisoUseInAIKyrios
Copy link
Contributor

LisoUseInAIKyrios commented Apr 28, 2024

Hook onto the litho code that loads/draws image from resources in the apk, and selectively hide if the image is yt_bag_outline.

@ILoveOpenSourceApplications
Copy link
Contributor Author

Hook onto the litho code that loads/draws image from resources in the apk, and selectively hide if the image is yt_bag_outline.

So the normal logcat method and capture which litho has the bufferstring yt_bag_outline in it?

@LisoUseInAIKyrios
Copy link
Contributor

No, I meant adding a new patch hook where litho is loading image resources (or where those image resources are drawn to screen).

@ILoveOpenSourceApplications
Copy link
Contributor Author

04-28 15:32:37.251  8481 14233 D revanced: LithoFilterPatch: Searching ID: null Path: video_metadata.eml|2989a5833b66f5b9|video_metadata_inner.eml|f705d32e61523ab9|CellType|ContainerType|ContainerType|ContainerType|video_subtitle.eml|4e63b22e4c3b9aae|TextType| BufferStrings: 3.9M views11 days agoShop...moreΓ¥Ö...moreΓ¥Ösans-serif-mediumΓ¥Ö3.9M views  11d ago   Shop  ...moreΓ¥Öyt_outline_bag_black_24Γ¥Ösans-serif-mediumΓ¥Ösans-serif-regularΓ¥Ösans-serif-regularΓ¥Ösans-serif-regularΓ¥Ösans-serif-regularΓ¥Ösans-serif-regularΓ¥Ö

@ILoveOpenSourceApplications
Copy link
Contributor Author

No, I meant adding a new patch hook where litho is loading image resources (or where those image resources are drawn to screen).

So implementing a new method for hiding such components.

@LisoUseInAIKyrios
Copy link
Contributor

I tried selectively filtering only when yt_outline_bag_ is present (it shows up 3 or 4 times), but it belongs to the entire subtitle text. So selectively hiding always hides the entire subtitle string.

Looking at this closer, not only is there an icon but there is also the word 'Shop'. So unless the 'shop' text is part of the icon layout component (seems unlikely), then hiding the shop icon and the word 'shop' is not possible since 'Shop' is a localized word. The only option is to selectively pick out localized text (and include every localized variant) and also hide the icon. Seems too fragile, and there is no existing hooks for any of this either.

@ILoveOpenSourceApplications
Copy link
Contributor Author

Welp, it was a worth a shot.

@oSumAtrIX
Copy link
Member

Litho seems to support accessibility options/ screen readers ,(such as the app "Developer Assistant" from Play Store):

Screenshot_20240428-135201

Evidently the view group has been flattened by Yoga to a view meaning that there's no way to edit it unless we figure out how using the Litho methods to edit it and trigger a rerender works.

An other method is to modify the YouTube /player response. This response should include metadata such as if the video has this Shopping stuff. It could perhaps also be returned as a Litho buffer, but all this needs more reversing.

@ILoveOpenSourceApplications
Copy link
Contributor Author

Just saw that @inotia00 implemented a patch to hide this.
Integrations:inotia00/revanced-integrations@ee4f543

@ILoveOpenSourceApplications
Copy link
Contributor Author

Just saw that @inotia00 implemented a patch to hide this. Integrations:inotia00/revanced-integrations@ee4f543

@LisoUseInAIKyrios, is this an applicable solution to this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Requesting a new feature that's not implemented yet
Projects
None yet
Development

No branches or pull requests

3 participants