diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 9075392e..5e007284 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -6,10 +6,72 @@ body: - type: markdown attributes: value: | +

+ + + + +
+ + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + + +
+
+ Continuing the legacy of Vanced +

+ # ReVanced Integrations bug report - Please check for existing bug reports [here](https://github.com/ReVanced/revanced-integrations/labels/Bug%20report) before creating a new one. + Before creating a new bug report, please keep the following in mind: + - **Do not submit a duplicate bug report**: You can review existing bug reports [here](https://github.com/ReVanced/revanced-integrations/labels/Bug%20report). + - **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app). - type: textarea attributes: label: Bug description @@ -37,9 +99,9 @@ body: id: acknowledgements attributes: label: Acknowledgements - description: Your issue will be closed if you don't follow the checklist below. + description: Your bug report will be closed if you don't follow the checklist below. options: - - label: This request is not a duplicate of an existing issue. + - label: This issue is not a duplicate of an existing bug report. required: true - label: I have chosen an appropriate title. required: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 1de66ff6..65324f82 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -6,10 +6,72 @@ body: - type: markdown attributes: value: | +

+ + + + +
+ + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + + +
+
+ Continuing the legacy of Vanced +

+ # ReVanced Integrations feature request - Please check for existing feature requests [here](https://github.com/ReVanced/revanced-integrations/labels/Feature%20request) before creating a new one. + Before creating a new feature request, please keep the following in mind: + - **Do not submit a duplicate feature request**: You can review existing feature requests [here](https://github.com/ReVanced/revanced-integrations/labels/Feature%20request). + - **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app). - type: textarea attributes: label: Feature description @@ -33,9 +95,9 @@ body: id: acknowledgements attributes: label: Acknowledgements - description: Your issue will be closed if you don't follow the checklist below. + description: Your feature request will be closed if you don't follow the checklist below. options: - - label: This request is not a duplicate of an existing issue. + - label: This issue is not a duplicate of an existing feature request. required: true - label: I have chosen an appropriate title. required: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 651abe41..ad9f9b3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,44 @@ +# [0.124.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v0.123.1-dev.1...v0.124.0-dev.1) (2023-11-23) + + +### Bug Fixes + +* **YouTube - Enable tablet layout:** Respect the original device layout ([bc56aa5](https://github.com/ReVanced/revanced-integrations/commit/bc56aa5f07d8fa5c241343ebf43887f360c79e74)) +* **YouTube - SponsorBlock:** Do not disable autoplay when skipping to the end of the video ([f936f24](https://github.com/ReVanced/revanced-integrations/commit/f936f240a7ad14bbf6130ef6960c0fa5542f78c5)) + + +### Features + +* **YouTube - Hide ads:** Hide shopping links in video description ([11e7c04](https://github.com/ReVanced/revanced-integrations/commit/11e7c04b707d86901809db3b4f427a0155787177)) +* **YouTube - Hide layout components:** Hide "For You" shelf in channel page ([2613e10](https://github.com/ReVanced/revanced-integrations/commit/2613e102cc446c910c4a2f750cc034e12995dd39)) + +# [0.124.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v0.123.1-dev.1...v0.124.0-dev.1) (2023-11-23) + + +### Bug Fixes + +* **YouTube - Enable tablet layout:** Respect the original device layout ([bc56aa5](https://github.com/ReVanced/revanced-integrations/commit/bc56aa5f07d8fa5c241343ebf43887f360c79e74)) + + +### Features + +* **YouTube - Hide ads:** Hide shopping links in video description ([11e7c04](https://github.com/ReVanced/revanced-integrations/commit/11e7c04b707d86901809db3b4f427a0155787177)) +* **YouTube - Hide layout components:** Hide "For You" shelf in channel page ([2613e10](https://github.com/ReVanced/revanced-integrations/commit/2613e102cc446c910c4a2f750cc034e12995dd39)) + +## [0.123.1-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v0.123.1-dev.1...v0.123.1-dev.2) (2023-11-23) + + +### Bug Fixes + +* **YouTube - Enable tablet layout:** Respect the original device layout ([9e3e747](https://github.com/ReVanced/revanced-integrations/commit/9e3e747ce66d58b9ee74e812a68e74d1a88288e0)) + +## [0.123.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v0.123.0...v0.123.1-dev.1) (2023-11-22) + + +### Bug Fixes + +* **YouTube - Custom playback speed:** Fix toast error on opening playback speed menu ([#522](https://github.com/ReVanced/revanced-integrations/issues/522)) ([0124f41](https://github.com/ReVanced/revanced-integrations/commit/0124f41cd699467e1c973ea42774c89b751f576f)) + # [0.123.0](https://github.com/ReVanced/revanced-integrations/compare/v0.122.1...v0.123.0) (2023-11-20) diff --git a/app/src/main/java/app/revanced/integrations/patches/VideoInformation.java b/app/src/main/java/app/revanced/integrations/patches/VideoInformation.java index 9d181905..b2a42378 100644 --- a/app/src/main/java/app/revanced/integrations/patches/VideoInformation.java +++ b/app/src/main/java/app/revanced/integrations/patches/VideoInformation.java @@ -12,6 +12,7 @@ import java.util.Objects; /** * Hooking class for the current playing video. + * @noinspection unused */ public final class VideoInformation { private static final float DEFAULT_YOUTUBE_PLAYBACK_SPEED = 1.0f; @@ -89,7 +90,7 @@ public final class VideoInformation { /** * Overrides the current playback speed. - * + *

* Used exclusively by {@link RememberPlaybackSpeedPatch} */ public static void overridePlaybackSpeed(float speedOverride) { @@ -124,24 +125,33 @@ public final class VideoInformation { /** * Seek on the current video. * Does not function for playback of Shorts. - * + *

* Caution: If called from a videoTimeHook() callback, * this will cause a recursive call into the same videoTimeHook() callback. * * @param millisecond The millisecond to seek the video to. - * @return if the seek was successful + * @return true if the seek was successful. */ public static boolean seekTo(final long millisecond) { + final long videoLength = getVideoLength(); + + // Don't seek more than the video length to prevent issues such as + // Play pause button or autoplay not working. + // TODO: These are arbitrarily chosen values and should be subject to be adjusted. + final long seekToMilliseconds = millisecond <= videoLength - 500 ? millisecond : millisecond - 100; + ReVancedUtils.verifyOnMainThread(); try { - LogHelper.printDebug(() -> "Seeking to " + millisecond); - return (Boolean) seekMethod.invoke(playerControllerRef.get(), millisecond); + LogHelper.printDebug(() -> "Seeking to " + seekToMilliseconds); + //noinspection DataFlowIssue + return (Boolean) seekMethod.invoke(playerControllerRef.get(), seekToMilliseconds); } catch (Exception ex) { LogHelper.printException(() -> "Failed to seek", ex); return false; } } + /** @noinspection UnusedReturnValue*/ public static boolean seekToRelative(long millisecondsRelative) { return seekTo(videoTime + millisecondsRelative); } @@ -159,10 +169,10 @@ public final class VideoInformation { /** * Differs from {@link #videoId} as this is the video id for the * last player response received, which may not be the current video playing. - * + *

* If Shorts are loading the background, this commonly will be * different from the Short that is currently on screen. - * + *

* For most use cases, you should instead use {@link #getVideoId()}. * * @return The id of the last video loaded. Empty string if not set yet. @@ -192,9 +202,9 @@ public final class VideoInformation { /** * Playback time of the current video playing. Includes Shorts. - * + *

* Value will lag behind the actual playback time by a variable amount based on the playback speed. - * + *

* If playback speed is 2.0x, this value may be up to 2000ms behind the actual playback time. * If playback speed is 1.0x, this value may be up to 1000ms behind the actual playback time. * If playback speed is 0.5x, this value may be up to 500ms behind the actual playback time. @@ -208,12 +218,12 @@ public final class VideoInformation { /** * @return If the playback is at the end of the video. - * + *

* If video is playing in the background with no video visible, * this always returns false (even if the video is actually at the end). - * + *

* This is equivalent to checking for {@link VideoState#ENDED}, - * but can give a more up to date result for code calling from some hooks. + * but can give a more up-to-date result for code calling from some hooks. * * @see VideoState */ diff --git a/app/src/main/java/app/revanced/integrations/patches/components/AdsFilter.java b/app/src/main/java/app/revanced/integrations/patches/components/AdsFilter.java index 40192d0d..5868596d 100644 --- a/app/src/main/java/app/revanced/integrations/patches/components/AdsFilter.java +++ b/app/src/main/java/app/revanced/integrations/patches/components/AdsFilter.java @@ -12,6 +12,7 @@ import app.revanced.integrations.utils.StringTrieSearch; public final class AdsFilter extends Filter { private final StringTrieSearch exceptions = new StringTrieSearch(); + private final StringFilterGroup shoppingLinks; public AdsFilter() { exceptions.addPatterns( @@ -71,6 +72,11 @@ public final class AdsFilter extends Filter { "products_in_video" ); + shoppingLinks = new StringFilterGroup( + SettingsEnum.HIDE_SHOPPING_LINKS, + "expandable_list" + ); + final var webLinkPanel = new StringFilterGroup( SettingsEnum.HIDE_WEB_SEARCH_RESULTS, "web_link_panel" @@ -93,6 +99,7 @@ public final class AdsFilter extends Filter { viewProducts, selfSponsor, webLinkPanel, + shoppingLinks, movieAds ); this.identifierFilterGroupList.addAll(carouselAd); @@ -104,6 +111,10 @@ public final class AdsFilter extends Filter { if (exceptions.matches(path)) return false; + // Check for the index because of likelihood of false positives. + if (matchedGroup == shoppingLinks && matchedIndex != 0) + return false; + return super.isFiltered(identifier, path, protobufBufferArray, matchedList, matchedGroup, matchedIndex); } diff --git a/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java b/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java index 278bfc2e..f11f43b8 100644 --- a/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java +++ b/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java @@ -192,6 +192,11 @@ public final class LayoutComponentsFilter extends Filter { "featured_channel_watermark_overlay" ); + final var forYouShelf = new StringFilterGroup( + SettingsEnum.HIDE_FOR_YOU_SHELF, + "mixed_content_shelf" + ); + this.pathFilterGroupList.addAll( channelBar, communityPosts, @@ -216,6 +221,7 @@ public final class LayoutComponentsFilter extends Filter { timedReactions, imageShelf, channelMemberShelf, + forYouShelf, custom ); diff --git a/app/src/main/java/app/revanced/integrations/patches/playback/speed/CustomPlaybackSpeedPatch.java b/app/src/main/java/app/revanced/integrations/patches/playback/speed/CustomPlaybackSpeedPatch.java index 30f79e64..3c281722 100644 --- a/app/src/main/java/app/revanced/integrations/patches/playback/speed/CustomPlaybackSpeedPatch.java +++ b/app/src/main/java/app/revanced/integrations/patches/playback/speed/CustomPlaybackSpeedPatch.java @@ -15,15 +15,23 @@ import java.util.Arrays; public class CustomPlaybackSpeedPatch { /** * Maximum playback speed, exclusive value. Custom speeds must be less than this value. - * Limit is required otherwise double digit speeds show up out of order in the UI selector. + * + * Going over 8x does not increase the actual playback speed any higher, + * and the UI selector starts flickering and acting weird. + * Over 10x and the speeds show up out of order in the UI selector. */ - public static final float MAXIMUM_PLAYBACK_SPEED = 10; + public static final float MAXIMUM_PLAYBACK_SPEED = 8; /** * Custom playback speeds. */ public static float[] customPlaybackSpeeds; + /** + * The last time the old playback menu was forcefully called. + */ + private static long lastTimeOldPlaybackMenuInvoked; + /** * PreferenceList entries and values, of all available playback speeds. */ @@ -101,36 +109,48 @@ public class CustomPlaybackSpeedPatch { // For some reason, the custom playback speed flyout panel is activated when the user opens the share panel. (A/B tests) // Check the child count of playback speed flyout panel to prevent this issue. // Child count of playback speed flyout panel is always 8. - if (PlaybackSpeedMenuFilterPatch.isPlaybackSpeedMenuVisible - && ((ViewGroup) recyclerView.getChildAt(0)).getChildCount() == 8) { - PlaybackSpeedMenuFilterPatch.isPlaybackSpeedMenuVisible = false; - ViewGroup parentView3rd = (ViewGroup) recyclerView.getParent().getParent().getParent(); - ViewGroup parentView4th = (ViewGroup) parentView3rd.getParent(); - - // Dismiss View [R.id.touch_outside] is the 1st ChildView of the 4th ParentView. - // This only shows in phone layout. - - final var touchInsidedView = parentView4th.getChildAt(0); - touchInsidedView.setSoundEffectsEnabled(false); - touchInsidedView.performClick(); - - // In tablet layout there is no Dismiss View, instead we just hide all two parent views. - parentView3rd.setVisibility(View.GONE); - parentView4th.setVisibility(View.GONE); - - // This works without issues for both tablet and phone layouts, - // So no code is needed to check whether the current device is a tablet or phone. - - // Close the new Playback speed menu and show the old one. - showOldPlaybackSpeedMenu(); + if (!PlaybackSpeedMenuFilterPatch.isPlaybackSpeedMenuVisible || recyclerView.getChildCount() == 0) { + return; } + ViewGroup PlaybackSpeedParentView = (ViewGroup) recyclerView.getChildAt(0); + if (PlaybackSpeedParentView == null || PlaybackSpeedParentView.getChildCount() != 8) { + return; + } + + PlaybackSpeedMenuFilterPatch.isPlaybackSpeedMenuVisible = false; + ViewGroup parentView3rd = (ViewGroup) recyclerView.getParent().getParent().getParent(); + ViewGroup parentView4th = (ViewGroup) parentView3rd.getParent(); + + // Dismiss View [R.id.touch_outside] is the 1st ChildView of the 4th ParentView. + // This only shows in phone layout. + final var touchInsidedView = parentView4th.getChildAt(0); + touchInsidedView.setSoundEffectsEnabled(false); + touchInsidedView.performClick(); + + // In tablet layout there is no Dismiss View, instead we just hide all two parent views. + parentView3rd.setVisibility(View.GONE); + parentView4th.setVisibility(View.GONE); + + // This works without issues for both tablet and phone layouts, + // So no code is needed to check whether the current device is a tablet or phone. + + // Close the new Playback speed menu and show the old one. + showOldPlaybackSpeedMenu(); } catch (Exception ex) { LogHelper.printException(() -> "onFlyoutMenuCreate failure", ex); } }); } - public static void showOldPlaybackSpeedMenu() { + private static void showOldPlaybackSpeedMenu() { + // This method is sometimes used multiple times. + // To prevent this, ignore method reuse within 1 second. + final long now = System.currentTimeMillis(); + if (now - lastTimeOldPlaybackMenuInvoked < 1000) { + LogHelper.printDebug(() -> "Ignoring call to showOldPlaybackSpeedMenu"); + return; + } + lastTimeOldPlaybackMenuInvoked = now; LogHelper.printDebug(() -> "Old video quality menu shown"); // Rest of the implementation added by patch. diff --git a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java index 99f62421..e4b9550a 100644 --- a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java +++ b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java @@ -50,6 +50,7 @@ public enum SettingsEnum { HIDE_MERCHANDISE_BANNERS("revanced_hide_merchandise_banners", BOOLEAN, TRUE), HIDE_PAID_CONTENT("revanced_hide_paid_content_ads", BOOLEAN, TRUE), HIDE_PRODUCTS_BANNER("revanced_hide_products_banner", BOOLEAN, TRUE), + HIDE_SHOPPING_LINKS("revanced_hide_shopping_links", BOOLEAN, TRUE), HIDE_SELF_SPONSOR("revanced_hide_self_sponsor_ads", BOOLEAN, TRUE), HIDE_VIDEO_ADS("revanced_hide_video_ads", BOOLEAN, TRUE, true), HIDE_WEB_SEARCH_RESULTS("revanced_hide_web_search_results", BOOLEAN, TRUE), @@ -114,6 +115,7 @@ public enum SettingsEnum { HIDE_TIMESTAMP("revanced_hide_timestamp", BOOLEAN, FALSE), @Deprecated HIDE_VIDEO_WATERMARK("revanced_hide_video_watermark", BOOLEAN, TRUE), HIDE_VIDEO_CHANNEL_WATERMARK("revanced_hide_channel_watermark", BOOLEAN, TRUE), + HIDE_FOR_YOU_SHELF("revanced_hide_for_you_shelf", BOOLEAN, TRUE), HIDE_VIDEO_QUALITY_MENU_FOOTER("revanced_hide_video_quality_menu_footer", BOOLEAN, TRUE), PLAYER_OVERLAY_OPACITY("revanced_player_overlay_opacity", INTEGER, 100, true), PLAYER_POPUP_PANELS("revanced_hide_player_popup_panels", BOOLEAN, FALSE), diff --git a/assets/revanced-headline/revanced-headline-vertical-dark.svg b/assets/revanced-headline/revanced-headline-vertical-dark.svg new file mode 100644 index 00000000..a59bfb50 --- /dev/null +++ b/assets/revanced-headline/revanced-headline-vertical-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/revanced-headline/revanced-headline-vertical-light.svg b/assets/revanced-headline/revanced-headline-vertical-light.svg new file mode 100644 index 00000000..3c5eeccc --- /dev/null +++ b/assets/revanced-headline/revanced-headline-vertical-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/revanced-logo/revanced-logo.svg b/assets/revanced-logo/revanced-logo.svg new file mode 100644 index 00000000..901e1914 --- /dev/null +++ b/assets/revanced-logo/revanced-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 2291ead8..69ed5db8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 0.123.0 +version = 0.124.0-dev.1