Skip to content

Commit b61a65a

Browse files
fix(YouTube - Hide Shorts components): Fix hiding of untoggled components
1 parent 37d16d7 commit b61a65a

File tree

1 file changed

+18
-3
lines changed
  • extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components

1 file changed

+18
-3
lines changed

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/ShortsFilter.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public final class ShortsFilter extends Filter {
4444
private final ByteArrayFilterGroup shortsCompactFeedVideoBuffer;
4545
private final StringFilterGroup useSoundButton;
4646
private final ByteArrayFilterGroup useSoundButtonBuffer;
47+
private final StringFilterGroup useTemplateButton;
48+
private final ByteArrayFilterGroup useTemplateButtonBuffer;
4749

4850
private final StringFilterGroup subscribeButton;
4951
private final StringFilterGroup joinButton;
@@ -187,6 +189,16 @@ public ShortsFilter() {
187189
"yt_outline_camera_"
188190
);
189191

192+
useTemplateButton = new StringFilterGroup(
193+
Settings.HIDE_SHORTS_USE_TEMPLATE_BUTTON,
194+
REEL_METAPANEL_PATH
195+
);
196+
197+
useTemplateButtonBuffer = new ByteArrayFilterGroup(
198+
null,
199+
"yt_outline_template_add_"
200+
);
201+
190202
videoActionButton = new StringFilterGroup(
191203
null,
192204
// Can be simply 'button.eml', 'shorts_video_action_button.eml' or 'reel_action_button.eml'
@@ -195,8 +207,7 @@ public ShortsFilter() {
195207

196208
suggestedAction = new StringFilterGroup(
197209
null,
198-
"suggested_action.eml",
199-
REEL_METAPANEL_PATH
210+
"suggested_action.eml"
200211
);
201212

202213
addPathCallbacks(
@@ -267,7 +278,7 @@ public ShortsFilter() {
267278
"yt_outline_dollar_sign_heart_"
268279
),
269280
new ByteArrayFilterGroup(
270-
Settings.HIDE_SHORTS_USE_TEMPLATE_BUTTON,
281+
Settings.HIDE_SHORTS_TEMPLATE_BUTTON,
271282
"yt_outline_template_add_"
272283
),
273284
new ByteArrayFilterGroup(
@@ -317,6 +328,10 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff
317328
return useSoundButtonBuffer.check(protobufBufferArray).isFiltered();
318329
}
319330

331+
if (matchedGroup == useTemplateButton) {
332+
return useTemplateButtonBuffer.check(protobufBufferArray).isFiltered();
333+
}
334+
320335
if (matchedGroup == shortsCompactFeedVideo) {
321336
return shouldHideShortsFeedItems() && shortsCompactFeedVideoBuffer.check(protobufBufferArray).isFiltered();
322337
}

0 commit comments

Comments
 (0)