feat(YouTube): Introduce Litho text component and span filtering framework#1277
feat(YouTube): Introduce Litho text component and span filtering framework#1277ILoveOpenSourceApplications wants to merge 7 commits into
Conversation
|
@LisoUseInAIKyrios, don't know how testing this works but just letting you know that I haven't tested it. |
|
If possible I would like this to be a shared patch across YouTube and YouTube Music, but I don't know how much ground work would be needed for that. |
|
This patch could be useful to hide the annoying "save" button, in the contextual menu (3-dots) of a comment. |
e42f88a to
23f0c9f
Compare
0a1155c to
9d60cdb
Compare
9d60cdb to
1ec6590
Compare
| fun addSpanFilter(classDescriptor: String) { | ||
| helperMethodRef.get()!!.addInstructions( | ||
| 0, |
There was a problem hiding this comment.
TODO:
- Add at least one span filter to verify all this works.
- Figure out if we want to refactor common code from litho and span filters into shared classes (may not be worth the effort considering this code is now rarely changed) edit: For now skip this.
|
So does this make it easier to make patches |
…ing framework" This reverts commit f5e6736.
|
@ILoveOpenSourceApplications Any update about this PR? Seems interesting. |
|
Waiting on Liso and his to-do list, I don't think there's much from my end. |
|
todo list: #1277 (comment) We can skip refactoring into shared classes. This code is rarely touched and I think it may be more complex to share code for this. |
f0be5b8 to
a2c0681
Compare
Description
Code adapted from @inotia00 https://github.com/inotia00/revanced-patches/
Additional context
Adds a new patching framework to intercept and filter SpannableString operations within Litho-based UI components.
Key additions:
InclusiveSpanPatchandTextComponentPatchto inject bytecode hooks into YouTube's text component constructors and spans.Filter,FilterGroup,InclusiveSpanType) to conditionally hide or remove spans (e.g., ClickableSpan, ImageSpan) based on context.StringTrieSearchintegration for highly efficient, multi-threaded pattern matching against span text.Test results