Compare commits

..

4 Commits

Author SHA1 Message Date
semantic-release-bot
674a5b8d29 chore: Release v5.29.0-dev.5 [skip ci]
# [5.29.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.29.0-dev.4...v5.29.0-dev.5) (2025-06-23)

### Bug Fixes

* **Google Photos:** Resolve startup crash for Android 5.0 devices ([7be3741](7be374100b))
2025-06-23 12:28:49 +00:00
LisoUseInAIKyrios
7be374100b fix(Google Photos): Resolve startup crash for Android 5.0 devices 2025-06-23 16:24:42 +04:00
semantic-release-bot
e48c152b95 chore: Release v5.29.0-dev.4 [skip ci]
# [5.29.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.29.0-dev.3...v5.29.0-dev.4) (2025-06-23)

### Bug Fixes

* **YouTube - Hide Shorts components:** Fix "Hide Use this sound button" ([#5233](https://github.com/ReVanced/revanced-patches/issues/5233)) ([a678f17](a678f178e1))
2025-06-23 09:33:13 +00:00
ILoveOpenSourceApplications
a678f178e1 fix(YouTube - Hide Shorts components): Fix "Hide Use this sound button" (#5233) 2025-06-23 13:29:53 +04:00
7 changed files with 61 additions and 26 deletions

View File

@@ -1,3 +1,17 @@
# [5.29.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.29.0-dev.4...v5.29.0-dev.5) (2025-06-23)
### Bug Fixes
* **Google Photos:** Resolve startup crash for Android 5.0 devices ([0294533](https://github.com/ReVanced/revanced-patches/commit/0294533c4d9a321aea086eedb4e46385ae9a026e))
# [5.29.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.29.0-dev.3...v5.29.0-dev.4) (2025-06-23)
### Bug Fixes
* **YouTube - Hide Shorts components:** Fix "Hide Use this sound button" ([#5233](https://github.com/ReVanced/revanced-patches/issues/5233)) ([5d6ec9e](https://github.com/ReVanced/revanced-patches/commit/5d6ec9e94a6221a0f32762d5bede893e9e7457fc))
# [5.29.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.29.0-dev.2...v5.29.0-dev.3) (2025-06-23) # [5.29.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.29.0-dev.2...v5.29.0-dev.3) (2025-06-23)

View File

@@ -19,7 +19,6 @@ import android.util.Pair;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.MalformedURLException; import java.net.MalformedURLException;
@@ -28,7 +27,6 @@ import java.util.Locale;
import app.revanced.extension.shared.requests.Requester; import app.revanced.extension.shared.requests.Requester;
import app.revanced.extension.shared.requests.Route; import app.revanced.extension.shared.requests.Route;
import app.revanced.extension.shared.Utils;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class GmsCoreSupport { public class GmsCoreSupport {
@@ -109,7 +107,6 @@ public class GmsCoreSupport {
/** /**
* Injection point. * Injection point.
*/ */
@RequiresApi(api = Build.VERSION_CODES.N)
public static void checkGmsCore(Activity context) { public static void checkGmsCore(Activity context) {
try { try {
// Verify the user has not included GmsCore for a root installation. // Verify the user has not included GmsCore for a root installation.
@@ -226,6 +223,11 @@ public class GmsCoreSupport {
* @return If GmsCore is not whitelisted from battery optimizations. * @return If GmsCore is not whitelisted from battery optimizations.
*/ */
private static boolean batteryOptimizationsEnabled(Context context) { private static boolean batteryOptimizationsEnabled(Context context) {
//noinspection ObsoleteSdkInt
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
// Android 5.0 does not have battery optimization settings.
return false;
}
var powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); var powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
return !powerManager.isIgnoringBatteryOptimizations(GMS_CORE_PACKAGE_NAME); return !powerManager.isIgnoringBatteryOptimizations(GMS_CORE_PACKAGE_NAME);
} }

View File

@@ -40,8 +40,10 @@ public final class ShortsFilter extends Filter {
private static WeakReference<PivotBar> pivotBarRef = new WeakReference<>(null); private static WeakReference<PivotBar> pivotBarRef = new WeakReference<>(null);
private final StringFilterGroup shortsCompactFeedVideoPath; private final StringFilterGroup shortsCompactFeedVideo;
private final ByteArrayFilterGroup shortsCompactFeedVideoBuffer; private final ByteArrayFilterGroup shortsCompactFeedVideoBuffer;
private final StringFilterGroup useSoundButton;
private final ByteArrayFilterGroup useSoundButtonBuffer;
private final StringFilterGroup subscribeButton; private final StringFilterGroup subscribeButton;
private final StringFilterGroup joinButton; private final StringFilterGroup joinButton;
@@ -49,11 +51,11 @@ public final class ShortsFilter extends Filter {
private final StringFilterGroup shelfHeader; private final StringFilterGroup shelfHeader;
private final StringFilterGroup suggestedAction; private final StringFilterGroup suggestedAction;
private final ByteArrayFilterGroupList suggestedActionsGroupList = new ByteArrayFilterGroupList(); private final ByteArrayFilterGroupList suggestedActionsBuffer = new ByteArrayFilterGroupList();
private final StringFilterGroup shortsActionBar; private final StringFilterGroup shortsActionBar;
private final StringFilterGroup actionButton; private final StringFilterGroup videoActionButton;
private final ByteArrayFilterGroupList videoActionButtonGroupList = new ByteArrayFilterGroupList(); private final ByteArrayFilterGroupList videoActionButtonBuffer = new ByteArrayFilterGroupList();
public ShortsFilter() { public ShortsFilter() {
// //
@@ -82,7 +84,7 @@ public final class ShortsFilter extends Filter {
// Path components. // Path components.
// //
shortsCompactFeedVideoPath = new StringFilterGroup(null, shortsCompactFeedVideo = new StringFilterGroup(null,
// Shorts that appear in the feed/search when the device is using tablet layout. // Shorts that appear in the feed/search when the device is using tablet layout.
"compact_video.eml", "compact_video.eml",
// 'video_lockup_with_attachment.eml' is shown instead of 'compact_video.eml' for some users // 'video_lockup_with_attachment.eml' is shown instead of 'compact_video.eml' for some users
@@ -174,7 +176,18 @@ public final class ShortsFilter extends Filter {
"reel_action_bar.eml" "reel_action_bar.eml"
); );
actionButton = new StringFilterGroup( useSoundButton = new StringFilterGroup(
Settings.HIDE_SHORTS_USE_SOUND_BUTTON,
"floating_action_button.eml",
REEL_METAPANEL_PATH
);
useSoundButtonBuffer = new ByteArrayFilterGroup(
null,
"yt_outline_camera_"
);
videoActionButton = new StringFilterGroup(
null, null,
// Can be simply 'button.eml', 'shorts_video_action_button.eml' or 'reel_action_button.eml' // Can be simply 'button.eml', 'shorts_video_action_button.eml' or 'reel_action_button.eml'
"button.eml" "button.eml"
@@ -186,16 +199,16 @@ public final class ShortsFilter extends Filter {
); );
addPathCallbacks( addPathCallbacks(
shortsCompactFeedVideoPath, joinButton, subscribeButton, paidPromotionButton, shortsCompactFeedVideo, joinButton, subscribeButton, paidPromotionButton,
shortsActionBar, suggestedAction, pausedOverlayButtons, channelBar, shortsActionBar, suggestedAction, pausedOverlayButtons, channelBar,
fullVideoLinkLabel, videoTitle, reelSoundMetadata, soundButton, infoPanel, fullVideoLinkLabel, videoTitle, useSoundButton, reelSoundMetadata, soundButton, infoPanel,
stickers, likeFountain, likeButton, dislikeButton stickers, likeFountain, likeButton, dislikeButton
); );
// //
// All other action buttons. // All other action buttons.
// //
videoActionButtonGroupList.addAll( videoActionButtonBuffer.addAll(
new ByteArrayFilterGroup( new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_COMMENTS_BUTTON, Settings.HIDE_SHORTS_COMMENTS_BUTTON,
"reel_comment_button", "reel_comment_button",
@@ -216,7 +229,7 @@ public final class ShortsFilter extends Filter {
// //
// Suggested actions. // Suggested actions.
// //
suggestedActionsGroupList.addAll( suggestedActionsBuffer.addAll(
new ByteArrayFilterGroup( new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_PREVIEW_COMMENT, Settings.HIDE_SHORTS_PREVIEW_COMMENT,
// Preview comment that can popup while a Short is playing. // Preview comment that can popup while a Short is playing.
@@ -242,10 +255,7 @@ public final class ShortsFilter extends Filter {
"yt_outline_bookmark_", "yt_outline_bookmark_",
// 'Save sound' button. It seems this has been removed and only 'Save music' is used. // 'Save sound' button. It seems this has been removed and only 'Save music' is used.
// Still hide this in case it's still present. // Still hide this in case it's still present.
"yt_outline_list_add_", "yt_outline_list_add_"
// 'Use this sound' button. It seems this has been removed and only 'Save music' is used.
// Still hide this in case it's still present.
"yt_outline_camera_"
), ),
new ByteArrayFilterGroup( new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_SEARCH_SUGGESTIONS, Settings.HIDE_SHORTS_SEARCH_SUGGESTIONS,
@@ -279,7 +289,7 @@ public final class ShortsFilter extends Filter {
} }
private boolean isEverySuggestedActionFilterEnabled() { private boolean isEverySuggestedActionFilterEnabled() {
for (ByteArrayFilterGroup group : suggestedActionsGroupList) { for (ByteArrayFilterGroup group : suggestedActionsBuffer) {
if (!group.isEnabled()) { if (!group.isEnabled()) {
return false; return false;
} }
@@ -297,15 +307,19 @@ public final class ShortsFilter extends Filter {
return path.startsWith(REEL_CHANNEL_BAR_PATH) || path.startsWith(REEL_METAPANEL_PATH); return path.startsWith(REEL_CHANNEL_BAR_PATH) || path.startsWith(REEL_METAPANEL_PATH);
} }
if (matchedGroup == shortsCompactFeedVideoPath) { if (matchedGroup == useSoundButton) {
return useSoundButtonBuffer.check(protobufBufferArray).isFiltered();
}
if (matchedGroup == shortsCompactFeedVideo) {
return shouldHideShortsFeedItems() && shortsCompactFeedVideoBuffer.check(protobufBufferArray).isFiltered(); return shouldHideShortsFeedItems() && shortsCompactFeedVideoBuffer.check(protobufBufferArray).isFiltered();
} }
// Video action buttons (comment, share, remix) have the same path. // Video action buttons (comment, share, remix) have the same path.
// Like and dislike are separate path filters and don't require buffer searching. // Like and dislike are separate path filters and don't require buffer searching.
if (matchedGroup == shortsActionBar) { if (matchedGroup == shortsActionBar) {
return actionButton.check(path).isFiltered() return videoActionButton.check(path).isFiltered()
&& videoActionButtonGroupList.check(protobufBufferArray).isFiltered(); && videoActionButtonBuffer.check(protobufBufferArray).isFiltered();
} }
if (matchedGroup == suggestedAction) { if (matchedGroup == suggestedAction) {
@@ -316,7 +330,7 @@ public final class ShortsFilter extends Filter {
return true; return true;
} }
return suggestedActionsGroupList.check(protobufBufferArray).isFiltered(); return suggestedActionsBuffer.check(protobufBufferArray).isFiltered();
} }
return true; return true;

View File

@@ -293,6 +293,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_SHORTS_SUPER_THANKS_BUTTON = new BooleanSetting("revanced_hide_shorts_super_thanks_button", TRUE); public static final BooleanSetting HIDE_SHORTS_SUPER_THANKS_BUTTON = new BooleanSetting("revanced_hide_shorts_super_thanks_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_TAGGED_PRODUCTS = new BooleanSetting("revanced_hide_shorts_tagged_products", TRUE); public static final BooleanSetting HIDE_SHORTS_TAGGED_PRODUCTS = new BooleanSetting("revanced_hide_shorts_tagged_products", TRUE);
public static final BooleanSetting HIDE_SHORTS_UPCOMING_BUTTON = new BooleanSetting("revanced_hide_shorts_upcoming_button", TRUE); public static final BooleanSetting HIDE_SHORTS_UPCOMING_BUTTON = new BooleanSetting("revanced_hide_shorts_upcoming_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_USE_SOUND_BUTTON = new BooleanSetting("revanced_hide_shorts_use_sound_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_USE_TEMPLATE_BUTTON = new BooleanSetting("revanced_hide_shorts_use_template_button", TRUE); public static final BooleanSetting HIDE_SHORTS_USE_TEMPLATE_BUTTON = new BooleanSetting("revanced_hide_shorts_use_template_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_VIDEO_TITLE = new BooleanSetting("revanced_hide_shorts_video_title", FALSE); public static final BooleanSetting HIDE_SHORTS_VIDEO_TITLE = new BooleanSetting("revanced_hide_shorts_video_title", FALSE);
public static final BooleanSetting SHORTS_AUTOPLAY = new BooleanSetting("revanced_shorts_autoplay", FALSE); public static final BooleanSetting SHORTS_AUTOPLAY = new BooleanSetting("revanced_shorts_autoplay", FALSE);

View File

@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
org.gradle.parallel = true org.gradle.parallel = true
android.useAndroidX = true android.useAndroidX = true
kotlin.code.style = official kotlin.code.style = official
version = 5.29.0-dev.3 version = 5.29.0-dev.5

View File

@@ -94,6 +94,7 @@ private val hideShortsComponentsResourcePatch = resourcePatch {
// Suggested actions. // Suggested actions.
SwitchPreference("revanced_hide_shorts_preview_comment"), SwitchPreference("revanced_hide_shorts_preview_comment"),
SwitchPreference("revanced_hide_shorts_save_sound_button"), SwitchPreference("revanced_hide_shorts_save_sound_button"),
SwitchPreference("revanced_hide_shorts_use_sound_button"),
SwitchPreference("revanced_hide_shorts_use_template_button"), SwitchPreference("revanced_hide_shorts_use_template_button"),
SwitchPreference("revanced_hide_shorts_upcoming_button"), SwitchPreference("revanced_hide_shorts_upcoming_button"),
SwitchPreference("revanced_hide_shorts_green_screen_button"), SwitchPreference("revanced_hide_shorts_green_screen_button"),

View File

@@ -822,9 +822,12 @@ To show the Audio track menu, change \'Spoof video streams\' to iOS TV"</string>
<string name="revanced_hide_shorts_save_sound_button_title">Hide Save music button</string> <string name="revanced_hide_shorts_save_sound_button_title">Hide Save music button</string>
<string name="revanced_hide_shorts_save_sound_button_summary_on">Save music button is hidden</string> <string name="revanced_hide_shorts_save_sound_button_summary_on">Save music button is hidden</string>
<string name="revanced_hide_shorts_save_sound_button_summary_off">Save music button is shown</string> <string name="revanced_hide_shorts_save_sound_button_summary_off">Save music button is shown</string>
<string name="revanced_hide_shorts_use_template_button_title">Hide Use template button</string> <string name="revanced_hide_shorts_use_sound_button_title">Hide Use this sound button</string>
<string name="revanced_hide_shorts_use_template_button_summary_on">Use template button is hidden</string> <string name="revanced_hide_shorts_use_sound_button_summary_on">Use this sound button is hidden</string>
<string name="revanced_hide_shorts_use_template_button_summary_off">Use template button is shown</string> <string name="revanced_hide_shorts_use_sound_button_summary_off">Use this sound button is shown</string>
<string name="revanced_hide_shorts_use_template_button_title">Hide Use this template button</string>
<string name="revanced_hide_shorts_use_template_button_summary_on">Use this template button is hidden</string>
<string name="revanced_hide_shorts_use_template_button_summary_off">Use this template button is shown</string>
<string name="revanced_hide_shorts_upcoming_button_title">Hide Upcoming button</string> <string name="revanced_hide_shorts_upcoming_button_title">Hide Upcoming button</string>
<string name="revanced_hide_shorts_upcoming_button_summary_on">Upcoming button is hidden</string> <string name="revanced_hide_shorts_upcoming_button_summary_on">Upcoming button is hidden</string>
<string name="revanced_hide_shorts_upcoming_button_summary_off">Upcoming button is shown</string> <string name="revanced_hide_shorts_upcoming_button_summary_off">Upcoming button is shown</string>