From a9c062cbce0288e5ae5b98f274ad3d408c3ac272 Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Wed, 6 Dec 2023 02:34:47 +0900 Subject: [PATCH] refactor(Utils): match to official ReVanced code --- .../app/revanced/extensions/Extensions.kt | 97 -------- .../account/component/MenuComponentPatch.kt | 8 +- .../fingerprints/MenuEntryFingerprint.kt | 7 +- .../music/account/handle/HideHandlePatch.kt | 10 +- ...ntSwitcherAccessibilityLabelFingerprint.kt | 7 +- ...InactiveAccountThumbnailSizeFingerprint.kt | 11 +- .../music/account/tos/TermsContainerPatch.kt | 8 +- .../fingerprints/TermsOfServiceFingerprint.kt | 7 +- .../DownloadButtonHookPatch.kt | 4 +- .../actionbar/label/ActionBarLabelPatch.kt | 8 +- .../actionbar/radio/HideRadioButtonPatch.kt | 4 +- .../music/ads/general/GeneralAdsPatch.kt | 36 ++- .../fingerprints/FloatingLayoutFingerprint.kt | 7 +- .../fingerprints/NotifierShelfFingerprint.kt | 7 +- .../patches/music/ads/music/MusicAdsPatch.kt | 4 +- .../compactdialog/CompactDialogPatch.kt | 8 +- .../fingerprints/DialogSolidFingerprint.kt | 7 +- .../flyoutpanel/component/FlyoutPanelPatch.kt | 8 +- .../playbackspeed/PlaybackSpeedPatch.kt | 4 +- .../replace/ReplaceDismissQueuePatch.kt | 8 +- .../flyoutpanel/sleeptimer/SleepTimerPatch.kt | 8 +- .../fingerprints/SleepTimerFingerprint.kt | 7 +- .../music/general/amoled/AmoledPatch.kt | 4 +- .../autocaptions/DisableAutoCaptionsPatch.kt | 8 +- .../icon/CustomBrandingIconMMTPatch.kt | 25 -- .../branding/icon/CustomBrandingIconPatch.kt | 112 +++++++++ .../CustomBrandingIconRevancifyBluePatch.kt | 22 -- .../CustomBrandingIconRevancifyRedPatch.kt | 23 -- .../buttonshelf/HideButtonShelfPatch.kt | 8 +- .../carouselshelf/HideCarouselShelfPatch.kt | 8 +- .../general/castbutton/HideCastButtonPatch.kt | 14 +- .../PlayerOverlayChipFingerprint.kt | 7 +- .../general/categorybar/CategoryBarPatch.kt | 8 +- .../fingerprints/ChipCloudFingerprint.kt | 7 +- .../HideChannelGuidelinesPatch.kt | 8 +- .../general/customfilter/CustomFilterPatch.kt | 8 +- .../emojipicker/HideEmojiPickerPatch.kt | 8 +- .../floatingbutton/NewPlaylistButtonPatch.kt | 8 +- .../FloatingButtonParentFingerprint.kt | 7 +- .../historybutton/HideHistoryButtonPatch.kt | 8 +- .../HistoryMenuItemFingerprint.kt | 7 +- .../landscapemode/LandScapeModePatch.kt | 8 +- .../TabletIdentifierFingerprint.kt | 7 +- .../OldStyleLibraryShelfPatch.kt | 12 +- .../fingerprints/BrowseIdFingerprint.kt | 7 +- .../playlistcard/HidePlaylistCardPatch.kt | 8 +- .../music/general/startpage/StartPagePatch.kt | 10 +- .../tooltip/TooltipContentViewPatch.kt | 2 +- .../TooltipContentViewFingerprint.kt | 7 +- .../backgroundplay/BackgroundPlayPatch.kt | 2 +- .../music/misc/codecs/CodecsUnlockPatch.kt | 6 +- .../music/misc/debugging/DebuggingPatch.kt | 2 +- .../exclusiveaudio/ExclusiveAudioPatch.kt | 8 +- .../fingerprints/PodCastConfigFingerprint.kt | 7 +- .../MinimizedPlaybackPatch.kt | 2 +- .../music/misc/premium/HideGetPremiumPatch.kt | 6 +- .../AccountMenuFooterFingerprint.kt | 7 +- .../spoofappversion/SpoofAppVersionPatch.kt | 8 +- .../misc/tastebuilder/TasteBuilderPatch.kt | 2 +- .../misc/tracking/SanitizeUrlQueryPatch.kt | 6 +- .../misc/translations/TranslationsPatch.kt | 17 +- .../black/BlackNavigationBarPatch.kt | 8 +- .../fingerprints/TabLayoutFingerprint.kt | 7 +- .../component/NavigationBarComponentPatch.kt | 16 +- .../fingerprints/TabLayoutTextFingerprint.kt | 7 +- .../colormatchplayer/ColorMatchPlayerPatch.kt | 10 +- .../minimizedplayer/MinimizedPlayerPatch.kt | 8 +- .../NewPlayerBackgroundPatch.kt | 8 +- .../NewPlayerBackgroundFingerprint.kt | 7 +- .../oldplayerlayout/OldPlayerLayoutPatch.kt | 8 +- .../OldStyleMiniPlayerPatch.kt | 10 +- .../fingerprints/SwipeToCloseFingerprint.kt | 7 +- .../player/repeat/RememberRepeatPatch.kt | 8 +- .../player/replace/ReplaceCastButtonPatch.kt | 24 +- .../CastButtonContainerFingerprint.kt | 9 +- .../player/shuffle/RememberShufflePatch.kt | 22 +- .../music/player/zenmode/ZenModePatch.kt | 8 +- .../utils/actionbarhook/ActionBarHookPatch.kt | 6 +- .../ActionsBarParentFingerprint.kt | 7 +- .../NewPlayerLayoutFingerprint.kt | 7 +- .../SeekBarConstructorFingerprint.kt | 11 +- .../AndroidAutoCertificatePatch.kt | 2 +- .../utils/fix/clientspoof/ClientSpoofPatch.kt | 2 +- .../FlyoutButtonContainerPatch.kt | 10 +- .../FlyoutButtonContainerResourcePatch.kt | 10 +- .../FlyoutButtonItemResourcePatch.kt | 8 +- .../FlyoutPanelLikeButtonFingerprint.kt | 7 +- .../music/utils/integrations/Constants.kt | 26 ++ .../utils/integrations/IntegrationsPatch.kt | 4 +- .../music/utils/intenthook/IntentHookPatch.kt | 6 +- .../music/utils/litho/LithoFilterPatch.kt | 8 +- .../mainactivity/MainActivityResolvePatch.kt | 6 +- .../patches/music/utils/microg/MicroGPatch.kt | 2 +- .../music/utils/microg/MicroGResourcePatch.kt | 12 +- .../OverrideQualityHookPatch.kt | 6 +- .../VideoQualityListFingerprint.kt | 7 +- .../overridespeed/OverrideSpeedHookPatch.kt | 10 +- .../playerresponse/PlayerResponsePatch.kt | 2 +- .../utils/playertype/PlayerTypeHookPatch.kt | 6 +- .../utils/resourceid/SharedResourceIdPatch.kt | 16 +- .../ReturnYouTubeDislikeBytecodePatch.kt | 6 +- .../ReturnYouTubeDislikePatch.kt | 18 +- .../fingerprints/TextComponentFingerprint.kt | 7 +- .../music/utils/settings}/CategoryType.kt | 4 +- .../music/utils/settings/ResourceUtils.kt} | 69 ++--- .../utils/settings/SettingsBytecodePatch.kt | 8 +- .../music/utils/settings/SettingsPatch.kt | 62 +---- .../sponsorblock/SponsorBlockBytecodePatch.kt | 2 +- .../utils/sponsorblock/SponsorBlockPatch.kt | 12 +- .../utils/videotype/VideoTypeHookPatch.kt | 6 +- .../customspeed/CustomPlaybackSpeedPatch.kt | 6 +- .../information/VideoInformationPatch.kt | 6 +- .../music/video/quality/VideoQualityPatch.kt | 8 +- .../music/video/speed/PlaybackSpeedPatch.kt | 13 +- .../reddit/ad/comments/HideCommentAdsPatch.kt | 2 +- .../patches/reddit/ad/general/HideAdsPatch.kt | 2 +- .../navigation/NavigationButtonsPatch.kt | 2 +- .../reddit/layout/place/PlaceButtonPatch.kt | 6 +- .../HomePagerScreenFingerprint.kt | 4 +- .../layout/premiumicon/PremiumIconPatch.kt | 2 +- .../RecentlyVisitedShelfPatch.kt | 2 +- .../screenshotpopup/ScreenshotPopupPatch.kt | 2 +- .../ScreenshotTakenBannerFingerprint.kt | 4 +- .../misc/openlink/OpenLinksDirectlyPatch.kt | 2 +- .../misc/openlink/OpenLinksExternallyPatch.kt | 6 +- .../tracking/url/SanitizeUrlQueryPatch.kt | 2 +- .../utils/resourceid/SharedResourceIdPatch.kt | 12 +- .../utils/settings/SettingsBytecodePatch.kt | 6 +- ...AcknowledgementsLabelBuilderFingerprint.kt | 4 +- .../shared/patch/ads/AbstractAdsPatch.kt | 2 +- .../AbstractCustomPlaybackSpeedPatch.kt | 2 +- .../integrations/AbstractIntegrationsPatch.kt | 2 +- .../patch/litho/ComponentParserPatch.kt | 2 +- .../shared/patch/litho/LithoThemePatch.kt | 2 +- .../shared/patch/mapping}/ResourceType.kt | 4 +- .../shared/patch}/microg/Constants.kt | 4 +- .../patch}/microg/MicroGBytecodeHelper.kt | 14 +- .../patch}/microg/MicroGManifestHelper.kt | 12 +- .../patch}/microg/MicroGResourceHelper.kt | 4 +- .../patch/opus/AbstractOpusCodecsPatch.kt | 2 +- .../settings/AbstractSettingsResourcePatch.kt | 21 +- .../tracking/AbstractSanitizeUrlQueryPatch.kt | 2 +- .../translations/AbstractTranslationsPatch.kt | 27 ++ .../versionspoof/AbstractVersionSpoofPatch.kt | 2 +- .../AbstractVoiceSearchButtonPatch.kt | 7 +- .../ads/general/GeneralAdsBytecodePatch.kt | 53 ++-- .../youtube/ads/general/GeneralAdsPatch.kt | 8 +- .../ads/getpremium/HideGetPremiumPatch.kt | 4 +- .../youtube/ads/video/VideoAdsPatch.kt | 2 +- .../general/AlternativeThumbnailsPatch.kt | 6 +- ...LRequestCallbackOnSucceededFingerprint.kt} | 0 .../buttoncontainer/ButtonContainerPatch.kt | 4 +- .../comment/CommentComponentPatch.kt | 4 +- .../flyoutpanel/feed/FeedFlyoutPanelPatch.kt | 4 +- .../ContextualMenuItemBuilderFingerprint.kt | 7 +- .../oldqualitylayout/OldQualityLayoutPatch.kt | 6 +- .../oldspeedlayout/OldSpeedLayoutPatch.kt | 6 +- .../player/PlayerFlyoutPanelPatch.kt | 10 +- .../AdvancedQualityBottomSheetFingerprint.kt | 7 +- .../CaptionsBottomSheetFingerprint.kt | 6 +- .../BottomSheetRecyclerViewPatch.kt | 6 +- ...ttomSheetRecyclerViewBuilderFingerprint.kt | 7 +- .../HideAutoplayPreviewPatch.kt | 14 +- .../CompactControlsOverlayPatch.kt | 4 +- .../HideEndScreenOverlayPatch.kt | 4 +- .../EndScreenResultsParentFingerprint.kt | 7 +- .../forcefullscreen/ForceFullscreenPatch.kt | 25 +- .../HideFullscreenPanelsPatch.kt | 11 +- .../FullscreenEngagementPanelFingerprint.kt | 11 +- .../landscapemode/LandScapeModePatch.kt | 4 +- .../quickactions/QuickActionsPatch.kt | 4 +- .../general/accountmenu/AccountMenuPatch.kt | 4 +- .../AccountListParentFingerprint.kt | 7 +- .../AccountMenuParentFingerprint.kt | 7 +- .../AccountMenuPatchFingerprint.kt | 2 +- .../general/autocaptions/AutoCaptionsPatch.kt | 4 +- .../autopopuppanels/PlayerPopupPanelsPatch.kt | 4 +- .../general/categorybar/CategoryBarPatch.kt | 4 +- .../FilterBarHeightFingerprint.kt | 7 +- .../RelatedChipCloudFingerprint.kt | 7 +- .../SearchResultsChipBarFingerprint.kt | 7 +- .../ChannelListSubMenuPatch.kt | 4 +- .../ChannelListSubMenuFingerprint.kt | 7 +- .../ChannelProfileComponentsPatch.kt | 4 +- .../crowdfundingbox/CrowdfundingBoxPatch.kt | 4 +- .../CrowdfundingBoxFingerprint.kt | 7 +- .../DescriptionComponentsPatch.kt | 4 +- .../FloatingMicrophonePatch.kt | 4 +- .../FloatingMicrophoneFingerprint.kt | 7 +- .../youtube/general/handle/HideHandlePatch.kt | 6 +- ...ntSwitcherAccessibilityLabelFingerprint.kt | 7 +- .../LatestVideosButtonPatch.kt | 4 +- .../LatestVideosButtonFingerprint.kt | 7 +- .../general/layout/LayoutComponentsPatch.kt | 4 +- .../GradientLoadingScreenPatch.kt | 10 +- ...GradientLoadingScreenPrimaryFingerprint.kt | 7 +- ...adientLoadingScreenSecondaryFingerprint.kt | 7 +- .../loadmorebutton/LoadMoreButtonPatch.kt | 4 +- .../fingerprints/LoadMoreButtonFingerprint.kt | 7 +- .../general/mixplaylists/MixPlaylistsPatch.kt | 9 +- .../general/musicsearch/MusicSearchPatch.kt | 4 +- .../VoiceSearchConfigFingerprint.kt | 7 +- .../searchterm/SearchTermThumbnailPatch.kt | 4 +- .../general/snackbar/HideSnackBarPatch.kt | 4 +- .../suggestions/SuggestionsShelfPatch.kt | 4 +- .../fingerprints/BreakingNewsFingerprint.kt | 7 +- .../tabletminiplayer/TabletMiniPlayerPatch.kt | 8 +- ...niPlayerDimensionsCalculatorFingerprint.kt | 7 +- .../general/toolbar/ToolBarButtonPatch.kt | 4 +- .../trendingsearches/TrendingSearchesPatch.kt | 8 +- .../fingerprints/SearchBarEntryFingerprint.kt | 8 +- .../widesearchbar/WideSearchBarPatch.kt | 4 +- .../SetActionBarRingoFingerprint.kt | 7 +- .../animated/AnimatedButtonBackgroundPatch.kt | 6 +- .../icon/CustomBrandingIconMMTPatch.kt | 52 ---- .../branding/icon/CustomBrandingIconPatch.kt | 179 +++++++++++++ .../CustomBrandingIconRevancifyBluePatch.kt | 51 ---- .../CustomBrandingIconRevancifyRedPatch.kt | 52 ---- .../branding/name/CustomBrandingNamePatch.kt | 2 +- .../doubletaplength/DoubleTapLengthPatch.kt | 8 +- .../layout/header/PremiumHeadingPatch.kt | 2 +- .../layout/materialyou/MaterialYouPatch.kt | 14 +- .../pipnotification/PiPNotificationPatch.kt | 2 +- .../PiPNotificationFingerprint.kt | 7 +- .../AddSplashAnimationPatch.kt | 8 +- .../youtube/layout/theme/GeneralThemePatch.kt | 2 +- .../youtube/layout/theme/ThemePatch.kt | 2 +- .../layout/tooltip/TooltipContentViewPatch.kt | 2 +- .../TooltipContentViewFingerprint.kt | 7 +- .../ambientmode/AmbientModeSwitchPatch.kt | 10 +- .../AmbientModeInFullscreenFingerprint.kt | 9 +- .../misc/codec/audio/ForceOpusCodecPatch.kt | 2 +- .../misc/codec/video/ForceVideoCodecPatch.kt | 4 +- .../externalbrowser/ExternalBrowserPatch.kt | 8 +- .../misc/language/LanguageSelectorPatch.kt | 4 +- .../misc/layoutswitch/LayoutSwitchPatch.kt | 4 +- .../MinimizedPlaybackPatch.kt | 4 +- .../MinimizedPlaybackManagerFingerprint.kt | 7 +- .../MinimizedPlaybackSettingsFingerprint.kt | 7 +- .../fingerprints/PiPControllerFingerprint.kt | 7 +- .../OpenLinksDirectlyPatch.kt | 4 +- .../youtube/misc/quic/QUICProtocolPatch.kt | 4 +- .../NewSplashAnimationPatch.kt | 11 +- ...atchWhileActivityWithInFlagsFingerprint.kt | 4 +- ...tchWhileActivityWithOutFlagsFingerprint.kt | 4 +- .../spoofappversion/SpoofAppVersionPatch.kt | 4 +- .../SpoofDeviceDimensionsPatch.kt | 4 +- .../misc/tracking/SanitizeUrlQueryPatch.kt | 4 +- .../misc/translations/TranslationsPatch.kt | 22 +- .../homepage/ChangeHomePagePatch.kt | 4 +- .../navigation/label/NavigationLabelPatch.kt | 4 +- .../NavigationButtonsPatch.kt | 34 ++- .../tabletnavbar/TabletNavigationBarPatch.kt | 4 +- .../alwaysrepeat/AlwaysRepeatPatch.kt | 4 +- .../AutoNavInformerFingerprint.kt | 11 +- .../download/hook/DownloadButtonHookPatch.kt | 4 +- .../download/pip/DisablePiPPatch.kt | 4 +- .../general/OverlayButtonsPatch.kt | 22 +- .../autoplaybutton/HideAutoplayButtonPatch.kt | 14 +- .../captionsbutton/HideCaptionsButtonPatch.kt | 4 +- .../player/castbutton/HideCastButtonPatch.kt | 4 +- .../endscreencards/HideEndScreenCardsPatch.kt | 33 ++- .../fingerprints/LayoutCircleFingerprint.kt | 7 +- .../fingerprints/LayoutIconFingerprint.kt | 7 +- .../fingerprints/LayoutVideoFingerprint.kt | 7 +- .../HideFilmstripOverlayPatch.kt | 4 +- .../FilmStripOverlayConfigFingerprint.kt | 7 +- .../FilmStripOverlayParentFingerprint.kt | 7 +- .../FineScrubbingOverlayFingerprint.kt | 11 +- .../hapticfeedback/HapticFeedBackPatch.kt | 4 +- .../player/infocards/HideInfoCardsPatch.kt | 6 +- .../musicbutton/HideMusicButtonPatch.kt | 4 +- .../MusicAppDeeplinkButtonFingerprint.kt | 12 +- .../HidePlayerButtonBackgroundPatch.kt | 2 +- .../CustomPlayerOverlayOpacityPatch.kt | 8 +- .../HidePreviousNextButtonPatch.kt | 4 +- .../player/seekmessage/SeekMessagePatch.kt | 4 +- .../SeekEduContainerFingerprint.kt | 7 +- .../SeekEduUndoOverlayFingerprint.kt | 7 +- .../player/speedoverlay/SpeedOverlayPatch.kt | 4 +- .../RestoreSlideToSeekBehaviorFingerprint.kt | 7 +- .../fingerprints/SpeedOverlayFingerprint.kt | 7 +- .../suggestactions/SuggestedActionsPatch.kt | 4 +- .../SuggestedActionsFingerprint.kt | 7 +- .../SuggestedVideoOverlayPatch.kt | 16 +- ....kt => CoreContainerBuilderFingerprint.kt} | 12 +- .../watermark/HideChannelWatermarkPatch.kt | 6 +- .../append/AppendTimeStampInformationPatch.kt | 4 +- .../seekbar/color/SeekbarColorPatch.kt | 12 +- .../ShortsSeekbarColorFingerprint.kt | 9 +- .../youtube/seekbar/hide/HideSeekbarPatch.kt | 4 +- .../seekbar/tapping/SeekbarTappingPatch.kt | 4 +- .../NewThumbnailPreviewPatch.kt | 4 +- .../seekbar/timestamps/HideTimeStampPatch.kt | 4 +- .../outlinebutton/ShortsOutlineButton.kt | 8 +- .../shortscomponent/ShortsComponentPatch.kt | 28 +-- .../ShortsNavigationBarPatch.kt | 4 +- .../ShortsSubscriptionsButtonPatch.kt | 68 ++--- .../shortscomponent/ShortsToolBarPatch.kt | 4 +- .../fingerprints/ShortsCommentFingerprint.kt | 7 +- .../fingerprints/ShortsDislikeFingerprint.kt | 7 +- .../ShortsInfoPanelFingerprint.kt | 7 +- .../fingerprints/ShortsLikeFingerprint.kt | 7 +- .../ShortsPaidPromotionFingerprint.kt | 7 +- .../fingerprints/ShortsPivotFingerprint.kt | 7 +- .../ShortsPivotLegacyFingerprint.kt | 7 +- .../fingerprints/ShortsRemixFingerprint.kt | 7 +- .../fingerprints/ShortsShareFingerprint.kt | 7 +- .../ShortsSubscriptionsFingerprint.kt | 7 +- ...rtsSubscriptionsTabletParentFingerprint.kt | 7 +- .../DisableShortsOnStartupPatch.kt | 8 +- .../UserWasInShortsFingerprint.kt | 7 +- .../swipe/controls/SwipeControlsPatch.kt | 14 +- .../utils/browseid/BrowseIdHookPatch.kt | 4 +- .../SetToolBarPaddingFingerprint.kt | 7 +- .../PivotBarCreateButtonViewFingerprint.kt | 7 +- .../PlayerSeekbarColorFingerprint.kt | 8 +- .../QualityMenuViewInflateFingerprint.kt | 7 +- .../SubtitleButtonControllerFingerprint.kt | 11 +- .../ThumbnailPreviewConfigFingerprint.kt | 7 +- .../fingerprints/TotalTimeFingerprint.kt | 7 +- .../YouTubeControlsOverlayFingerprint.kt | 11 +- .../utils/fix/clientspoof/ClientSpoofPatch.kt | 2 +- .../DoubleBackToClosePatch.kt | 4 +- .../parameter/SpoofPlayerParameterPatch.kt | 4 +- ...ayerResponseModelImplGeneralFingerprint.kt | 11 +- ...rResponseModelImplLiveStreamFingerprint.kt | 11 +- ...PlayerResponseModelImplRecommendedLevel.kt | 11 +- .../fix/swiperefresh/SwipeRefreshPatch.kt | 2 +- .../youtube/utils/integrations/Constants.kt | 32 +++ .../utils/integrations/IntegrationsPatch.kt | 2 +- .../youtube/utils/litho/LithoFilterPatch.kt | 4 +- .../lockmodestate/LockModeStateHookPatch.kt | 4 +- .../mainactivity/MainActivityResolvePatch.kt | 4 +- .../utils/microg/MicroGBytecodePatch.kt | 2 +- .../youtube/utils/microg/MicroGPatch.kt | 8 +- .../utils/navbarindex/NavBarIndexHookPatch.kt | 4 +- .../OverrideQualityHookPatch.kt | 10 +- .../VideoQualityListFingerprint.kt | 7 +- .../overridespeed/OverrideSpeedHookPatch.kt | 6 +- .../playerbutton/PlayerButtonHookPatch.kt | 6 +- .../fingerprints/LiveChatFingerprint.kt | 7 +- .../playercontrols/PlayerControlsPatch.kt | 6 +- .../BottomControlsInflateFingerprint.kt | 7 +- .../ControlsLayoutInflateFingerprint.kt | 7 +- .../playerresponse/PlayerResponsePatch.kt | 2 +- .../utils/playertype/PlayerTypeHookPatch.kt | 4 +- .../quickactions/QuickActionsHookPatch.kt | 4 +- .../QuickActionsElementFingerprint.kt | 11 +- .../utils/resourceid/SharedResourceIdPatch.kt | 16 +- .../general/ReturnYouTubeDislikePatch.kt | 6 +- .../ReturnYouTubeDislikeOldLayoutPatch.kt | 8 +- .../fingerprints/ButtonTagFingerprint.kt | 7 +- .../ReturnYouTubeDislikeRollingNumberPatch.kt | 4 +- .../shorts/ReturnYouTubeDislikeShortsPatch.kt | 4 +- .../youtube/utils/settings/ResourceUtils.kt} | 62 ++--- .../utils/settings/SettingsBytecodePatch.kt | 4 +- .../youtube/utils/settings/SettingsPatch.kt | 57 +---- .../ThemeSetterSystemFingerprint.kt | 7 +- .../sponsorblock/SponsorBlockBytecodePatch.kt | 8 +- .../utils/sponsorblock/SponsorBlockPatch.kt | 71 +++--- .../youtube/utils/toolbar/ToolBarHookPatch.kt | 4 +- .../fingerprints/ToolBarButtonFingerprint.kt | 7 +- .../youtube/utils/videocpn/VideoCpnPatch.kt | 2 +- .../utils/videoid/general/VideoIdPatch.kt | 4 +- .../fingerprint/VideoLengthFingerprint.kt | 7 +- .../VideoIdWithoutShortsPatch.kt | 4 +- .../customspeed/CustomPlaybackSpeedPatch.kt | 2 +- .../youtube/video/hdr/DisableHdrVideoPatch.kt | 4 +- .../video/quality/VideoQualityPatch.kt | 6 +- .../youtube/video/speed/PlaybackSpeedPatch.kt | 9 +- .../kotlin/app/revanced/util/BytecodeUtils.kt | 183 ++++++++++++++ .../kotlin/app/revanced/util/ResourceUtils.kt | 121 +++++++++ .../revanced/util/bytecode/BytecodeHelper.kt | 32 --- .../revanced/util/bytecode/BytecodeUtils.kt | 56 ----- .../fingerprint/LiteralValueFingerprint.kt | 34 +++ .../revanced/util/integrations/Constants.kt | 38 --- .../revanced/util/pivotbar/InjectionUtils.kt | 30 --- .../app/revanced/util/resources/IconHelper.kt | 235 ------------------ .../revanced/util/resources/ResourceUtils.kt | 85 ------- ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-hdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-mdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-xhdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-xxhdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-xxxhdpi}/ic_launcher_release.png | Bin .../ic_app_icons_themed_youtube_music.xml | 0 .../drawable-hdpi/action_bar_logo.png | Bin 6044 -> 0 bytes .../drawable-hdpi/action_bar_logo_release.png | Bin 4922 -> 0 bytes .../mmt/resource/drawable-hdpi/record.png | Bin 5639 -> 0 bytes .../resource/drawable-large-hdpi/record.png | Bin 8017 -> 0 bytes .../resource/drawable-large-mdpi/record.png | Bin 6633 -> 0 bytes .../resource/drawable-large-xhdpi/record.png | Bin 10591 -> 0 bytes .../drawable-mdpi/action_bar_logo.png | Bin 3074 -> 0 bytes .../mmt/resource/drawable-mdpi/record.png | Bin 4135 -> 0 bytes .../drawable-xhdpi/action_bar_logo.png | Bin 4968 -> 0 bytes .../mmt/resource/drawable-xhdpi/record.png | Bin 7219 -> 0 bytes .../resource/drawable-xlarge-hdpi/record.png | Bin 10433 -> 0 bytes .../resource/drawable-xlarge-mdpi/record.png | Bin 7219 -> 0 bytes .../drawable-xxhdpi/action_bar_logo.png | Bin 6995 -> 0 bytes .../mmt/resource/drawable-xxhdpi/record.png | Bin 10433 -> 0 bytes .../drawable-xxxhdpi/action_bar_logo.png | Bin 8840 -> 0 bytes ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-hdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-mdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-xhdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-xxhdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-xxxhdpi}/ic_launcher_release.png | Bin .../ic_app_icons_themed_youtube_music.xml | 0 ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-hdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-mdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-xhdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-xxhdpi}/ic_launcher_release.png | Bin ...uct_youtube_music_background_color_108.png | Bin ...uct_youtube_music_foreground_color_108.png | Bin .../mipmap-xxxhdpi}/ic_launcher_release.png | Bin .../ic_app_icons_themed_youtube_music.xml | 0 ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../mipmap-hdpi}/ic_launcher.png | Bin .../mipmap-hdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../mipmap-mdpi}/ic_launcher.png | Bin .../mipmap-mdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../mipmap-xhdpi}/ic_launcher.png | Bin .../mipmap-xhdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../mipmap-xxhdpi}/ic_launcher.png | Bin .../mipmap-xxhdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../mipmap-xxxhdpi}/ic_launcher.png | Bin .../mipmap-xxxhdpi}/ic_launcher_round.png | Bin ...daptive_monochrome_ic_youtube_launcher.xml | 0 .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-hdpi}/ic_launcher.png | Bin .../mipmap-hdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-mdpi}/ic_launcher.png | Bin .../mipmap-mdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-xhdpi}/ic_launcher.png | Bin .../mipmap-xhdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-xxhdpi}/ic_launcher.png | Bin .../mipmap-xxhdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-xxxhdpi}/ic_launcher.png | Bin .../mipmap-xxxhdpi}/ic_launcher_round.png | Bin ...daptive_monochrome_ic_youtube_launcher.xml | 0 .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-hdpi}/ic_launcher.png | Bin .../mipmap-hdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-mdpi}/ic_launcher.png | Bin .../mipmap-mdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-xhdpi}/ic_launcher.png | Bin .../mipmap-xhdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-xxhdpi}/ic_launcher.png | Bin .../mipmap-xxhdpi}/ic_launcher_round.png | Bin ...veproduct_youtube_background_color_108.png | Bin ...veproduct_youtube_foreground_color_108.png | Bin .../launcher/mipmap-xxxhdpi}/ic_launcher.png | Bin .../mipmap-xxxhdpi}/ic_launcher_round.png | Bin ...daptive_monochrome_ic_youtube_launcher.xml | 0 .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin .../product_logo_youtube_color_144.png | Bin .../product_logo_youtube_color_192.png | Bin .../product_logo_youtube_color_24.png | Bin .../product_logo_youtube_color_36.png | Bin 566 files changed, 2043 insertions(+), 2341 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/extensions/Extensions.kt delete mode 100644 src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconMMTPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconPatch.kt delete mode 100644 src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconRevancifyBluePatch.kt delete mode 100644 src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconRevancifyRedPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/music/utils/integrations/Constants.kt rename src/main/kotlin/app/revanced/{util/enum => patches/music/utils/settings}/CategoryType.kt (70%) rename src/main/kotlin/app/revanced/{util/resources/MusicResourceHelper.kt => patches/music/utils/settings/ResourceUtils.kt} (83%) rename src/main/kotlin/app/revanced/{util/enum => patches/shared/patch/mapping}/ResourceType.kt (65%) rename src/main/kotlin/app/revanced/{util => patches/shared/patch}/microg/Constants.kt (98%) rename src/main/kotlin/app/revanced/{util => patches/shared/patch}/microg/MicroGBytecodeHelper.kt (95%) rename src/main/kotlin/app/revanced/{util => patches/shared/patch}/microg/MicroGManifestHelper.kt (81%) rename src/main/kotlin/app/revanced/{util => patches/shared/patch}/microg/MicroGResourceHelper.kt (96%) create mode 100644 src/main/kotlin/app/revanced/patches/shared/patch/translations/AbstractTranslationsPatch.kt rename src/main/kotlin/app/revanced/patches/youtube/alternativethumbnails/general/fingerprints/{CronetURLRequestCallbackOnSucceededFingerprint.kt.kt => CronetURLRequestCallbackOnSucceededFingerprint.kt} (100%) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconMMTPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconRevancifyBluePatch.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconRevancifyRedPatch.kt rename src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/fingerprints/{CoreConatinerBuilderFingerprint.kt => CoreContainerBuilderFingerprint.kt} (58%) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/utils/integrations/Constants.kt rename src/main/kotlin/app/revanced/{util/resources/ResourceHelper.kt => patches/youtube/utils/settings/ResourceUtils.kt} (67%) create mode 100644 src/main/kotlin/app/revanced/util/BytecodeUtils.kt create mode 100644 src/main/kotlin/app/revanced/util/ResourceUtils.kt delete mode 100644 src/main/kotlin/app/revanced/util/bytecode/BytecodeHelper.kt delete mode 100644 src/main/kotlin/app/revanced/util/bytecode/BytecodeUtils.kt create mode 100644 src/main/kotlin/app/revanced/util/fingerprint/LiteralValueFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/util/integrations/Constants.kt delete mode 100644 src/main/kotlin/app/revanced/util/pivotbar/InjectionUtils.kt delete mode 100644 src/main/kotlin/app/revanced/util/resources/IconHelper.kt delete mode 100644 src/main/kotlin/app/revanced/util/resources/ResourceUtils.kt rename src/main/resources/music/branding/mmt/{launchericon/hdpi => launcher/mipmap-hdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/hdpi => launcher/mipmap-hdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/hdpi => launcher/mipmap-hdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/mdpi => launcher/mipmap-mdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/mdpi => launcher/mipmap-mdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/mdpi => launcher/mipmap-mdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/xhdpi => launcher/mipmap-xhdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/xhdpi => launcher/mipmap-xhdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/xhdpi => launcher/mipmap-xhdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/xxhdpi => launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/xxhdpi => launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/xxhdpi => launcher/mipmap-xxhdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/xxxhdpi => launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/xxxhdpi => launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/mmt/{launchericon/xxxhdpi => launcher/mipmap-xxxhdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/mmt/{monochromeicon => monochrome}/drawable/ic_app_icons_themed_youtube_music.xml (100%) delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-hdpi/action_bar_logo.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-hdpi/action_bar_logo_release.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-hdpi/record.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-large-hdpi/record.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-large-mdpi/record.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-large-xhdpi/record.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-mdpi/action_bar_logo.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-mdpi/record.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-xhdpi/action_bar_logo.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-xhdpi/record.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-xlarge-hdpi/record.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-xlarge-mdpi/record.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-xxhdpi/action_bar_logo.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-xxhdpi/record.png delete mode 100644 src/main/resources/music/branding/mmt/resource/drawable-xxxhdpi/action_bar_logo.png rename src/main/resources/music/branding/{revancify-blue/launchericon/hdpi => revancify_blue/launcher/mipmap-hdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/hdpi => revancify_blue/launcher/mipmap-hdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/hdpi => revancify_blue/launcher/mipmap-hdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/mdpi => revancify_blue/launcher/mipmap-mdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/mdpi => revancify_blue/launcher/mipmap-mdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/mdpi => revancify_blue/launcher/mipmap-mdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/xhdpi => revancify_blue/launcher/mipmap-xhdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/xhdpi => revancify_blue/launcher/mipmap-xhdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/xhdpi => revancify_blue/launcher/mipmap-xhdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/xxhdpi => revancify_blue/launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/xxhdpi => revancify_blue/launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/xxhdpi => revancify_blue/launcher/mipmap-xxhdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/xxxhdpi => revancify_blue/launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/xxxhdpi => revancify_blue/launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-blue/launchericon/xxxhdpi => revancify_blue/launcher/mipmap-xxxhdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-blue/monochromeicon => revancify_blue/monochrome}/drawable/ic_app_icons_themed_youtube_music.xml (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/hdpi => revancify_red/launcher/mipmap-hdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/hdpi => revancify_red/launcher/mipmap-hdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/hdpi => revancify_red/launcher/mipmap-hdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/mdpi => revancify_red/launcher/mipmap-mdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/mdpi => revancify_red/launcher/mipmap-mdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/mdpi => revancify_red/launcher/mipmap-mdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/xhdpi => revancify_red/launcher/mipmap-xhdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/xhdpi => revancify_red/launcher/mipmap-xhdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/xhdpi => revancify_red/launcher/mipmap-xhdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/xxhdpi => revancify_red/launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/xxhdpi => revancify_red/launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/xxhdpi => revancify_red/launcher/mipmap-xxhdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/xxxhdpi => revancify_red/launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_music_background_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/xxxhdpi => revancify_red/launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_music_foreground_color_108.png (100%) rename src/main/resources/music/branding/{revancify-red/launchericon/xxxhdpi => revancify_red/launcher/mipmap-xxxhdpi}/ic_launcher_release.png (100%) rename src/main/resources/music/branding/{revancify-red/monochromeicon => revancify_red/monochrome}/drawable/ic_app_icons_themed_youtube_music.xml (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/hdpi => launcher/mipmap-hdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/hdpi => launcher/mipmap-hdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/hdpi => launcher/mipmap-hdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/hdpi => launcher/mipmap-hdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/mdpi => launcher/mipmap-mdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/mdpi => launcher/mipmap-mdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/mdpi => launcher/mipmap-mdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/mdpi => launcher/mipmap-mdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xhdpi => launcher/mipmap-xhdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xhdpi => launcher/mipmap-xhdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xhdpi => launcher/mipmap-xhdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xhdpi => launcher/mipmap-xhdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xxhdpi => launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xxhdpi => launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xxhdpi => launcher/mipmap-xxhdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xxhdpi => launcher/mipmap-xxhdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xxxhdpi => launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xxxhdpi => launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xxxhdpi => launcher/mipmap-xxxhdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/mmt/{launchericon/xxxhdpi => launcher/mipmap-xxxhdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/mmt/{monochromeicon => monochrome}/drawable/adaptive_monochrome_ic_youtube_launcher.xml (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/hdpi => splash/drawable-hdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/hdpi => splash/drawable-hdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/hdpi => splash/drawable-hdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/hdpi => splash/drawable-hdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/mdpi => splash/drawable-mdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/mdpi => splash/drawable-mdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/mdpi => splash/drawable-mdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/mdpi => splash/drawable-mdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xhdpi => splash/drawable-xhdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xhdpi => splash/drawable-xhdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xhdpi => splash/drawable-xhdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xhdpi => splash/drawable-xhdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xxhdpi => splash/drawable-xxhdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xxhdpi => splash/drawable-xxhdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xxhdpi => splash/drawable-xxhdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xxhdpi => splash/drawable-xxhdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xxxhdpi => splash/drawable-xxxhdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xxxhdpi => splash/drawable-xxxhdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xxxhdpi => splash/drawable-xxxhdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/mmt/{splashicon/xxxhdpi => splash/drawable-xxxhdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/hdpi => revancify_blue/launcher/mipmap-hdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/hdpi => revancify_blue/launcher/mipmap-hdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/hdpi => revancify_blue/launcher/mipmap-hdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/hdpi => revancify_blue/launcher/mipmap-hdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/mdpi => revancify_blue/launcher/mipmap-mdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/mdpi => revancify_blue/launcher/mipmap-mdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/mdpi => revancify_blue/launcher/mipmap-mdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/mdpi => revancify_blue/launcher/mipmap-mdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xhdpi => revancify_blue/launcher/mipmap-xhdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xhdpi => revancify_blue/launcher/mipmap-xhdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xhdpi => revancify_blue/launcher/mipmap-xhdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xhdpi => revancify_blue/launcher/mipmap-xhdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xxhdpi => revancify_blue/launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xxhdpi => revancify_blue/launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xxhdpi => revancify_blue/launcher/mipmap-xxhdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xxhdpi => revancify_blue/launcher/mipmap-xxhdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xxxhdpi => revancify_blue/launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xxxhdpi => revancify_blue/launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xxxhdpi => revancify_blue/launcher/mipmap-xxxhdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/launchericon/xxxhdpi => revancify_blue/launcher/mipmap-xxxhdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/monochromeicon => revancify_blue/monochrome}/drawable/adaptive_monochrome_ic_youtube_launcher.xml (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/hdpi => revancify_blue/splash/drawable-hdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/hdpi => revancify_blue/splash/drawable-hdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/hdpi => revancify_blue/splash/drawable-hdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/hdpi => revancify_blue/splash/drawable-hdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/mdpi => revancify_blue/splash/drawable-mdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/mdpi => revancify_blue/splash/drawable-mdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/mdpi => revancify_blue/splash/drawable-mdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/mdpi => revancify_blue/splash/drawable-mdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xhdpi => revancify_blue/splash/drawable-xhdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xhdpi => revancify_blue/splash/drawable-xhdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xhdpi => revancify_blue/splash/drawable-xhdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xhdpi => revancify_blue/splash/drawable-xhdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xxhdpi => revancify_blue/splash/drawable-xxhdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xxhdpi => revancify_blue/splash/drawable-xxhdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xxhdpi => revancify_blue/splash/drawable-xxhdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xxhdpi => revancify_blue/splash/drawable-xxhdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xxxhdpi => revancify_blue/splash/drawable-xxxhdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xxxhdpi => revancify_blue/splash/drawable-xxxhdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xxxhdpi => revancify_blue/splash/drawable-xxxhdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-blue/splashicon/xxxhdpi => revancify_blue/splash/drawable-xxxhdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/hdpi => revancify_red/launcher/mipmap-hdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/hdpi => revancify_red/launcher/mipmap-hdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/hdpi => revancify_red/launcher/mipmap-hdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/hdpi => revancify_red/launcher/mipmap-hdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/mdpi => revancify_red/launcher/mipmap-mdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/mdpi => revancify_red/launcher/mipmap-mdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/mdpi => revancify_red/launcher/mipmap-mdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/mdpi => revancify_red/launcher/mipmap-mdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xhdpi => revancify_red/launcher/mipmap-xhdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xhdpi => revancify_red/launcher/mipmap-xhdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xhdpi => revancify_red/launcher/mipmap-xhdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xhdpi => revancify_red/launcher/mipmap-xhdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xxhdpi => revancify_red/launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xxhdpi => revancify_red/launcher/mipmap-xxhdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xxhdpi => revancify_red/launcher/mipmap-xxhdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xxhdpi => revancify_red/launcher/mipmap-xxhdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xxxhdpi => revancify_red/launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xxxhdpi => revancify_red/launcher/mipmap-xxxhdpi}/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xxxhdpi => revancify_red/launcher/mipmap-xxxhdpi}/ic_launcher.png (100%) rename src/main/resources/youtube/branding/{revancify-red/launchericon/xxxhdpi => revancify_red/launcher/mipmap-xxxhdpi}/ic_launcher_round.png (100%) rename src/main/resources/youtube/branding/{revancify-red/monochromeicon => revancify_red/monochrome}/drawable/adaptive_monochrome_ic_youtube_launcher.xml (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/hdpi => revancify_red/splash/drawable-hdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/hdpi => revancify_red/splash/drawable-hdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/hdpi => revancify_red/splash/drawable-hdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/hdpi => revancify_red/splash/drawable-hdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/mdpi => revancify_red/splash/drawable-mdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/mdpi => revancify_red/splash/drawable-mdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/mdpi => revancify_red/splash/drawable-mdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/mdpi => revancify_red/splash/drawable-mdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xhdpi => revancify_red/splash/drawable-xhdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xhdpi => revancify_red/splash/drawable-xhdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xhdpi => revancify_red/splash/drawable-xhdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xhdpi => revancify_red/splash/drawable-xhdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xxhdpi => revancify_red/splash/drawable-xxhdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xxhdpi => revancify_red/splash/drawable-xxhdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xxhdpi => revancify_red/splash/drawable-xxhdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xxhdpi => revancify_red/splash/drawable-xxhdpi}/product_logo_youtube_color_36.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xxxhdpi => revancify_red/splash/drawable-xxxhdpi}/product_logo_youtube_color_144.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xxxhdpi => revancify_red/splash/drawable-xxxhdpi}/product_logo_youtube_color_192.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xxxhdpi => revancify_red/splash/drawable-xxxhdpi}/product_logo_youtube_color_24.png (100%) rename src/main/resources/youtube/branding/{revancify-red/splashicon/xxxhdpi => revancify_red/splash/drawable-xxxhdpi}/product_logo_youtube_color_36.png (100%) diff --git a/src/main/kotlin/app/revanced/extensions/Extensions.kt b/src/main/kotlin/app/revanced/extensions/Extensions.kt deleted file mode 100644 index 7223d7a9b..000000000 --- a/src/main/kotlin/app/revanced/extensions/Extensions.kt +++ /dev/null @@ -1,97 +0,0 @@ -package app.revanced.extensions - -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.patcher.patch.PatchException -import app.revanced.patcher.util.proxy.mutableTypes.MutableClass -import app.revanced.patcher.util.proxy.mutableTypes.MutableField -import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod -import app.revanced.patcher.util.smali.toInstruction -import app.revanced.util.integrations.Constants.PATCHES_PATH -import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation -import com.android.tools.smali.dexlib2.iface.Method -import com.android.tools.smali.dexlib2.util.MethodUtil -import org.w3c.dom.Node - -internal fun MutableMethodImplementation.injectHideCall( - index: Int, - register: Int, - patches: String, - method: String -) { - this.addInstruction( - index, - "invoke-static { v$register }, $PATCHES_PATH/$patches;->$method(Landroid/view/View;)V".toInstruction() - ) -} - -/** - * Return [PatchException] from a [MethodFingerprint]. - * - * @return The [PatchException] for the [MethodFingerprint]. - */ -val MethodFingerprint.exception - get() = PatchException("Failed to resolve ${this.javaClass.simpleName}") - -/** - * Find the [MutableMethod] from a given [Method] in a [MutableClass]. - * - * @param method The [Method] to find. - * @return The [MutableMethod]. - */ -fun MutableClass.findMutableMethodOf(method: Method) = this.methods.first { - MethodUtil.methodSignaturesMatch(it, method) -} - -/** - * apply a transform to all methods of the class - * - * @param transform the transformation function. original method goes in, transformed method goes out - */ -fun MutableClass.transformMethods(transform: MutableMethod.() -> MutableMethod) { - val transformedMethods = methods.map { it.transform() } - methods.clear() - methods.addAll(transformedMethods) -} - -/** - * apply a transform to all fields of the class - * - * @param transform the transformation function. original field goes in, transformed field goes out - */ -fun MutableClass.transformFields(transform: MutableField.() -> MutableField) { - val transformedFields = fields.map { it.transform() } - fields.clear() - fields.addAll(transformedFields) -} - -/** - * traverse the class hierarchy starting from the given root class - * - * @param targetClass the class to start traversing the class hierarchy from - * @param callback function that is called for every class in the hierarchy - */ -fun BytecodeContext.traverseClassHierarchy( - targetClass: MutableClass, - callback: MutableClass.() -> Unit -) { - callback(targetClass) - this.findClass(targetClass.superclass ?: return)?.mutableClass?.let { - traverseClassHierarchy(it, callback) - } -} - -internal fun Node.doRecursively(action: (Node) -> Unit) { - action(this) - for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action) -} - -internal fun String.startsWithAny(vararg prefixes: String): Boolean { - for (prefix in prefixes) - if (this.startsWith(prefix)) - return true - - return false -} - - diff --git a/src/main/kotlin/app/revanced/patches/music/account/component/MenuComponentPatch.kt b/src/main/kotlin/app/revanced/patches/music/account/component/MenuComponentPatch.kt index 76c6dcc10..c2912c848 100644 --- a/src/main/kotlin/app/revanced/patches/music/account/component/MenuComponentPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/account/component/MenuComponentPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.account.component -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,10 +9,11 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.music.account.component.fingerprints.MenuEntryFingerprint +import app.revanced.patches.music.utils.integrations.Constants.ACCOUNT import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_ACCOUNT +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.MethodReference @@ -43,7 +43,7 @@ object MenuComponentPatch : BytecodePatch( addInstruction( textIndex + 1, - "invoke-static {v$textRegister, v$viewRegister}, $MUSIC_ACCOUNT->hideAccountMenu(Ljava/lang/CharSequence;Landroid/view/View;)V" + "invoke-static {v$textRegister, v$viewRegister}, $ACCOUNT->hideAccountMenu(Ljava/lang/CharSequence;Landroid/view/View;)V" ) } } ?: throw MenuEntryFingerprint.exception diff --git a/src/main/kotlin/app/revanced/patches/music/account/component/fingerprints/MenuEntryFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/account/component/fingerprints/MenuEntryFingerprint.kt index 06b36b8d6..8c08a649d 100644 --- a/src/main/kotlin/app/revanced/patches/music/account/component/fingerprints/MenuEntryFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/account/component/fingerprints/MenuEntryFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.music.account.component.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.MenuEntry -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object MenuEntryFingerprint : MethodFingerprint( +object MenuEntryFingerprint : LiteralValueFingerprint( returnType = "V", - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(MenuEntry) } + literalSupplier = { MenuEntry } ) diff --git a/src/main/kotlin/app/revanced/patches/music/account/handle/HideHandlePatch.kt b/src/main/kotlin/app/revanced/patches/music/account/handle/HideHandlePatch.kt index e55ba392d..55b13a6dd 100644 --- a/src/main/kotlin/app/revanced/patches/music/account/handle/HideHandlePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/account/handle/HideHandlePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.account.handle -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,10 +9,11 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.account.handle.fingerprints.AccountSwitcherAccessibilityLabelFingerprint import app.revanced.patches.music.account.handle.fingerprints.NamesInactiveAccountThumbnailSizeFingerprint +import app.revanced.patches.music.utils.integrations.Constants.ACCOUNT import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_ACCOUNT +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -56,7 +56,7 @@ object HideHandlePatch : BytecodePatch( replaceInstruction( index, - "invoke-static {v${textViewInstruction.registerC}, v${textViewInstruction.registerD}}, $MUSIC_ACCOUNT->hideHandle(Landroid/widget/TextView;I)V" + "invoke-static {v${textViewInstruction.registerC}, v${textViewInstruction.registerD}}, $ACCOUNT->hideHandle(Landroid/widget/TextView;I)V" ) break @@ -75,7 +75,7 @@ object HideHandlePatch : BytecodePatch( addInstructions( targetIndex, """ - invoke-static {v$targetRegister}, $MUSIC_ACCOUNT->hideHandle(Z)Z + invoke-static {v$targetRegister}, $ACCOUNT->hideHandle(Z)Z move-result v$targetRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/account/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/account/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt index da9b041a0..4295e8bd7 100644 --- a/src/main/kotlin/app/revanced/patches/music/account/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/account/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.music.account.handle.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.AccountSwitcherAccessibility -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object AccountSwitcherAccessibilityLabelFingerprint : MethodFingerprint( +object AccountSwitcherAccessibilityLabelFingerprint : LiteralValueFingerprint( returnType = "V", parameters = listOf("L", "Ljava/lang/Object;"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(AccountSwitcherAccessibility) } + literalSupplier = { AccountSwitcherAccessibility } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/account/handle/fingerprints/NamesInactiveAccountThumbnailSizeFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/account/handle/fingerprints/NamesInactiveAccountThumbnailSizeFingerprint.kt index 5822532ef..cef825d17 100644 --- a/src/main/kotlin/app/revanced/patches/music/account/handle/fingerprints/NamesInactiveAccountThumbnailSizeFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/account/handle/fingerprints/NamesInactiveAccountThumbnailSizeFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.music.account.handle.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.NamesInactiveAccountThumbnailSize -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object NamesInactiveAccountThumbnailSizeFingerprint : MethodFingerprint( +object NamesInactiveAccountThumbnailSizeFingerprint : LiteralValueFingerprint( returnType = "V", parameters = listOf("L", "Ljava/lang/Object;"), opcodes = listOf( @@ -21,9 +20,5 @@ object NamesInactiveAccountThumbnailSizeFingerprint : MethodFingerprint( Opcode.MOVE_RESULT_OBJECT, Opcode.IF_EQZ ), - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - NamesInactiveAccountThumbnailSize - ) - } + literalSupplier = { NamesInactiveAccountThumbnailSize } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/account/tos/TermsContainerPatch.kt b/src/main/kotlin/app/revanced/patches/music/account/tos/TermsContainerPatch.kt index b9795a6f5..81aef9faf 100644 --- a/src/main/kotlin/app/revanced/patches/music/account/tos/TermsContainerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/account/tos/TermsContainerPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.account.tos -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -10,10 +9,11 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.account.tos.fingerprints.TermsOfServiceFingerprint +import app.revanced.patches.music.utils.integrations.Constants.ACCOUNT import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_ACCOUNT +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c @@ -55,7 +55,7 @@ object TermsContainerPatch : BytecodePatch( ) addInstructions( index, """ - invoke-static {}, $MUSIC_ACCOUNT->hideTermsContainer()I + invoke-static {}, $ACCOUNT->hideTermsContainer()I move-result v$visibilityRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/account/tos/fingerprints/TermsOfServiceFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/account/tos/fingerprints/TermsOfServiceFingerprint.kt index 38d381c03..5049d83f7 100644 --- a/src/main/kotlin/app/revanced/patches/music/account/tos/fingerprints/TermsOfServiceFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/account/tos/fingerprints/TermsOfServiceFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.music.account.tos.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.TosFooter -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object TermsOfServiceFingerprint : MethodFingerprint( +object TermsOfServiceFingerprint : LiteralValueFingerprint( returnType = "Landroid/view/View;", - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(TosFooter) } + literalSupplier = { TosFooter } ) diff --git a/src/main/kotlin/app/revanced/patches/music/actionbar/downloadbuttonhook/DownloadButtonHookPatch.kt b/src/main/kotlin/app/revanced/patches/music/actionbar/downloadbuttonhook/DownloadButtonHookPatch.kt index ba79e4345..353e8aa6d 100644 --- a/src/main/kotlin/app/revanced/patches/music/actionbar/downloadbuttonhook/DownloadButtonHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/actionbar/downloadbuttonhook/DownloadButtonHookPatch.kt @@ -6,9 +6,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.actionbarhook.ActionBarHookPatch import app.revanced.patches.music.utils.intenthook.IntentHookPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.music.video.information.VideoInformationPatch -import app.revanced.util.enum.CategoryType @Patch( name = "Hook download button", @@ -22,7 +22,7 @@ import app.revanced.util.enum.CategoryType compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object DownloadButtonHookPatch : BytecodePatch() { +object DownloadButtonHookPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { SettingsPatch.addMusicPreference( diff --git a/src/main/kotlin/app/revanced/patches/music/actionbar/label/ActionBarLabelPatch.kt b/src/main/kotlin/app/revanced/patches/music/actionbar/label/ActionBarLabelPatch.kt index eb8bc0c81..eca14c67c 100644 --- a/src/main/kotlin/app/revanced/patches/music/actionbar/label/ActionBarLabelPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/actionbar/label/ActionBarLabelPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.actionbar.label -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,10 +8,11 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.actionbar.label.fingerprints.ActionBarLabelFingerprint import app.revanced.patches.music.utils.fingerprints.ActionsBarParentFingerprint +import app.revanced.patches.music.utils.integrations.Constants.ACTIONBAR import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_ACTIONBAR +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -43,7 +43,7 @@ object ActionBarLabelPatch : BytecodePatch( addInstructions( targetIndex, """ - invoke-static {v$targetRegister}, $MUSIC_ACTIONBAR->hideActionBarLabel(Z)Z + invoke-static {v$targetRegister}, $ACTIONBAR->hideActionBarLabel(Z)Z move-result v$targetRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/actionbar/radio/HideRadioButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/actionbar/radio/HideRadioButtonPatch.kt index 5ad7886aa..9514f46a6 100644 --- a/src/main/kotlin/app/revanced/patches/music/actionbar/radio/HideRadioButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/actionbar/radio/HideRadioButtonPatch.kt @@ -5,8 +5,8 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.actionbarhook.ActionBarHookPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType @Patch( name = "Hide radio button", @@ -18,7 +18,7 @@ import app.revanced.util.enum.CategoryType compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object HideRadioButtonPatch : BytecodePatch() { +object HideRadioButtonPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { SettingsPatch.addMusicPreference( diff --git a/src/main/kotlin/app/revanced/patches/music/ads/general/GeneralAdsPatch.kt b/src/main/kotlin/app/revanced/patches/music/ads/general/GeneralAdsPatch.kt index 385460701..16223f529 100644 --- a/src/main/kotlin/app/revanced/patches/music/ads/general/GeneralAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/ads/general/GeneralAdsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.ads.general -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,14 +9,15 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.ads.general.fingerprints.FloatingLayoutFingerprint import app.revanced.patches.music.ads.general.fingerprints.NotifierShelfFingerprint import app.revanced.patches.music.ads.music.MusicAdsPatch +import app.revanced.patches.music.utils.integrations.Constants.ADS_PATH +import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.music.utils.litho.LithoFilterPatch import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.FloatingLayout +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH -import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -47,12 +47,12 @@ object GeneralAdsPatch : BytecodePatch( */ FloatingLayoutFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(FloatingLayout) + 2 + val targetIndex = getWideLiteralInstructionIndex(FloatingLayout) + 2 val targetRegister = getInstruction(targetIndex).registerA addInstruction( targetIndex + 1, - "invoke-static {v$targetRegister}, $MUSIC_ADS_PATH/PremiumPromotionPatch;->hidePremiumPromotion(Landroid/view/View;)V" + "invoke-static {v$targetRegister}, $ADS_PATH/PremiumPromotionPatch;->hidePremiumPromotion(Landroid/view/View;)V" ) } } ?: throw FloatingLayoutFingerprint.exception @@ -63,25 +63,35 @@ object GeneralAdsPatch : BytecodePatch( NotifierShelfFingerprint.result?.let { it.mutableMethod.apply { val linearLayoutIndex = it.scanResult.patternScanResult!!.startIndex - val linearLayoutRegister = getInstruction(linearLayoutIndex).registerC + val linearLayoutRegister = + getInstruction(linearLayoutIndex).registerC val textViewIndex = linearLayoutIndex + 2 - val textViewRegister = getInstruction(textViewIndex).registerA + val textViewRegister = + getInstruction(textViewIndex).registerA addInstruction( textViewIndex, - "invoke-static {v$linearLayoutRegister, v$textViewRegister}, $MUSIC_ADS_PATH/PremiumRenewalPatch;->hidePremiumRenewal(Landroid/widget/LinearLayout;Landroid/view/View;)V" + "invoke-static {v$linearLayoutRegister, v$textViewRegister}, $ADS_PATH/PremiumRenewalPatch;->hidePremiumRenewal(Landroid/widget/LinearLayout;Landroid/view/View;)V" ) } } ?: throw NotifierShelfFingerprint.exception - SettingsPatch.addMusicPreference(CategoryType.ADS, "revanced_close_interstitial_ads", "true") + SettingsPatch.addMusicPreference( + CategoryType.ADS, + "revanced_close_interstitial_ads", + "true" + ) SettingsPatch.addMusicPreference(CategoryType.ADS, "revanced_hide_general_ads", "true") SettingsPatch.addMusicPreference(CategoryType.ADS, "revanced_hide_music_ads", "true") - SettingsPatch.addMusicPreference(CategoryType.ADS, "revanced_hide_premium_promotion", "true") + SettingsPatch.addMusicPreference( + CategoryType.ADS, + "revanced_hide_premium_promotion", + "true" + ) SettingsPatch.addMusicPreference(CategoryType.ADS, "revanced_hide_premium_renewal", "true") } private const val FILTER_CLASS_DESCRIPTOR = - "$MUSIC_COMPONENTS_PATH/AdsFilter;" + "$COMPONENTS_PATH/AdsFilter;" } diff --git a/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/FloatingLayoutFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/FloatingLayoutFingerprint.kt index 0eb149a37..733ff72af 100644 --- a/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/FloatingLayoutFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/FloatingLayoutFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.music.ads.general.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.FloatingLayout -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object FloatingLayoutFingerprint : MethodFingerprint( +object FloatingLayoutFingerprint : LiteralValueFingerprint( returnType = "Landroid/view/View;", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = emptyList(), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(FloatingLayout) } + literalSupplier = { FloatingLayout } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/NotifierShelfFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/NotifierShelfFingerprint.kt index 77bbd01b5..5f88e662d 100644 --- a/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/NotifierShelfFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/NotifierShelfFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.ads.general.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.MusicNotifierShelf -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object NotifierShelfFingerprint : MethodFingerprint( +object NotifierShelfFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, opcodes = listOf( @@ -16,5 +15,5 @@ object NotifierShelfFingerprint : MethodFingerprint( Opcode.CHECK_CAST, Opcode.IPUT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(MusicNotifierShelf) } + literalSupplier = { MusicNotifierShelf } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/ads/music/MusicAdsPatch.kt b/src/main/kotlin/app/revanced/patches/music/ads/music/MusicAdsPatch.kt index 75f559674..988725031 100644 --- a/src/main/kotlin/app/revanced/patches/music/ads/music/MusicAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/ads/music/MusicAdsPatch.kt @@ -1,8 +1,8 @@ package app.revanced.patches.music.ads.music +import app.revanced.patches.music.utils.integrations.Constants.ADS_PATH import app.revanced.patches.shared.patch.ads.AbstractAdsPatch -import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH object MusicAdsPatch : AbstractAdsPatch( - "$MUSIC_ADS_PATH/MusicAdsPatch;->hideMusicAds()Z" + "$ADS_PATH/MusicAdsPatch;->hideMusicAds()Z" ) diff --git a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/compactdialog/CompactDialogPatch.kt b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/compactdialog/CompactDialogPatch.kt index 50eef9178..2ff9cbafe 100644 --- a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/compactdialog/CompactDialogPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/compactdialog/CompactDialogPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.flyoutpanel.compactdialog -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch @@ -8,10 +7,11 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.music.flyoutpanel.compactdialog.fingerprints.DialogSolidFingerprint +import app.revanced.patches.music.utils.integrations.Constants.FLYOUT import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_FLYOUT +import app.revanced.util.exception @Patch( name = "Enable compact dialog", @@ -36,7 +36,7 @@ object CompactDialogPatch : BytecodePatch( ) { addInstructions( 2, """ - invoke-static {p0}, $MUSIC_FLYOUT->enableCompactDialog(I)I + invoke-static {p0}, $FLYOUT->enableCompactDialog(I)I move-result p0 """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/compactdialog/fingerprints/DialogSolidFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/compactdialog/fingerprints/DialogSolidFingerprint.kt index 2cad4ed5d..fcddc4a07 100644 --- a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/compactdialog/fingerprints/DialogSolidFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/compactdialog/fingerprints/DialogSolidFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.flyoutpanel.compactdialog.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.DialogSolid -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object DialogSolidFingerprint : MethodFingerprint( +object DialogSolidFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L"), @@ -16,6 +15,6 @@ object DialogSolidFingerprint : MethodFingerprint( Opcode.MOVE_RESULT_OBJECT, Opcode.INVOKE_STATIC ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(DialogSolid) } + literalSupplier = { DialogSolid } ) diff --git a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/component/FlyoutPanelPatch.kt b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/component/FlyoutPanelPatch.kt index 68a1c38b9..2a02fb411 100644 --- a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/component/FlyoutPanelPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/component/FlyoutPanelPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.flyoutpanel.component -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -11,9 +10,10 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.music.flyoutpanel.utils.EnumUtils.getEnumIndex import app.revanced.patches.music.utils.fingerprints.MenuItemFingerprint import app.revanced.patches.music.utils.flyoutbutton.FlyoutButtonContainerPatch +import app.revanced.patches.music.utils.integrations.Constants.FLYOUT +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_FLYOUT +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.Instruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -48,7 +48,7 @@ object FlyoutPanelPatch : BytecodePatch( addInstructionsWithLabels( enumIndex + 1, """ - invoke-static {v$enumRegister}, $MUSIC_FLYOUT->hideFlyoutPanels(Ljava/lang/Enum;)Z + invoke-static {v$enumRegister}, $FLYOUT->hideFlyoutPanels(Ljava/lang/Enum;)Z move-result v$freeRegister if-nez v$freeRegister, :hide """, ExternalLabel("hide", jumpInstruction) diff --git a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/playbackspeed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/playbackspeed/PlaybackSpeedPatch.kt index cd648b590..c35d3961a 100644 --- a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/playbackspeed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/playbackspeed/PlaybackSpeedPatch.kt @@ -6,8 +6,8 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.flyoutbutton.FlyoutButtonContainerPatch import app.revanced.patches.music.utils.overridespeed.OverrideSpeedHookPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType @Patch( name = "Enable playback speed", @@ -20,7 +20,7 @@ import app.revanced.util.enum.CategoryType compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object PlaybackSpeedPatch : BytecodePatch() { +object PlaybackSpeedPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { SettingsPatch.addMusicPreference( diff --git a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/replace/ReplaceDismissQueuePatch.kt b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/replace/ReplaceDismissQueuePatch.kt index 638fe0a6a..2dd7c18d7 100644 --- a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/replace/ReplaceDismissQueuePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/replace/ReplaceDismissQueuePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.flyoutpanel.replace -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,10 +9,11 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.flyoutpanel.utils.EnumUtils.getEnumIndex import app.revanced.patches.music.utils.fingerprints.MenuItemFingerprint import app.revanced.patches.music.utils.flyoutbutton.FlyoutButtonItemResourcePatch +import app.revanced.patches.music.utils.integrations.Constants.FLYOUT +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.music.video.information.VideoInformationPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_FLYOUT +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -46,7 +46,7 @@ object ReplaceDismissQueuePatch : BytecodePatch( addInstruction( enumIndex + 1, - "invoke-static {v$enumRegister, v$textViewRegister, v$imageViewRegister}, $MUSIC_FLYOUT->replaceDismissQueue(Ljava/lang/Enum;Landroid/widget/TextView;Landroid/widget/ImageView;)V" + "invoke-static {v$enumRegister, v$textViewRegister, v$imageViewRegister}, $FLYOUT->replaceDismissQueue(Ljava/lang/Enum;Landroid/widget/TextView;Landroid/widget/ImageView;)V" ) } } ?: throw MenuItemFingerprint.exception diff --git a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/sleeptimer/SleepTimerPatch.kt b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/sleeptimer/SleepTimerPatch.kt index b12e62bf1..8a28b70f8 100644 --- a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/sleeptimer/SleepTimerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/sleeptimer/SleepTimerPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.flyoutpanel.sleeptimer -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,9 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.flyoutpanel.sleeptimer.fingerprints.SleepTimerFingerprint +import app.revanced.patches.music.utils.integrations.Constants.FLYOUT +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_FLYOUT +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -32,7 +32,7 @@ object SleepTimerPatch : BytecodePatch( addInstructions( insertIndex, """ - invoke-static {}, $MUSIC_FLYOUT->enableSleepTimer()Z + invoke-static {}, $FLYOUT->enableSleepTimer()Z move-result v$targetRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/sleeptimer/fingerprints/SleepTimerFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/sleeptimer/fingerprints/SleepTimerFingerprint.kt index c4008d050..acf6f3b77 100644 --- a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/sleeptimer/fingerprints/SleepTimerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/sleeptimer/fingerprints/SleepTimerFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.music.flyoutpanel.sleeptimer.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object SleepTimerFingerprint : MethodFingerprint( +object SleepTimerFingerprint : LiteralValueFingerprint( returnType = "Z", parameters = emptyList(), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45372767) } + literalSupplier = { 45372767 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/general/amoled/AmoledPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/amoled/AmoledPatch.kt index 2adc6f55b..4dd683570 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/amoled/AmoledPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/amoled/AmoledPatch.kt @@ -4,8 +4,8 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.shared.patch.litho.LithoThemePatch -import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH import org.w3c.dom.Element @Patch( @@ -18,7 +18,7 @@ import org.w3c.dom.Element object AmoledPatch : ResourcePatch() { override fun execute(context: ResourceContext) { - LithoThemePatch.injectCall("$MUSIC_UTILS_PATH/LithoThemePatch;->applyLithoTheme(I)I") + LithoThemePatch.injectCall("$UTILS_PATH/LithoThemePatch;->applyLithoTheme(I)I") context.xmlEditor["res/values/colors.xml"].use { editor -> val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element diff --git a/src/main/kotlin/app/revanced/patches/music/general/autocaptions/DisableAutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/autocaptions/DisableAutoCaptionsPatch.kt index 760e83087..fa0c6a7c9 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/autocaptions/DisableAutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/autocaptions/DisableAutoCaptionsPatch.kt @@ -1,16 +1,16 @@ package app.revanced.patches.music.general.autocaptions -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.GENERAL +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.shared.fingerprints.captions.SubtitleTrackFingerprint -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -32,7 +32,7 @@ object DisableAutoCaptionsPatch : BytecodePatch( addInstructions( index, """ - invoke-static {v$register}, $MUSIC_GENERAL->disableAutoCaptions(Z)Z + invoke-static {v$register}, $GENERAL->disableAutoCaptions(Z)Z move-result v$register """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconMMTPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconMMTPatch.kt deleted file mode 100644 index 52914e8f2..000000000 --- a/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconMMTPatch.kt +++ /dev/null @@ -1,25 +0,0 @@ -package app.revanced.patches.music.general.branding.icon - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.util.resources.IconHelper.customIconMusic -import app.revanced.util.resources.IconHelper.customIconMusicAdditional - -@Patch( - name = "Custom branding icon MMT", - description = "Changes the YouTube Music launcher icon to MMT.", - compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")], - use = false -) -@Suppress("unused") -object CustomBrandingIconMMTPatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - - context.customIconMusic("mmt") - context.customIconMusicAdditional("mmt") - - } - -} diff --git a/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconPatch.kt new file mode 100644 index 000000000..95a39e04b --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconPatch.kt @@ -0,0 +1,112 @@ +package app.revanced.patches.music.general.branding.icon + +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.PatchException +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotation.CompatiblePackage +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import java.io.File +import java.nio.file.Files + +@Patch( + name = "Custom branding icon YouTube Music", + description = "Change the YouTube Music launcher icon to the icon specified in options.json.", + compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] +) +@Suppress("unused") +object CustomBrandingIconPatch : ResourcePatch() { + private const val DEFAULT_ICON_KEY = "Revancify Blue" + + private val availableIcon = mapOf( + "MMT" to "mmt", + DEFAULT_ICON_KEY to "revancify_blue", + "Revancify Red" to "revancify_red" + ) + + private val mipmapIconResourceFileNames = arrayOf( + "adaptiveproduct_youtube_music_background_color_108", + "adaptiveproduct_youtube_music_foreground_color_108", + "ic_launcher_release" + ).map { "$it.png" }.toTypedArray() + + private val mipmapDirectories = arrayOf( + "xxxhdpi", + "xxhdpi", + "xhdpi", + "hdpi", + "mdpi" + ).map { "mipmap-$it" } + + private var AppIcon by stringPatchOption( + key = "AppIcon", + default = DEFAULT_ICON_KEY, + values = availableIcon, + title = "App icon", + description = """ + The path to a folder containing the following folders: + + ${mipmapDirectories.joinToString("\n") { "- $it" }} + + Each of these folders has to have the following files: + + ${mipmapIconResourceFileNames.joinToString("\n") { "- $it" }} + """ + .split("\n") + .joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line. + .trimIndent(), // Remove the leading newline. + ) + + override fun execute(context: ResourceContext) { + AppIcon?.let { appIcon -> + if (!availableIcon.containsKey(appIcon)) { + mipmapDirectories.map { directory -> + ResourceGroup( + directory, *mipmapIconResourceFileNames + ) + }.let { resourceGroups -> + val path = File(appIcon) + val resourceDirectory = context["res"] + + resourceGroups.forEach { group -> + val fromDirectory = path.resolve(group.resourceDirectoryName) + val toDirectory = resourceDirectory.resolve(group.resourceDirectoryName) + + group.resources.forEach { iconFileName -> + Files.write( + toDirectory.resolve(iconFileName).toPath(), + fromDirectory.resolve(iconFileName).readBytes() + ) + } + } + } + } else { + val appIconValue = availableIcon[appIcon] + "" + val resourcePath = "music/branding/$appIconValue" + + // change launcher icon. + mipmapDirectories.map { directory -> + ResourceGroup( + directory, *mipmapIconResourceFileNames + ) + }.let { resourceGroups -> + resourceGroups.forEach { + context.copyResources("$resourcePath/launcher", it) + } + } + + // change monochrome icon. + arrayOf( + ResourceGroup( + "drawable", + "ic_app_icons_themed_youtube_music.xml" + ) + ).forEach { resourceGroup -> + context.copyResources("$resourcePath/monochrome", resourceGroup) + } + } + } ?: throw PatchException("Invalid app icon path.") + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconRevancifyBluePatch.kt b/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconRevancifyBluePatch.kt deleted file mode 100644 index 92f33dcb1..000000000 --- a/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconRevancifyBluePatch.kt +++ /dev/null @@ -1,22 +0,0 @@ -package app.revanced.patches.music.general.branding.icon - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.util.resources.IconHelper.customIconMusic - -@Patch( - name = "Custom branding icon Revancify Blue", - description = "Changes the YouTube Music launcher icon to Revancify Blue.", - compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] -) -@Suppress("unused") -object CustomBrandingIconRevancifyBluePatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - - context.customIconMusic("revancify-blue") - - } - -} diff --git a/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconRevancifyRedPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconRevancifyRedPatch.kt deleted file mode 100644 index f9b161bbd..000000000 --- a/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconRevancifyRedPatch.kt +++ /dev/null @@ -1,23 +0,0 @@ -package app.revanced.patches.music.general.branding.icon - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.util.resources.IconHelper.customIconMusic - -@Patch( - name = "Custom branding icon Revancify Red", - description = "Changes the YouTube Music launcher icon to Revancify Red.", - compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")], - use = false -) -@Suppress("unused") -object CustomBrandingIconRevancifyRedPatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - - context.customIconMusic("revancify-red") - - } - -} diff --git a/src/main/kotlin/app/revanced/patches/music/general/buttonshelf/HideButtonShelfPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/buttonshelf/HideButtonShelfPatch.kt index 6de4d2a9d..065e496d3 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/buttonshelf/HideButtonShelfPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/buttonshelf/HideButtonShelfPatch.kt @@ -4,10 +4,10 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.music.utils.litho.LithoFilterPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH @Patch( name = "Hide button shelf", @@ -19,7 +19,7 @@ import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object HideButtonShelfPatch : BytecodePatch() { +object HideButtonShelfPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { SettingsPatch.addMusicPreference( @@ -33,5 +33,5 @@ object HideButtonShelfPatch : BytecodePatch() { } private const val FILTER_CLASS_DESCRIPTOR = - "$MUSIC_COMPONENTS_PATH/ButtonShelfFilter;" + "$COMPONENTS_PATH/ButtonShelfFilter;" } diff --git a/src/main/kotlin/app/revanced/patches/music/general/carouselshelf/HideCarouselShelfPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/carouselshelf/HideCarouselShelfPatch.kt index aefe5d150..b4def4476 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/carouselshelf/HideCarouselShelfPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/carouselshelf/HideCarouselShelfPatch.kt @@ -4,10 +4,10 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.music.utils.litho.LithoFilterPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH @Patch( name = "Hide carousel shelf", @@ -19,7 +19,7 @@ import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object HideCarouselShelfPatch : BytecodePatch() { +object HideCarouselShelfPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { SettingsPatch.addMusicPreference( @@ -33,5 +33,5 @@ object HideCarouselShelfPatch : BytecodePatch() { } private const val FILTER_CLASS_DESCRIPTOR = - "$MUSIC_COMPONENTS_PATH/CarouselShelfFilter;" + "$COMPONENTS_PATH/CarouselShelfFilter;" } diff --git a/src/main/kotlin/app/revanced/patches/music/general/castbutton/HideCastButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/castbutton/HideCastButtonPatch.kt index 7c063b089..084a253b8 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/castbutton/HideCastButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/castbutton/HideCastButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.general.castbutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -11,12 +10,13 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.general.castbutton.fingerprints.MediaRouteButtonFingerprint import app.revanced.patches.music.general.castbutton.fingerprints.PlayerOverlayChipFingerprint +import app.revanced.patches.music.utils.integrations.Constants.GENERAL import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.PlayerOverlayChip +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_GENERAL +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -47,7 +47,7 @@ object HideCastButtonPatch : BytecodePatch( setVisibilityMethod?.apply { addInstructions( 0, """ - invoke-static {p1}, $MUSIC_GENERAL->hideCastButton(I)I + invoke-static {p1}, $GENERAL->hideCastButton(I)I move-result p1 """ ) @@ -59,12 +59,12 @@ object HideCastButtonPatch : BytecodePatch( */ PlayerOverlayChipFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(PlayerOverlayChip) + 2 + val targetIndex = getWideLiteralInstructionIndex(PlayerOverlayChip) + 2 val targetRegister = getInstruction(targetIndex).registerA addInstruction( targetIndex + 1, - "invoke-static {v$targetRegister}, $MUSIC_GENERAL->hideCastButton(Landroid/view/View;)V" + "invoke-static {v$targetRegister}, $GENERAL->hideCastButton(Landroid/view/View;)V" ) } } ?: throw PlayerOverlayChipFingerprint.exception diff --git a/src/main/kotlin/app/revanced/patches/music/general/castbutton/fingerprints/PlayerOverlayChipFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/general/castbutton/fingerprints/PlayerOverlayChipFingerprint.kt index 01c6ac2b6..553b75e2b 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/castbutton/fingerprints/PlayerOverlayChipFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/castbutton/fingerprints/PlayerOverlayChipFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.general.castbutton.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.PlayerOverlayChip -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object PlayerOverlayChipFingerprint : MethodFingerprint( +object PlayerOverlayChipFingerprint : LiteralValueFingerprint( returnType = "L", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(PlayerOverlayChip) } + literalSupplier = { PlayerOverlayChip } ) diff --git a/src/main/kotlin/app/revanced/patches/music/general/categorybar/CategoryBarPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/categorybar/CategoryBarPatch.kt index 79845441d..4f72a8ddf 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/categorybar/CategoryBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/categorybar/CategoryBarPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.general.categorybar -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,10 +7,11 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.general.categorybar.fingerprints.ChipCloudFingerprint +import app.revanced.patches.music.utils.integrations.Constants.GENERAL import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -35,7 +35,7 @@ object CategoryBarPatch : BytecodePatch( addInstruction( targetIndex + 1, - "invoke-static { v$targetRegister }, $MUSIC_GENERAL->hideCategoryBar(Landroid/view/View;)V" + "invoke-static { v$targetRegister }, $GENERAL->hideCategoryBar(Landroid/view/View;)V" ) } } ?: throw ChipCloudFingerprint.exception diff --git a/src/main/kotlin/app/revanced/patches/music/general/categorybar/fingerprints/ChipCloudFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/general/categorybar/fingerprints/ChipCloudFingerprint.kt index 0759dfb1c..443309a29 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/categorybar/fingerprints/ChipCloudFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/categorybar/fingerprints/ChipCloudFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.music.general.categorybar.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.ChipCloud -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object ChipCloudFingerprint : MethodFingerprint( +object ChipCloudFingerprint : LiteralValueFingerprint( returnType = "V", opcodes = listOf( Opcode.CONST, @@ -13,6 +12,6 @@ object ChipCloudFingerprint : MethodFingerprint( Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ChipCloud) } + literalSupplier = { ChipCloud } ) diff --git a/src/main/kotlin/app/revanced/patches/music/general/channelguidelines/HideChannelGuidelinesPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/channelguidelines/HideChannelGuidelinesPatch.kt index 3ead35b4c..e3c4d5194 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/channelguidelines/HideChannelGuidelinesPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/channelguidelines/HideChannelGuidelinesPatch.kt @@ -4,10 +4,10 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.music.utils.litho.LithoFilterPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH @Patch( name = "Hide channel guidelines", @@ -19,7 +19,7 @@ import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object HideChannelGuidelinesPatch : BytecodePatch() { +object HideChannelGuidelinesPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { SettingsPatch.addMusicPreference( @@ -33,5 +33,5 @@ object HideChannelGuidelinesPatch : BytecodePatch() { } private const val FILTER_CLASS_DESCRIPTOR = - "$MUSIC_COMPONENTS_PATH/ChannelGuidelinesFilter;" + "$COMPONENTS_PATH/ChannelGuidelinesFilter;" } diff --git a/src/main/kotlin/app/revanced/patches/music/general/customfilter/CustomFilterPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/customfilter/CustomFilterPatch.kt index 44c96e170..cf43120c4 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/customfilter/CustomFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/customfilter/CustomFilterPatch.kt @@ -4,10 +4,10 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.music.utils.litho.LithoFilterPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH @Patch( name = "Enable custom filter", @@ -19,7 +19,7 @@ import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object CustomFilterPatch : BytecodePatch() { +object CustomFilterPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { SettingsPatch.addMusicPreference( @@ -38,5 +38,5 @@ object CustomFilterPatch : BytecodePatch() { } private const val FILTER_CLASS_DESCRIPTOR = - "$MUSIC_COMPONENTS_PATH/CustomFilter;" + "$COMPONENTS_PATH/CustomFilter;" } diff --git a/src/main/kotlin/app/revanced/patches/music/general/emojipicker/HideEmojiPickerPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/emojipicker/HideEmojiPickerPatch.kt index 2f2d9739c..b06d779dd 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/emojipicker/HideEmojiPickerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/emojipicker/HideEmojiPickerPatch.kt @@ -4,10 +4,10 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.music.utils.litho.LithoFilterPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH @Patch( name = "Hide emoji picker", @@ -19,7 +19,7 @@ import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object HideEmojiPickerPatch : BytecodePatch() { +object HideEmojiPickerPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { SettingsPatch.addMusicPreference( @@ -33,5 +33,5 @@ object HideEmojiPickerPatch : BytecodePatch() { } private const val FILTER_CLASS_DESCRIPTOR = - "$MUSIC_COMPONENTS_PATH/EmojiPickerFilter;" + "$COMPONENTS_PATH/EmojiPickerFilter;" } diff --git a/src/main/kotlin/app/revanced/patches/music/general/floatingbutton/NewPlaylistButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/floatingbutton/NewPlaylistButtonPatch.kt index 4fcd38d3e..d57042fdb 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/floatingbutton/NewPlaylistButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/floatingbutton/NewPlaylistButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.general.floatingbutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,10 +9,11 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.music.general.floatingbutton.fingerprints.FloatingButtonFingerprint import app.revanced.patches.music.general.floatingbutton.fingerprints.FloatingButtonParentFingerprint +import app.revanced.patches.music.utils.integrations.Constants.GENERAL import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_GENERAL +import app.revanced.util.exception @Patch( name = "Hide new playlist button", @@ -40,7 +40,7 @@ object NewPlaylistButtonPatch : BytecodePatch( it.mutableMethod.apply { addInstructionsWithLabels( 1, """ - invoke-static {}, $MUSIC_GENERAL->hideNewPlaylistButton()Z + invoke-static {}, $GENERAL->hideNewPlaylistButton()Z move-result v0 if-eqz v0, :show return-void diff --git a/src/main/kotlin/app/revanced/patches/music/general/floatingbutton/fingerprints/FloatingButtonParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/general/floatingbutton/fingerprints/FloatingButtonParentFingerprint.kt index 0cdc699b2..b0132cbdb 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/floatingbutton/fingerprints/FloatingButtonParentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/floatingbutton/fingerprints/FloatingButtonParentFingerprint.kt @@ -1,16 +1,15 @@ package app.revanced.patches.music.general.floatingbutton.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isNarrowLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object FloatingButtonParentFingerprint : MethodFingerprint( +object FloatingButtonParentFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL, parameters = listOf("L"), opcodes = listOf(Opcode.INVOKE_DIRECT), - customFingerprint = { methodDef, _ -> methodDef.isNarrowLiteralExists(259982244) } + literalSupplier = { 259982244 } ) diff --git a/src/main/kotlin/app/revanced/patches/music/general/historybutton/HideHistoryButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/historybutton/HideHistoryButtonPatch.kt index 481f54ebb..6f23da9b3 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/historybutton/HideHistoryButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/historybutton/HideHistoryButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.general.historybutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,10 +7,11 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.general.historybutton.fingerprints.HistoryMenuItemFingerprint +import app.revanced.patches.music.utils.integrations.Constants.GENERAL import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @Patch( @@ -36,7 +36,7 @@ object HideHistoryButtonPatch : BytecodePatch( addInstructions( insertIndex, """ - invoke-static {v$insertRegister}, $MUSIC_GENERAL->hideHistoryButton(Z)Z + invoke-static {v$insertRegister}, $GENERAL->hideHistoryButton(Z)Z move-result v$insertRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/general/historybutton/fingerprints/HistoryMenuItemFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/general/historybutton/fingerprints/HistoryMenuItemFingerprint.kt index 0d6c29f69..7bb38b5ae 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/historybutton/fingerprints/HistoryMenuItemFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/historybutton/fingerprints/HistoryMenuItemFingerprint.kt @@ -3,7 +3,7 @@ package app.revanced.patches.music.general.historybutton.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.HistoryMenuItem -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -15,5 +15,8 @@ object HistoryMenuItemFingerprint : MethodFingerprint( Opcode.INVOKE_INTERFACE, Opcode.RETURN_VOID ), - customFingerprint = { methodDef, classDef -> methodDef.isWideLiteralExists(HistoryMenuItem) && classDef.methods.count() == 5 } + customFingerprint = { methodDef, classDef -> + methodDef.containsWideLiteralInstructionIndex(HistoryMenuItem) + && classDef.methods.count() == 5 + } ) diff --git a/src/main/kotlin/app/revanced/patches/music/general/landscapemode/LandScapeModePatch.kt b/src/main/kotlin/app/revanced/patches/music/general/landscapemode/LandScapeModePatch.kt index a8ac0b43f..3b60f4c29 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/landscapemode/LandScapeModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/landscapemode/LandScapeModePatch.kt @@ -1,16 +1,16 @@ package app.revanced.patches.music.general.landscapemode -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.general.landscapemode.fingerprints.TabletIdentifierFingerprint +import app.revanced.patches.music.utils.integrations.Constants.GENERAL import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_GENERAL +import app.revanced.util.exception @Patch( name = "Enable landscape mode", @@ -29,7 +29,7 @@ object LandScapeModePatch : BytecodePatch( TabletIdentifierFingerprint.result?.let { it.mutableMethod.addInstructions( it.scanResult.patternScanResult!!.endIndex + 1, """ - invoke-static {p0}, $MUSIC_GENERAL->enableLandScapeMode(Z)Z + invoke-static {p0}, $GENERAL->enableLandScapeMode(Z)Z move-result p0 """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/general/landscapemode/fingerprints/TabletIdentifierFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/general/landscapemode/fingerprints/TabletIdentifierFingerprint.kt index 016e7a350..06600e8fb 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/landscapemode/fingerprints/TabletIdentifierFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/landscapemode/fingerprints/TabletIdentifierFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.general.landscapemode.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.IsTablet -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object TabletIdentifierFingerprint : MethodFingerprint( +object TabletIdentifierFingerprint : LiteralValueFingerprint( returnType = "Z", accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, parameters = listOf("L"), @@ -16,6 +15,6 @@ object TabletIdentifierFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(IsTablet) } + literalSupplier = { IsTablet } ) diff --git a/src/main/kotlin/app/revanced/patches/music/general/oldstylelibraryshelf/OldStyleLibraryShelfPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/oldstylelibraryshelf/OldStyleLibraryShelfPatch.kt index 7524922e3..11cb069e9 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/oldstylelibraryshelf/OldStyleLibraryShelfPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/oldstylelibraryshelf/OldStyleLibraryShelfPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.general.oldstylelibraryshelf -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,10 +7,11 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.general.oldstylelibraryshelf.fingerprints.BrowseIdFingerprint +import app.revanced.patches.music.utils.integrations.Constants.GENERAL +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getStringIndex -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_GENERAL +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Patch( @@ -28,12 +28,12 @@ object OldStyleLibraryShelfPatch : BytecodePatch( BrowseIdFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getStringIndex("FEmusic_offline") - 5 + val targetIndex = getStringInstructionIndex("FEmusic_offline") - 5 val targetRegister = getInstruction(targetIndex).registerA addInstructions( targetIndex + 1, """ - invoke-static {v$targetRegister}, $MUSIC_GENERAL->enableOldStyleLibraryShelf(Ljava/lang/String;)Ljava/lang/String; + invoke-static {v$targetRegister}, $GENERAL->enableOldStyleLibraryShelf(Ljava/lang/String;)Ljava/lang/String; move-result-object v$targetRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/general/oldstylelibraryshelf/fingerprints/BrowseIdFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/general/oldstylelibraryshelf/fingerprints/BrowseIdFingerprint.kt index 97ac467d0..4562f739e 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/oldstylelibraryshelf/fingerprints/BrowseIdFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/oldstylelibraryshelf/fingerprints/BrowseIdFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.music.general.oldstylelibraryshelf.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object BrowseIdFingerprint : MethodFingerprint( +object BrowseIdFingerprint : LiteralValueFingerprint( returnType = "L", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L"), strings = listOf("FEmusic_offline"), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45358178) } + literalSupplier = { 45358178 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/general/playlistcard/HidePlaylistCardPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/playlistcard/HidePlaylistCardPatch.kt index d56e369e9..77b1341c3 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/playlistcard/HidePlaylistCardPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/playlistcard/HidePlaylistCardPatch.kt @@ -4,10 +4,10 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.music.utils.litho.LithoFilterPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH @Patch( name = "Hide playlist card", @@ -19,7 +19,7 @@ import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object HidePlaylistCardPatch : BytecodePatch() { +object HidePlaylistCardPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { SettingsPatch.addMusicPreference( @@ -33,5 +33,5 @@ object HidePlaylistCardPatch : BytecodePatch() { } private const val FILTER_CLASS_DESCRIPTOR = - "$MUSIC_COMPONENTS_PATH/PlaylistCardFilter;" + "$COMPONENTS_PATH/PlaylistCardFilter;" } diff --git a/src/main/kotlin/app/revanced/patches/music/general/startpage/StartPagePatch.kt b/src/main/kotlin/app/revanced/patches/music/general/startpage/StartPagePatch.kt index f425e82cb..71f31afeb 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/startpage/StartPagePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/startpage/StartPagePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.general.startpage -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,12 +8,13 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.general.startpage.fingerprints.ColdStartUpFingerprint +import app.revanced.patches.music.utils.integrations.Constants.GENERAL import app.revanced.patches.music.utils.intenthook.IntentHookPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.music.utils.settings.SettingsPatch.contexts -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_GENERAL -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.copyXmlNode +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -39,7 +39,7 @@ object StartPagePatch : BytecodePatch( addInstructions( targetIndex + 1, """ - invoke-static {v$targetRegister}, $MUSIC_GENERAL->setStartPage(Ljava/lang/String;)Ljava/lang/String; + invoke-static {v$targetRegister}, $GENERAL->setStartPage(Ljava/lang/String;)Ljava/lang/String; move-result-object v$targetRegister return-object v$targetRegister """ diff --git a/src/main/kotlin/app/revanced/patches/music/general/tooltip/TooltipContentViewPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/tooltip/TooltipContentViewPatch.kt index 917ab3b00..329358c6b 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/tooltip/TooltipContentViewPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/tooltip/TooltipContentViewPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.general.tooltip -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch @@ -8,6 +7,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.general.tooltip.fingerprints.TooltipContentViewFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.util.exception @Patch( name = "Hide tooltip content", diff --git a/src/main/kotlin/app/revanced/patches/music/general/tooltip/fingerprints/TooltipContentViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/general/tooltip/fingerprints/TooltipContentViewFingerprint.kt index 5feedc64b..6caa17a2c 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/tooltip/fingerprints/TooltipContentViewFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/tooltip/fingerprints/TooltipContentViewFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.music.general.tooltip.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.ToolTipContentView -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object TooltipContentViewFingerprint : MethodFingerprint( +object TooltipContentViewFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ToolTipContentView) } + literalSupplier = { ToolTipContentView } ) diff --git a/src/main/kotlin/app/revanced/patches/music/misc/backgroundplay/BackgroundPlayPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/backgroundplay/BackgroundPlayPatch.kt index aa5ad32ff..33a90a3a9 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/backgroundplay/BackgroundPlayPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/backgroundplay/BackgroundPlayPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.misc.backgroundplay -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch @@ -8,6 +7,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.music.misc.backgroundplay.fingerprints.BackgroundPlaybackParentFingerprint +import app.revanced.util.exception @Patch( name = "Background play", diff --git a/src/main/kotlin/app/revanced/patches/music/misc/codecs/CodecsUnlockPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/codecs/CodecsUnlockPatch.kt index 69d478147..353d59433 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/codecs/CodecsUnlockPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/codecs/CodecsUnlockPatch.kt @@ -3,10 +3,10 @@ package app.revanced.patches.music.misc.codecs import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.MISC_PATH +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.shared.patch.opus.AbstractOpusCodecsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH @Patch( name = "Enable opus codec", @@ -16,7 +16,7 @@ import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH ) @Suppress("unused") object CodecsUnlockPatch : AbstractOpusCodecsPatch( - "$MUSIC_MISC_PATH/OpusCodecPatch;->enableOpusCodec()Z" + "$MISC_PATH/OpusCodecPatch;->enableOpusCodec()Z" ) { override fun execute(context: BytecodeContext) { super.execute(context) diff --git a/src/main/kotlin/app/revanced/patches/music/misc/debugging/DebuggingPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/debugging/DebuggingPatch.kt index 1093eb9c2..35ad8bf48 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/debugging/DebuggingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/debugging/DebuggingPatch.kt @@ -4,8 +4,8 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType @Patch( name = "Enable debug logging", diff --git a/src/main/kotlin/app/revanced/patches/music/misc/exclusiveaudio/ExclusiveAudioPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/exclusiveaudio/ExclusiveAudioPatch.kt index bfbd0ae08..ec6bd2fa6 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/exclusiveaudio/ExclusiveAudioPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/exclusiveaudio/ExclusiveAudioPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.misc.exclusiveaudio -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -12,7 +11,8 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.music.misc.exclusiveaudio.fingerprints.DataSavingSettingsFragmentFingerprint import app.revanced.patches.music.misc.exclusiveaudio.fingerprints.MusicBrowserServiceFingerprint import app.revanced.patches.music.misc.exclusiveaudio.fingerprints.PodCastConfigFingerprint -import app.revanced.util.bytecode.getStringIndex +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -39,7 +39,7 @@ object ExclusiveAudioPatch : BytecodePatch( MusicBrowserServiceFingerprint.result?.let { it.mutableMethod.apply { val targetIndex = - getStringIndex("MBS: Return empty root for client: %s, isFullMediaBrowserEnabled: %b, is client browsable: %b, isRedAccount: %b") + getStringInstructionIndex("MBS: Return empty root for client: %s, isFullMediaBrowserEnabled: %b, is client browsable: %b, isRedAccount: %b") for (index in targetIndex downTo 0) { if (getInstruction(index).opcode != Opcode.INVOKE_VIRTUAL) continue @@ -83,7 +83,7 @@ object ExclusiveAudioPatch : BytecodePatch( DataSavingSettingsFragmentFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getStringIndex("pref_key_dont_play_nma_video") + 4 + val insertIndex = getStringInstructionIndex("pref_key_dont_play_nma_video") + 4 val targetRegister = getInstruction(insertIndex).registerD addInstruction( diff --git a/src/main/kotlin/app/revanced/patches/music/misc/exclusiveaudio/fingerprints/PodCastConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/misc/exclusiveaudio/fingerprints/PodCastConfigFingerprint.kt index 5aa13a80f..4ffdfac20 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/exclusiveaudio/fingerprints/PodCastConfigFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/exclusiveaudio/fingerprints/PodCastConfigFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.misc.exclusiveaudio.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object PodCastConfigFingerprint : MethodFingerprint( +object PodCastConfigFingerprint : LiteralValueFingerprint( returnType = "Z", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = emptyList(), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45388403) } + literalSupplier = { 45388403 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/misc/minimizedplayback/MinimizedPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/minimizedplayback/MinimizedPlaybackPatch.kt index 98d0e9fbc..7bb344bdb 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/minimizedplayback/MinimizedPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/minimizedplayback/MinimizedPlaybackPatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.music.misc.minimizedplayback -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.misc.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint +import app.revanced.util.exception @Patch( name = "Enable minimized playback", diff --git a/src/main/kotlin/app/revanced/patches/music/misc/premium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/premium/HideGetPremiumPatch.kt index 7a1f059f0..6c5056915 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/premium/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/premium/HideGetPremiumPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.misc.premium -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -15,7 +14,8 @@ import app.revanced.patches.music.misc.premium.fingerprints.MembershipSettingsFi import app.revanced.patches.music.misc.premium.fingerprints.MembershipSettingsParentFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.PrivacyTosFooter -import app.revanced.util.bytecode.getWideLiteralIndex +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -53,7 +53,7 @@ object HideGetPremiumPatch : BytecodePatch( AccountMenuFooterFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(PrivacyTosFooter) + 4 + val targetIndex = getWideLiteralInstructionIndex(PrivacyTosFooter) + 4 targetReference = getInstruction(targetIndex + 1).reference with( diff --git a/src/main/kotlin/app/revanced/patches/music/misc/premium/fingerprints/AccountMenuFooterFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/misc/premium/fingerprints/AccountMenuFooterFingerprint.kt index 7b5c02ebd..eb80a26e4 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/premium/fingerprints/AccountMenuFooterFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/premium/fingerprints/AccountMenuFooterFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.misc.premium.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.PrivacyTosFooter -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object AccountMenuFooterFingerprint : MethodFingerprint( +object AccountMenuFooterFingerprint : LiteralValueFingerprint( returnType = "L", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, opcodes = listOf( @@ -18,5 +17,5 @@ object AccountMenuFooterFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.IGET_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(PrivacyTosFooter) } + literalSupplier = { PrivacyTosFooter } ) diff --git a/src/main/kotlin/app/revanced/patches/music/misc/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/spoofappversion/SpoofAppVersionPatch.kt index f1bd059da..dceace2b6 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/spoofappversion/SpoofAppVersionPatch.kt @@ -4,13 +4,13 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.general.oldstylelibraryshelf.OldStyleLibraryShelfPatch +import app.revanced.patches.music.utils.integrations.Constants.MISC_PATH import app.revanced.patches.music.utils.intenthook.IntentHookPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.music.utils.settings.SettingsPatch.contexts import app.revanced.patches.shared.patch.versionspoof.AbstractVersionSpoofPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.copyXmlNode @Patch( name = "Spoof app version", @@ -24,7 +24,7 @@ import app.revanced.util.resources.ResourceUtils.copyXmlNode ) @Suppress("unused") object SpoofAppVersionPatch : AbstractVersionSpoofPatch( - "$MUSIC_MISC_PATH/SpoofAppVersionPatch;->getVersionOverride(Ljava/lang/String;)Ljava/lang/String;" + "$MISC_PATH/SpoofAppVersionPatch;->getVersionOverride(Ljava/lang/String;)Ljava/lang/String;" ) { override fun execute(context: BytecodeContext) { super.execute(context) diff --git a/src/main/kotlin/app/revanced/patches/music/misc/tastebuilder/TasteBuilderPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/tastebuilder/TasteBuilderPatch.kt index 5fe4154b5..b31c104ad 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/tastebuilder/TasteBuilderPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/tastebuilder/TasteBuilderPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.misc.tastebuilder -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,6 +7,7 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.misc.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/music/misc/tracking/SanitizeUrlQueryPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/tracking/SanitizeUrlQueryPatch.kt index ecc9044c2..e83fc7355 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/tracking/SanitizeUrlQueryPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/tracking/SanitizeUrlQueryPatch.kt @@ -4,11 +4,11 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.misc.tracking.fingerprints.ShareLinkFormatterFingerprint +import app.revanced.patches.music.utils.integrations.Constants.MISC_PATH +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.shared.fingerprints.tracking.CopyTextEndpointFingerprint import app.revanced.patches.shared.patch.tracking.AbstractSanitizeUrlQueryPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH @Patch( name = "Sanitize sharing links", @@ -18,7 +18,7 @@ import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH ) @Suppress("unused") object SanitizeUrlQueryPatch : AbstractSanitizeUrlQueryPatch( - "$MUSIC_MISC_PATH/SanitizeUrlQueryPatch;", + "$MISC_PATH/SanitizeUrlQueryPatch;", listOf( CopyTextEndpointFingerprint, ShareLinkFormatterFingerprint diff --git a/src/main/kotlin/app/revanced/patches/music/misc/translations/TranslationsPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/translations/TranslationsPatch.kt index d74e74b13..34bd4554a 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/translations/TranslationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/translations/TranslationsPatch.kt @@ -1,11 +1,9 @@ package app.revanced.patches.music.misc.translations -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceHelper.addTranslations +import app.revanced.patches.shared.patch.translations.AbstractTranslationsPatch @Patch( name = "Translations", @@ -14,14 +12,9 @@ import app.revanced.util.resources.ResourceHelper.addTranslations compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] ) @Suppress("unused") -object TranslationsPatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - - context.addTranslations("music", LANGUAGE_LIST) - - } - - private val LANGUAGE_LIST = arrayOf( +object TranslationsPatch : AbstractTranslationsPatch( + "music", + arrayOf( "bg-rBG", "bn", "cs-rCZ", @@ -44,4 +37,4 @@ object TranslationsPatch : ResourcePatch() { "zh-rCN", "zh-rTW" ) -} +) diff --git a/src/main/kotlin/app/revanced/patches/music/navigation/black/BlackNavigationBarPatch.kt b/src/main/kotlin/app/revanced/patches/music/navigation/black/BlackNavigationBarPatch.kt index 779e89771..4f6c7a096 100644 --- a/src/main/kotlin/app/revanced/patches/music/navigation/black/BlackNavigationBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/navigation/black/BlackNavigationBarPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.navigation.black -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,10 +7,11 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.navigation.black.fingerprints.TabLayoutFingerprint +import app.revanced.patches.music.utils.integrations.Constants.NAVIGATION import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_NAVIGATION +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -36,7 +36,7 @@ object BlackNavigationBarPatch : BytecodePatch( addInstructions( targetIndex + 1, """ - invoke-static {}, $MUSIC_NAVIGATION->enableBlackNavigationBar()I + invoke-static {}, $NAVIGATION->enableBlackNavigationBar()I move-result v$targetRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/navigation/black/fingerprints/TabLayoutFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/navigation/black/fingerprints/TabLayoutFingerprint.kt index 9a0cb79a2..1af22909e 100644 --- a/src/main/kotlin/app/revanced/patches/music/navigation/black/fingerprints/TabLayoutFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/navigation/black/fingerprints/TabLayoutFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.navigation.black.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.ColorGrey -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object TabLayoutFingerprint : MethodFingerprint( +object TabLayoutFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = emptyList(), @@ -16,6 +15,6 @@ object TabLayoutFingerprint : MethodFingerprint( Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ColorGrey) } + literalSupplier = { ColorGrey } ) diff --git a/src/main/kotlin/app/revanced/patches/music/navigation/component/NavigationBarComponentPatch.kt b/src/main/kotlin/app/revanced/patches/music/navigation/component/NavigationBarComponentPatch.kt index e812304aa..e4dd2700d 100644 --- a/src/main/kotlin/app/revanced/patches/music/navigation/component/NavigationBarComponentPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/navigation/component/NavigationBarComponentPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.navigation.component -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,11 +8,12 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.navigation.component.fingerprints.TabLayoutTextFingerprint +import app.revanced.patches.music.utils.integrations.Constants.NAVIGATION import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_NAVIGATION +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -39,7 +39,7 @@ object NavigationBarComponentPatch : BytecodePatch( */ TabLayoutTextFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(SharedResourceIdPatch.Text1) + 3 + val targetIndex = getWideLiteralInstructionIndex(SharedResourceIdPatch.Text1) + 3 val targetParameter = getInstruction(targetIndex).reference val targetRegister = getInstruction(targetIndex).registerA @@ -48,7 +48,7 @@ object NavigationBarComponentPatch : BytecodePatch( addInstruction( targetIndex + 1, - "invoke-static {v$targetRegister}, $MUSIC_NAVIGATION->hideNavigationLabel(Landroid/widget/TextView;)V" + "invoke-static {v$targetRegister}, $NAVIGATION->hideNavigationLabel(Landroid/widget/TextView;)V" ) } } ?: throw TabLayoutTextFingerprint.exception @@ -85,12 +85,12 @@ object NavigationBarComponentPatch : BytecodePatch( addInstruction( pivotTabIndex, - "invoke-static {v$pivotTabRegister}, $MUSIC_NAVIGATION->hideNavigationButton(Landroid/view/View;)V" + "invoke-static {v$pivotTabRegister}, $NAVIGATION->hideNavigationButton(Landroid/view/View;)V" ) addInstruction( insertIndex, - "sput-object v$enumRegister, $MUSIC_NAVIGATION->lastPivotTab:Ljava/lang/Enum;" + "sput-object v$enumRegister, $NAVIGATION->lastPivotTab:Ljava/lang/Enum;" ) } } ?: throw TabLayoutTextFingerprint.exception diff --git a/src/main/kotlin/app/revanced/patches/music/navigation/component/fingerprints/TabLayoutTextFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/navigation/component/fingerprints/TabLayoutTextFingerprint.kt index b586f1847..6d2eecf41 100644 --- a/src/main/kotlin/app/revanced/patches/music/navigation/component/fingerprints/TabLayoutTextFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/navigation/component/fingerprints/TabLayoutTextFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.navigation.component.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.Text1 -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object TabLayoutTextFingerprint : MethodFingerprint( +object TabLayoutTextFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L"), @@ -20,6 +19,6 @@ object TabLayoutTextFingerprint : MethodFingerprint( Opcode.INVOKE_INTERFACE, Opcode.MOVE_RESULT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(Text1) } + literalSupplier = { Text1 } ) diff --git a/src/main/kotlin/app/revanced/patches/music/player/colormatchplayer/ColorMatchPlayerPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/colormatchplayer/ColorMatchPlayerPatch.kt index 781dec8e1..15624ef6b 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/colormatchplayer/ColorMatchPlayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/colormatchplayer/ColorMatchPlayerPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.player.colormatchplayer -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -12,9 +11,10 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.music.player.colormatchplayer.fingerprints.NewPlayerColorFingerprint import app.revanced.patches.music.utils.fingerprints.PlayerColorFingerprint +import app.revanced.patches.music.utils.integrations.Constants.PLAYER +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.Instruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -83,7 +83,7 @@ object ColorMatchPlayerPatch : BytecodePatch( addInstructionsWithLabels( insertIndex, """ - invoke-static {}, $MUSIC_PLAYER->enableColorMatchPlayer()Z + invoke-static {}, $PLAYER->enableColorMatchPlayer()Z move-result v2 if-eqz v2, :off iget v0, p0, $miniPlayerReference1 @@ -118,7 +118,7 @@ object ColorMatchPlayerPatch : BytecodePatch( addInstructionsWithLabels( insertIndex, """ - invoke-static {}, $MUSIC_PLAYER->enableColorMatchPlayer()Z + invoke-static {}, $PLAYER->enableColorMatchPlayer()Z move-result v1 if-eqz v1, :off iget v0, p0, $miniPlayerReference1 diff --git a/src/main/kotlin/app/revanced/patches/music/player/minimizedplayer/MinimizedPlayerPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/minimizedplayer/MinimizedPlayerPatch.kt index ca4392607..a646b570b 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/minimizedplayer/MinimizedPlayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/minimizedplayer/MinimizedPlayerPatch.kt @@ -1,15 +1,15 @@ package app.revanced.patches.music.player.minimizedplayer -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.player.minimizedplayer.fingerprints.MinimizedPlayerFingerprint +import app.revanced.patches.music.utils.integrations.Constants.PLAYER +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -32,7 +32,7 @@ object MinimizedPlayerPatch : BytecodePatch( addInstructions( index, """ - invoke-static {v$register}, $MUSIC_PLAYER->enableForceMinimizedPlayer(Z)Z + invoke-static {v$register}, $PLAYER->enableForceMinimizedPlayer(Z)Z move-result v$register """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/player/newplayerbackground/NewPlayerBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/newplayerbackground/NewPlayerBackgroundPatch.kt index 32327a6d2..b0f518479 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/newplayerbackground/NewPlayerBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/newplayerbackground/NewPlayerBackgroundPatch.kt @@ -1,15 +1,15 @@ package app.revanced.patches.music.player.newplayerbackground -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.player.newplayerbackground.fingerprints.NewPlayerBackgroundFingerprint +import app.revanced.patches.music.utils.integrations.Constants.PLAYER +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_PLAYER +import app.revanced.util.exception @Patch( name = "Enable new player background", @@ -27,7 +27,7 @@ object NewPlayerBackgroundPatch : BytecodePatch( it.mutableMethod.apply { addInstructions( 0, """ - invoke-static {}, $MUSIC_PLAYER->enableNewPlayerBackground()Z + invoke-static {}, $PLAYER->enableNewPlayerBackground()Z move-result v0 return v0 """ diff --git a/src/main/kotlin/app/revanced/patches/music/player/newplayerbackground/fingerprints/NewPlayerBackgroundFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/player/newplayerbackground/fingerprints/NewPlayerBackgroundFingerprint.kt index 791371837..aadefac60 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/newplayerbackground/fingerprints/NewPlayerBackgroundFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/newplayerbackground/fingerprints/NewPlayerBackgroundFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.music.player.newplayerbackground.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object NewPlayerBackgroundFingerprint : MethodFingerprint( +object NewPlayerBackgroundFingerprint : LiteralValueFingerprint( returnType = "Z", parameters = emptyList(), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45415319) } + literalSupplier = { 45415319 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/player/oldplayerlayout/OldPlayerLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/oldplayerlayout/OldPlayerLayoutPatch.kt index e455d263b..715500403 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/oldplayerlayout/OldPlayerLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/oldplayerlayout/OldPlayerLayoutPatch.kt @@ -1,15 +1,15 @@ package app.revanced.patches.music.player.oldplayerlayout -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.fingerprints.NewPlayerLayoutFingerprint +import app.revanced.patches.music.utils.integrations.Constants.PLAYER +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_PLAYER +import app.revanced.util.exception @Patch( name = "Enable old player layout", @@ -28,7 +28,7 @@ object OldPlayerLayoutPatch : BytecodePatch( it.mutableMethod.apply { addInstructions( 0, """ - invoke-static {}, $MUSIC_PLAYER->enableOldPlayerLayout()Z + invoke-static {}, $PLAYER->enableOldPlayerLayout()Z move-result v0 return v0 """ diff --git a/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/OldStyleMiniPlayerPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/OldStyleMiniPlayerPatch.kt index 4e8fb37d4..378d10895 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/OldStyleMiniPlayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/OldStyleMiniPlayerPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.player.oldstyleminiplayer -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,9 +9,10 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.player.oldstyleminiplayer.fingerprints.NextButtonVisibilityFingerprint import app.revanced.patches.music.player.oldstyleminiplayer.fingerprints.SwipeToCloseFingerprint import app.revanced.patches.music.utils.fingerprints.PlayerColorFingerprint +import app.revanced.patches.music.utils.integrations.Constants.PLAYER +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -44,7 +44,7 @@ object OldStyleMiniPlayerPatch : BytecodePatch( addInstructions( targetIndex + 1, """ - invoke-static {v$targetRegister}, $MUSIC_PLAYER->enableOldStyleMiniPlayer(Z)Z + invoke-static {v$targetRegister}, $PLAYER->enableOldStyleMiniPlayer(Z)Z move-result v$targetRegister """ ) @@ -59,7 +59,7 @@ object OldStyleMiniPlayerPatch : BytecodePatch( addInstructions( insertIndex, """ - invoke-static {v$targetRegister}, $MUSIC_PLAYER->enableOldStyleMiniPlayer(Z)Z + invoke-static {v$targetRegister}, $PLAYER->enableOldStyleMiniPlayer(Z)Z move-result v$targetRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/fingerprints/SwipeToCloseFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/fingerprints/SwipeToCloseFingerprint.kt index 11de57b4f..33733bf60 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/fingerprints/SwipeToCloseFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/fingerprints/SwipeToCloseFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.music.player.oldstyleminiplayer.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object SwipeToCloseFingerprint : MethodFingerprint( +object SwipeToCloseFingerprint : LiteralValueFingerprint( returnType = "Z", parameters = emptyList(), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45398432) } + literalSupplier = { 45398432 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/player/repeat/RememberRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/repeat/RememberRepeatPatch.kt index 6f21c4c52..4ce67c8ac 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/repeat/RememberRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/repeat/RememberRepeatPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.player.repeat -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,9 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.player.repeat.fingerprints.RepeatTrackFingerprint +import app.revanced.patches.music.utils.integrations.Constants.PLAYER +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -31,7 +31,7 @@ object RememberRepeatPatch : BytecodePatch( addInstructions( targetIndex, """ - invoke-static {v$targetRegister}, $MUSIC_PLAYER->rememberRepeatState(Z)Z + invoke-static {v$targetRegister}, $PLAYER->rememberRepeatState(Z)Z move-result v$targetRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/music/player/replace/ReplaceCastButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/replace/ReplaceCastButtonPatch.kt index 812586284..588cf82a5 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/replace/ReplaceCastButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/replace/ReplaceCastButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.player.replace -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,20 +8,21 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.player.replace.fingerprints.CastButtonContainerFingerprint +import app.revanced.patches.music.utils.integrations.Constants.PLAYER +import app.revanced.patches.music.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.music.utils.mainactivity.MainActivityResolvePatch import app.revanced.patches.music.utils.mainactivity.MainActivityResolvePatch.mainActivityClassDef import app.revanced.patches.music.utils.playerresponse.PlayerResponsePatch import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.PlayerCastMediaRouteButton +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.music.utils.settings.SettingsPatch.contexts import app.revanced.patches.music.utils.videotype.VideoTypeHookPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_PLAYER -import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -44,13 +44,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference use = false ) @Suppress("unused") -object ReplaceCastButtonPatch : BytecodePatch() { +object ReplaceCastButtonPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { CastButtonContainerFingerprint.resolve(context, mainActivityClassDef) CastButtonContainerFingerprint.result?.let { it.mutableMethod.apply { - val freeIndex = getWideLiteralIndex(PlayerCastMediaRouteButton) + 1 + val freeIndex = getWideLiteralInstructionIndex(PlayerCastMediaRouteButton) + 1 val freeRegister = getInstruction(freeIndex).registerA val getActivityIndex = freeIndex - 4 @@ -71,7 +71,7 @@ object ReplaceCastButtonPatch : BytecodePatch() { addInstruction( index + 1, "invoke-static {v$freeRegister, v${viewGroupInstruction.registerC}, v${viewGroupInstruction.registerD}}, " + - MUSIC_PLAYER + + PLAYER + "->" + "replaceCastButton(Landroid/app/Activity;Landroid/view/ViewGroup;Landroid/view/View;)V" ) @@ -87,13 +87,13 @@ object ReplaceCastButtonPatch : BytecodePatch() { } ?: throw CastButtonContainerFingerprint.exception PlayerResponsePatch.injectPlaylistCall( - "$MUSIC_UTILS_PATH/CheckMusicVideoPatch;" + + "$UTILS_PATH/CheckMusicVideoPatch;" + "->" + "playbackStart(Ljava/lang/String;Ljava/lang/String;IZ)V" ) arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "layout", "open_music_button.xml" ) diff --git a/src/main/kotlin/app/revanced/patches/music/player/replace/fingerprints/CastButtonContainerFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/player/replace/fingerprints/CastButtonContainerFingerprint.kt index 3d10d3aa9..0daf1d097 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/replace/fingerprints/CastButtonContainerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/replace/fingerprints/CastButtonContainerFingerprint.kt @@ -1,12 +1,9 @@ package app.revanced.patches.music.player.replace.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.PlayerCastMediaRouteButton -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object CastButtonContainerFingerprint : MethodFingerprint( +object CastButtonContainerFingerprint : LiteralValueFingerprint( returnType = "V", - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists(PlayerCastMediaRouteButton) - } + literalSupplier = { PlayerCastMediaRouteButton } ) diff --git a/src/main/kotlin/app/revanced/patches/music/player/shuffle/RememberShufflePatch.kt b/src/main/kotlin/app/revanced/patches/music/player/shuffle/RememberShufflePatch.kt index ec2fd2565..829014e30 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/shuffle/RememberShufflePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/shuffle/RememberShufflePatch.kt @@ -1,8 +1,5 @@ package app.revanced.patches.music.player.shuffle -import app.revanced.extensions.exception -import app.revanced.extensions.transformFields -import app.revanced.extensions.traverseClassHierarchy import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -17,9 +14,12 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patches.music.player.shuffle.fingerprints.MusicPlaybackControlsFingerprint import app.revanced.patches.music.player.shuffle.fingerprints.ShuffleClassReferenceFingerprint +import app.revanced.patches.music.utils.integrations.Constants.PLAYER +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_PLAYER +import app.revanced.util.exception +import app.revanced.util.transformFields +import app.revanced.util.traverseClassHierarchy import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -78,7 +78,7 @@ object RememberShufflePatch : BytecodePatch( constructorMethod.apply { addInstruction( implementation!!.instructions.size - 1, - "sput-object p0, $MUSIC_PLAYBACK_CONTROLS_CLASS_DESCRIPTOR->shuffleClass:$SHUFFLE_CLASS" + "sput-object p0, $PLAYBACK_CONTROLS_CLASS_DESCRIPTOR->shuffleClass:$SHUFFLE_CLASS" ) } @@ -87,7 +87,7 @@ object RememberShufflePatch : BytecodePatch( 0, """ move-object v0, p0 """ + shuffleStateLabel + """ - invoke-static {v1}, $MUSIC_PLAYER->setShuffleState(I)V + invoke-static {v1}, $PLAYER->setShuffleState(I)V """ ) } @@ -112,7 +112,7 @@ object RememberShufflePatch : BytecodePatch( it.mutableMethod.apply { addInstruction( 0, - "invoke-virtual {v0}, $MUSIC_PLAYBACK_CONTROLS_CLASS_DESCRIPTOR->rememberShuffleState()V" + "invoke-virtual {v0}, $PLAYBACK_CONTROLS_CLASS_DESCRIPTOR->rememberShuffleState()V" ) val shuffleField = ImmutableField( @@ -137,10 +137,10 @@ object RememberShufflePatch : BytecodePatch( shuffleMethod.addInstructionsWithLabels( 0, """ - invoke-static {}, $MUSIC_PLAYER->getShuffleState()I + invoke-static {}, $PLAYER->getShuffleState()I move-result v2 if-nez v2, :dont_shuffle - sget-object v0, $MUSIC_PLAYBACK_CONTROLS_CLASS_DESCRIPTOR->shuffleClass:$SHUFFLE_CLASS + sget-object v0, $PLAYBACK_CONTROLS_CLASS_DESCRIPTOR->shuffleClass:$SHUFFLE_CLASS """ + shuffleStateLabel + """ iget-object v3, v0, $imageViewReference invoke-virtual {v3}, Landroid/widget/ImageView;->performClick()Z @@ -164,7 +164,7 @@ object RememberShufflePatch : BytecodePatch( } - private const val MUSIC_PLAYBACK_CONTROLS_CLASS_DESCRIPTOR = + private const val PLAYBACK_CONTROLS_CLASS_DESCRIPTOR = "Lcom/google/android/apps/youtube/music/watchpage/MusicPlaybackControls;" private lateinit var SHUFFLE_CLASS: String diff --git a/src/main/kotlin/app/revanced/patches/music/player/zenmode/ZenModePatch.kt b/src/main/kotlin/app/revanced/patches/music/player/zenmode/ZenModePatch.kt index da212f575..5084d1572 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/zenmode/ZenModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/zenmode/ZenModePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.player.zenmode -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,9 +9,10 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.player.zenmode.fingerprints.ZenModeFingerprint import app.revanced.patches.music.utils.fingerprints.PlayerColorFingerprint +import app.revanced.patches.music.utils.integrations.Constants.PLAYER +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -46,7 +46,7 @@ object ZenModePatch : BytecodePatch( addInstructionsWithLabels( insertIndex, """ - invoke-static {}, $MUSIC_PLAYER->enableZenMode()Z + invoke-static {}, $PLAYER->enableZenMode()Z move-result v$dummyRegister if-eqz v$dummyRegister, :off const v$dummyRegister, -0xfcfcfd diff --git a/src/main/kotlin/app/revanced/patches/music/utils/actionbarhook/ActionBarHookPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/actionbarhook/ActionBarHookPatch.kt index b8a37955a..76e99d694 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/actionbarhook/ActionBarHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/actionbarhook/ActionBarHookPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.utils.actionbarhook -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,8 +7,9 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.actionbarhook.fingerprints.ActionBarHookFingerprint import app.revanced.patches.music.utils.fingerprints.ActionsBarParentFingerprint +import app.revanced.patches.music.utils.integrations.Constants.ACTIONBAR import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch -import app.revanced.util.integrations.Constants.MUSIC_ACTIONBAR +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Patch(dependencies = [SharedResourceIdPatch::class]) @@ -32,7 +32,7 @@ object ActionBarHookPatch : BytecodePatch( addInstruction( targetIndex + 1, - "invoke-static {v$targetRegister}, $MUSIC_ACTIONBAR->hookActionBar(Landroid/view/ViewGroup;)V" + "invoke-static {v$targetRegister}, $ACTIONBAR->hookActionBar(Landroid/view/ViewGroup;)V" ) } } ?: throw ActionBarHookFingerprint.exception diff --git a/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/ActionsBarParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/ActionsBarParentFingerprint.kt index d8ef46d74..5a6b72614 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/ActionsBarParentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/ActionsBarParentFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.music.utils.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.ActionsContainer -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ActionsBarParentFingerprint : MethodFingerprint( +object ActionsBarParentFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ActionsContainer) } + literalSupplier = { ActionsContainer } ) diff --git a/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/NewPlayerLayoutFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/NewPlayerLayoutFingerprint.kt index 263b121eb..84a965338 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/NewPlayerLayoutFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/NewPlayerLayoutFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.music.utils.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object NewPlayerLayoutFingerprint : MethodFingerprint( +object NewPlayerLayoutFingerprint : LiteralValueFingerprint( returnType = "Z", parameters = emptyList(), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45399578) } + literalSupplier = { 45399578 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/SeekBarConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/SeekBarConstructorFingerprint.kt index 954755c2c..3aecea124 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/SeekBarConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/fingerprints/SeekBarConstructorFingerprint.kt @@ -1,14 +1,9 @@ package app.revanced.patches.music.utils.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.InlineTimeBarAdBreakMarkerColor -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object SeekBarConstructorFingerprint : MethodFingerprint( +object SeekBarConstructorFingerprint : LiteralValueFingerprint( returnType = "V", - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - InlineTimeBarAdBreakMarkerColor - ) - } + literalSupplier = { InlineTimeBarAdBreakMarkerColor } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/utils/fix/androidauto/AndroidAutoCertificatePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/fix/androidauto/AndroidAutoCertificatePatch.kt index 7ec4b8842..0c66cbc44 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/fix/androidauto/AndroidAutoCertificatePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/fix/androidauto/AndroidAutoCertificatePatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.music.utils.fix.androidauto -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.fix.androidauto.fingerprints.CertificateCheckFingerprint +import app.revanced.util.exception @Patch( name = "Certificate spoof", diff --git a/src/main/kotlin/app/revanced/patches/music/utils/fix/clientspoof/ClientSpoofPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/fix/clientspoof/ClientSpoofPatch.kt index 245cce731..edf4768d1 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/fix/clientspoof/ClientSpoofPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/fix/clientspoof/ClientSpoofPatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.music.utils.fix.clientspoof -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patches.music.utils.fix.clientspoof.fingerprints.UserAgentHeaderBuilderFingerprint import app.revanced.patches.music.utils.microg.Constants.MUSIC_PACKAGE_NAME +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction object ClientSpoofPatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonContainerPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonContainerPatch.kt index 8e642dd07..454232413 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonContainerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonContainerPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.utils.flyoutbutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,10 +7,11 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.flyoutbutton.fingerprints.FlyoutPanelLikeButtonFingerprint +import app.revanced.patches.music.utils.integrations.Constants.FLYOUT import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.MusicMenuLikeButtons -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.MUSIC_FLYOUT +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -28,7 +28,7 @@ object FlyoutButtonContainerPatch : BytecodePatch( FlyoutPanelLikeButtonFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(MusicMenuLikeButtons) + val targetIndex = getWideLiteralInstructionIndex(MusicMenuLikeButtons) var insertIndex = -1 @@ -40,7 +40,7 @@ object FlyoutButtonContainerPatch : BytecodePatch( addInstruction( index + 1, - "invoke-static {v$register}, $MUSIC_FLYOUT->setFlyoutButtonContainer(Landroid/view/View;)V" + "invoke-static {v$register}, $FLYOUT->setFlyoutButtonContainer(Landroid/view/View;)V" ) break } diff --git a/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonContainerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonContainerResourcePatch.kt index 6ef21b4db..1a37ad47b 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonContainerResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonContainerResourcePatch.kt @@ -2,8 +2,8 @@ package app.revanced.patches.music.utils.flyoutbutton import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources object FlyoutButtonContainerResourcePatch : ResourcePatch() { override fun execute(context: ResourceContext) { @@ -14,7 +14,7 @@ object FlyoutButtonContainerResourcePatch : ResourcePatch() { context["res/layout-v21"].mkdirs() arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "layout-v21", "music_menu_like_buttons.xml" ) @@ -22,7 +22,7 @@ object FlyoutButtonContainerResourcePatch : ResourcePatch() { context.copyResources("music/flyout", resourceGroup) } - fun copyResources(resourceGroups: List) { + fun copyResources(resourceGroups: List) { resourceGroups.forEach { context.copyResources("music/flyout", it) } } @@ -30,7 +30,7 @@ object FlyoutButtonContainerResourcePatch : ResourcePatch() { "yt_outline_play_arrow_half_circle_black_24" ).map { "$it.png" }.toTypedArray() - fun createGroup(directory: String) = ResourceUtils.ResourceGroup( + fun createGroup(directory: String) = ResourceGroup( directory, *resourceFileNames ) diff --git a/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonItemResourcePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonItemResourcePatch.kt index 24abdbe14..d6b78de33 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonItemResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonItemResourcePatch.kt @@ -2,13 +2,13 @@ package app.revanced.patches.music.utils.flyoutbutton import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources object FlyoutButtonItemResourcePatch : ResourcePatch() { override fun execute(context: ResourceContext) { - fun copyResources(resourceGroups: List) { + fun copyResources(resourceGroups: List) { resourceGroups.forEach { context.copyResources("music/flyout", it) } } @@ -16,7 +16,7 @@ object FlyoutButtonItemResourcePatch : ResourcePatch() { "yt_outline_youtube_logo_icon_black_24" ).map { "$it.png" }.toTypedArray() - fun createGroup(directory: String) = ResourceUtils.ResourceGroup( + fun createGroup(directory: String) = ResourceGroup( directory, *resourceFileNames ) diff --git a/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/fingerprints/FlyoutPanelLikeButtonFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/fingerprints/FlyoutPanelLikeButtonFingerprint.kt index d5595a52c..cb61008ad 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/fingerprints/FlyoutPanelLikeButtonFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/fingerprints/FlyoutPanelLikeButtonFingerprint.kt @@ -1,15 +1,14 @@ package app.revanced.patches.music.utils.flyoutbutton.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.MusicMenuLikeButtons -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object FlyoutPanelLikeButtonFingerprint : MethodFingerprint( +object FlyoutPanelLikeButtonFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC, parameters = listOf("L", "Ljava/lang/Object;"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(MusicMenuLikeButtons) } + literalSupplier = { MusicMenuLikeButtons } ) diff --git a/src/main/kotlin/app/revanced/patches/music/utils/integrations/Constants.kt b/src/main/kotlin/app/revanced/patches/music/utils/integrations/Constants.kt new file mode 100644 index 000000000..f61d13808 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/music/utils/integrations/Constants.kt @@ -0,0 +1,26 @@ +package app.revanced.patches.music.utils.integrations + +@Suppress("MemberVisibilityCanBePrivate") +object Constants { + const val INTEGRATIONS_PATH = "Lapp/revanced/music" + const val PATCHES_PATH = "$INTEGRATIONS_PATH/patches" + + const val ACCOUNT_PATH = "$PATCHES_PATH/account" + const val ACTIONBAR_PATH = "$PATCHES_PATH/actionbar" + const val ADS_PATH = "$PATCHES_PATH/ads" + const val COMPONENTS_PATH = "$PATCHES_PATH/components" + const val FLYOUT_PATH = "$PATCHES_PATH/flyout" + const val GENERAL_PATH = "$PATCHES_PATH/general" + const val MISC_PATH = "$PATCHES_PATH/misc" + const val NAVIGATION_PATH = "$PATCHES_PATH/navigation" + const val PLAYER_PATH = "$PATCHES_PATH/player" + const val VIDEO_PATH = "$PATCHES_PATH/video" + const val UTILS_PATH = "$PATCHES_PATH/utils" + + const val ACCOUNT = "$ACCOUNT_PATH/AccountPatch;" + const val ACTIONBAR = "$ACTIONBAR_PATH/ActionBarPatch;" + const val FLYOUT = "$FLYOUT_PATH/FlyoutPatch;" + const val GENERAL = "$GENERAL_PATH/GeneralPatch;" + const val NAVIGATION = "$NAVIGATION_PATH/NavigationPatch;" + const val PLAYER = "$PLAYER_PATH/PlayerPatch;" +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/utils/integrations/IntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/integrations/IntegrationsPatch.kt index 8f68988d2..c5b80fd8e 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/integrations/IntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/integrations/IntegrationsPatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.music.utils.integrations import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.INTEGRATIONS_PATH import app.revanced.patches.music.utils.integrations.fingerprints.InitFingerprint import app.revanced.patches.shared.patch.integrations.AbstractIntegrationsPatch -import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH @Patch(requiresIntegrations = true) object IntegrationsPatch : AbstractIntegrationsPatch( - "$MUSIC_INTEGRATIONS_PATH/utils/ReVancedUtils;", + "$INTEGRATIONS_PATH/utils/ReVancedUtils;", setOf(InitFingerprint), ) diff --git a/src/main/kotlin/app/revanced/patches/music/utils/intenthook/IntentHookPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/intenthook/IntentHookPatch.kt index ffb94ea95..8d6f75476 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/intenthook/IntentHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/intenthook/IntentHookPatch.kt @@ -1,15 +1,15 @@ package app.revanced.patches.music.utils.intenthook -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel +import app.revanced.patches.music.utils.integrations.Constants.INTEGRATIONS_PATH import app.revanced.patches.music.utils.intenthook.fingerprints.FullStackTraceActivityFingerprint import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH +import app.revanced.util.exception @Patch(dependencies = [SettingsPatch::class]) object IntentHookPatch : BytecodePatch( @@ -21,7 +21,7 @@ object IntentHookPatch : BytecodePatch( it.mutableMethod.apply { addInstructionsWithLabels( 1, """ - invoke-static {p0}, $MUSIC_INTEGRATIONS_PATH/settingsmenu/ReVancedSettingActivity;->initializeSettings(Landroid/app/Activity;)Z + invoke-static {p0}, $INTEGRATIONS_PATH/settingsmenu/ReVancedSettingActivity;->initializeSettings(Landroid/app/Activity;)Z move-result v0 if-eqz v0, :show return-void diff --git a/src/main/kotlin/app/revanced/patches/music/utils/litho/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/litho/LithoFilterPatch.kt index 6d6c75060..201df0009 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/litho/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/litho/LithoFilterPatch.kt @@ -1,15 +1,15 @@ package app.revanced.patches.music.utils.litho -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.music.utils.litho.fingerprints.LithoFilterFingerprint import app.revanced.patches.shared.patch.litho.ComponentParserPatch import app.revanced.patches.shared.patch.litho.ComponentParserPatch.pathBuilderHook -import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH +import app.revanced.util.exception import java.io.Closeable @Patch(dependencies = [ComponentParserPatch::class]) @@ -17,7 +17,7 @@ object LithoFilterPatch : BytecodePatch( setOf(LithoFilterFingerprint) ), Closeable { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "$MUSIC_COMPONENTS_PATH/LithoFilterPatch;" + "$COMPONENTS_PATH/LithoFilterPatch;" internal lateinit var addFilter: (String) -> Unit private set @@ -50,7 +50,7 @@ object LithoFilterPatch : BytecodePatch( .mutableMethod.addInstructions( 0, """ const/16 v0, $filterCount - new-array v0, v0, [$MUSIC_COMPONENTS_PATH/Filter; + new-array v0, v0, [$COMPONENTS_PATH/Filter; """ ) } diff --git a/src/main/kotlin/app/revanced/patches/music/utils/mainactivity/MainActivityResolvePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/mainactivity/MainActivityResolvePatch.kt index e4da8e607..750f89e74 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/mainactivity/MainActivityResolvePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/mainactivity/MainActivityResolvePatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.music.utils.mainactivity -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod +import app.revanced.patches.music.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.music.utils.mainactivity.fingerprints.MainActivityFingerprint -import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.ClassDef object MainActivityResolvePatch : BytecodePatch( @@ -29,7 +29,7 @@ object MainActivityResolvePatch : BytecodePatch( onCreateMethod.apply { addInstruction( 2, - "invoke-static/range {p0 .. p0}, $MUSIC_UTILS_PATH/$methods;->$descriptor(Landroid/content/Context;)V" + "invoke-static/range {p0 .. p0}, $UTILS_PATH/$methods;->$descriptor(Landroid/content/Context;)V" ) } } diff --git a/src/main/kotlin/app/revanced/patches/music/utils/microg/MicroGPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/microg/MicroGPatch.kt index 75ee3f8ad..9e3989080 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/microg/MicroGPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/microg/MicroGPatch.kt @@ -16,8 +16,8 @@ import app.revanced.patches.music.utils.microg.fingerprints.CastDynamiteModuleV2 import app.revanced.patches.music.utils.microg.fingerprints.GooglePlayUtilityFingerprint import app.revanced.patches.music.utils.microg.fingerprints.PrimeFingerprint import app.revanced.patches.music.utils.microg.fingerprints.ServiceCheckFingerprint +import app.revanced.patches.shared.patch.microg.MicroGBytecodeHelper import app.revanced.patches.shared.patch.packagename.PackageNamePatch -import app.revanced.util.microg.MicroGBytecodeHelper @Patch( name = "MicroG support", diff --git a/src/main/kotlin/app/revanced/patches/music/utils/microg/MicroGResourcePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/microg/MicroGResourcePatch.kt index 9d2d7773b..f35e5ef51 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/microg/MicroGResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/microg/MicroGResourcePatch.kt @@ -7,14 +7,14 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.microg.Constants.MUSIC_PACKAGE_NAME import app.revanced.patches.music.utils.microg.Constants.SPOOFED_PACKAGE_NAME import app.revanced.patches.music.utils.microg.Constants.SPOOFED_PACKAGE_SIGNATURE +import app.revanced.patches.music.utils.settings.CategoryType +import app.revanced.patches.music.utils.settings.ResourceUtils.addMicroGPreference +import app.revanced.patches.music.utils.settings.ResourceUtils.setMicroG import app.revanced.patches.music.utils.settings.SettingsPatch +import app.revanced.patches.shared.patch.microg.Constants.MICROG_PACKAGE_NAME +import app.revanced.patches.shared.patch.microg.MicroGManifestHelper.addSpoofingMetadata +import app.revanced.patches.shared.patch.microg.MicroGResourceHelper.patchManifest import app.revanced.patches.shared.patch.packagename.PackageNamePatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.microg.Constants.MICROG_PACKAGE_NAME -import app.revanced.util.microg.MicroGManifestHelper.addSpoofingMetadata -import app.revanced.util.microg.MicroGResourceHelper.patchManifest -import app.revanced.util.resources.MusicResourceHelper.addMicroGPreference -import app.revanced.util.resources.MusicResourceHelper.setMicroG @Patch( dependencies = [ diff --git a/src/main/kotlin/app/revanced/patches/music/utils/overridequality/OverrideQualityHookPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/overridequality/OverrideQualityHookPatch.kt index 4cfda76bc..1c83651e0 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/overridequality/OverrideQualityHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/overridequality/OverrideQualityHookPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.utils.overridequality -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -10,10 +9,11 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable +import app.revanced.patches.music.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.music.utils.overridequality.fingerprints.VideoQualityListFingerprint import app.revanced.patches.music.utils.overridequality.fingerprints.VideoQualityPatchFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch -import app.revanced.util.integrations.Constants.MUSIC_VIDEO_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.immutable.ImmutableField @@ -81,7 +81,7 @@ object OverrideQualityHookPatch : BytecodePatch( } private const val INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR = - "$MUSIC_VIDEO_PATH/VideoQualityPatch;" + "$VIDEO_PATH/VideoQualityPatch;" private lateinit var QUALITY_CLASS: String private lateinit var QUALITY_METHOD: String diff --git a/src/main/kotlin/app/revanced/patches/music/utils/overridequality/fingerprints/VideoQualityListFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/utils/overridequality/fingerprints/VideoQualityListFingerprint.kt index 04d621965..379e6c1fe 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/overridequality/fingerprints/VideoQualityListFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/overridequality/fingerprints/VideoQualityListFingerprint.kt @@ -1,16 +1,15 @@ package app.revanced.patches.music.utils.overridequality.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.QualityAuto -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object VideoQualityListFingerprint : MethodFingerprint( +object VideoQualityListFingerprint : LiteralValueFingerprint( returnType = "V", parameters = listOf("L"), opcodes = listOf( Opcode.INVOKE_INTERFACE, Opcode.RETURN_VOID ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(QualityAuto) } + literalSupplier = { QualityAuto } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/utils/overridespeed/OverrideSpeedHookPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/overridespeed/OverrideSpeedHookPatch.kt index cea49007a..177c1a8bb 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/overridespeed/OverrideSpeedHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/overridespeed/OverrideSpeedHookPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.utils.overridespeed -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -9,11 +8,12 @@ import app.revanced.patcher.extensions.or import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod +import app.revanced.patches.music.utils.integrations.Constants.INTEGRATIONS_PATH +import app.revanced.patches.music.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.music.utils.overridespeed.fingerprints.PlaybackSpeedFingerprint import app.revanced.patches.music.utils.overridespeed.fingerprints.PlaybackSpeedParentFingerprint import app.revanced.patches.music.utils.overridespeed.fingerprints.PlaybackSpeedPatchFingerprint -import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH -import app.revanced.util.integrations.Constants.MUSIC_VIDEO_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c import com.android.tools.smali.dexlib2.dexbacked.reference.DexBackedMethodReference @@ -101,10 +101,10 @@ object OverrideSpeedHookPatch : BytecodePatch( } private const val INTEGRATIONS_PLAYBACK_SPEED_CLASS_DESCRIPTOR = - "$MUSIC_VIDEO_PATH/PlaybackSpeedPatch;" + "$VIDEO_PATH/PlaybackSpeedPatch;" private const val INTEGRATIONS_VIDEO_HELPER_CLASS_DESCRIPTOR = - "$MUSIC_INTEGRATIONS_PATH/utils/VideoHelpers;" + "$INTEGRATIONS_PATH/utils/VideoHelpers;" private lateinit var SPEED_CLASS: String private lateinit var SPEED_REFERENCE: Reference diff --git a/src/main/kotlin/app/revanced/patches/music/utils/playerresponse/PlayerResponsePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/playerresponse/PlayerResponsePatch.kt index 1afe02506..6384d904c 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/playerresponse/PlayerResponsePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/playerresponse/PlayerResponsePatch.kt @@ -1,11 +1,11 @@ package app.revanced.patches.music.utils.playerresponse -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.music.utils.playerresponse.fingerprints.PlaybackStartDescriptorFingerprint +import app.revanced.util.exception object PlayerResponsePatch : BytecodePatch( setOf(PlaybackStartDescriptorFingerprint) diff --git a/src/main/kotlin/app/revanced/patches/music/utils/playertype/PlayerTypeHookPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/playertype/PlayerTypeHookPatch.kt index 7ea506c4d..e549e91fc 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/playertype/PlayerTypeHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/playertype/PlayerTypeHookPatch.kt @@ -1,11 +1,11 @@ package app.revanced.patches.music.utils.playertype -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patches.music.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.music.utils.playertype.fingerprint.PlayerTypeFingerprint -import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH +import app.revanced.util.exception @Suppress("unused") object PlayerTypeHookPatch : BytecodePatch( @@ -25,5 +25,5 @@ object PlayerTypeHookPatch : BytecodePatch( } private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "$MUSIC_UTILS_PATH/PlayerTypeHookPatch;" + "$UTILS_PATH/PlayerTypeHookPatch;" } diff --git a/src/main/kotlin/app/revanced/patches/music/utils/resourceid/SharedResourceIdPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/resourceid/SharedResourceIdPatch.kt index 2f0b5d6c7..493147abe 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/resourceid/SharedResourceIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/resourceid/SharedResourceIdPatch.kt @@ -4,14 +4,14 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch -import app.revanced.util.enum.ResourceType -import app.revanced.util.enum.ResourceType.BOOL -import app.revanced.util.enum.ResourceType.COLOR -import app.revanced.util.enum.ResourceType.DIMEN -import app.revanced.util.enum.ResourceType.ID -import app.revanced.util.enum.ResourceType.LAYOUT -import app.revanced.util.enum.ResourceType.STRING -import app.revanced.util.enum.ResourceType.STYLE +import app.revanced.patches.shared.patch.mapping.ResourceType +import app.revanced.patches.shared.patch.mapping.ResourceType.BOOL +import app.revanced.patches.shared.patch.mapping.ResourceType.COLOR +import app.revanced.patches.shared.patch.mapping.ResourceType.DIMEN +import app.revanced.patches.shared.patch.mapping.ResourceType.ID +import app.revanced.patches.shared.patch.mapping.ResourceType.LAYOUT +import app.revanced.patches.shared.patch.mapping.ResourceType.STRING +import app.revanced.patches.shared.patch.mapping.ResourceType.STYLE @Patch(dependencies = [ResourceMappingPatch::class]) object SharedResourceIdPatch : ResourcePatch() { diff --git a/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/ReturnYouTubeDislikeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/ReturnYouTubeDislikeBytecodePatch.kt index 09bc7ca6a..af566af07 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/ReturnYouTubeDislikeBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/ReturnYouTubeDislikeBytecodePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.utils.returnyoutubedislike -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,13 +7,14 @@ import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.music.utils.returnyoutubedislike.fingerprints.DislikeFingerprint import app.revanced.patches.music.utils.returnyoutubedislike.fingerprints.LikeFingerprint import app.revanced.patches.music.utils.returnyoutubedislike.fingerprints.RemoveLikeFingerprint import app.revanced.patches.music.utils.returnyoutubedislike.fingerprints.TextComponentFingerprint import app.revanced.patches.music.video.information.VideoInformationPatch -import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c @@ -34,7 +34,7 @@ object ReturnYouTubeDislikeBytecodePatch : BytecodePatch( ) ) { private const val INTEGRATIONS_RYD_CLASS_DESCRIPTOR = - "$MUSIC_UTILS_PATH/ReturnYouTubeDislikePatch;" + "$UTILS_PATH/ReturnYouTubeDislikePatch;" override fun execute(context: BytecodeContext) { setOf( diff --git a/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index aecc6a396..b7b8ce7ae 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -4,9 +4,9 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.settings.ResourceUtils.RETURN_YOUTUBE_DISLIKE_SETTINGS_KEY +import app.revanced.patches.music.utils.settings.ResourceUtils.addReVancedMusicPreference import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.resources.MusicResourceHelper.RETURN_YOUTUBE_DISLIKE_SETTINGS_KEY -import app.revanced.util.resources.MusicResourceHelper.addReVancedMusicPreference import org.w3c.dom.Element import org.w3c.dom.Node @@ -31,13 +31,17 @@ object ReturnYouTubeDislikePatch : ResourcePatch() { "revanced_ryd_enabled" ) context.addSwitchPreference("revanced_ryd_compact_layout", "false", "revanced_ryd_enabled") - context.addSwitchPreference("revanced_ryd_toast_on_connection_error", "true", "revanced_ryd_enabled") + context.addSwitchPreference( + "revanced_ryd_toast_on_connection_error", + "true", + "revanced_ryd_enabled" + ) context.addPreferenceCategory("revanced_ryd_about") context.addAboutPreference("revanced_ryd_attribution") } - private const val YOUTUBE_MUSIC_SETTINGS_PATH = "res/xml/settings_headers.xml" + private const val YOUTUBE_SETTINGS_PATH = "res/xml/settings_headers.xml" private const val SWITCH_PREFERENCE_TAG_NAME = "com.google.android.apps.youtube.music.ui.preference.SwitchCompatPreference" private const val PREFERENCE_CATEGORY_TAG_NAME = @@ -52,7 +56,7 @@ object ReturnYouTubeDislikePatch : ResourcePatch() { private fun ResourceContext.addAboutPreference( key: String ) { - this.xmlEditor[YOUTUBE_MUSIC_SETTINGS_PATH].use { editor -> + this.xmlEditor[YOUTUBE_SETTINGS_PATH].use { editor -> val tags = editor.file.getElementsByTagName(PREFERENCE_CATEGORY_TAG_NAME) List(tags.length) { tags.item(it) as Element } .filter { it.getAttribute("android:key").contains("revanced_ryd_about") } @@ -73,7 +77,7 @@ object ReturnYouTubeDislikePatch : ResourcePatch() { private fun ResourceContext.addPreferenceCategory( category: String ) { - this.xmlEditor[YOUTUBE_MUSIC_SETTINGS_PATH].use { editor -> + this.xmlEditor[YOUTUBE_SETTINGS_PATH].use { editor -> val tags = editor.file.getElementsByTagName("PreferenceScreen") List(tags.length) { tags.item(it) as Element } .filter { @@ -100,7 +104,7 @@ object ReturnYouTubeDislikePatch : ResourcePatch() { defaultValue: String, dependencyKey: String ) { - this.xmlEditor[YOUTUBE_MUSIC_SETTINGS_PATH].use { editor -> + this.xmlEditor[YOUTUBE_SETTINGS_PATH].use { editor -> val tags = editor.file.getElementsByTagName("PreferenceScreen") List(tags.length) { tags.item(it) as Element } .filter { diff --git a/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/fingerprints/TextComponentFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/fingerprints/TextComponentFingerprint.kt index 4dd976c77..be8808351 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/fingerprints/TextComponentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/returnyoutubedislike/fingerprints/TextComponentFingerprint.kt @@ -1,12 +1,11 @@ package app.revanced.patches.music.utils.returnyoutubedislike.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.ButtonIconPaddingMedium -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object TextComponentFingerprint : MethodFingerprint( +object TextComponentFingerprint : LiteralValueFingerprint( returnType = "V", opcodes = listOf(Opcode.CONST_HIGH16), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ButtonIconPaddingMedium) } + literalSupplier = { ButtonIconPaddingMedium } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/enum/CategoryType.kt b/src/main/kotlin/app/revanced/patches/music/utils/settings/CategoryType.kt similarity index 70% rename from src/main/kotlin/app/revanced/util/enum/CategoryType.kt rename to src/main/kotlin/app/revanced/patches/music/utils/settings/CategoryType.kt index 555c2aa86..1cb3fcd99 100644 --- a/src/main/kotlin/app/revanced/util/enum/CategoryType.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/settings/CategoryType.kt @@ -1,6 +1,6 @@ -package app.revanced.util.enum +package app.revanced.patches.music.utils.settings -internal enum class CategoryType(val value: String, var added: Boolean) { +enum class CategoryType(val value: String, var added: Boolean) { ACCOUNT("account", false), ACTION_BAR("action_bar", false), ADS("ads", false), diff --git a/src/main/kotlin/app/revanced/util/resources/MusicResourceHelper.kt b/src/main/kotlin/app/revanced/patches/music/utils/settings/ResourceUtils.kt similarity index 83% rename from src/main/kotlin/app/revanced/util/resources/MusicResourceHelper.kt rename to src/main/kotlin/app/revanced/patches/music/utils/settings/ResourceUtils.kt index a1e0daa60..38961ac92 100644 --- a/src/main/kotlin/app/revanced/util/resources/MusicResourceHelper.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/settings/ResourceUtils.kt @@ -1,62 +1,45 @@ -package app.revanced.util.resources +package app.revanced.patches.music.utils.settings -import app.revanced.extensions.doRecursively import app.revanced.patcher.data.ResourceContext -import app.revanced.util.enum.CategoryType +import app.revanced.util.adoptChild +import app.revanced.util.cloneNodes +import app.revanced.util.doRecursively +import app.revanced.util.insertNode import org.w3c.dom.Element -import org.w3c.dom.Node -private fun Node.adoptChild(tagName: String, block: Element.() -> Unit) { - val child = ownerDocument.createElement(tagName) - child.block() - appendChild(child) -} +@Suppress("MemberVisibilityCanBePrivate") +object ResourceUtils { -private fun Node.cloneNodes(parent: Node) { - val node = cloneNode(true) - parent.appendChild(node) - parent.removeChild(this) -} + const val YOUTUBE_MUSIC_SETTINGS_PATH = "res/xml/settings_headers.xml" -private fun Node.insertNode(tagName: String, targetNode: Node, block: Element.() -> Unit) { - val child = ownerDocument.createElement(tagName) - child.block() - parentNode.insertBefore(child, targetNode) -} + const val YOUTUBE_MUSIC_SETTINGS_KEY = "revanced_extended_settings" + const val RETURN_YOUTUBE_DISLIKE_SETTINGS_KEY = "revanced_ryd_settings" -internal object MusicResourceHelper { - - private const val YOUTUBE_MUSIC_SETTINGS_PATH = "res/xml/settings_headers.xml" - - internal const val YOUTUBE_MUSIC_SETTINGS_KEY = "revanced_extended_settings" - - internal const val RETURN_YOUTUBE_DISLIKE_SETTINGS_KEY = "revanced_ryd_settings" - - private const val YOUTUBE_MUSIC_PREFERENCE_SCREEN_TAG_NAME = + const val YOUTUBE_MUSIC_PREFERENCE_SCREEN_TAG_NAME = "PreferenceScreen" - private const val YOUTUBE_MUSIC_PREFERENCE_TAG_NAME = + const val YOUTUBE_MUSIC_PREFERENCE_TAG_NAME = "com.google.android.apps.youtube.music.ui.preference.SwitchCompatPreference" - private const val YOUTUBE_MUSIC_PREFERENCE_TARGET_CLASS = + const val YOUTUBE_MUSIC_PREFERENCE_TARGET_CLASS = "com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" - internal var targetPackage = "com.google.android.apps.youtube.music" + var targetPackage = "com.google.android.apps.youtube.music" - internal fun ResourceContext.setMicroG(newPackage: String) { + fun ResourceContext.setMicroG(newPackage: String) { targetPackage = newPackage replacePackageName() } - private fun setMusicPreferenceCategory(newCategory: String) { + fun setMusicPreferenceCategory(newCategory: String) { CategoryType.entries.forEach { preference -> if (newCategory == preference.value) preference.added = true } } - private fun included(category: String): Boolean { + fun included(category: String): Boolean { CategoryType.entries.forEach { preference -> if (category == preference.value) return preference.added @@ -64,7 +47,7 @@ internal object MusicResourceHelper { return false } - internal fun ResourceContext.addMusicPreferenceCategory( + fun ResourceContext.addMusicPreferenceCategory( category: String ) { this.xmlEditor[YOUTUBE_MUSIC_SETTINGS_PATH].use { editor -> @@ -83,7 +66,7 @@ internal object MusicResourceHelper { } } - internal fun ResourceContext.sortMusicPreferenceCategory( + fun ResourceContext.sortMusicPreferenceCategory( category: String ) { this.xmlEditor[YOUTUBE_MUSIC_SETTINGS_PATH].use { editor -> @@ -100,14 +83,14 @@ internal object MusicResourceHelper { replacePackageName() } - private fun ResourceContext.replacePackageName() { + fun ResourceContext.replacePackageName() { this[YOUTUBE_MUSIC_SETTINGS_PATH].writeText( this[YOUTUBE_MUSIC_SETTINGS_PATH].readText() .replace("\"com.google.android.apps.youtube.music\"", "\"" + targetPackage + "\"") ) } - internal fun ResourceContext.addMicroGPreference( + fun ResourceContext.addMicroGPreference( category: String, key: String, packageName: String, @@ -134,7 +117,7 @@ internal object MusicResourceHelper { } } - internal fun ResourceContext.addMusicPreference( + fun ResourceContext.addMusicPreference( category: String, key: String, defaultValue: String, @@ -158,7 +141,7 @@ internal object MusicResourceHelper { } } - internal fun ResourceContext.addMusicPreferenceWithIntent( + fun ResourceContext.addMusicPreferenceWithIntent( category: String, key: String, dependencyKey: String @@ -188,7 +171,7 @@ internal object MusicResourceHelper { } } - internal fun ResourceContext.addMusicPreferenceWithoutSummary( + fun ResourceContext.addMusicPreferenceWithoutSummary( category: String, key: String, defaultValue: String @@ -207,7 +190,7 @@ internal object MusicResourceHelper { } } - internal fun ResourceContext.addReVancedMusicPreference( + fun ResourceContext.addReVancedMusicPreference( key: String ) { this.xmlEditor[YOUTUBE_MUSIC_SETTINGS_PATH].use { editor -> @@ -247,7 +230,7 @@ internal object MusicResourceHelper { } } - internal fun ResourceContext.hookPreference( + fun ResourceContext.hookPreference( key: String, fragment: String ) { diff --git a/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsBytecodePatch.kt index e54ce099d..d773a398e 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsBytecodePatch.kt @@ -1,18 +1,18 @@ package app.revanced.patches.music.utils.settings -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.utils.fingerprints.NewPlayerLayoutFingerprint +import app.revanced.patches.music.utils.integrations.Constants.INTEGRATIONS_PATH import app.revanced.patches.music.utils.integrations.IntegrationsPatch import app.revanced.patches.music.utils.mainactivity.MainActivityResolvePatch import app.revanced.patches.music.utils.mainactivity.MainActivityResolvePatch.injectInit import app.revanced.patches.music.utils.settings.fingerprints.PreferenceFingerprint import app.revanced.patches.music.utils.settings.fingerprints.SettingsHeadersFragmentFingerprint -import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -31,9 +31,9 @@ object SettingsBytecodePatch : BytecodePatch( ) ) { private const val INTEGRATIONS_ACTIVITY_CLASS_DESCRIPTOR = - "$MUSIC_INTEGRATIONS_PATH/settingsmenu/ReVancedSettingActivity;" + "$INTEGRATIONS_PATH/settingsmenu/ReVancedSettingActivity;" private const val INTEGRATIONS_FRAGMENT_CLASS_DESCRIPTOR = - "$MUSIC_INTEGRATIONS_PATH/settingsmenu/ReVancedSettingsFragment;" + "$INTEGRATIONS_PATH/settingsmenu/ReVancedSettingsFragment;" override fun execute(context: BytecodeContext) { diff --git a/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsPatch.kt index a89bf3e88..b4e5f33cb 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsPatch.kt @@ -3,25 +3,19 @@ package app.revanced.patches.music.utils.settings import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.settings.ResourceUtils.YOUTUBE_MUSIC_SETTINGS_KEY +import app.revanced.patches.music.utils.settings.ResourceUtils.addMusicPreference +import app.revanced.patches.music.utils.settings.ResourceUtils.addMusicPreferenceCategory +import app.revanced.patches.music.utils.settings.ResourceUtils.addMusicPreferenceWithIntent +import app.revanced.patches.music.utils.settings.ResourceUtils.addMusicPreferenceWithoutSummary +import app.revanced.patches.music.utils.settings.ResourceUtils.addReVancedMusicPreference +import app.revanced.patches.music.utils.settings.ResourceUtils.sortMusicPreferenceCategory import app.revanced.patches.shared.patch.settings.AbstractSettingsResourcePatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.resources.IconHelper -import app.revanced.util.resources.IconHelper.copyFiles -import app.revanced.util.resources.IconHelper.makeDirectoryAndCopyFiles -import app.revanced.util.resources.MusicResourceHelper.YOUTUBE_MUSIC_SETTINGS_KEY -import app.revanced.util.resources.MusicResourceHelper.addMusicPreference -import app.revanced.util.resources.MusicResourceHelper.addMusicPreferenceCategory -import app.revanced.util.resources.MusicResourceHelper.addMusicPreferenceWithIntent -import app.revanced.util.resources.MusicResourceHelper.addMusicPreferenceWithoutSummary -import app.revanced.util.resources.MusicResourceHelper.addReVancedMusicPreference -import app.revanced.util.resources.MusicResourceHelper.sortMusicPreferenceCategory -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import app.revanced.util.copyXmlNode import org.w3c.dom.Element import java.io.Closeable -import java.io.File -import java.nio.file.Paths @Patch( name = "Settings", @@ -31,9 +25,7 @@ import java.nio.file.Paths ) @Suppress("unused") object SettingsPatch : AbstractSettingsResourcePatch( - "music/settings", - "music/settings/host", - false + "music/settings" ), Closeable { override fun execute(context: ResourceContext) { contexts = context @@ -44,7 +36,7 @@ object SettingsPatch : AbstractSettingsResourcePatch( context["res/values-v21"].mkdirs() arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "values-v21", "strings.xml" ) @@ -88,36 +80,6 @@ object SettingsPatch : AbstractSettingsResourcePatch( context.addReVancedMusicPreference(YOUTUBE_MUSIC_SETTINGS_KEY) - /** - * If a custom branding icon path exists, merge it - */ - val iconPath = "branding-music" - val targetDirectory = Paths.get("").toAbsolutePath().toString() + "/$iconPath" - - if (File(targetDirectory).exists()) { - fun copyResources(resourceGroups: List) { - try { - context.copyFiles(resourceGroups, iconPath) - } catch (_: Exception) { - context.makeDirectoryAndCopyFiles(resourceGroups, iconPath) - } - } - - val iconResourceFileNames = - IconHelper.YOUTUBE_MUSIC_LAUNCHER_ICON_ARRAY - .map { "$it.png" } - .toTypedArray() - - fun createGroup(directory: String) = ResourceUtils.ResourceGroup( - directory, *iconResourceFileNames - ) - - arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi") - .map { "mipmap-$it" } - .map(::createGroup) - .let(::copyResources) - } - super.execute(context) } diff --git a/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/SponsorBlockBytecodePatch.kt index 43024acd8..fa6a29fa0 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/SponsorBlockBytecodePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.utils.sponsorblock -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -14,6 +13,7 @@ import app.revanced.patches.music.utils.sponsorblock.bytecode.fingerprints.Music import app.revanced.patches.music.utils.sponsorblock.bytecode.fingerprints.MusicPlaybackControlsTimeBarOnMeasureFingerprint import app.revanced.patches.music.utils.sponsorblock.bytecode.fingerprints.SeekbarOnDrawFingerprint import app.revanced.patches.music.video.information.VideoInformationPatch +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction3rc import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/SponsorBlockPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/SponsorBlockPatch.kt index 0df991217..5a2eebaf8 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/SponsorBlockPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/SponsorBlockPatch.kt @@ -4,11 +4,11 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.settings.ResourceUtils +import app.revanced.patches.music.utils.settings.ResourceUtils.hookPreference import app.revanced.patches.music.utils.settings.SettingsPatch -import app.revanced.util.resources.MusicResourceHelper -import app.revanced.util.resources.MusicResourceHelper.hookPreference -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources @Patch( name = "SponsorBlock", @@ -27,7 +27,7 @@ object SponsorBlockPatch : ResourcePatch() { * Copy preference */ arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "xml", "sponsorblock_prefs.xml" ) @@ -57,7 +57,7 @@ object SponsorBlockPatch : ResourcePatch() { context["res/xml/sponsorblock_prefs.xml"].readText() .replace( "\"com.google.android.apps.youtube.music\"", - "\"" + MusicResourceHelper.targetPackage + "\"" + "\"" + ResourceUtils.targetPackage + "\"" ) ) diff --git a/src/main/kotlin/app/revanced/patches/music/utils/videotype/VideoTypeHookPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/videotype/VideoTypeHookPatch.kt index 8bf01a4ab..0cf6db34e 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/videotype/VideoTypeHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/videotype/VideoTypeHookPatch.kt @@ -1,13 +1,13 @@ package app.revanced.patches.music.utils.videotype -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patches.music.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.music.utils.videotype.fingerprint.VideoTypeFingerprint import app.revanced.patches.music.utils.videotype.fingerprint.VideoTypeParentFingerprint -import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @Suppress("unused") @@ -43,5 +43,5 @@ object VideoTypeHookPatch : BytecodePatch( } private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "$MUSIC_UTILS_PATH/VideoTypeHookPatch;" + "$UTILS_PATH/VideoTypeHookPatch;" } diff --git a/src/main/kotlin/app/revanced/patches/music/video/customspeed/CustomPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/music/video/customspeed/CustomPlaybackSpeedPatch.kt index 2ce6e3520..18fe34074 100644 --- a/src/main/kotlin/app/revanced/patches/music/video/customspeed/CustomPlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/video/customspeed/CustomPlaybackSpeedPatch.kt @@ -3,11 +3,11 @@ package app.revanced.patches.music.video.customspeed import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.music.utils.intenthook.IntentHookPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.shared.patch.customspeed.AbstractCustomPlaybackSpeedPatch -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_VIDEO_PATH @Patch( name = "Custom playback speed", @@ -17,7 +17,7 @@ import app.revanced.util.integrations.Constants.MUSIC_VIDEO_PATH ) @Suppress("unused") object CustomPlaybackSpeedPatch : AbstractCustomPlaybackSpeedPatch( - "$MUSIC_VIDEO_PATH/CustomPlaybackSpeedPatch;", + "$VIDEO_PATH/CustomPlaybackSpeedPatch;", 3.0f ) { override fun execute(context: BytecodeContext) { diff --git a/src/main/kotlin/app/revanced/patches/music/video/information/VideoInformationPatch.kt b/src/main/kotlin/app/revanced/patches/music/video/information/VideoInformationPatch.kt index a9e97a317..072002968 100644 --- a/src/main/kotlin/app/revanced/patches/music/video/information/VideoInformationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/video/information/VideoInformationPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.video.information -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -11,6 +10,7 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patches.music.utils.fingerprints.SeekBarConstructorFingerprint +import app.revanced.patches.music.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.music.video.information.fingerprints.BackgroundPlaybackVideoIdFingerprint import app.revanced.patches.music.video.information.fingerprints.BackgroundPlaybackVideoIdParentFingerprint @@ -18,7 +18,7 @@ import app.revanced.patches.music.video.information.fingerprints.PlayerControlle import app.revanced.patches.music.video.information.fingerprints.VideoEndFingerprint import app.revanced.patches.music.video.information.fingerprints.VideoIdParentFingerprint import app.revanced.patches.music.video.information.fingerprints.VideoLengthFingerprint -import app.revanced.util.integrations.Constants.MUSIC_VIDEO_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation @@ -40,7 +40,7 @@ object VideoInformationPatch : BytecodePatch( ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "$MUSIC_VIDEO_PATH/VideoInformation;" + "$VIDEO_PATH/VideoInformation;" private var backgroundPlaybackInsertIndex = 0 private var offset = 0 diff --git a/src/main/kotlin/app/revanced/patches/music/video/quality/VideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/music/video/quality/VideoQualityPatch.kt index ddb19eff0..6de932a43 100644 --- a/src/main/kotlin/app/revanced/patches/music/video/quality/VideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/video/quality/VideoQualityPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.video.quality -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,12 +7,13 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.music.utils.overridequality.OverrideQualityHookPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.music.video.information.VideoInformationPatch import app.revanced.patches.music.video.quality.fingerprints.UserQualityChangeFingerprint -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_VIDEO_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c @Patch( @@ -67,5 +67,5 @@ object VideoQualityPatch : BytecodePatch( } private const val INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR = - "$MUSIC_VIDEO_PATH/VideoQualityPatch;" + "$VIDEO_PATH/VideoQualityPatch;" } diff --git a/src/main/kotlin/app/revanced/patches/music/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/music/video/speed/PlaybackSpeedPatch.kt index c7debc614..9371980e4 100644 --- a/src/main/kotlin/app/revanced/patches/music/video/speed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/video/speed/PlaybackSpeedPatch.kt @@ -1,19 +1,20 @@ package app.revanced.patches.music.video.speed -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.utils.integrations.Constants.UTILS_PATH +import app.revanced.patches.music.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.music.utils.overridespeed.OverrideSpeedHookPatch +import app.revanced.patches.music.utils.settings.CategoryType import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.patches.music.video.speed.fingerprints.PlaybackSpeedBottomSheetFingerprint import app.revanced.patches.music.video.speed.fingerprints.PlaybackSpeedBottomSheetParentFingerprint -import app.revanced.util.bytecode.BytecodeHelper.updatePatchStatus -import app.revanced.util.enum.CategoryType -import app.revanced.util.integrations.Constants.MUSIC_VIDEO_PATH +import app.revanced.util.exception +import app.revanced.util.updatePatchStatus import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @Patch( @@ -57,10 +58,10 @@ object PlaybackSpeedPatch : BytecodePatch( "true" ) - context.updatePatchStatus("RememberPlaybackSpeed", false) + context.updatePatchStatus("$UTILS_PATH/PatchStatus;","RememberPlaybackSpeed") } private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "$MUSIC_VIDEO_PATH/PlaybackSpeedPatch;" + "$VIDEO_PATH/PlaybackSpeedPatch;" } \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/reddit/ad/comments/HideCommentAdsPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/ad/comments/HideCommentAdsPatch.kt index 40e15820a..19f76c295 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/ad/comments/HideCommentAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/ad/comments/HideCommentAdsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.ad.comments -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,6 +7,7 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.reddit.ad.comments.fingerprints.HideCommentAdsFingerprint +import app.revanced.util.exception object HideCommentAdsPatch : BytecodePatch( setOf(HideCommentAdsFingerprint) diff --git a/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt index 041b90a25..d765a35c5 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.ad.general -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels @@ -16,6 +15,7 @@ import app.revanced.patches.reddit.ad.general.fingerprints.AdPostFingerprint import app.revanced.patches.reddit.ad.general.fingerprints.NewAdPostFingerprint import app.revanced.patches.reddit.utils.settings.SettingsBytecodePatch.updateSettingsStatus import app.revanced.patches.reddit.utils.settings.SettingsPatch +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c diff --git a/src/main/kotlin/app/revanced/patches/reddit/layout/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/layout/navigation/NavigationButtonsPatch.kt index d9baf921d..b98793348 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/layout/navigation/NavigationButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/layout/navigation/NavigationButtonsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.layout.navigation -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,6 +9,7 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.reddit.layout.navigation.fingerprints.BottomNavScreenFingerprint import app.revanced.patches.reddit.utils.settings.SettingsBytecodePatch.updateSettingsStatus import app.revanced.patches.reddit.utils.settings.SettingsPatch +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/reddit/layout/place/PlaceButtonPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/layout/place/PlaceButtonPatch.kt index 42e2deead..711dca17b 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/layout/place/PlaceButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/layout/place/PlaceButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.layout.place -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -12,7 +11,8 @@ import app.revanced.patches.reddit.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.reddit.utils.resourceid.SharedResourceIdPatch.ToolBarNavSearchCtaContainer import app.revanced.patches.reddit.utils.settings.SettingsBytecodePatch.updateSettingsStatus import app.revanced.patches.reddit.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -38,7 +38,7 @@ object PlaceButtonPatch : BytecodePatch( HomePagerScreenFingerprint.result?.let { it.mutableMethod.apply { val targetIndex = - getWideLiteralIndex(ToolBarNavSearchCtaContainer) + 3 + getWideLiteralInstructionIndex(ToolBarNavSearchCtaContainer) + 3 val targetRegister = getInstruction(targetIndex - 1).registerA diff --git a/src/main/kotlin/app/revanced/patches/reddit/layout/place/fingerprints/HomePagerScreenFingerprint.kt b/src/main/kotlin/app/revanced/patches/reddit/layout/place/fingerprints/HomePagerScreenFingerprint.kt index 7440c560b..b9d3240c1 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/layout/place/fingerprints/HomePagerScreenFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/layout/place/fingerprints/HomePagerScreenFingerprint.kt @@ -3,7 +3,7 @@ package app.revanced.patches.reddit.layout.place.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.reddit.utils.resourceid.SharedResourceIdPatch.ToolBarNavSearchCtaContainer -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags object HomePagerScreenFingerprint : MethodFingerprint( @@ -12,6 +12,6 @@ object HomePagerScreenFingerprint : MethodFingerprint( parameters = listOf("Landroid/view/LayoutInflater;", "Landroid/view/ViewGroup;"), customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("/HomePagerScreen;") - && methodDef.isWideLiteralExists(ToolBarNavSearchCtaContainer) + && methodDef.containsWideLiteralInstructionIndex(ToolBarNavSearchCtaContainer) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/reddit/layout/premiumicon/PremiumIconPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/layout/premiumicon/PremiumIconPatch.kt index eb741536c..d033af0c8 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/layout/premiumicon/PremiumIconPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/layout/premiumicon/PremiumIconPatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.reddit.layout.premiumicon -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.reddit.layout.premiumicon.fingerprints.PremiumIconFingerprint +import app.revanced.util.exception @Patch( name = "Premium icon", diff --git a/src/main/kotlin/app/revanced/patches/reddit/layout/recentlyvisited/RecentlyVisitedShelfPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/layout/recentlyvisited/RecentlyVisitedShelfPatch.kt index 92a3764b5..f852d2787 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/layout/recentlyvisited/RecentlyVisitedShelfPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/layout/recentlyvisited/RecentlyVisitedShelfPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.layout.recentlyvisited -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,6 +9,7 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.reddit.layout.recentlyvisited.fingerprints.CommunityDrawerPresenterFingerprint import app.revanced.patches.reddit.utils.settings.SettingsBytecodePatch.updateSettingsStatus import app.revanced.patches.reddit.utils.settings.SettingsPatch +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/reddit/layout/screenshotpopup/ScreenshotPopupPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/layout/screenshotpopup/ScreenshotPopupPatch.kt index d30c2f20e..60f651a52 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/layout/screenshotpopup/ScreenshotPopupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/layout/screenshotpopup/ScreenshotPopupPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.layout.screenshotpopup -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -12,6 +11,7 @@ import app.revanced.patches.reddit.layout.screenshotpopup.fingerprints.Screensho import app.revanced.patches.reddit.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.reddit.utils.settings.SettingsBytecodePatch.updateSettingsStatus import app.revanced.patches.reddit.utils.settings.SettingsPatch +import app.revanced.util.exception @Patch( name = "Disable screenshot popup", diff --git a/src/main/kotlin/app/revanced/patches/reddit/layout/screenshotpopup/fingerprints/ScreenshotTakenBannerFingerprint.kt b/src/main/kotlin/app/revanced/patches/reddit/layout/screenshotpopup/fingerprints/ScreenshotTakenBannerFingerprint.kt index 89c033b7d..15659aae2 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/layout/screenshotpopup/fingerprints/ScreenshotTakenBannerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/layout/screenshotpopup/fingerprints/ScreenshotTakenBannerFingerprint.kt @@ -3,14 +3,14 @@ package app.revanced.patches.reddit.layout.screenshotpopup.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.reddit.utils.resourceid.SharedResourceIdPatch.ScreenShotShareBanner -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags object ScreenshotTakenBannerFingerprint : MethodFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, customFingerprint = { methodDef, classDef -> - methodDef.isWideLiteralExists(ScreenShotShareBanner) + methodDef.containsWideLiteralInstructionIndex(ScreenShotShareBanner) && classDef.sourceFile == "ScreenshotTakenBanner.kt" } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/reddit/misc/openlink/OpenLinksDirectlyPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/misc/openlink/OpenLinksDirectlyPatch.kt index 48ce0a68c..05f4cf52a 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/misc/openlink/OpenLinksDirectlyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/misc/openlink/OpenLinksDirectlyPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.misc.openlink -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch @@ -9,6 +8,7 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.reddit.misc.openlink.fingerprints.ScreenNavigatorFingerprint import app.revanced.patches.reddit.utils.settings.SettingsBytecodePatch.updateSettingsStatus import app.revanced.patches.reddit.utils.settings.SettingsPatch +import app.revanced.util.exception @Patch( name = "Open links directly", diff --git a/src/main/kotlin/app/revanced/patches/reddit/misc/openlink/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/misc/openlink/OpenLinksExternallyPatch.kt index 4d0b677f8..f5fda7c00 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/misc/openlink/OpenLinksExternallyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/misc/openlink/OpenLinksExternallyPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.misc.openlink -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -11,7 +10,8 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.reddit.misc.openlink.fingerprints.ScreenNavigatorFingerprint import app.revanced.patches.reddit.utils.settings.SettingsBytecodePatch.updateSettingsStatus import app.revanced.patches.reddit.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getStringIndex +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex @Patch( name = "Open links externally", @@ -29,7 +29,7 @@ object OpenLinksExternallyPatch : BytecodePatch( override fun execute(context: BytecodeContext) { ScreenNavigatorFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getStringIndex("uri") + 2 + val insertIndex = getStringInstructionIndex("uri") + 2 addInstructionsWithLabels( insertIndex, """ diff --git a/src/main/kotlin/app/revanced/patches/reddit/misc/tracking/url/SanitizeUrlQueryPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/misc/tracking/url/SanitizeUrlQueryPatch.kt index 8fdc4bad3..479c5bd6e 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/misc/tracking/url/SanitizeUrlQueryPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/misc/tracking/url/SanitizeUrlQueryPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.misc.tracking.url -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -11,6 +10,7 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.reddit.misc.tracking.url.fingerprints.ShareLinkFormatterFingerprint import app.revanced.patches.reddit.utils.settings.SettingsBytecodePatch.updateSettingsStatus import app.revanced.patches.reddit.utils.settings.SettingsPatch +import app.revanced.util.exception @Patch( name = "Sanitize sharing links", diff --git a/src/main/kotlin/app/revanced/patches/reddit/utils/resourceid/SharedResourceIdPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/utils/resourceid/SharedResourceIdPatch.kt index 54dd052e7..81f86eb35 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/utils/resourceid/SharedResourceIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/utils/resourceid/SharedResourceIdPatch.kt @@ -4,15 +4,15 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch -import app.revanced.util.enum.ResourceType -import app.revanced.util.enum.ResourceType.ID -import app.revanced.util.enum.ResourceType.STRING +import app.revanced.patches.shared.patch.mapping.ResourceType +import app.revanced.patches.shared.patch.mapping.ResourceType.ID +import app.revanced.patches.shared.patch.mapping.ResourceType.STRING @Patch(dependencies = [ResourceMappingPatch::class]) object SharedResourceIdPatch : ResourcePatch() { - internal var LabelAcknowledgements = -1L - internal var ScreenShotShareBanner = -1L - internal var ToolBarNavSearchCtaContainer = -1L + var LabelAcknowledgements: Long = -1L + var ScreenShotShareBanner: Long = -1L + var ToolBarNavSearchCtaContainer: Long = -1L override fun execute(context: ResourceContext) { diff --git a/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsBytecodePatch.kt index 36834d00e..061dde130 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsBytecodePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.utils.settings -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -13,7 +12,8 @@ import app.revanced.patches.reddit.utils.resourceid.SharedResourceIdPatch.LabelA import app.revanced.patches.reddit.utils.settings.fingerprints.AcknowledgementsLabelBuilderFingerprint import app.revanced.patches.reddit.utils.settings.fingerprints.OssLicensesMenuActivityOnCreateFingerprint import app.revanced.patches.reddit.utils.settings.fingerprints.SettingsStatusLoadFingerprint -import app.revanced.util.bytecode.getWideLiteralIndex +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch(dependencies = [SharedResourceIdPatch::class]) @@ -46,7 +46,7 @@ object SettingsBytecodePatch : BytecodePatch( AcknowledgementsLabelBuilderFingerprint.result?.let { it.mutableMethod.apply { val insertIndex = - getWideLiteralIndex(LabelAcknowledgements) + 3 + getWideLiteralInstructionIndex(LabelAcknowledgements) + 3 val insertRegister = getInstruction(insertIndex - 1).registerA diff --git a/src/main/kotlin/app/revanced/patches/reddit/utils/settings/fingerprints/AcknowledgementsLabelBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/reddit/utils/settings/fingerprints/AcknowledgementsLabelBuilderFingerprint.kt index 18a1bccc4..257a12645 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/utils/settings/fingerprints/AcknowledgementsLabelBuilderFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/utils/settings/fingerprints/AcknowledgementsLabelBuilderFingerprint.kt @@ -3,7 +3,7 @@ package app.revanced.patches.reddit.utils.settings.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.reddit.utils.resourceid.SharedResourceIdPatch.LabelAcknowledgements -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags object AcknowledgementsLabelBuilderFingerprint : MethodFingerprint( @@ -12,6 +12,6 @@ object AcknowledgementsLabelBuilderFingerprint : MethodFingerprint( parameters = listOf("Landroidx/preference/Preference;"), customFingerprint = { methodDef, _ -> methodDef.definingClass.startsWith("Lcom/reddit/screen/settings/preferences/") - && methodDef.isWideLiteralExists(LabelAcknowledgements) + && methodDef.containsWideLiteralInstructionIndex(LabelAcknowledgements) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/ads/AbstractAdsPatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/ads/AbstractAdsPatch.kt index 0e38c5fed..06b6a2523 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/ads/AbstractAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/ads/AbstractAdsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.shared.patch.ads -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels @@ -10,6 +9,7 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.shared.fingerprints.ads.LegacyAdsFingerprint import app.revanced.patches.shared.fingerprints.ads.MainstreamAdsFingerprint +import app.revanced.util.exception abstract class AbstractAdsPatch( private val descriptor: String diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/customspeed/AbstractCustomPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/customspeed/AbstractCustomPlaybackSpeedPatch.kt index 610bf915c..3576ac76d 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/customspeed/AbstractCustomPlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/customspeed/AbstractCustomPlaybackSpeedPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.shared.patch.customspeed -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,6 +8,7 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patches.shared.fingerprints.customspeed.SpeedArrayGeneratorFingerprint import app.revanced.patches.shared.fingerprints.customspeed.SpeedLimiterFallBackFingerprint import app.revanced.patches.shared.fingerprints.customspeed.SpeedLimiterFingerprint +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/integrations/AbstractIntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/integrations/AbstractIntegrationsPatch.kt index a5adc6795..f1384227f 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/integrations/AbstractIntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/integrations/AbstractIntegrationsPatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.shared.patch.integrations -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patches.shared.patch.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint.RegisterResolver +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.ClassDef import com.android.tools.smali.dexlib2.iface.Method diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/litho/ComponentParserPatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/litho/ComponentParserPatch.kt index ce89f4baf..eae9f56d3 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/litho/ComponentParserPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/litho/ComponentParserPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.shared.patch.litho -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,6 +8,7 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.shared.fingerprints.litho.EmptyComponentBuilderFingerprint import app.revanced.patches.shared.fingerprints.litho.IdentifierFingerprint +import app.revanced.util.exception import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/litho/LithoThemePatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/litho/LithoThemePatch.kt index b3f6b2074..066e6090e 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/litho/LithoThemePatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/litho/LithoThemePatch.kt @@ -1,11 +1,11 @@ package app.revanced.patches.shared.patch.litho -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.shared.fingerprints.litho.LithoThemeFingerprint +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c import com.android.tools.smali.dexlib2.iface.reference.MethodReference diff --git a/src/main/kotlin/app/revanced/util/enum/ResourceType.kt b/src/main/kotlin/app/revanced/patches/shared/patch/mapping/ResourceType.kt similarity index 65% rename from src/main/kotlin/app/revanced/util/enum/ResourceType.kt rename to src/main/kotlin/app/revanced/patches/shared/patch/mapping/ResourceType.kt index 5d469d687..34654c0e7 100644 --- a/src/main/kotlin/app/revanced/util/enum/ResourceType.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/mapping/ResourceType.kt @@ -1,6 +1,6 @@ -package app.revanced.util.enum +package app.revanced.patches.shared.patch.mapping -internal enum class ResourceType(val value: String) { +enum class ResourceType(val value: String) { ATTR("attr"), BOOL("bool"), COLOR("color"), diff --git a/src/main/kotlin/app/revanced/util/microg/Constants.kt b/src/main/kotlin/app/revanced/patches/shared/patch/microg/Constants.kt similarity index 98% rename from src/main/kotlin/app/revanced/util/microg/Constants.kt rename to src/main/kotlin/app/revanced/patches/shared/patch/microg/Constants.kt index 3c280af7f..8a54ab4d9 100644 --- a/src/main/kotlin/app/revanced/util/microg/Constants.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/microg/Constants.kt @@ -1,9 +1,9 @@ -package app.revanced.util.microg +package app.revanced.patches.shared.patch.microg /** * constants for microG builds with signature spoofing */ -internal object Constants { +object Constants { /** * microG vendor name * aka. package prefix / package base diff --git a/src/main/kotlin/app/revanced/util/microg/MicroGBytecodeHelper.kt b/src/main/kotlin/app/revanced/patches/shared/patch/microg/MicroGBytecodeHelper.kt similarity index 95% rename from src/main/kotlin/app/revanced/util/microg/MicroGBytecodeHelper.kt rename to src/main/kotlin/app/revanced/patches/shared/patch/microg/MicroGBytecodeHelper.kt index d908f4230..933a6a38f 100644 --- a/src/main/kotlin/app/revanced/util/microg/MicroGBytecodeHelper.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/microg/MicroGBytecodeHelper.kt @@ -1,16 +1,16 @@ -package app.revanced.util.microg +package app.revanced.patches.shared.patch.microg -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.util.proxy.mutableTypes.MutableClass import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod -import app.revanced.util.microg.Constants.ACTIONS -import app.revanced.util.microg.Constants.AUTHORITIES -import app.revanced.util.microg.Constants.MICROG_VENDOR -import app.revanced.util.microg.Constants.PERMISSIONS +import app.revanced.patches.shared.patch.microg.Constants.ACTIONS +import app.revanced.patches.shared.patch.microg.Constants.AUTHORITIES +import app.revanced.patches.shared.patch.microg.Constants.MICROG_VENDOR +import app.revanced.patches.shared.patch.microg.Constants.PERMISSIONS +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c @@ -20,7 +20,7 @@ import com.android.tools.smali.dexlib2.immutable.reference.ImmutableStringRefere /** * Helper class for applying bytecode patches needed for the microg-support patches. */ -internal object MicroGBytecodeHelper { +object MicroGBytecodeHelper { /** * Transform strings with package name out of [fromPackageName] and [toPackageName]. diff --git a/src/main/kotlin/app/revanced/util/microg/MicroGManifestHelper.kt b/src/main/kotlin/app/revanced/patches/shared/patch/microg/MicroGManifestHelper.kt similarity index 81% rename from src/main/kotlin/app/revanced/util/microg/MicroGManifestHelper.kt rename to src/main/kotlin/app/revanced/patches/shared/patch/microg/MicroGManifestHelper.kt index ed1cba0ed..2ef387a06 100644 --- a/src/main/kotlin/app/revanced/util/microg/MicroGManifestHelper.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/microg/MicroGManifestHelper.kt @@ -1,17 +1,17 @@ -package app.revanced.util.microg +package app.revanced.patches.shared.patch.microg import app.revanced.patcher.data.ResourceContext -import app.revanced.util.microg.Constants.META_GMS_PACKAGE_NAME -import app.revanced.util.microg.Constants.META_SPOOFED_PACKAGE_NAME -import app.revanced.util.microg.Constants.META_SPOOFED_PACKAGE_SIGNATURE -import app.revanced.util.microg.Constants.MICROG_VENDOR +import app.revanced.patches.shared.patch.microg.Constants.META_GMS_PACKAGE_NAME +import app.revanced.patches.shared.patch.microg.Constants.META_SPOOFED_PACKAGE_NAME +import app.revanced.patches.shared.patch.microg.Constants.META_SPOOFED_PACKAGE_SIGNATURE +import app.revanced.patches.shared.patch.microg.Constants.MICROG_VENDOR import org.w3c.dom.Element import org.w3c.dom.Node /** * helper class for adding manifest metadata needed for microG builds with signature spoofing */ -internal object MicroGManifestHelper { +object MicroGManifestHelper { /** * Add manifest entries needed for package and signature spoofing when using MicroG. diff --git a/src/main/kotlin/app/revanced/util/microg/MicroGResourceHelper.kt b/src/main/kotlin/app/revanced/patches/shared/patch/microg/MicroGResourceHelper.kt similarity index 96% rename from src/main/kotlin/app/revanced/util/microg/MicroGResourceHelper.kt rename to src/main/kotlin/app/revanced/patches/shared/patch/microg/MicroGResourceHelper.kt index 0d275f47d..c149e53b1 100644 --- a/src/main/kotlin/app/revanced/util/microg/MicroGResourceHelper.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/microg/MicroGResourceHelper.kt @@ -1,11 +1,11 @@ -package app.revanced.util.microg +package app.revanced.patches.shared.patch.microg import app.revanced.patcher.data.ResourceContext /** * Helper class for applying resource patches needed for the microg-support patches. */ -internal object MicroGResourceHelper { +object MicroGResourceHelper { /** * Patch the manifest to work with MicroG. * diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/opus/AbstractOpusCodecsPatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/opus/AbstractOpusCodecsPatch.kt index 7f69c721a..f89ae4e51 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/opus/AbstractOpusCodecsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/opus/AbstractOpusCodecsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.shared.patch.opus -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,6 +8,7 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.shared.fingerprints.opus.CodecReferenceFingerprint import app.revanced.patches.shared.fingerprints.opus.CodecSelectorFingerprint +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/settings/AbstractSettingsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/settings/AbstractSettingsResourcePatch.kt index 37e4bed5a..ef31db2ff 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/settings/AbstractSettingsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/settings/AbstractSettingsResourcePatch.kt @@ -2,35 +2,34 @@ package app.revanced.patches.shared.patch.settings import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import app.revanced.util.copyXmlNode /** * Abstract settings resource patch * * @param sourceDirectory Source directory to copy the preference template from - * @param sourceHostDirectory Source directory to copy the preference template from */ abstract class AbstractSettingsResourcePatch( - private val sourceDirectory: String, - private val sourceHostDirectory: String, - private val isYouTube: Boolean, + private val sourceDirectory: String ) : ResourcePatch() { override fun execute(context: ResourceContext) { + val sourceHostDirectory = "$sourceDirectory/host" + val isYouTube = sourceDirectory.startsWith("youtube") /** * Copy strings */ context.copyXmlNode(sourceHostDirectory, "values/strings.xml", "resources") /** - * Initialize ReVanced Settings + * Copy ReVanced Settings */ - if (isYouTube) + if (isYouTube) { context.copyResources( sourceDirectory, - ResourceUtils.ResourceGroup("xml", "revanced_prefs.xml") + ResourceGroup("xml", "revanced_prefs.xml") ) - + } } } \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/tracking/AbstractSanitizeUrlQueryPatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/tracking/AbstractSanitizeUrlQueryPatch.kt index be05b4d6f..f9fc7b392 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/tracking/AbstractSanitizeUrlQueryPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/tracking/AbstractSanitizeUrlQueryPatch.kt @@ -1,11 +1,11 @@ package app.revanced.patches.shared.patch.tracking -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction abstract class AbstractSanitizeUrlQueryPatch( diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/translations/AbstractTranslationsPatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/translations/AbstractTranslationsPatch.kt new file mode 100644 index 000000000..632ba73b8 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/shared/patch/translations/AbstractTranslationsPatch.kt @@ -0,0 +1,27 @@ +package app.revanced.patches.shared.patch.translations + +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.util.classLoader +import java.nio.file.Files +import java.nio.file.StandardCopyOption + +abstract class AbstractTranslationsPatch( + private val sourceDirectory: String, + private val languageArray: Array +) : ResourcePatch() { + override fun execute(context: ResourceContext) { + languageArray.forEach { language -> + val directory = "values-$language-v21" + val relativePath = "$language/strings.xml" + + context["res/$directory"].mkdir() + + Files.copy( + classLoader.getResourceAsStream("$sourceDirectory/translations/$relativePath")!!, + context["res"].resolve("$directory/strings.xml").toPath(), + StandardCopyOption.REPLACE_EXISTING + ) + } + } +} diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/versionspoof/AbstractVersionSpoofPatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/versionspoof/AbstractVersionSpoofPatch.kt index 6b970a3e0..0bfe49ced 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/versionspoof/AbstractVersionSpoofPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/versionspoof/AbstractVersionSpoofPatch.kt @@ -1,11 +1,11 @@ package app.revanced.patches.shared.patch.versionspoof -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patches.shared.fingerprints.versionspoof.ClientInfoFingerprint import app.revanced.patches.shared.fingerprints.versionspoof.ClientInfoParentFingerprint +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.dexbacked.reference.DexBackedFieldReference import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/voicesearch/AbstractVoiceSearchButtonPatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/voicesearch/AbstractVoiceSearchButtonPatch.kt index 6e9549f92..f3ff28e82 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/voicesearch/AbstractVoiceSearchButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/voicesearch/AbstractVoiceSearchButtonPatch.kt @@ -28,9 +28,10 @@ abstract class AbstractVoiceSearchButtonPatch( .filter { it.getAttribute("android:id").equals(VOICE_SEARCH_ID) } .forEach { node -> replacements.forEach replacement@{ replacement -> - node.getAttributeNode("android:layout_$replacement")?.let { attribute -> - attribute.textContent = "0.0dip" - } + node.getAttributeNode("android:layout_$replacement") + ?.let { attribute -> + attribute.textContent = "0.0dip" + } } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/ads/general/GeneralAdsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ads/general/GeneralAdsBytecodePatch.kt index 5e5220ef8..8bf2bb503 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ads/general/GeneralAdsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ads/general/GeneralAdsBytecodePatch.kt @@ -1,44 +1,51 @@ package app.revanced.patches.youtube.ads.general -import app.revanced.extensions.findMutableMethodOf -import app.revanced.extensions.injectHideCall import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AdAttribution -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.findMutableMethodOf +import app.revanced.util.injectHideViewCall import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction31i import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c @Patch(dependencies = [SharedResourceIdPatch::class]) -@Suppress("LABEL_NAME_CLASH") -object GeneralAdsBytecodePatch : BytecodePatch() { +object GeneralAdsBytecodePatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { context.classes.forEach { classDef -> classDef.methods.forEach { method -> - if (!method.isWideLiteralExists(AdAttribution)) - return@forEach + method.implementation.apply { + this?.instructions?.forEachIndexed { index, instruction -> + if (instruction.opcode != Opcode.CONST) + return@forEachIndexed + // Instruction to store the id adAttribution into a register + if ((instruction as Instruction31i).wideLiteral != AdAttribution) + return@forEachIndexed - context.proxy(classDef) - .mutableClass - .findMutableMethodOf(method) - .apply { - val insertIndex = getWideLiteralIndex(AdAttribution) + 1 - if (getInstruction(insertIndex).opcode != Opcode.INVOKE_VIRTUAL) - return@forEach + val insertIndex = index + 1 - val viewRegister = getInstruction(insertIndex).registerC + // Call to get the view with the id adAttribution + (instructions.elementAt(insertIndex)).apply { + if (opcode != Opcode.INVOKE_VIRTUAL) + return@forEachIndexed - this.implementation!!.injectHideCall( - insertIndex, - viewRegister, - "ads/AdsFilter", - "hideAdAttributionView" - ) + // Hide the view + val viewRegister = (this as Instruction35c).registerC + context.proxy(classDef) + .mutableClass + .findMutableMethodOf(method) + .injectHideViewCall( + insertIndex, + viewRegister, + "$COMPONENTS_PATH/AdsFilter;", + "hideAdAttributionView" + ) + } } + } } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/ads/general/GeneralAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ads/general/GeneralAdsPatch.kt index fde4b44a8..4ee0b3c5d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ads/general/GeneralAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ads/general/GeneralAdsPatch.kt @@ -1,7 +1,5 @@ package app.revanced.patches.youtube.ads.general -import app.revanced.extensions.doRecursively -import app.revanced.extensions.startsWithAny import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage @@ -9,10 +7,12 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.ads.getpremium.HideGetPremiumPatch import app.revanced.patches.youtube.utils.fix.doublebacktoclose.DoubleBackToClosePatch import app.revanced.patches.youtube.utils.fix.swiperefresh.SwipeRefreshPatch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.copyXmlNode +import app.revanced.util.doRecursively +import app.revanced.util.startsWithAny import org.w3c.dom.Element @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/HideGetPremiumPatch.kt index d69ebb54f..0921519fa 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/HideGetPremiumPatch.kt @@ -1,13 +1,13 @@ package app.revanced.patches.youtube.ads.getpremium -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.ads.getpremium.fingerprints.CompactYpcOfferModuleViewFingerprint -import app.revanced.util.integrations.Constants.COMPONENTS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction object HideGetPremiumPatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/ads/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ads/video/VideoAdsPatch.kt index fbffc8aed..015f406dd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ads/video/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ads/video/VideoAdsPatch.kt @@ -4,8 +4,8 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.ads.AbstractAdsPatch +import app.revanced.patches.youtube.utils.integrations.Constants.ADS_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.ADS_PATH @Patch( name = "Hide video ads", diff --git a/src/main/kotlin/app/revanced/patches/youtube/alternativethumbnails/general/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/alternativethumbnails/general/AlternativeThumbnailsPatch.kt index 5005446fa..9ae1bb3e2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/alternativethumbnails/general/AlternativeThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/alternativethumbnails/general/AlternativeThumbnailsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.alternativethumbnails.general -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -11,10 +10,11 @@ import app.revanced.patches.youtube.alternativethumbnails.general.fingerprints.C import app.revanced.patches.youtube.alternativethumbnails.general.fingerprints.CronetURLRequestCallbackOnSucceededFingerprint import app.revanced.patches.youtube.alternativethumbnails.general.fingerprints.MessageDigestImageUrlFingerprint import app.revanced.patches.youtube.alternativethumbnails.general.fingerprints.MessageDigestImageUrlParentFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.ALTERNATIVE_THUMBNAILS import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch.contexts -import app.revanced.util.integrations.Constants.ALTERNATIVE_THUMBNAILS -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.copyXmlNode +import app.revanced.util.exception @Patch( name = "Alternative thumbnails", diff --git a/src/main/kotlin/app/revanced/patches/youtube/alternativethumbnails/general/fingerprints/CronetURLRequestCallbackOnSucceededFingerprint.kt.kt b/src/main/kotlin/app/revanced/patches/youtube/alternativethumbnails/general/fingerprints/CronetURLRequestCallbackOnSucceededFingerprint.kt similarity index 100% rename from src/main/kotlin/app/revanced/patches/youtube/alternativethumbnails/general/fingerprints/CronetURLRequestCallbackOnSucceededFingerprint.kt.kt rename to src/main/kotlin/app/revanced/patches/youtube/alternativethumbnails/general/fingerprints/CronetURLRequestCallbackOnSucceededFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/buttoncontainer/ButtonContainerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/buttoncontainer/ButtonContainerPatch.kt index 18adbe1a5..d7b0ba4ed 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/buttoncontainer/ButtonContainerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/buttoncontainer/ButtonContainerPatch.kt @@ -4,9 +4,9 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH @Patch( name = "Hide button container", @@ -44,7 +44,7 @@ import app.revanced.util.integrations.Constants.COMPONENTS_PATH ] ) @Suppress("unused") -object ButtonContainerPatch : BytecodePatch() { +object ButtonContainerPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { LithoFilterPatch.addFilter("$COMPONENTS_PATH/ButtonsFilter;") diff --git a/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/comment/CommentComponentPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/comment/CommentComponentPatch.kt index 401396ffb..b8fe8fe99 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/comment/CommentComponentPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/comment/CommentComponentPatch.kt @@ -4,9 +4,9 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH @Patch( name = "Hide comment component", @@ -44,7 +44,7 @@ import app.revanced.util.integrations.Constants.COMPONENTS_PATH ] ) @Suppress("unused") -object CommentComponentPatch : BytecodePatch() { +object CommentComponentPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { LithoFilterPatch.addFilter("$COMPONENTS_PATH/CommentsFilter;") diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/FeedFlyoutPanelPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/FeedFlyoutPanelPatch.kt index 427883de1..31f9e4f20 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/FeedFlyoutPanelPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/FeedFlyoutPanelPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.flyoutpanel.feed -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -11,9 +10,10 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.flyoutpanel.feed.fingerprints.BottomSheetMenuItemBuilderFingerprint import app.revanced.patches.youtube.flyoutpanel.feed.fingerprints.ContextualMenuItemBuilderFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.FLYOUT_PANEL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.FLYOUT_PANEL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/fingerprints/ContextualMenuItemBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/fingerprints/ContextualMenuItemBuilderFingerprint.kt index 6fa98bba1..c72641cfd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/fingerprints/ContextualMenuItemBuilderFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/fingerprints/ContextualMenuItemBuilderFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.flyoutpanel.feed.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.PosterArtWidthDefault -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object ContextualMenuItemBuilderFingerprint : MethodFingerprint( +object ContextualMenuItemBuilderFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC, parameters = listOf("L", "L"), returnType = "V", @@ -18,5 +17,5 @@ object ContextualMenuItemBuilderFingerprint : MethodFingerprint( Opcode.MOVE_RESULT, Opcode.ADD_INT_2ADDR ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(PosterArtWidthDefault) } + literalSupplier = { PosterArtWidthDefault } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/oldqualitylayout/OldQualityLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/oldqualitylayout/OldQualityLayoutPatch.kt index e0d7f1d34..e223a43dc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/oldqualitylayout/OldQualityLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/oldqualitylayout/OldQualityLayoutPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.flyoutpanel.oldqualitylayout -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,11 +9,12 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.flyoutpanel.recyclerview.BottomSheetRecyclerViewPatch import app.revanced.patches.youtube.utils.fingerprints.QualityMenuViewInflateFingerprint import app.revanced.patches.youtube.utils.fingerprints.RecyclerViewTreeObserverFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.FLYOUT_PANEL import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH -import app.revanced.util.integrations.Constants.FLYOUT_PANEL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/oldspeedlayout/OldSpeedLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/oldspeedlayout/OldSpeedLayoutPatch.kt index 3bd174885..da8695ff7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/oldspeedlayout/OldSpeedLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/oldspeedlayout/OldSpeedLayoutPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.flyoutpanel.oldspeedlayout -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels @@ -14,9 +13,10 @@ import app.revanced.patches.youtube.flyoutpanel.oldspeedlayout.fingerprints.Cust import app.revanced.patches.youtube.flyoutpanel.oldspeedlayout.fingerprints.PlaybackRateBottomSheetClassFingerprint import app.revanced.patches.youtube.flyoutpanel.recyclerview.BottomSheetRecyclerViewPatch import app.revanced.patches.youtube.utils.fingerprints.RecyclerViewTreeObserverFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH -import app.revanced.util.integrations.Constants.VIDEO_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.immutable.ImmutableField diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/PlayerFlyoutPanelPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/PlayerFlyoutPanelPatch.kt index 65a57fd2c..e681103e5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/PlayerFlyoutPanelPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/PlayerFlyoutPanelPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.flyoutpanel.player -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -11,14 +10,15 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.flyoutpanel.player.fingerprints.AdvancedQualityBottomSheetFingerprint import app.revanced.patches.youtube.flyoutpanel.player.fingerprints.CaptionsBottomSheetFingerprint import app.revanced.patches.youtube.utils.fingerprints.QualityMenuViewInflateFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.FLYOUT_PANEL import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BottomSheetFooterText import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.COMPONENTS_PATH -import app.revanced.util.integrations.Constants.FLYOUT_PANEL +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -96,7 +96,7 @@ object PlayerFlyoutPanelPatch : BytecodePatch( private fun MethodFingerprint.injectCall(descriptor: String) { result?.let { it.mutableMethod.apply { - val insertIndex = getWideLiteralIndex(BottomSheetFooterText) + 3 + val insertIndex = getWideLiteralInstructionIndex(BottomSheetFooterText) + 3 val insertRegister = getInstruction(insertIndex).registerA diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/fingerprints/AdvancedQualityBottomSheetFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/fingerprints/AdvancedQualityBottomSheetFingerprint.kt index a9c5b91da..3e40cae2e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/fingerprints/AdvancedQualityBottomSheetFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/fingerprints/AdvancedQualityBottomSheetFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.flyoutpanel.player.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.VideoQualityBottomSheet -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object AdvancedQualityBottomSheetFingerprint : MethodFingerprint( +object AdvancedQualityBottomSheetFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L", "L", "L"), returnType = "L", @@ -37,5 +36,5 @@ object AdvancedQualityBottomSheetFingerprint : MethodFingerprint( Opcode.IGET_OBJECT, Opcode.CONST_STRING ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(VideoQualityBottomSheet) } + literalSupplier = { VideoQualityBottomSheet } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/fingerprints/CaptionsBottomSheetFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/fingerprints/CaptionsBottomSheetFingerprint.kt index 48a72df61..616992892 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/fingerprints/CaptionsBottomSheetFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/fingerprints/CaptionsBottomSheetFingerprint.kt @@ -4,13 +4,13 @@ import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BottomSheetFooterText import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.SubtitleMenuSettingsFooterInfo -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags object CaptionsBottomSheetFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists(BottomSheetFooterText) - && methodDef.isWideLiteralExists(SubtitleMenuSettingsFooterInfo) + methodDef.containsWideLiteralInstructionIndex(BottomSheetFooterText) + && methodDef.containsWideLiteralInstructionIndex(SubtitleMenuSettingsFooterInfo) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/recyclerview/BottomSheetRecyclerViewPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/recyclerview/BottomSheetRecyclerViewPatch.kt index fbc87d0db..edbec9702 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/recyclerview/BottomSheetRecyclerViewPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/recyclerview/BottomSheetRecyclerViewPatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.youtube.flyoutpanel.recyclerview -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patches.youtube.flyoutpanel.recyclerview.fingerprints.BottomSheetRecyclerViewBuilderFingerprint -import app.revanced.util.bytecode.getWide32LiteralIndex +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction object BottomSheetRecyclerViewPatch : BytecodePatch( @@ -22,7 +22,7 @@ object BottomSheetRecyclerViewPatch : BytecodePatch( */ BottomSheetRecyclerViewBuilderFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWide32LiteralIndex(45382015) + 2 + val targetIndex = getWideLiteralInstructionIndex(45382015) + 2 val targetRegister = getInstruction(targetIndex).registerA addInstruction( diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/recyclerview/fingerprints/BottomSheetRecyclerViewBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/recyclerview/fingerprints/BottomSheetRecyclerViewBuilderFingerprint.kt index 488410cc1..5fffd3b5a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/recyclerview/fingerprints/BottomSheetRecyclerViewBuilderFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/recyclerview/fingerprints/BottomSheetRecyclerViewBuilderFingerprint.kt @@ -1,8 +1,7 @@ package app.revanced.patches.youtube.flyoutpanel.recyclerview.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object BottomSheetRecyclerViewBuilderFingerprint : MethodFingerprint( - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45382015) } +object BottomSheetRecyclerViewBuilderFingerprint : LiteralValueFingerprint( + literalSupplier = { 45382015 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/autoplaypreview/HideAutoplayPreviewPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/autoplaypreview/HideAutoplayPreviewPatch.kt index 5b7c642c2..3fe0782dc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/autoplaypreview/HideAutoplayPreviewPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/autoplaypreview/HideAutoplayPreviewPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.fullscreen.autoplaypreview -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,13 +8,14 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.FULLSCREEN import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AutoNavPreviewStub import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AutoNavToggle import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getStringIndex -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.FULLSCREEN +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -61,9 +61,9 @@ object HideAutoplayPreviewPatch : BytecodePatch( LayoutConstructorFingerprint.result?.let { it.mutableMethod.apply { val dummyRegister = - getInstruction(getStringIndex("1.0x")).registerA - val insertIndex = getWideLiteralIndex(AutoNavPreviewStub) - val jumpIndex = getWideLiteralIndex(AutoNavToggle) - 1 + getInstruction(getStringInstructionIndex("1.0x")).registerA + val insertIndex = getWideLiteralInstructionIndex(AutoNavPreviewStub) + val jumpIndex = getWideLiteralInstructionIndex(AutoNavToggle) - 1 addInstructionsWithLabels( insertIndex, """ diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/compactcontrolsoverlay/CompactControlsOverlayPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/compactcontrolsoverlay/CompactControlsOverlayPatch.kt index 4158b82f3..d0166ef24 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/compactcontrolsoverlay/CompactControlsOverlayPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/compactcontrolsoverlay/CompactControlsOverlayPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.fullscreen.compactcontrolsoverlay -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,9 +8,10 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.utils.fingerprints.YouTubeControlsOverlayFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.FULLSCREEN import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.FULLSCREEN +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/endscreenoverlay/HideEndScreenOverlayPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/endscreenoverlay/HideEndScreenOverlayPatch.kt index c95a7d658..af07cfcb6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/endscreenoverlay/HideEndScreenOverlayPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/endscreenoverlay/HideEndScreenOverlayPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.fullscreen.endscreenoverlay -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,9 +9,10 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.fullscreen.endscreenoverlay.fingerprints.EndScreenResultsParentFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.FULLSCREEN import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.FULLSCREEN +import app.revanced.util.exception @Patch( name = "Hide end screen overlay", diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/endscreenoverlay/fingerprints/EndScreenResultsParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/endscreenoverlay/fingerprints/EndScreenResultsParentFingerprint.kt index b65368e71..f2ca5112f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/endscreenoverlay/fingerprints/EndScreenResultsParentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/endscreenoverlay/fingerprints/EndScreenResultsParentFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.youtube.fullscreen.endscreenoverlay.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AppRelatedEndScreenResults -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object EndScreenResultsParentFingerprint : MethodFingerprint( +object EndScreenResultsParentFingerprint : LiteralValueFingerprint( returnType = "V", - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(AppRelatedEndScreenResults) } + literalSupplier = { AppRelatedEndScreenResults } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/forcefullscreen/ForceFullscreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/forcefullscreen/ForceFullscreenPatch.kt index 484ae676e..f409dce4d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/forcefullscreen/ForceFullscreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/forcefullscreen/ForceFullscreenPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.fullscreen.forcefullscreen -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -12,9 +11,10 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.fullscreen.forcefullscreen.fingerprints.ClientSettingEndpointFingerprint import app.revanced.patches.youtube.fullscreen.forcefullscreen.fingerprints.VideoPortraitParentFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.FULLSCREEN import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getStringIndex -import app.revanced.util.integrations.Constants.FULLSCREEN +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -66,12 +66,16 @@ object ForceFullscreenPatch : BytecodePatch( */ ClientSettingEndpointFingerprint.result?.let { it.mutableMethod.apply { - val getActivityIndex = getStringIndex("watch") + 2 - val getActivityReference = getInstruction(getActivityIndex).reference - val classRegister = getInstruction(getActivityIndex).registerB + val getActivityIndex = getStringInstructionIndex("watch") + 2 + val getActivityReference = + getInstruction(getActivityIndex).reference + val classRegister = + getInstruction(getActivityIndex).registerB - val watchDescriptorMethodIndex = getStringIndex("start_watch_minimized") - 1 - val watchDescriptorRegister = getInstruction(watchDescriptorMethodIndex).registerD + val watchDescriptorMethodIndex = + getStringInstructionIndex("start_watch_minimized") - 1 + val watchDescriptorRegister = + getInstruction(watchDescriptorMethodIndex).registerD addInstructions( watchDescriptorMethodIndex, """ @@ -80,7 +84,7 @@ object ForceFullscreenPatch : BytecodePatch( """ ) - val insertIndex = getStringIndex("force_fullscreen") + val insertIndex = getStringInstructionIndex("force_fullscreen") val freeRegister = getInstruction(insertIndex).registerA addInstructions( @@ -99,7 +103,8 @@ object ForceFullscreenPatch : BytecodePatch( */ VideoPortraitParentFingerprint.result?.let { it.mutableMethod.apply { - val stringIndex = getStringIndex("Acquiring NetLatencyActionLogger failed. taskId=") + val stringIndex = + getStringInstructionIndex("Acquiring NetLatencyActionLogger failed. taskId=") val invokeIndex = getTargetIndexTo(stringIndex, Opcode.INVOKE_INTERFACE) val targetIndex = getTargetIndexTo(invokeIndex, Opcode.CHECK_CAST) val targetClass = context diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/fullscreenpanels/HideFullscreenPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/fullscreenpanels/HideFullscreenPanelsPatch.kt index d04d9fb09..f0f28fb45 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/fullscreenpanels/HideFullscreenPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/fullscreenpanels/HideFullscreenPanelsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.fullscreen.fullscreenpanels -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -14,12 +13,12 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.fullscreen.fullscreenpanels.fingerprints.FullscreenEngagementPanelFingerprint import app.revanced.patches.youtube.fullscreen.fullscreenpanels.fingerprints.FullscreenViewAdderFingerprint import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.FULLSCREEN import app.revanced.patches.youtube.utils.quickactions.QuickActionsHookPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.FullScreenEngagementPanel import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getNarrowLiteralIndex -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.FULLSCREEN +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -72,7 +71,7 @@ object HideFullscreenPanelsPatch : BytecodePatch( FullscreenEngagementPanelFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(FullScreenEngagementPanel) + 3 + val targetIndex = getWideLiteralInstructionIndex(FullScreenEngagementPanel) + 3 val targetRegister = getInstruction(targetIndex).registerA addInstruction( @@ -101,7 +100,7 @@ object HideFullscreenPanelsPatch : BytecodePatch( LayoutConstructorFingerprint.result?.let { it.mutableMethod.apply { val dummyRegister = - getInstruction(getNarrowLiteralIndex(159962)).registerA + getInstruction(getWideLiteralInstructionIndex(159962)).registerA val invokeIndex = implementation!!.instructions.indexOfFirst { instruction -> instruction.opcode == Opcode.INVOKE_VIRTUAL && diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/fullscreenpanels/fingerprints/FullscreenEngagementPanelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/fullscreenpanels/fingerprints/FullscreenEngagementPanelFingerprint.kt index 641628c87..bc5d70c37 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/fullscreenpanels/fingerprints/FullscreenEngagementPanelFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/fullscreenpanels/fingerprints/FullscreenEngagementPanelFingerprint.kt @@ -1,15 +1,10 @@ package app.revanced.patches.youtube.fullscreen.fullscreenpanels.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.FullScreenEngagementPanel -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object FullscreenEngagementPanelFingerprint : MethodFingerprint( +object FullscreenEngagementPanelFingerprint : LiteralValueFingerprint( returnType = "L", parameters = listOf("L"), - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - FullScreenEngagementPanel - ) - } + literalSupplier = { FullScreenEngagementPanel } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/landscapemode/LandScapeModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/landscapemode/LandScapeModePatch.kt index ff1162d25..60c4dc672 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/landscapemode/LandScapeModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/landscapemode/LandScapeModePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.fullscreen.landscapemode -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -11,8 +10,9 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.OrientationParentFingerprint import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.OrientationPrimaryFingerprint import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.OrientationSecondaryFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.FULLSCREEN import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.FULLSCREEN +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/quickactions/QuickActionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/quickactions/QuickActionsPatch.kt index 905901801..0cd750552 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/quickactions/QuickActionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/quickactions/QuickActionsPatch.kt @@ -4,10 +4,10 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.quickactions.QuickActionsHookPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH @Patch( name = "Quick actions components", @@ -46,7 +46,7 @@ import app.revanced.util.integrations.Constants.COMPONENTS_PATH ] ) @Suppress("unused") -object QuickActionsPatch : BytecodePatch() { +object QuickActionsPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { LithoFilterPatch.addFilter("$COMPONENTS_PATH/QuickActionFilter;") diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/AccountMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/AccountMenuPatch.kt index fe421bc0d..a3d02a7fb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/AccountMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/AccountMenuPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.accountmenu -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -14,9 +13,10 @@ import app.revanced.patches.youtube.general.accountmenu.fingerprints.AccountMenu import app.revanced.patches.youtube.general.accountmenu.fingerprints.AccountMenuParentFingerprint import app.revanced.patches.youtube.general.accountmenu.fingerprints.AccountMenuPatchFingerprint import app.revanced.patches.youtube.general.accountmenu.fingerprints.SetViewGroupMarginFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountListParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountListParentFingerprint.kt index ffb01707d..5b2b822fe 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountListParentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountListParentFingerprint.kt @@ -1,9 +1,8 @@ package app.revanced.patches.youtube.general.accountmenu.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.CompactListItem -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object AccountListParentFingerprint : MethodFingerprint( - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(CompactListItem) } +object AccountListParentFingerprint : LiteralValueFingerprint( + literalSupplier = { CompactListItem } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountMenuParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountMenuParentFingerprint.kt index 5c76ac941..802e64dfd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountMenuParentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountMenuParentFingerprint.kt @@ -1,16 +1,15 @@ package app.revanced.patches.youtube.general.accountmenu.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.CompactLink -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object AccountMenuParentFingerprint : MethodFingerprint( +object AccountMenuParentFingerprint : LiteralValueFingerprint( opcodes = listOf( Opcode.CONST, Opcode.CONST_4, Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(CompactLink) } + literalSupplier = { CompactLink } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountMenuPatchFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountMenuPatchFingerprint.kt index da44f68df..37f14fdeb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountMenuPatchFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/accountmenu/fingerprints/AccountMenuPatchFingerprint.kt @@ -8,7 +8,7 @@ object AccountMenuPatchFingerprint : MethodFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.STATIC, customFingerprint = { methodDef, _ -> - methodDef.definingClass == "Lapp/revanced/integrations/patches/layout/GeneralPatch;" + methodDef.definingClass == "Lapp/revanced/integrations/patches/general/GeneralPatch;" && methodDef.name == "hideAccountMenu" } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/autocaptions/AutoCaptionsPatch.kt index 85ce5a12a..d788ff071 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/autocaptions/AutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/autocaptions/AutoCaptionsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.autocaptions -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels @@ -13,10 +12,11 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.shared.fingerprints.captions.SubtitleTrackFingerprint import app.revanced.patches.youtube.general.autocaptions.fingerprints.StartVideoInformerFingerprint import app.revanced.patches.youtube.utils.fingerprints.SubtitleButtonControllerFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception @Patch( name = "Disable auto captions", diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/autopopuppanels/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/autopopuppanels/PlayerPopupPanelsPatch.kt index 384b37c46..85439415e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/autopopuppanels/PlayerPopupPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/autopopuppanels/PlayerPopupPanelsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.autopopuppanels -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,8 +8,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.general.autopopuppanels.fingerprints.EngagementPanelControllerFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception @Patch( name = "Hide auto player popup panels", diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/CategoryBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/CategoryBarPatch.kt index 2dd64b630..073b70e67 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/CategoryBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/CategoryBarPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.categorybar -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -11,9 +10,10 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.categorybar.fingerprints.FilterBarHeightFingerprint import app.revanced.patches.youtube.general.categorybar.fingerprints.RelatedChipCloudFingerprint import app.revanced.patches.youtube.general.categorybar.fingerprints.SearchResultsChipBarFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/FilterBarHeightFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/FilterBarHeightFingerprint.kt index 5b636f1f5..8a1efbe97 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/FilterBarHeightFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/FilterBarHeightFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.general.categorybar.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.FilterBarHeight -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object FilterBarHeightFingerprint : MethodFingerprint( +object FilterBarHeightFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, opcodes = listOf( @@ -16,5 +15,5 @@ object FilterBarHeightFingerprint : MethodFingerprint( Opcode.MOVE_RESULT, Opcode.IPUT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(FilterBarHeight) } + literalSupplier = { FilterBarHeight } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/RelatedChipCloudFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/RelatedChipCloudFingerprint.kt index 3c1a10d2e..ab8dc547f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/RelatedChipCloudFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/RelatedChipCloudFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.general.categorybar.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.RelatedChipCloudMargin -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object RelatedChipCloudFingerprint : MethodFingerprint( +object RelatedChipCloudFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, opcodes = listOf( @@ -15,5 +14,5 @@ object RelatedChipCloudFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(RelatedChipCloudMargin) } + literalSupplier = { RelatedChipCloudMargin } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/SearchResultsChipBarFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/SearchResultsChipBarFingerprint.kt index ce4a97ea4..b80d4adcc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/SearchResultsChipBarFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/categorybar/fingerprints/SearchResultsChipBarFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.general.categorybar.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BarContainerHeight -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object SearchResultsChipBarFingerprint : MethodFingerprint( +object SearchResultsChipBarFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, opcodes = listOf( @@ -17,5 +16,5 @@ object SearchResultsChipBarFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(BarContainerHeight) } + literalSupplier = { BarContainerHeight } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/channellistsubmenu/ChannelListSubMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/channellistsubmenu/ChannelListSubMenuPatch.kt index 4410a0968..f5e4abea1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/channellistsubmenu/ChannelListSubMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/channellistsubmenu/ChannelListSubMenuPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.channellistsubmenu -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,9 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.channellistsubmenu.fingerprints.ChannelListSubMenuFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/channellistsubmenu/fingerprints/ChannelListSubMenuFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/channellistsubmenu/fingerprints/ChannelListSubMenuFingerprint.kt index e340499e1..8a336ecca 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/channellistsubmenu/fingerprints/ChannelListSubMenuFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/channellistsubmenu/fingerprints/ChannelListSubMenuFingerprint.kt @@ -1,16 +1,15 @@ package app.revanced.patches.youtube.general.channellistsubmenu.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ChannelListSubMenu -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object ChannelListSubMenuFingerprint : MethodFingerprint( +object ChannelListSubMenuFingerprint : LiteralValueFingerprint( opcodes = listOf( Opcode.CONST, Opcode.CONST_4, Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ChannelListSubMenu) } + literalSupplier = { ChannelListSubMenu } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/channelprofile/ChannelProfileComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/channelprofile/ChannelProfileComponentsPatch.kt index 5dbe8a065..d2f3e740d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/channelprofile/ChannelProfileComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/channelprofile/ChannelProfileComponentsPatch.kt @@ -4,9 +4,9 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH @Patch( name = "Hide channel profile components", @@ -44,7 +44,7 @@ import app.revanced.util.integrations.Constants.COMPONENTS_PATH ] ) @Suppress("unused") -object ChannelProfileComponentsPatch : BytecodePatch() { +object ChannelProfileComponentsPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { LithoFilterPatch.addFilter("$COMPONENTS_PATH/ChannelProfileFilter;") diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/crowdfundingbox/CrowdfundingBoxPatch.kt index 6635cd4d8..dca8431cf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/crowdfundingbox/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/crowdfundingbox/CrowdfundingBoxPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.crowdfundingbox -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,9 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.crowdfundingbox.fingerprints.CrowdfundingBoxFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/crowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/crowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt index 73d40e3a9..acf358e9c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/crowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/crowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt @@ -1,18 +1,17 @@ package app.revanced.patches.youtube.general.crowdfundingbox.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.DonationCompanion -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object CrowdfundingBoxFingerprint : MethodFingerprint( +object CrowdfundingBoxFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, opcodes = listOf( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT, Opcode.IPUT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(DonationCompanion) } + literalSupplier = { DonationCompanion } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/descriptions/DescriptionComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/descriptions/DescriptionComponentsPatch.kt index 44e172e18..bc43304ec 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/descriptions/DescriptionComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/descriptions/DescriptionComponentsPatch.kt @@ -4,9 +4,9 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH @Patch( name = "Hide description components", @@ -44,7 +44,7 @@ import app.revanced.util.integrations.Constants.COMPONENTS_PATH ] ) @Suppress("unused") -object DescriptionComponentsPatch : BytecodePatch() { +object DescriptionComponentsPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { LithoFilterPatch.addFilter("$COMPONENTS_PATH/DescriptionsFilter;") diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/floatingmicrophone/FloatingMicrophonePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/floatingmicrophone/FloatingMicrophonePatch.kt index 384e720eb..0d08cffd6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/floatingmicrophone/FloatingMicrophonePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/floatingmicrophone/FloatingMicrophonePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.floatingmicrophone -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,9 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.floatingmicrophone.fingerprints.FloatingMicrophoneFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/floatingmicrophone/fingerprints/FloatingMicrophoneFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/floatingmicrophone/fingerprints/FloatingMicrophoneFingerprint.kt index 688a86032..8a62910c4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/floatingmicrophone/fingerprints/FloatingMicrophoneFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/floatingmicrophone/fingerprints/FloatingMicrophoneFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.general.floatingmicrophone.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.Fab -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object FloatingMicrophoneFingerprint : MethodFingerprint( +object FloatingMicrophoneFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = emptyList(), @@ -16,5 +15,5 @@ object FloatingMicrophoneFingerprint : MethodFingerprint( Opcode.IF_EQZ, Opcode.RETURN_VOID ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(Fab) } + literalSupplier = { Fab } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/handle/HideHandlePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/handle/HideHandlePatch.kt index c6f5c83eb..a7781e8d4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/handle/HideHandlePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/handle/HideHandlePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.handle -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,11 +7,12 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.handle.fingerprints.AccountSwitcherAccessibilityLabelFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt index 3ac0a70b7..f4d73867e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.youtube.general.handle.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AccountSwitcherAccessibility -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object AccountSwitcherAccessibilityLabelFingerprint : MethodFingerprint( +object AccountSwitcherAccessibilityLabelFingerprint : LiteralValueFingerprint( returnType = "V", parameters = listOf("L", "Ljava/lang/Object;"), opcodes = listOf( @@ -17,5 +16,5 @@ object AccountSwitcherAccessibilityLabelFingerprint : MethodFingerprint( Opcode.APUT_OBJECT, Opcode.CONST ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(AccountSwitcherAccessibility) } + literalSupplier = { AccountSwitcherAccessibility } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/latestvideosbutton/LatestVideosButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/latestvideosbutton/LatestVideosButtonPatch.kt index 7e99d4bbc..33efd7904 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/latestvideosbutton/LatestVideosButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/latestvideosbutton/LatestVideosButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.latestvideosbutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,9 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.latestvideosbutton.fingerprints.LatestVideosButtonFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/latestvideosbutton/fingerprints/LatestVideosButtonFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/latestvideosbutton/fingerprints/LatestVideosButtonFingerprint.kt index e6a00e543..38a071c55 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/latestvideosbutton/fingerprints/LatestVideosButtonFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/latestvideosbutton/fingerprints/LatestVideosButtonFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.general.latestvideosbutton.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.Bar -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object LatestVideosButtonFingerprint : MethodFingerprint( +object LatestVideosButtonFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L", "Z"), @@ -17,5 +16,5 @@ object LatestVideosButtonFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(Bar) } + literalSupplier = { Bar } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/layout/LayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/layout/LayoutComponentsPatch.kt index 991a0fa2e..7eef9d4b4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/layout/LayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/layout/LayoutComponentsPatch.kt @@ -4,9 +4,9 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH @Patch( name = "Hide layout components", @@ -44,7 +44,7 @@ import app.revanced.util.integrations.Constants.COMPONENTS_PATH ] ) @Suppress("unused") -object LayoutComponentsPatch : BytecodePatch() { +object LayoutComponentsPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { LithoFilterPatch.addFilter("$COMPONENTS_PATH/CommunityPostFilter;") LithoFilterPatch.addFilter("$COMPONENTS_PATH/LayoutComponentsFilter;") diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/GradientLoadingScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/GradientLoadingScreenPatch.kt index b42604631..42716cbaf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/GradientLoadingScreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/GradientLoadingScreenPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.loadingscreen -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,9 +8,10 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.loadingscreen.fingerprints.GradientLoadingScreenPrimaryFingerprint import app.revanced.patches.youtube.general.loadingscreen.fingerprints.GradientLoadingScreenSecondaryFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWide32LiteralIndex -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -60,7 +60,7 @@ object GradientLoadingScreenPatch : BytecodePatch( */ GradientLoadingScreenSecondaryFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWide32LiteralIndex(45418917) + 2 + val targetIndex = getWideLiteralInstructionIndex(45418917) + 2 val targetRegister = getInstruction(targetIndex).registerA addInstructions( @@ -74,7 +74,7 @@ object GradientLoadingScreenPatch : BytecodePatch( GradientLoadingScreenPrimaryFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWide32LiteralIndex(45412406) + 2 + val targetIndex = getWideLiteralInstructionIndex(45412406) + 2 val targetRegister = getInstruction(targetIndex).registerA addInstructions( diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/fingerprints/GradientLoadingScreenPrimaryFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/fingerprints/GradientLoadingScreenPrimaryFingerprint.kt index 34c0079d9..6a04b7b31 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/fingerprints/GradientLoadingScreenPrimaryFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/fingerprints/GradientLoadingScreenPrimaryFingerprint.kt @@ -1,8 +1,7 @@ package app.revanced.patches.youtube.general.loadingscreen.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object GradientLoadingScreenPrimaryFingerprint : MethodFingerprint( - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45412406) } +object GradientLoadingScreenPrimaryFingerprint : LiteralValueFingerprint( + literalSupplier = { 45412406 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/fingerprints/GradientLoadingScreenSecondaryFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/fingerprints/GradientLoadingScreenSecondaryFingerprint.kt index 9f6ea6cdd..883671b57 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/fingerprints/GradientLoadingScreenSecondaryFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/loadingscreen/fingerprints/GradientLoadingScreenSecondaryFingerprint.kt @@ -1,8 +1,7 @@ package app.revanced.patches.youtube.general.loadingscreen.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object GradientLoadingScreenSecondaryFingerprint : MethodFingerprint( - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45418917) } +object GradientLoadingScreenSecondaryFingerprint : LiteralValueFingerprint( + literalSupplier = { 45418917 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/loadmorebutton/LoadMoreButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/loadmorebutton/LoadMoreButtonPatch.kt index 0de614520..80511f603 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/loadmorebutton/LoadMoreButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/loadmorebutton/LoadMoreButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.loadmorebutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,9 +8,10 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.loadmorebutton.fingerprints.LoadMoreButtonFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/loadmorebutton/fingerprints/LoadMoreButtonFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/loadmorebutton/fingerprints/LoadMoreButtonFingerprint.kt index 380e42795..7084928c0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/loadmorebutton/fingerprints/LoadMoreButtonFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/loadmorebutton/fingerprints/LoadMoreButtonFingerprint.kt @@ -1,16 +1,15 @@ package app.revanced.patches.youtube.general.loadmorebutton.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ExpandButtonDown -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object LoadMoreButtonFingerprint : MethodFingerprint( +object LoadMoreButtonFingerprint : LiteralValueFingerprint( opcodes = listOf( Opcode.CONST, Opcode.CONST_4, Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ExpandButtonDown) } + literalSupplier = { ExpandButtonDown } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/mixplaylists/MixPlaylistsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/mixplaylists/MixPlaylistsPatch.kt index 66863015a..a0efbe9cd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/mixplaylists/MixPlaylistsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/mixplaylists/MixPlaylistsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.mixplaylists -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels @@ -12,10 +11,11 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.general.mixplaylists.fingerprints.ElementParserFingerprint import app.revanced.patches.youtube.general.mixplaylists.fingerprints.EmptyFlatBufferFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getStringIndex -import app.revanced.util.integrations.Constants.COMPONENTS_PATH +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @@ -81,7 +81,8 @@ object MixPlaylistsPatch : BytecodePatch( val insertIndex = implementation!!.instructions.indexOfFirst { instruction -> instruction.opcode == Opcode.CHECK_CAST } + 1 - val jumpIndex = getStringIndex("Failed to convert Element to Flatbuffers: %s") + 2 + val jumpIndex = + getStringInstructionIndex("Failed to convert Element to Flatbuffers: %s") + 2 val freeIndex = it.scanResult.patternScanResult!!.startIndex - 1 diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/musicsearch/MusicSearchPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/musicsearch/MusicSearchPatch.kt index 78cd34e75..a5a94c47d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/musicsearch/MusicSearchPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/musicsearch/MusicSearchPatch.kt @@ -1,14 +1,14 @@ package app.revanced.patches.youtube.general.musicsearch -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.musicsearch.fingerprints.VoiceSearchConfigFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception @Patch( name = "Enable music search", diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/musicsearch/fingerprints/VoiceSearchConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/musicsearch/fingerprints/VoiceSearchConfigFingerprint.kt index f483b73ff..01eb151e8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/musicsearch/fingerprints/VoiceSearchConfigFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/musicsearch/fingerprints/VoiceSearchConfigFingerprint.kt @@ -1,9 +1,8 @@ package app.revanced.patches.youtube.general.musicsearch.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object VoiceSearchConfigFingerprint : MethodFingerprint( +object VoiceSearchConfigFingerprint : LiteralValueFingerprint( returnType = "Z", - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45417109) } + literalSupplier = { 45417109 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/searchterm/SearchTermThumbnailPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/searchterm/SearchTermThumbnailPatch.kt index 2da02a740..e7c57114b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/searchterm/SearchTermThumbnailPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/searchterm/SearchTermThumbnailPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.searchterm -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -12,8 +11,9 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.general.searchterm.fingerprints.CreateSearchSuggestionsFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/snackbar/HideSnackBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/snackbar/HideSnackBarPatch.kt index fb2a967c8..5f99b7b37 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/snackbar/HideSnackBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/snackbar/HideSnackBarPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.snackbar -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,8 +8,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.general.snackbar.fingerprints.HideSnackBarFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception @Patch( name = "Hide snack bar", diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/suggestions/SuggestionsShelfPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/suggestions/SuggestionsShelfPatch.kt index e9dd137b7..fcd520b31 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/suggestions/SuggestionsShelfPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/suggestions/SuggestionsShelfPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.suggestions -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,10 +8,11 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.suggestions.fingerprints.BreakingNewsFingerprint import app.revanced.patches.youtube.utils.browseid.BrowseIdHookPatch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.navbarindex.NavBarIndexHookPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/suggestions/fingerprints/BreakingNewsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/suggestions/fingerprints/BreakingNewsFingerprint.kt index 58f61b887..b6ce00338 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/suggestions/fingerprints/BreakingNewsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/suggestions/fingerprints/BreakingNewsFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.general.suggestions.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.HorizontalCardList -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object BreakingNewsFingerprint : MethodFingerprint( +object BreakingNewsFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, opcodes = listOf( Opcode.CONST, @@ -15,5 +14,5 @@ object BreakingNewsFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(HorizontalCardList) } + literalSupplier = { HorizontalCardList } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/tabletminiplayer/TabletMiniPlayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/tabletminiplayer/TabletMiniPlayerPatch.kt index 52067685a..259b8ebb2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/tabletminiplayer/TabletMiniPlayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/tabletminiplayer/TabletMiniPlayerPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.tabletminiplayer -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -13,10 +12,11 @@ import app.revanced.patches.youtube.general.tabletminiplayer.fingerprints.MiniPl import app.revanced.patches.youtube.general.tabletminiplayer.fingerprints.MiniPlayerOverrideFingerprint import app.revanced.patches.youtube.general.tabletminiplayer.fingerprints.MiniPlayerOverrideNoContextFingerprint import app.revanced.patches.youtube.general.tabletminiplayer.fingerprints.MiniPlayerResponseModelSizeCheckFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getStringIndex -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -83,7 +83,7 @@ object TabletMiniPlayerPatch : BytecodePatch( MiniPlayerOverrideFingerprint.result?.let { it.mutableMethod.apply { (context.toMethodWalker(this) - .nextMethod(getStringIndex("appName") + 2, true) + .nextMethod(getStringInstructionIndex("appName") + 2, true) .getMethod() as MutableMethod) .instructionProxyCall() } diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/tabletminiplayer/fingerprints/MiniPlayerDimensionsCalculatorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/tabletminiplayer/fingerprints/MiniPlayerDimensionsCalculatorFingerprint.kt index 488240f56..ec745d1a9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/tabletminiplayer/fingerprints/MiniPlayerDimensionsCalculatorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/tabletminiplayer/fingerprints/MiniPlayerDimensionsCalculatorFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.general.tabletminiplayer.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.FloatyBarTopMargin -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object MiniPlayerDimensionsCalculatorFingerprint : MethodFingerprint( +object MiniPlayerDimensionsCalculatorFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(FloatyBarTopMargin) } + literalSupplier = { FloatyBarTopMargin } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/toolbar/ToolBarButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/toolbar/ToolBarButtonPatch.kt index 082acb310..7639d9de2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/toolbar/ToolBarButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/toolbar/ToolBarButtonPatch.kt @@ -4,9 +4,9 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.toolbar.ToolBarHookPatch -import app.revanced.util.integrations.Constants.GENERAL @Patch( name = "Hide toolbar button", @@ -44,7 +44,7 @@ import app.revanced.util.integrations.Constants.GENERAL ] ) @Suppress("unused") -object ToolBarButtonPatch : BytecodePatch() { +object ToolBarButtonPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { ToolBarHookPatch.injectCall("$GENERAL->hideToolBarButton") diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/TrendingSearchesPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/TrendingSearchesPatch.kt index 289ece178..5b7867555 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/TrendingSearchesPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/TrendingSearchesPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.trendingsearches -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,13 +7,14 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.general.trendingsearches.fingerprints.SearchBarEntryFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.YtOutlineArrowTimeBlack import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.YtOutlineFireBlack import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.YtOutlineSearchBlack import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @@ -62,7 +62,7 @@ object TrendingSearchesPatch : BytecodePatch( SearchBarEntryFingerprint.result?.let { it.mutableMethod.apply { SearchTerm.entries - .map { searchTerm -> getWideLiteralIndex(searchTerm.resourceId) to searchTerm.value } + .map { searchTerm -> getWideLiteralInstructionIndex(searchTerm.resourceId) to searchTerm.value } .sortedBy { searchTerm -> searchTerm.first } .reversed() .forEach { (index, value) -> diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/fingerprints/SearchBarEntryFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/fingerprints/SearchBarEntryFingerprint.kt index c007de750..653f6e221 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/fingerprints/SearchBarEntryFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/fingerprints/SearchBarEntryFingerprint.kt @@ -5,15 +5,15 @@ import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.YtOutlineArrowTimeBlack import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.YtOutlineFireBlack import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.YtOutlineSearchBlack -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags object SearchBarEntryFingerprint : MethodFingerprint( returnType = "L", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists(YtOutlineArrowTimeBlack) - && methodDef.isWideLiteralExists(YtOutlineFireBlack) - && methodDef.isWideLiteralExists(YtOutlineSearchBlack) + methodDef.containsWideLiteralInstructionIndex(YtOutlineArrowTimeBlack) + && methodDef.containsWideLiteralInstructionIndex(YtOutlineFireBlack) + && methodDef.containsWideLiteralInstructionIndex(YtOutlineSearchBlack) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/WideSearchBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/WideSearchBarPatch.kt index 4e5e3af9b..4de5133d5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/WideSearchBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/WideSearchBarPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.general.widesearchbar -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -12,10 +11,11 @@ import app.revanced.patches.youtube.general.widesearchbar.fingerprints.SetAction import app.revanced.patches.youtube.general.widesearchbar.fingerprints.SetWordMarkHeaderFingerprint import app.revanced.patches.youtube.general.widesearchbar.fingerprints.YouActionBarFingerprint import app.revanced.patches.youtube.utils.fingerprints.LayoutSwitchFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch.contexts -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/fingerprints/SetActionBarRingoFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/fingerprints/SetActionBarRingoFingerprint.kt index 9b3e10287..0de2bc4aa 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/fingerprints/SetActionBarRingoFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/fingerprints/SetActionBarRingoFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.youtube.general.widesearchbar.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ActionBarRingo -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object SetActionBarRingoFingerprint : MethodFingerprint( +object SetActionBarRingoFingerprint : LiteralValueFingerprint( returnType = "L", parameters = listOf("L", "L"), opcodes = listOf( @@ -14,5 +13,5 @@ object SetActionBarRingoFingerprint : MethodFingerprint( Opcode.IGET_OBJECT, Opcode.INVOKE_STATIC ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ActionBarRingo) } + literalSupplier = { ActionBarRingo } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/animated/AnimatedButtonBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/animated/AnimatedButtonBackgroundPatch.kt index a4c6a91ae..105d93ba1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/animated/AnimatedButtonBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/animated/AnimatedButtonBackgroundPatch.kt @@ -5,8 +5,8 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources @Patch( name = "Hide animated button background", @@ -49,7 +49,7 @@ object AnimatedButtonBackgroundPatch : ResourcePatch() { */ context.copyResources( "youtube/animated", - ResourceUtils.ResourceGroup( + ResourceGroup( "raw", "pause_tap_feedback.json", "play_tap_feedback.json" diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconMMTPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconMMTPatch.kt deleted file mode 100644 index 81f74fc76..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconMMTPatch.kt +++ /dev/null @@ -1,52 +0,0 @@ -package app.revanced.patches.youtube.layout.branding.icon - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.IconHelper.customIcon -import app.revanced.util.resources.ResourceHelper.updatePatchStatusIcon - -@Patch( - name = "Custom branding icon MMT", - description = "Changes the YouTube launcher icon to MMT.", - dependencies = [SettingsPatch::class], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.25.40", - "18.27.36", - "18.29.38", - "18.30.37", - "18.31.40", - "18.32.39", - "18.33.40", - "18.34.38", - "18.35.36", - "18.36.39", - "18.37.36", - "18.38.44", - "18.39.41", - "18.40.34", - "18.41.39", - "18.42.41", - "18.43.45", - "18.44.41", - "18.45.43", - "18.46.43" - ] - ) - ], - use = false -) -@Suppress("unused") -object CustomBrandingIconMMTPatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - - context.customIcon("mmt") - context.updatePatchStatusIcon("mmt") - - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt new file mode 100644 index 000000000..b5cac813c --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt @@ -0,0 +1,179 @@ +package app.revanced.patches.youtube.layout.branding.icon + +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.PatchException +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotation.CompatiblePackage +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption +import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatusIcon +import app.revanced.patches.youtube.utils.settings.SettingsPatch +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import org.w3c.dom.Element +import java.io.File +import java.nio.file.Files + +@Patch( + name = "Custom branding icon YouTube", + description = "Change the YouTube launcher icon to the icon specified in options.json.", + dependencies = [SettingsPatch::class], + compatiblePackages = [ + CompatiblePackage( + "com.google.android.youtube", + [ + "18.25.40", + "18.27.36", + "18.29.38", + "18.30.37", + "18.31.40", + "18.32.39", + "18.33.40", + "18.34.38", + "18.35.36", + "18.36.39", + "18.37.36", + "18.38.44", + "18.39.41", + "18.40.34", + "18.41.39", + "18.42.41", + "18.43.45", + "18.44.41", + "18.45.43", + "18.46.43" + ] + ) + ] +) +@Suppress("unused") +object CustomBrandingIconPatch : ResourcePatch() { + private const val DEFAULT_ICON_KEY = "Revancify Blue" + + private val availableIcon = mapOf( + "MMT" to "mmt", + DEFAULT_ICON_KEY to "revancify_blue", + "Revancify Red" to "revancify_red" + ) + + private val drawableIconResourceFileNames = arrayOf( + "product_logo_youtube_color_24", + "product_logo_youtube_color_36", + "product_logo_youtube_color_144", + "product_logo_youtube_color_192" + ).map { "$it.png" }.toTypedArray() + + private val drawableDirectories = arrayOf( + "xxxhdpi", + "xxhdpi", + "xhdpi", + "hdpi", + "mdpi" + ).map { "drawable-$it" } + + private val mipmapIconResourceFileNames = arrayOf( + "adaptiveproduct_youtube_background_color_108", + "adaptiveproduct_youtube_foreground_color_108", + "ic_launcher", + "ic_launcher_round" + ).map { "$it.png" }.toTypedArray() + + private val mipmapDirectories = arrayOf( + "xxxhdpi", + "xxhdpi", + "xhdpi", + "hdpi", + "mdpi" + ).map { "mipmap-$it" } + + private var AppIcon by stringPatchOption( + key = "AppIcon", + default = DEFAULT_ICON_KEY, + values = availableIcon, + title = "App icon", + description = """ + The path to a folder containing the following folders: + + ${mipmapDirectories.joinToString("\n") { "- $it" }} + + Each of these folders has to have the following files: + + ${mipmapIconResourceFileNames.joinToString("\n") { "- $it" }} + """ + .split("\n") + .joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line. + .trimIndent(), // Remove the leading newline. + ) + + override fun execute(context: ResourceContext) { + AppIcon?.let { appIcon -> + if (!availableIcon.containsKey(appIcon)) { + mipmapDirectories.map { directory -> + ResourceGroup( + directory, *mipmapIconResourceFileNames + ) + }.let { resourceGroups -> + val path = File(appIcon) + val resourceDirectory = context["res"] + + resourceGroups.forEach { group -> + val fromDirectory = path.resolve(group.resourceDirectoryName) + val toDirectory = resourceDirectory.resolve(group.resourceDirectoryName) + + group.resources.forEach { iconFileName -> + Files.write( + toDirectory.resolve(iconFileName).toPath(), + fromDirectory.resolve(iconFileName).readBytes() + ) + } + } + } + } else { + val appIconValue = availableIcon[appIcon] + "" + val resourcePath = "youtube/branding/$appIconValue" + + // change launcher icon. + mipmapDirectories.map { directory -> + ResourceGroup( + directory, *mipmapIconResourceFileNames + ) + }.let { resourceGroups -> + resourceGroups.forEach { + context.copyResources("$resourcePath/launcher", it) + } + } + + // change splash icon. + drawableDirectories.map { directory -> + ResourceGroup( + directory, *drawableIconResourceFileNames + ) + }.let { resourceGroups -> + resourceGroups.forEach { + context.copyResources("$resourcePath/splash", it) + } + } + + // change monochrome icon. + arrayOf( + ResourceGroup( + "drawable", + "adaptive_monochrome_ic_youtube_launcher.xml" + ) + ).forEach { resourceGroup -> + context.copyResources("$resourcePath/monochrome", resourceGroup) + } + + // disable splash animation. + context.xmlEditor["res/values-v31/styles.xml"].use { editor -> + val tags = editor.file.getElementsByTagName("item") + List(tags.length) { tags.item(it) as Element } + .filter { it.getAttribute("name").contains("android:windowSplashScreenAnimatedIcon") } + .forEach { it.parentNode.removeChild(it) } + } + + context.updatePatchStatusIcon(appIconValue) + } + } ?: throw PatchException("Invalid app icon path.") + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconRevancifyBluePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconRevancifyBluePatch.kt deleted file mode 100644 index 466a040e6..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconRevancifyBluePatch.kt +++ /dev/null @@ -1,51 +0,0 @@ -package app.revanced.patches.youtube.layout.branding.icon - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.IconHelper.customIcon -import app.revanced.util.resources.ResourceHelper.updatePatchStatusIcon - -@Patch( - name = "Custom branding icon Revancify Blue", - description = "Changes the YouTube launcher icon to Revancify Blue.", - dependencies = [SettingsPatch::class], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.25.40", - "18.27.36", - "18.29.38", - "18.30.37", - "18.31.40", - "18.32.39", - "18.33.40", - "18.34.38", - "18.35.36", - "18.36.39", - "18.37.36", - "18.38.44", - "18.39.41", - "18.40.34", - "18.41.39", - "18.42.41", - "18.43.45", - "18.44.41", - "18.45.43", - "18.46.43" - ] - ) - ] -) -@Suppress("unused") -object CustomBrandingIconRevancifyBluePatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - - context.customIcon("revancify-blue") - context.updatePatchStatusIcon("revancify_blue") - - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconRevancifyRedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconRevancifyRedPatch.kt deleted file mode 100644 index d4b7317bf..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconRevancifyRedPatch.kt +++ /dev/null @@ -1,52 +0,0 @@ -package app.revanced.patches.youtube.layout.branding.icon - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.IconHelper.customIcon -import app.revanced.util.resources.ResourceHelper.updatePatchStatusIcon - -@Patch( - name = "Custom branding icon Revancify Red", - description = "Changes the YouTube launcher icon to Revancify Red.", - dependencies = [SettingsPatch::class], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.25.40", - "18.27.36", - "18.29.38", - "18.30.37", - "18.31.40", - "18.32.39", - "18.33.40", - "18.34.38", - "18.35.36", - "18.36.39", - "18.37.36", - "18.38.44", - "18.39.41", - "18.40.34", - "18.41.39", - "18.42.41", - "18.43.45", - "18.44.41", - "18.45.43", - "18.46.43" - ] - ) - ], - use = false -) -@Suppress("unused") -object CustomBrandingIconRevancifyRedPatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - - context.customIcon("revancify-red") - context.updatePatchStatusIcon("revancify_red") - - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/name/CustomBrandingNamePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/name/CustomBrandingNamePatch.kt index 5c9903834..582888d28 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/name/CustomBrandingNamePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/name/CustomBrandingNamePatch.kt @@ -6,8 +6,8 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption +import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatusLabel import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceHelper.updatePatchStatusLabel @Patch( name = "Custom branding name YouTube", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/doubletaplength/DoubleTapLengthPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/doubletaplength/DoubleTapLengthPatch.kt index 9ec98e38c..92bf0fce8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/doubletaplength/DoubleTapLengthPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/doubletaplength/DoubleTapLengthPatch.kt @@ -6,10 +6,10 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption +import app.revanced.patches.youtube.utils.settings.ResourceUtils.addEntryValues import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceHelper.addEntryValues -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources @Patch( name = "Custom double tap length", @@ -63,7 +63,7 @@ object DoubleTapLengthPatch : ResourcePatch() { */ context.copyResources( "youtube/doubletap", - ResourceUtils.ResourceGroup( + ResourceGroup( "values-v21", "arrays.xml" ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/header/PremiumHeadingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/header/PremiumHeadingPatch.kt index 0bed39c67..e2dbd2ae9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/header/PremiumHeadingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/header/PremiumHeadingPatch.kt @@ -6,8 +6,8 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.booleanPatchOption +import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatusHeader import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceHelper.updatePatchStatusHeader import kotlin.io.path.copyTo @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/materialyou/MaterialYouPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/materialyou/MaterialYouPatch.kt index 95dee80fa..a50050fa7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/materialyou/MaterialYouPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/materialyou/MaterialYouPatch.kt @@ -6,11 +6,11 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.layout.theme.GeneralThemePatch import app.revanced.patches.youtube.layout.theme.GeneralThemePatch.isMonetPatchIncluded +import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatusTheme import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceHelper.updatePatchStatusTheme -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import app.revanced.util.copyXmlNode @Patch( name = "MaterialYou", @@ -53,16 +53,16 @@ object MaterialYouPatch : ResourcePatch() { override fun execute(context: ResourceContext) { arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable-night-v31", "new_content_dot_background.xml" ), - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable-v31", "new_content_count_background.xml", "new_content_dot_background.xml" ), - ResourceUtils.ResourceGroup( + ResourceGroup( "layout-v31", "new_content_count.xml" ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/pipnotification/PiPNotificationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/pipnotification/PiPNotificationPatch.kt index 17c49e076..be0c6c018 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/pipnotification/PiPNotificationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/pipnotification/PiPNotificationPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.layout.pipnotification -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch @@ -10,6 +9,7 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.layout.pipnotification.fingerprints.PiPNotificationFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/pipnotification/fingerprints/PiPNotificationFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/pipnotification/fingerprints/PiPNotificationFingerprint.kt index c27b1aca5..866104323 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/pipnotification/fingerprints/PiPNotificationFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/pipnotification/fingerprints/PiPNotificationFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.layout.pipnotification.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.EditSettingsAction -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object PiPNotificationFingerprint : MethodFingerprint( +object PiPNotificationFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(EditSettingsAction) } + literalSupplier = { EditSettingsAction } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/splashanimation/AddSplashAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/splashanimation/AddSplashAnimationPatch.kt index 25640093b..3c966923c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/splashanimation/AddSplashAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/splashanimation/AddSplashAnimationPatch.kt @@ -4,9 +4,9 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import app.revanced.util.copyXmlNode import kotlin.io.path.exists @Patch( @@ -58,7 +58,7 @@ object AddSplashAnimationPatch : ResourcePatch() { * extract from YouTube v18.18.39 */ arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable", "\$\$avd_anim__1__0.xml", "\$\$avd_anim__1__1.xml", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/GeneralThemePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/GeneralThemePatch.kt index 900859868..faf3b7ffe 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/GeneralThemePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/GeneralThemePatch.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.litho.LithoThemePatch -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import org.w3c.dom.Element @Patch(dependencies = [LithoThemePatch::class]) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt index cde85ee83..5ab98215a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt @@ -7,8 +7,8 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption import app.revanced.patches.youtube.layout.theme.GeneralThemePatch.isMonetPatchIncluded +import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatusTheme import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceHelper.updatePatchStatusTheme import org.w3c.dom.Element @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tooltip/TooltipContentViewPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tooltip/TooltipContentViewPatch.kt index 554c7ac19..c2304d37d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tooltip/TooltipContentViewPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tooltip/TooltipContentViewPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.layout.tooltip -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch @@ -9,6 +8,7 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.layout.tooltip.fingerprints.TooltipContentViewFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch +import app.revanced.util.exception @Patch( name = "Hide tooltip content", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tooltip/fingerprints/TooltipContentViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tooltip/fingerprints/TooltipContentViewFingerprint.kt index 3d185e27b..f96dbfecc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tooltip/fingerprints/TooltipContentViewFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tooltip/fingerprints/TooltipContentViewFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.layout.tooltip.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ToolTipContentView -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object TooltipContentViewFingerprint : MethodFingerprint( +object TooltipContentViewFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ToolTipContentView) } + literalSupplier = { ToolTipContentView } ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/ambientmode/AmbientModeSwitchPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/ambientmode/AmbientModeSwitchPatch.kt index 978c11898..b735b056d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/ambientmode/AmbientModeSwitchPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/ambientmode/AmbientModeSwitchPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.ambientmode -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,10 +9,11 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.misc.ambientmode.fingerprints.AmbientModeInFullscreenFingerprint import app.revanced.patches.youtube.misc.ambientmode.fingerprints.PowerSaveModeFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.FULLSCREEN +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWide32LiteralIndex -import app.revanced.util.integrations.Constants.FULLSCREEN -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c @@ -88,7 +88,7 @@ object AmbientModeSwitchPatch : BytecodePatch( AmbientModeInFullscreenFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWide32LiteralIndex(45389368) + 3 + val targetIndex = getWideLiteralInstructionIndex(45389368) + 3 val targetRegister = getInstruction(targetIndex).registerA addInstructions( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/ambientmode/fingerprints/AmbientModeInFullscreenFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/ambientmode/fingerprints/AmbientModeInFullscreenFingerprint.kt index 1a4eb2611..4dc57447a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/ambientmode/fingerprints/AmbientModeInFullscreenFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/ambientmode/fingerprints/AmbientModeInFullscreenFingerprint.kt @@ -1,11 +1,8 @@ package app.revanced.patches.youtube.misc.ambientmode.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object AmbientModeInFullscreenFingerprint : MethodFingerprint( +object AmbientModeInFullscreenFingerprint : LiteralValueFingerprint( returnType = "V", - customFingerprint = { methodDef, _ -> - methodDef.isWide32LiteralExists(45389368) - } + literalSupplier = { 45389368 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/codec/audio/ForceOpusCodecPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/codec/audio/ForceOpusCodecPatch.kt index e771107b0..0382194ad 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/codec/audio/ForceOpusCodecPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/codec/audio/ForceOpusCodecPatch.kt @@ -4,8 +4,8 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.opus.AbstractOpusCodecsPatch +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.MISC_PATH @Patch( name = "Force OPUS codec", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/codec/video/ForceVideoCodecPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/codec/video/ForceVideoCodecPatch.kt index f4871365a..d9204c5da 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/codec/video/ForceVideoCodecPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/codec/video/ForceVideoCodecPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.codec.video -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -15,8 +14,9 @@ import app.revanced.patches.youtube.misc.codec.video.fingerprints.VideoPropsFing import app.revanced.patches.youtube.misc.codec.video.fingerprints.VideoPropsParentFingerprint import app.revanced.patches.youtube.misc.codec.video.fingerprints.VideoSecondaryFingerprint import app.revanced.patches.youtube.utils.fingerprints.LayoutSwitchFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.dexbacked.reference.DexBackedFieldReference import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/externalbrowser/ExternalBrowserPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/externalbrowser/ExternalBrowserPatch.kt index 7954d162c..b74d1a0ce 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/externalbrowser/ExternalBrowserPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/externalbrowser/ExternalBrowserPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.externalbrowser -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,9 +9,10 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.misc.externalbrowser.fingerprints.ExternalBrowserPrimaryFingerprint import app.revanced.patches.youtube.misc.externalbrowser.fingerprints.ExternalBrowserSecondaryFingerprint import app.revanced.patches.youtube.misc.externalbrowser.fingerprints.ExternalBrowserTertiaryFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getStringIndex -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -65,7 +65,7 @@ object ExternalBrowserPatch : BytecodePatch( fingerprint.result?.let { it.mutableMethod.apply { val targetIndex = - getStringIndex("android.support.customtabs.action.CustomTabsService") + getStringInstructionIndex("android.support.customtabs.action.CustomTabsService") val register = getInstruction(targetIndex).registerA addInstructions( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/language/LanguageSelectorPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/language/LanguageSelectorPatch.kt index 381284e5b..15020f12c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/language/LanguageSelectorPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/language/LanguageSelectorPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.language -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,8 +8,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.misc.language.fingerprints.GeneralPrefsFingerprint import app.revanced.patches.youtube.misc.language.fingerprints.GeneralPrefsLegacyFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/layoutswitch/LayoutSwitchPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/layoutswitch/LayoutSwitchPatch.kt index 209765bb4..30d7e2735 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/layoutswitch/LayoutSwitchPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/layoutswitch/LayoutSwitchPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.layoutswitch -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels @@ -11,8 +10,9 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.misc.layoutswitch.fingerprints.GetFormFactorFingerprint import app.revanced.patches.youtube.utils.fingerprints.LayoutSwitchFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception @Patch( name = "Layout switch", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/MinimizedPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/MinimizedPlaybackPatch.kt index 3840c7ff4..971d9dd16 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/MinimizedPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/MinimizedPlaybackPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.minimizedplayback -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -13,9 +12,10 @@ import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.KidsMini import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackSettingsFingerprint import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.PiPControllerFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.integrations.IntegrationsPatch import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.MethodReference diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/MinimizedPlaybackManagerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/MinimizedPlaybackManagerFingerprint.kt index 66b1aae7e..2d5a9a6b3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/MinimizedPlaybackManagerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/MinimizedPlaybackManagerFingerprint.kt @@ -1,15 +1,14 @@ package app.revanced.patches.youtube.misc.minimizedplayback.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isNarrowLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object MinimizedPlaybackManagerFingerprint : MethodFingerprint( +object MinimizedPlaybackManagerFingerprint : LiteralValueFingerprint( returnType = "Z", accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, parameters = listOf("L"), opcodes = listOf(Opcode.AND_INT_LIT16), - customFingerprint = { methodDef, _ -> methodDef.isNarrowLiteralExists(64657230) } + literalSupplier = { 64657230 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/MinimizedPlaybackSettingsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/MinimizedPlaybackSettingsFingerprint.kt index 7914e6aac..81a74ca65 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/MinimizedPlaybackSettingsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/MinimizedPlaybackSettingsFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.misc.minimizedplayback.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BackgroundCategory -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object MinimizedPlaybackSettingsFingerprint : MethodFingerprint( +object MinimizedPlaybackSettingsFingerprint : LiteralValueFingerprint( returnType = "L", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, opcodes = listOf( @@ -19,5 +18,5 @@ object MinimizedPlaybackSettingsFingerprint : MethodFingerprint( Opcode.IF_NEZ, Opcode.GOTO ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(BackgroundCategory) } + literalSupplier = { BackgroundCategory } ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/PiPControllerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/PiPControllerFingerprint.kt index 117036489..aad082a5c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/PiPControllerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/fingerprints/PiPControllerFingerprint.kt @@ -1,12 +1,11 @@ package app.revanced.patches.youtube.misc.minimizedplayback.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isNarrowLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object PiPControllerFingerprint : MethodFingerprint( +object PiPControllerFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = emptyList(), @@ -14,5 +13,5 @@ object PiPControllerFingerprint : MethodFingerprint( Opcode.IF_NEZ, Opcode.INVOKE_DIRECT ), - customFingerprint = { methodDef, _ -> methodDef.isNarrowLiteralExists(151635310) } + literalSupplier = { 151635310 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/openlinksdirectly/OpenLinksDirectlyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/openlinksdirectly/OpenLinksDirectlyPatch.kt index 3dc658f23..8995d00c6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/openlinksdirectly/OpenLinksDirectlyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/openlinksdirectly/OpenLinksDirectlyPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.openlinksdirectly -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction @@ -9,8 +8,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyFingerprintPrimary import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyFingerprintSecondary +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c import com.android.tools.smali.dexlib2.iface.reference.MethodReference diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/quic/QUICProtocolPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/quic/QUICProtocolPatch.kt index dc19bf7b7..59ffdad63 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/quic/QUICProtocolPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/quic/QUICProtocolPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.quic -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch @@ -8,8 +7,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.misc.quic.fingerprints.CronetEngineBuilderFingerprint import app.revanced.patches.youtube.misc.quic.fingerprints.ExperimentalCronetEngineBuilderFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception @Patch( name = "Disable QUIC protocol", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/NewSplashAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/NewSplashAnimationPatch.kt index 0d820e097..a603e051b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/NewSplashAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/NewSplashAnimationPatch.kt @@ -10,14 +10,13 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.misc.splashanimation.fingerprints.WatchWhileActivityWithInFlagsFingerprint import app.revanced.patches.youtube.misc.splashanimation.fingerprints.WatchWhileActivityWithOutFlagsFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.mainactivity.MainActivityResolvePatch import app.revanced.patches.youtube.utils.mainactivity.MainActivityResolvePatch.mainActivityClassDef import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.DarkSplashAnimation import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWide32LiteralIndex -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @@ -59,7 +58,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction ] ) @Suppress("unused") -object NewSplashAnimationPatch : BytecodePatch() { +object NewSplashAnimationPatch : BytecodePatch(emptySet()) { override fun execute(context: BytecodeContext) { WatchWhileActivityWithInFlagsFingerprint.resolve(context, mainActivityClassDef) @@ -74,7 +73,7 @@ object NewSplashAnimationPatch : BytecodePatch() { */ WatchWhileActivityWithInFlagsFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWide32LiteralIndex(45407550) + 3 + val targetIndex = getWideLiteralInstructionIndex(45407550) + 3 inject(targetIndex) } } @@ -84,7 +83,7 @@ object NewSplashAnimationPatch : BytecodePatch() { */ WatchWhileActivityWithOutFlagsFingerprint.result?.let { it.mutableMethod.apply { - var startIndex = getWideLiteralIndex(DarkSplashAnimation) - 1 + var startIndex = getWideLiteralInstructionIndex(DarkSplashAnimation) - 1 val endIndex = startIndex - 30 for (index in startIndex downTo endIndex) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithInFlagsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithInFlagsFingerprint.kt index c802d5ef2..dd10648b8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithInFlagsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithInFlagsFingerprint.kt @@ -1,13 +1,13 @@ package app.revanced.patches.youtube.misc.splashanimation.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex object WatchWhileActivityWithInFlagsFingerprint : MethodFingerprint( returnType = "V", parameters = listOf("Landroid/os/Bundle;"), customFingerprint = { methodDef, _ -> methodDef.name == "onCreate" - && methodDef.isWide32LiteralExists(45407550) + && methodDef.containsWideLiteralInstructionIndex(45407550) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithOutFlagsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithOutFlagsFingerprint.kt index 31d0e570b..efe8ebd3f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithOutFlagsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithOutFlagsFingerprint.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.misc.splashanimation.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.DarkSplashAnimation -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode object WatchWhileActivityWithOutFlagsFingerprint : MethodFingerprint( @@ -21,6 +21,6 @@ object WatchWhileActivityWithOutFlagsFingerprint : MethodFingerprint( ), customFingerprint = { methodDef, _ -> methodDef.name == "onCreate" - && methodDef.isWideLiteralExists(DarkSplashAnimation) + && methodDef.containsWideLiteralInstructionIndex(DarkSplashAnimation) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/spoofappversion/SpoofAppVersionPatch.kt index 54cfe2b20..ed3d5024e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/spoofappversion/SpoofAppVersionPatch.kt @@ -5,10 +5,10 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.versionspoof.AbstractVersionSpoofPatch +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch.contexts -import app.revanced.util.integrations.Constants.MISC_PATH -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.copyXmlNode import org.w3c.dom.Element @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/spoofdimensions/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/spoofdimensions/SpoofDeviceDimensionsPatch.kt index 83b7b211e..5bed1524e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/spoofdimensions/SpoofDeviceDimensionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/spoofdimensions/SpoofDeviceDimensionsPatch.kt @@ -1,14 +1,14 @@ package app.revanced.patches.youtube.misc.spoofdimensions -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.misc.spoofdimensions.fingerprints.DeviceDimensionsModelToStringFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.util.MethodUtil @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/tracking/SanitizeUrlQueryPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/tracking/SanitizeUrlQueryPatch.kt index 98942d480..d3097c5aa 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/tracking/SanitizeUrlQueryPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/tracking/SanitizeUrlQueryPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.tracking -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction @@ -10,8 +9,9 @@ import app.revanced.patches.shared.fingerprints.tracking.CopyTextEndpointFingerp import app.revanced.patches.shared.patch.tracking.AbstractSanitizeUrlQueryPatch import app.revanced.patches.youtube.misc.tracking.fingerprints.ShareLinkFormatterFingerprint import app.revanced.patches.youtube.misc.tracking.fingerprints.SystemShareLinkFormatterFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/translations/TranslationsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/translations/TranslationsPatch.kt index 3c095d464..3ad5f59a0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/translations/TranslationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/translations/TranslationsPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.youtube.misc.translations import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.shared.patch.translations.AbstractTranslationsPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceHelper.addTranslations @Patch( name = "Translations", @@ -40,16 +39,9 @@ import app.revanced.util.resources.ResourceHelper.addTranslations ] ) @Suppress("unused") -object TranslationsPatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - - context.addTranslations("youtube", LANGUAGE_LIST) - - SettingsPatch.updatePatchStatus("Translations") - - } - - private val LANGUAGE_LIST = arrayOf( +object TranslationsPatch : AbstractTranslationsPatch( + "youtube", + arrayOf( "ar", "bg-rBG", "bn", @@ -74,4 +66,10 @@ object TranslationsPatch : ResourcePatch() { "zh-rCN", "zh-rTW" ) +) { + override fun execute(context: ResourceContext) { + super.execute(context) + + SettingsPatch.updatePatchStatus("Translations") + } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/ChangeHomePagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/ChangeHomePagePatch.kt index 6816296b1..0f5854205 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/ChangeHomePagePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/navigation/homepage/ChangeHomePagePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.navigation.homepage -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels @@ -11,8 +10,9 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.navigation.homepage.fingerprints.IntentExceptionFingerprint import app.revanced.patches.youtube.navigation.homepage.fingerprints.LauncherActivityFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.NAVIGATION import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.NAVIGATION +import app.revanced.util.exception @Patch( name = "Change homepage", diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/label/NavigationLabelPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/label/NavigationLabelPatch.kt index 52833b2eb..a9624a4be 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/label/NavigationLabelPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/navigation/label/NavigationLabelPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.navigation.label -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,8 +7,9 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.navigation.label.fingerprints.PivotBarSetTextFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.NAVIGATION import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.NAVIGATION +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/navigationbuttons/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/navigationbuttons/NavigationButtonsPatch.kt index c44fea22c..6b0e137c4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/navigationbuttons/NavigationButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/navigation/navigationbuttons/NavigationButtonsPatch.kt @@ -1,25 +1,26 @@ package app.revanced.patches.youtube.navigation.navigationbuttons -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.navigation.navigationbuttons.fingerprints.AutoMotiveFingerprint import app.revanced.patches.youtube.navigation.navigationbuttons.fingerprints.PivotBarEnumFingerprint import app.revanced.patches.youtube.navigation.navigationbuttons.fingerprints.PivotBarShortsButtonViewFingerprint import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.NAVIGATION import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AvatarImageWithTextTab import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ImageOnlyTab import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.NAVIGATION -import app.revanced.util.pivotbar.InjectionUtils.REGISTER_TEMPLATE_REPLACEMENT -import app.revanced.util.pivotbar.InjectionUtils.injectHook +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.Opcode.MOVE_RESULT_OBJECT import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -108,7 +109,7 @@ object NavigationButtonsPatch : BytecodePatch( YOU_BUTTON_HOOK to AvatarImageWithTextTab ).forEach { (hook, resourceId) -> val insertIndex = implementation!!.instructions.let { - val scanStart = getWideLiteralIndex(resourceId) + val scanStart = getWideLiteralInstructionIndex(resourceId) scanStart + it.subList(scanStart, it.size - 1).indexOfFirst { instruction -> instruction.opcode == Opcode.INVOKE_VIRTUAL @@ -151,6 +152,8 @@ object NavigationButtonsPatch : BytecodePatch( } + private const val REGISTER_TEMPLATE_REPLACEMENT: String = "REGISTER_INDEX" + private const val ENUM_HOOK = "sput-object v$REGISTER_TEMPLATE_REPLACEMENT, $NAVIGATION" + "->" + @@ -170,4 +173,23 @@ object NavigationButtonsPatch : BytecodePatch( "invoke-static { v$REGISTER_TEMPLATE_REPLACEMENT }, $NAVIGATION" + "->" + "hideYouButton(Landroid/view/View;)V" + + /** + * Injects an instruction into insertIndex of the hook. + * @param hook The hook to insert. + * @param insertIndex The index to insert the instruction at. + * [MOVE_RESULT_OBJECT] has to be the previous instruction before [insertIndex]. + */ + private fun MutableMethod.injectHook(hook: String, insertIndex: Int) { + val injectTarget = this + + // Register to pass to the hook + val registerIndex = insertIndex - 1 // MOVE_RESULT_OBJECT is always the previous instruction + val register = injectTarget.getInstruction(registerIndex).registerA + + injectTarget.addInstruction( + insertIndex, + hook.replace("REGISTER_INDEX", register.toString()), + ) + } } \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/tabletnavbar/TabletNavigationBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/tabletnavbar/TabletNavigationBarPatch.kt index faa36c784..4ec8079f5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/tabletnavbar/TabletNavigationBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/navigation/tabletnavbar/TabletNavigationBarPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.navigation.tabletnavbar -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,8 +9,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.navigation.tabletnavbar.fingerprints.PivotBarChangedFingerprint import app.revanced.patches.youtube.navigation.tabletnavbar.fingerprints.PivotBarStyleFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.NAVIGATION import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.NAVIGATION +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/alwaysrepeat/AlwaysRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/alwaysrepeat/AlwaysRepeatPatch.kt index 985c471c0..0adaadf77 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/alwaysrepeat/AlwaysRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/alwaysrepeat/AlwaysRepeatPatch.kt @@ -1,13 +1,13 @@ package app.revanced.patches.youtube.overlaybutton.alwaysrepeat -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.AutoNavInformerFingerprint -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction object AlwaysRepeatPatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/alwaysrepeat/fingerprints/AutoNavInformerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/alwaysrepeat/fingerprints/AutoNavInformerFingerprint.kt index 53851c0f3..541d480f1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/alwaysrepeat/fingerprints/AutoNavInformerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/alwaysrepeat/fingerprints/AutoNavInformerFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.SettingsBooleanTimeRangeDialog -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object AutoNavInformerFingerprint : MethodFingerprint( +object AutoNavInformerFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L"), @@ -16,9 +15,5 @@ object AutoNavInformerFingerprint : MethodFingerprint( Opcode.MOVE_RESULT, Opcode.XOR_INT_2ADDR ), - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - SettingsBooleanTimeRangeDialog - ) - } + literalSupplier = { SettingsBooleanTimeRangeDialog } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/download/hook/DownloadButtonHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/download/hook/DownloadButtonHookPatch.kt index 04385dd6a..c6159eb85 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/download/hook/DownloadButtonHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/download/hook/DownloadButtonHookPatch.kt @@ -1,13 +1,13 @@ package app.revanced.patches.youtube.overlaybutton.download.hook -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.overlaybutton.download.hook.fingerprints.DownloadActionsFingerprint -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH +import app.revanced.util.exception object DownloadButtonHookPatch : BytecodePatch( setOf(DownloadActionsFingerprint) diff --git a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/download/pip/DisablePiPPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/download/pip/DisablePiPPatch.kt index c74932d97..eb806f6af 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/download/pip/DisablePiPPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/download/pip/DisablePiPPatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.youtube.overlaybutton.download.pip -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patches.youtube.overlaybutton.download.pip.fingerprints.PiPPlaybackFingerprint -import app.revanced.util.integrations.Constants.INTEGRATIONS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.INTEGRATIONS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction /** diff --git a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt index 2a659c293..044fe31f5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.overlaybutton.general -import app.revanced.extensions.doRecursively import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage @@ -9,16 +8,17 @@ import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.booleanPat import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.AlwaysRepeatPatch import app.revanced.patches.youtube.overlaybutton.download.hook.DownloadButtonHookPatch import app.revanced.patches.youtube.overlaybutton.download.pip.DisablePiPPatch +import app.revanced.patches.youtube.utils.integrations.Constants.OVERLAY_BUTTONS_PATH import app.revanced.patches.youtube.utils.overridespeed.OverrideSpeedHookPatch import app.revanced.patches.youtube.utils.playerbutton.PlayerButtonHookPatch import app.revanced.patches.youtube.utils.playercontrols.PlayerControlsPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.videoid.general.VideoIdPatch -import app.revanced.util.integrations.Constants.BUTTON_PATH -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import app.revanced.util.copyXmlNode +import app.revanced.util.doRecursively import org.w3c.dom.Element @Patch( @@ -84,9 +84,9 @@ object OverlayButtonsPatch : ResourcePatch() { "CopyVideoUrlTimestamp", "ExternalDownload", "SpeedDialog" - ).forEach { - PlayerControlsPatch.initializeControl("$BUTTON_PATH/$it;") - PlayerControlsPatch.injectVisibility("$BUTTON_PATH/$it;") + ).forEach { patch -> + PlayerControlsPatch.initializeControl("$OVERLAY_BUTTONS_PATH/$patch;") + PlayerControlsPatch.injectVisibility("$OVERLAY_BUTTONS_PATH/$patch;") } /** @@ -98,7 +98,7 @@ object OverlayButtonsPatch : ResourcePatch() { * Copy resources */ arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable", "playlist_repeat_button.xml", "playlist_shuffle_button.xml", @@ -110,7 +110,7 @@ object OverlayButtonsPatch : ResourcePatch() { if (OutlineIcon == true) { arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable-xxhdpi", "ic_fullscreen_vertical_button.png", "quantum_ic_fullscreen_exit_grey600_24.png", @@ -132,7 +132,7 @@ object OverlayButtonsPatch : ResourcePatch() { } } else { arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable-xxhdpi", "ic_fullscreen_vertical_button.png", "ic_vr.png", diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/autoplaybutton/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/autoplaybutton/HideAutoplayButtonPatch.kt index f71c3dc44..a3e980f34 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/autoplaybutton/HideAutoplayButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/autoplaybutton/HideAutoplayButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.autoplaybutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,13 +8,14 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AutoNavPreviewStub import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.VideoZoomIndicatorLayout import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getStringIndex -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -62,9 +62,9 @@ object HideAutoplayButtonPatch : BytecodePatch( LayoutConstructorFingerprint.result?.let { it.mutableMethod.apply { val dummyRegister = - getInstruction(getStringIndex("1.0x")).registerA - val insertIndex = getWideLiteralIndex(AutoNavPreviewStub) - val jumpIndex = getWideLiteralIndex(VideoZoomIndicatorLayout) - 1 + getInstruction(getStringInstructionIndex("1.0x")).registerA + val insertIndex = getWideLiteralInstructionIndex(AutoNavPreviewStub) + val jumpIndex = getWideLiteralInstructionIndex(VideoZoomIndicatorLayout) - 1 addInstructionsWithLabels( insertIndex, """ diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/captionsbutton/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/captionsbutton/HideCaptionsButtonPatch.kt index c7c7400de..b2d695e86 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/captionsbutton/HideCaptionsButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/captionsbutton/HideCaptionsButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.captionsbutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,9 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.fingerprints.SubtitleButtonControllerFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/castbutton/HideCastButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/castbutton/HideCastButtonPatch.kt index 8a41055f7..adc2be121 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/castbutton/HideCastButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/castbutton/HideCastButtonPatch.kt @@ -1,14 +1,14 @@ package app.revanced.patches.youtube.player.castbutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.player.castbutton.fingerprints.CastButtonFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception @Patch( name = "Hide cast button", diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/HideEndScreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/HideEndScreenCardsPatch.kt index 948ad32ae..3e02b6ae5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/HideEndScreenCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/HideEndScreenCardsPatch.kt @@ -1,18 +1,19 @@ package app.revanced.patches.youtube.player.endscreencards -import app.revanced.extensions.exception -import app.revanced.extensions.injectHideCall import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.fingerprint.MethodFingerprintResult +import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.player.endscreencards.fingerprints.LayoutCircleFingerprint import app.revanced.patches.youtube.player.endscreencards.fingerprints.LayoutIconFingerprint import app.revanced.patches.youtube.player.endscreencards.fingerprints.LayoutVideoFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -59,27 +60,25 @@ object HideEndScreenCardsPatch : BytecodePatch( ) ) { override fun execute(context: BytecodeContext) { + fun MethodFingerprint.injectHideCall() { + result?.let { + it.mutableMethod.apply { + val insertIndex = it.scanResult.patternScanResult!!.endIndex + val viewRegister = getInstruction(insertIndex).registerA - fun MethodFingerprintResult.injectHideCalls() { - val index = scanResult.patternScanResult!!.endIndex - mutableMethod.apply { - val register = this.getInstruction(index).registerA - implementation!!.injectHideCall( - index + 1, - register, - "layout/PlayerPatch", - "hideEndScreenCards" - ) - } + addInstruction( + insertIndex + 1, + "invoke-static { v$viewRegister }, $PLAYER->hideEndScreenCards(Landroid/view/View;)V" + ) + } + } ?: throw exception } listOf( LayoutCircleFingerprint, LayoutIconFingerprint, LayoutVideoFingerprint - ).forEach { - it.result?.injectHideCalls() ?: throw it.exception - } + ).forEach(MethodFingerprint::injectHideCall) /** * Add settings diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutCircleFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutCircleFingerprint.kt index c08b54b66..f02f2f5e0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutCircleFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutCircleFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.youtube.player.endscreencards.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.EndScreenElementLayoutCircle -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object LayoutCircleFingerprint : MethodFingerprint( +object LayoutCircleFingerprint : LiteralValueFingerprint( returnType = "Landroid/view/View;", opcodes = listOf( Opcode.CONST, @@ -14,5 +13,5 @@ object LayoutCircleFingerprint : MethodFingerprint( Opcode.MOVE_RESULT_OBJECT, Opcode.CHECK_CAST, ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(EndScreenElementLayoutCircle) } + literalSupplier = { EndScreenElementLayoutCircle } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutIconFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutIconFingerprint.kt index c015f125c..236e76b22 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutIconFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutIconFingerprint.kt @@ -1,16 +1,15 @@ package app.revanced.patches.youtube.player.endscreencards.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.EndScreenElementLayoutIcon -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object LayoutIconFingerprint : MethodFingerprint( +object LayoutIconFingerprint : LiteralValueFingerprint( returnType = "Landroid/view/View;", opcodes = listOf( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT, Opcode.CHECK_CAST, ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(EndScreenElementLayoutIcon) } + literalSupplier = { EndScreenElementLayoutIcon } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutVideoFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutVideoFingerprint.kt index 0133d3e80..0be600c9a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutVideoFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/endscreencards/fingerprints/LayoutVideoFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.youtube.player.endscreencards.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.EndScreenElementLayoutVideo -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object LayoutVideoFingerprint : MethodFingerprint( +object LayoutVideoFingerprint : LiteralValueFingerprint( returnType = "Landroid/view/View;", opcodes = listOf( Opcode.CONST, @@ -14,5 +13,5 @@ object LayoutVideoFingerprint : MethodFingerprint( Opcode.MOVE_RESULT_OBJECT, Opcode.CHECK_CAST, ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(EndScreenElementLayoutVideo) } + literalSupplier = { EndScreenElementLayoutVideo } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/HideFilmstripOverlayPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/HideFilmstripOverlayPatch.kt index 4b7e7ee65..c30c08e09 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/HideFilmstripOverlayPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/HideFilmstripOverlayPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.filmstripoverlay -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -16,9 +15,10 @@ import app.revanced.patches.youtube.player.filmstripoverlay.fingerprints.FilmStr import app.revanced.patches.youtube.player.filmstripoverlay.fingerprints.FilmStripOverlayParentFingerprint import app.revanced.patches.youtube.player.filmstripoverlay.fingerprints.FilmStripOverlayPreviewFingerprint import app.revanced.patches.youtube.player.filmstripoverlay.fingerprints.FineScrubbingOverlayFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FilmStripOverlayConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FilmStripOverlayConfigFingerprint.kt index 539ccbb3b..e4f58fb62 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FilmStripOverlayConfigFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FilmStripOverlayConfigFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.youtube.player.filmstripoverlay.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object FilmStripOverlayConfigFingerprint : MethodFingerprint( +object FilmStripOverlayConfigFingerprint : LiteralValueFingerprint( returnType = "Z", parameters = emptyList(), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45381958) } + literalSupplier = { 45381958 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FilmStripOverlayParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FilmStripOverlayParentFingerprint.kt index f82361e50..e1d605208 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FilmStripOverlayParentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FilmStripOverlayParentFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.player.filmstripoverlay.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.Scrubbing -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object FilmStripOverlayParentFingerprint : MethodFingerprint( +object FilmStripOverlayParentFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(Scrubbing) } + literalSupplier = { Scrubbing } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FineScrubbingOverlayFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FineScrubbingOverlayFingerprint.kt index 63cc333ee..06fe6b050 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FineScrubbingOverlayFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FineScrubbingOverlayFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.player.filmstripoverlay.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.YoutubeControlsOverlay -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object FineScrubbingOverlayFingerprint : MethodFingerprint( +object FineScrubbingOverlayFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = emptyList(), @@ -19,9 +18,5 @@ object FineScrubbingOverlayFingerprint : MethodFingerprint( Opcode.IGET_OBJECT, Opcode.IGET_OBJECT ), - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - YoutubeControlsOverlay - ) - } + literalSupplier = { YoutubeControlsOverlay } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/hapticfeedback/HapticFeedBackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/hapticfeedback/HapticFeedBackPatch.kt index 470848ccf..f01ce261e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/hapticfeedback/HapticFeedBackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/hapticfeedback/HapticFeedBackPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.hapticfeedback -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -15,8 +14,9 @@ import app.revanced.patches.youtube.player.hapticfeedback.fingerprints.Scrubbing import app.revanced.patches.youtube.player.hapticfeedback.fingerprints.SeekHapticsFingerprint import app.revanced.patches.youtube.player.hapticfeedback.fingerprints.SeekUndoHapticsFingerprint import app.revanced.patches.youtube.player.hapticfeedback.fingerprints.ZoomHapticsFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/infocards/HideInfoCardsPatch.kt index 7e0bfe44e..f5ba59037 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/infocards/HideInfoCardsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.infocards -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,10 +7,11 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.player.infocards.fingerprints.InfoCardsIncognitoFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/musicbutton/HideMusicButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/musicbutton/HideMusicButtonPatch.kt index 9114168c3..8b1063d59 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/musicbutton/HideMusicButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/musicbutton/HideMusicButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.musicbutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,9 +8,10 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.player.musicbutton.fingerprints.MusicAppDeeplinkButtonFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception @Patch( name = "Hide music button", diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/musicbutton/fingerprints/MusicAppDeeplinkButtonFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/musicbutton/fingerprints/MusicAppDeeplinkButtonFingerprint.kt index 8e06886a3..372659b4d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/musicbutton/fingerprints/MusicAppDeeplinkButtonFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/musicbutton/fingerprints/MusicAppDeeplinkButtonFingerprint.kt @@ -1,17 +1,13 @@ package app.revanced.patches.youtube.player.musicbutton.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.MusicAppDeeplinkButtonView -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object MusicAppDeeplinkButtonFingerprint : MethodFingerprint( +object MusicAppDeeplinkButtonFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Z", "Z"), - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - MusicAppDeeplinkButtonView - ) - }) \ No newline at end of file + literalSupplier = { MusicAppDeeplinkButtonView } +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/playerbuttonbg/HidePlayerButtonBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/playerbuttonbg/HidePlayerButtonBackgroundPatch.kt index 4ef510b6f..a3f8f3a94 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/playerbuttonbg/HidePlayerButtonBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/playerbuttonbg/HidePlayerButtonBackgroundPatch.kt @@ -1,11 +1,11 @@ package app.revanced.patches.youtube.player.playerbuttonbg -import app.revanced.extensions.doRecursively import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.settings.SettingsPatch +import app.revanced.util.doRecursively import org.w3c.dom.Element @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/playeroverlay/CustomPlayerOverlayOpacityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/playeroverlay/CustomPlayerOverlayOpacityPatch.kt index bafbf037a..2d47106a7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/playeroverlay/CustomPlayerOverlayOpacityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/playeroverlay/CustomPlayerOverlayOpacityPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.playeroverlay -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,11 +8,12 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.fingerprints.YouTubeControlsOverlayFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ScrimOverlay import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -60,7 +60,7 @@ object CustomPlayerOverlayOpacityPatch : BytecodePatch( YouTubeControlsOverlayFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(ScrimOverlay) + 3 + val targetIndex = getWideLiteralInstructionIndex(ScrimOverlay) + 3 val targetParameter = getInstruction(targetIndex).reference val targetRegister = getInstruction(targetIndex).registerA diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/previousnextbutton/HidePreviousNextButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/previousnextbutton/HidePreviousNextButtonPatch.kt index 454a79bb6..29eb09c07 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/previousnextbutton/HidePreviousNextButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/previousnextbutton/HidePreviousNextButtonPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.previousnextbutton -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,8 +7,9 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.fingerprints.PlayerControlsVisibilityModelFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/SeekMessagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/SeekMessagePatch.kt index 9a8e6cdf6..092bf40fb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/SeekMessagePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/SeekMessagePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.seekmessage -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -11,10 +10,11 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.player.seekmessage.fingerprints.SeekEduContainerFingerprint import app.revanced.patches.youtube.player.seekmessage.fingerprints.SeekEduUndoOverlayFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.SeekUndoEduOverlayStub import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/fingerprints/SeekEduContainerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/fingerprints/SeekEduContainerFingerprint.kt index c8fbc4b33..8de3c0851 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/fingerprints/SeekEduContainerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/fingerprints/SeekEduContainerFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.youtube.player.seekmessage.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.EasySeekEduContainer -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object SeekEduContainerFingerprint : MethodFingerprint( +object SeekEduContainerFingerprint : LiteralValueFingerprint( returnType = "V", - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(EasySeekEduContainer) } + literalSupplier = { EasySeekEduContainer } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/fingerprints/SeekEduUndoOverlayFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/fingerprints/SeekEduUndoOverlayFingerprint.kt index 07cd314b7..0dd0631ab 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/fingerprints/SeekEduUndoOverlayFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/seekmessage/fingerprints/SeekEduUndoOverlayFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.youtube.player.seekmessage.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.SeekUndoEduOverlayStub -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object SeekEduUndoOverlayFingerprint : MethodFingerprint( +object SeekEduUndoOverlayFingerprint : LiteralValueFingerprint( returnType = "V", - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(SeekUndoEduOverlayStub) } + literalSupplier = { SeekUndoEduOverlayStub } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/SpeedOverlayPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/SpeedOverlayPatch.kt index 5cb3577b0..fbdeccfd7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/SpeedOverlayPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/SpeedOverlayPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.speedoverlay -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,8 +8,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.player.speedoverlay.fingerprints.RestoreSlideToSeekBehaviorFingerprint import app.revanced.patches.youtube.player.speedoverlay.fingerprints.SpeedOverlayFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/fingerprints/RestoreSlideToSeekBehaviorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/fingerprints/RestoreSlideToSeekBehaviorFingerprint.kt index 089e2a5d3..24ef19702 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/fingerprints/RestoreSlideToSeekBehaviorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/fingerprints/RestoreSlideToSeekBehaviorFingerprint.kt @@ -1,15 +1,14 @@ package app.revanced.patches.youtube.player.speedoverlay.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode /** * This value restores the 'Slide to seek' behavior. */ -object RestoreSlideToSeekBehaviorFingerprint : MethodFingerprint( +object RestoreSlideToSeekBehaviorFingerprint : LiteralValueFingerprint( returnType = "Z", parameters = emptyList(), opcodes = listOf(Opcode.MOVE_RESULT), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45411329) } + literalSupplier = { 45411329 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/fingerprints/SpeedOverlayFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/fingerprints/SpeedOverlayFingerprint.kt index b74f1f0ab..ec95d0bf2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/fingerprints/SpeedOverlayFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/speedoverlay/fingerprints/SpeedOverlayFingerprint.kt @@ -1,15 +1,14 @@ package app.revanced.patches.youtube.player.speedoverlay.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode /** * This value disables 'Playing at 2x speed' while holding down. */ -object SpeedOverlayFingerprint : MethodFingerprint( +object SpeedOverlayFingerprint : LiteralValueFingerprint( returnType = "Z", parameters = emptyList(), opcodes = listOf(Opcode.MOVE_RESULT), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45411330) } + literalSupplier = { 45411330 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/SuggestedActionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/SuggestedActionsPatch.kt index 19d04bee6..a88e4fa90 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/SuggestedActionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/SuggestedActionsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.suggestactions -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,11 +7,12 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.player.suggestactions.fingerprints.SuggestedActionsFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/fingerprints/SuggestedActionsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/fingerprints/SuggestedActionsFingerprint.kt index 47ece0762..a6024872e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/fingerprints/SuggestedActionsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/fingerprints/SuggestedActionsFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.youtube.player.suggestactions.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.SuggestedAction -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object SuggestedActionsFingerprint : MethodFingerprint( +object SuggestedActionsFingerprint : LiteralValueFingerprint( returnType = "V", opcodes = listOf( Opcode.CONST, @@ -13,5 +12,5 @@ object SuggestedActionsFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(SuggestedAction) } + literalSupplier = { SuggestedAction } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/SuggestedVideoOverlayPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/SuggestedVideoOverlayPatch.kt index ed9114855..9a1c12455 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/SuggestedVideoOverlayPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/SuggestedVideoOverlayPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.suggestedvideooverlay -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,12 +7,13 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.player.suggestedvideooverlay.fingerprints.CoreConatinerBuilderFingerprint +import app.revanced.patches.youtube.player.suggestedvideooverlay.fingerprints.CoreContainerBuilderFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.CoreContainer import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @@ -54,13 +54,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction ) @Suppress("unused") object SuggestedVideoOverlayPatch : BytecodePatch( - setOf(CoreConatinerBuilderFingerprint) + setOf(CoreContainerBuilderFingerprint) ) { override fun execute(context: BytecodeContext) { - CoreConatinerBuilderFingerprint.result?.let { + CoreContainerBuilderFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(CoreContainer) + 4 + val targetIndex = getWideLiteralInstructionIndex(CoreContainer) + 4 val targetReference = getInstruction(targetIndex).reference @@ -75,7 +75,7 @@ object SuggestedVideoOverlayPatch : BytecodePatch( "invoke-static {v$targetRegister}, $PLAYER->hideSuggestedVideoOverlay(Landroid/view/ViewGroup;)V" ) } - } ?: throw CoreConatinerBuilderFingerprint.exception + } ?: throw CoreContainerBuilderFingerprint.exception /** * Add settings diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/fingerprints/CoreConatinerBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/fingerprints/CoreContainerBuilderFingerprint.kt similarity index 58% rename from src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/fingerprints/CoreConatinerBuilderFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/fingerprints/CoreContainerBuilderFingerprint.kt index 80718350e..0d931db40 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/fingerprints/CoreConatinerBuilderFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/suggestedvideooverlay/fingerprints/CoreContainerBuilderFingerprint.kt @@ -1,17 +1,13 @@ package app.revanced.patches.youtube.player.suggestedvideooverlay.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.CoreContainer -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object CoreConatinerBuilderFingerprint : MethodFingerprint( +object CoreContainerBuilderFingerprint : LiteralValueFingerprint( returnType = "Landroid/view/View;", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Landroid/content/Context;"), - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - CoreContainer - ) - }) \ No newline at end of file + literalSupplier = { CoreContainer } +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/watermark/HideChannelWatermarkPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/watermark/HideChannelWatermarkPatch.kt index d0e23a9cc..fc0dc1718 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/watermark/HideChannelWatermarkPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/watermark/HideChannelWatermarkPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.player.watermark -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,10 +9,11 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.player.watermark.fingerprints.HideWatermarkFingerprint import app.revanced.patches.youtube.player.watermark.fingerprints.HideWatermarkParentFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/seekbar/append/AppendTimeStampInformationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/seekbar/append/AppendTimeStampInformationPatch.kt index 58cea869c..e08dad25b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/seekbar/append/AppendTimeStampInformationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/seekbar/append/AppendTimeStampInformationPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.seekbar.append -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -10,11 +9,12 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.fingerprints.TotalTimeFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SEEKBAR import app.revanced.patches.youtube.utils.overridequality.OverrideQualityHookPatch import app.revanced.patches.youtube.utils.overridespeed.OverrideSpeedHookPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.SEEKBAR +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c diff --git a/src/main/kotlin/app/revanced/patches/youtube/seekbar/color/SeekbarColorPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/seekbar/color/SeekbarColorPatch.kt index 53e48950a..8174a96c2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/seekbar/color/SeekbarColorPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/seekbar/color/SeekbarColorPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.seekbar.color -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -13,14 +12,15 @@ import app.revanced.patches.shared.patch.litho.LithoThemePatch import app.revanced.patches.youtube.seekbar.color.fingerprints.ControlsOverlayStyleFingerprint import app.revanced.patches.youtube.seekbar.color.fingerprints.ShortsSeekbarColorFingerprint import app.revanced.patches.youtube.utils.fingerprints.PlayerSeekbarColorFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SEEKBAR import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.InlineTimeBarColorizedBarPlayedColorDark import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.InlineTimeBarPlayedNotHighlightedColor import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelTimeBarPlayedColor import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch.contexts -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.SEEKBAR +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction import org.w3c.dom.Element @@ -71,12 +71,12 @@ object SeekbarColorPatch : BytecodePatch( ) { override fun execute(context: BytecodeContext) { PlayerSeekbarColorFingerprint.result?.mutableMethod?.apply { - hook(getWideLiteralIndex(InlineTimeBarColorizedBarPlayedColorDark) + 2) - hook(getWideLiteralIndex(InlineTimeBarPlayedNotHighlightedColor) + 2) + hook(getWideLiteralInstructionIndex(InlineTimeBarColorizedBarPlayedColorDark) + 2) + hook(getWideLiteralInstructionIndex(InlineTimeBarPlayedNotHighlightedColor) + 2) } ?: throw PlayerSeekbarColorFingerprint.exception ShortsSeekbarColorFingerprint.result?.mutableMethod?.apply { - hook(getWideLiteralIndex(ReelTimeBarPlayedColor) + 2) + hook(getWideLiteralInstructionIndex(ReelTimeBarPlayedColor) + 2) } ?: throw ShortsSeekbarColorFingerprint.exception ControlsOverlayStyleFingerprint.result?.let { diff --git a/src/main/kotlin/app/revanced/patches/youtube/seekbar/color/fingerprints/ShortsSeekbarColorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/seekbar/color/fingerprints/ShortsSeekbarColorFingerprint.kt index e3af9a970..83b0c7754 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/seekbar/color/fingerprints/ShortsSeekbarColorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/seekbar/color/fingerprints/ShortsSeekbarColorFingerprint.kt @@ -1,15 +1,12 @@ package app.revanced.patches.youtube.seekbar.color.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelTimeBarPlayedColor -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsSeekbarColorFingerprint : MethodFingerprint( +object ShortsSeekbarColorFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists(ReelTimeBarPlayedColor) - } + literalSupplier = { ReelTimeBarPlayedColor } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/seekbar/hide/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/seekbar/hide/HideSeekbarPatch.kt index 144bb6856..7340b2ab1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/seekbar/hide/HideSeekbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/seekbar/hide/HideSeekbarPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.seekbar.hide -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -11,8 +10,9 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.seekbar.color.SeekbarColorPatch import app.revanced.patches.youtube.utils.fingerprints.SeekbarFingerprint import app.revanced.patches.youtube.utils.fingerprints.SeekbarOnDrawFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SEEKBAR import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.SEEKBAR +import app.revanced.util.exception @Patch( name = "Hide seekbar", diff --git a/src/main/kotlin/app/revanced/patches/youtube/seekbar/tapping/SeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/seekbar/tapping/SeekbarTappingPatch.kt index 435a47a0e..52bb2e9b3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/seekbar/tapping/SeekbarTappingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/seekbar/tapping/SeekbarTappingPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.seekbar.tapping -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -11,8 +10,9 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.seekbar.tapping.fingerprints.SeekbarTappingFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SEEKBAR import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.SEEKBAR +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c import com.android.tools.smali.dexlib2.dexbacked.reference.DexBackedMethodReference diff --git a/src/main/kotlin/app/revanced/patches/youtube/seekbar/thumbnailpreview/NewThumbnailPreviewPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/seekbar/thumbnailpreview/NewThumbnailPreviewPatch.kt index ccdafaaef..ebb1b1149 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/seekbar/thumbnailpreview/NewThumbnailPreviewPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/seekbar/thumbnailpreview/NewThumbnailPreviewPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.seekbar.thumbnailpreview -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,8 +7,9 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.fingerprints.ThumbnailPreviewConfigFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SEEKBAR import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.SEEKBAR +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/seekbar/timestamps/HideTimeStampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/seekbar/timestamps/HideTimeStampPatch.kt index 9049a5de9..808c191cb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/seekbar/timestamps/HideTimeStampPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/seekbar/timestamps/HideTimeStampPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.seekbar.timestamps -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,9 +9,10 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.seekbar.timestamps.fingerprints.TimeCounterFingerprint import app.revanced.patches.youtube.utils.fingerprints.PlayerSeekbarColorFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SEEKBAR import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.SEEKBAR +import app.revanced.util.exception @Patch( name = "Hide time stamp", diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/outlinebutton/ShortsOutlineButton.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/outlinebutton/ShortsOutlineButton.kt index 92623ffcf..be912d50e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/outlinebutton/ShortsOutlineButton.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/outlinebutton/ShortsOutlineButton.kt @@ -5,8 +5,8 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources @Patch( name = "Shorts outline button", @@ -54,7 +54,7 @@ object ShortsOutlineButton : ResourcePatch() { ).forEach { dpi -> context.copyResources( "youtube/shorts/outline", - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable-$dpi", "ic_remix_filled_white_24.webp", "ic_remix_filled_white_shadowed.webp", @@ -68,7 +68,7 @@ object ShortsOutlineButton : ResourcePatch() { arrayOf( // Shorts outline icons for older versions of YouTube - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable", "ic_right_comment_32c.xml", "ic_right_dislike_off_32c.xml", diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsComponentPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsComponentPatch.kt index b50863974..31ac9035f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsComponentPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsComponentPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.shorts.shortscomponent -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -21,6 +20,8 @@ import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsPi import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsPivotLegacyFingerprint import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsRemixFingerprint import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsShareFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelDynRemix @@ -34,9 +35,8 @@ import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelR import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelRightLikeIcon import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.RightComment import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.COMPONENTS_PATH -import app.revanced.util.integrations.Constants.SHORTS +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -100,7 +100,7 @@ object ShortsComponentPatch : BytecodePatch( */ ShortsCommentFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getWideLiteralIndex(RightComment) + 3 + val insertIndex = getWideLiteralInstructionIndex(RightComment) + 3 hideButton(insertIndex, 1, "hideShortsPlayerCommentsButton") } @@ -111,7 +111,7 @@ object ShortsComponentPatch : BytecodePatch( */ ShortsDislikeFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getWideLiteralIndex(ReelRightDislikeIcon) + val insertIndex = getWideLiteralInstructionIndex(ReelRightDislikeIcon) val insertRegister = getInstruction(insertIndex).registerA val jumpIndex = getTargetIndexUpTo(insertIndex, Opcode.CONST_CLASS) + 2 @@ -132,7 +132,7 @@ object ShortsComponentPatch : BytecodePatch( */ ShortsInfoPanelFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getWideLiteralIndex(ReelPlayerInfoPanel) + 3 + val insertIndex = getWideLiteralInstructionIndex(ReelPlayerInfoPanel) + 3 hideButtons( insertIndex, @@ -147,7 +147,7 @@ object ShortsComponentPatch : BytecodePatch( */ ShortsLikeFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getWideLiteralIndex(ReelRightLikeIcon) + val insertIndex = getWideLiteralInstructionIndex(ReelRightLikeIcon) val insertRegister = getInstruction(insertIndex).registerA @@ -169,8 +169,8 @@ object ShortsComponentPatch : BytecodePatch( */ ShortsPaidPromotionFingerprint.result?.let { it.mutableMethod.apply { - val primaryIndex = getWideLiteralIndex(ReelPlayerBadge) + 3 - val secondaryIndex = getWideLiteralIndex(ReelPlayerBadge2) + 3 + val primaryIndex = getWideLiteralInstructionIndex(ReelPlayerBadge) + 3 + val secondaryIndex = getWideLiteralInstructionIndex(ReelPlayerBadge2) + 3 if (primaryIndex > secondaryIndex) { hideButtons( @@ -203,7 +203,7 @@ object ShortsComponentPatch : BytecodePatch( */ ShortsPivotLegacyFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(ReelForcedMuteButton) + val targetIndex = getWideLiteralInstructionIndex(ReelForcedMuteButton) val targetRegister = getInstruction(targetIndex).registerA val insertIndex = getTargetIndexDownTo(targetIndex, Opcode.IF_EQZ) @@ -219,7 +219,7 @@ object ShortsComponentPatch : BytecodePatch( } } ?: ShortsPivotFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(ReelPivotButton) + val targetIndex = getWideLiteralInstructionIndex(ReelPivotButton) val insertIndex = getTargetIndexDownTo(targetIndex, Opcode.INVOKE_STATIC) + 2 hideButtons( @@ -235,7 +235,7 @@ object ShortsComponentPatch : BytecodePatch( */ ShortsRemixFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getWideLiteralIndex(ReelDynRemix) - 2 + val insertIndex = getWideLiteralInstructionIndex(ReelDynRemix) - 2 hideButton(insertIndex, 0, "hideShortsPlayerRemixButton") } @@ -246,7 +246,7 @@ object ShortsComponentPatch : BytecodePatch( */ ShortsShareFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getWideLiteralIndex(ReelDynShare) - 2 + val insertIndex = getWideLiteralInstructionIndex(ReelDynShare) - 2 hideButton(insertIndex, 0, "hideShortsPlayerShareButton") } diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsNavigationBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsNavigationBarPatch.kt index 40185ee37..07ff128f4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsNavigationBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsNavigationBarPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.shorts.shortscomponent -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -12,7 +11,8 @@ import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.BottomNa import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.RenderBottomNavigationBarFingerprint import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.SetPivotBarFingerprint import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint -import app.revanced.util.integrations.Constants.SHORTS +import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsSubscriptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsSubscriptionsButtonPatch.kt index 59a987cf9..7ea0ea8b7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsSubscriptionsButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsSubscriptionsButtonPatch.kt @@ -1,24 +1,27 @@ package app.revanced.patches.youtube.shorts.shortscomponent -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsSubscriptionsFingerprint import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsSubscriptionsTabletFingerprint import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsSubscriptionsTabletParentFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerFooter import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerPausedStateButton -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.SHORTS +import app.revanced.patches.youtube.utils.settings.SettingsPatch +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference +@Patch(dependencies = [SettingsPatch::class]) object ShortsSubscriptionsButtonPatch : BytecodePatch( setOf( ShortsSubscriptionsFingerprint, @@ -28,7 +31,7 @@ object ShortsSubscriptionsButtonPatch : BytecodePatch( override fun execute(context: BytecodeContext) { ShortsSubscriptionsFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getWideLiteralIndex(ReelPlayerPausedStateButton) + 2 + val insertIndex = getWideLiteralInstructionIndex(ReelPlayerPausedStateButton) + 2 val insertRegister = getInstruction(insertIndex).registerA addInstruction( @@ -41,41 +44,42 @@ object ShortsSubscriptionsButtonPatch : BytecodePatch( /** * Deprecated in YouTube v18.31.xx+ */ - ShortsSubscriptionsTabletParentFingerprint.result?.let { parentResult -> - parentResult.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(ReelPlayerFooter) - 1 - if (getInstruction(targetIndex).opcode != Opcode.IPUT) - throw ShortsSubscriptionsTabletFingerprint.exception - subscriptionFieldReference = - (getInstruction(targetIndex)).reference as FieldReference - } + if (!SettingsPatch.upward1831) { + ShortsSubscriptionsTabletParentFingerprint.result?.let { parentResult -> + parentResult.mutableMethod.apply { + val targetIndex = getWideLiteralInstructionIndex(ReelPlayerFooter) - 1 + if (getInstruction(targetIndex).opcode != Opcode.IPUT) + throw ShortsSubscriptionsTabletFingerprint.exception + subscriptionFieldReference = + (getInstruction(targetIndex)).reference as FieldReference + } - ShortsSubscriptionsTabletFingerprint.also { - it.resolve( - context, - parentResult.classDef - ) - }.result?.mutableMethod?.let { - with(it.implementation!!.instructions) { - filter { instruction -> - val fieldReference = - (instruction as? ReferenceInstruction)?.reference as? FieldReference - instruction.opcode == Opcode.IGET && fieldReference == subscriptionFieldReference - }.forEach { instruction -> - val insertIndex = indexOf(instruction) + 1 - val register = (instruction as TwoRegisterInstruction).registerA + ShortsSubscriptionsTabletFingerprint.also { + it.resolve( + context, + parentResult.classDef + ) + }.result?.mutableMethod?.let { + with(it.implementation!!.instructions) { + filter { instruction -> + val fieldReference = + (instruction as? ReferenceInstruction)?.reference as? FieldReference + instruction.opcode == Opcode.IGET && fieldReference == subscriptionFieldReference + }.forEach { instruction -> + val insertIndex = indexOf(instruction) + 1 + val register = (instruction as TwoRegisterInstruction).registerA - it.addInstructions( - insertIndex, """ + it.addInstructions( + insertIndex, """ invoke-static {v$register}, $SHORTS->hideShortsPlayerSubscriptionsButton(I)I move-result v$register """ - ) + ) + } } - } - } + } ?: throw ShortsSubscriptionsTabletFingerprint.exception + } ?: throw ShortsSubscriptionsTabletParentFingerprint.exception } - } private lateinit var subscriptionFieldReference: FieldReference diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsToolBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsToolBarPatch.kt index b643d462e..c2cf8168a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsToolBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/ShortsToolBarPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.shorts.shortscomponent -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,8 +8,9 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ToolBarBannerFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS import app.revanced.patches.youtube.utils.toolbar.ToolBarHookPatch -import app.revanced.util.integrations.Constants.SHORTS +import app.revanced.util.exception @Patch(dependencies = [ToolBarHookPatch::class]) object ShortsToolBarPatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsCommentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsCommentFingerprint.kt index a395c6939..4fd324fe9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsCommentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsCommentFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.RightComment -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsCommentFingerprint : MethodFingerprint( +object ShortsCommentFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = listOf("Z", "Z", "L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(RightComment) } + literalSupplier = { RightComment } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsDislikeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsDislikeFingerprint.kt index 7baabbd95..6cb41562c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsDislikeFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsDislikeFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelRightDislikeIcon -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsDislikeFingerprint : MethodFingerprint( +object ShortsDislikeFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = listOf("Z", "Z", "L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelRightDislikeIcon) } + literalSupplier = { ReelRightDislikeIcon } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsInfoPanelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsInfoPanelFingerprint.kt index 98f96d747..c208126d5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsInfoPanelFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsInfoPanelFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerInfoPanel -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsInfoPanelFingerprint : MethodFingerprint( +object ShortsInfoPanelFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelPlayerInfoPanel) } + literalSupplier = { ReelPlayerInfoPanel } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsLikeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsLikeFingerprint.kt index 2ec94aef1..48de0634e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsLikeFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsLikeFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelRightLikeIcon -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsLikeFingerprint : MethodFingerprint( +object ShortsLikeFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = listOf("Z", "Z", "L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelRightLikeIcon) } + literalSupplier = { ReelRightLikeIcon } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPaidPromotionFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPaidPromotionFingerprint.kt index 9b0db5b40..6eb821fed 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPaidPromotionFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPaidPromotionFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerBadge -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsPaidPromotionFingerprint : MethodFingerprint( +object ShortsPaidPromotionFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelPlayerBadge) } + literalSupplier = { ReelPlayerBadge } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPivotFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPivotFingerprint.kt index cbd1f39d5..6ccaf71d3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPivotFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPivotFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPivotButton -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsPivotFingerprint : MethodFingerprint( +object ShortsPivotFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = listOf("Z", "Z", "L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelPivotButton) } + literalSupplier = { ReelPivotButton } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPivotLegacyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPivotLegacyFingerprint.kt index 4618e6e34..45f08b305 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPivotLegacyFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsPivotLegacyFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelForcedMuteButton -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsPivotLegacyFingerprint : MethodFingerprint( +object ShortsPivotLegacyFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = listOf("Z", "Z", "L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelForcedMuteButton) } + literalSupplier = { ReelForcedMuteButton } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsRemixFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsRemixFingerprint.kt index ffe39ad39..03c476b60 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsRemixFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsRemixFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelDynRemix -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsRemixFingerprint : MethodFingerprint( +object ShortsRemixFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = listOf("Z", "Z", "L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelDynRemix) } + literalSupplier = { ReelDynRemix } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsShareFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsShareFingerprint.kt index 715c6ffa3..f4c558d26 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsShareFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsShareFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelDynShare -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsShareFingerprint : MethodFingerprint( +object ShortsShareFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = listOf("Z", "Z", "L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelDynShare) } + literalSupplier = { ReelDynShare } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsSubscriptionsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsSubscriptionsFingerprint.kt index b755261f2..274fa8aef 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsSubscriptionsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsSubscriptionsFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerPausedStateButton -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsSubscriptionsFingerprint : MethodFingerprint( +object ShortsSubscriptionsFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = emptyList(), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelPlayerPausedStateButton) } + literalSupplier = { ReelPlayerPausedStateButton } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsSubscriptionsTabletParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsSubscriptionsTabletParentFingerprint.kt index 6ffedd4ae..60cbe5b7f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsSubscriptionsTabletParentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsSubscriptionsTabletParentFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerFooter -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ShortsSubscriptionsTabletParentFingerprint : MethodFingerprint( +object ShortsSubscriptionsTabletParentFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelPlayerFooter) } + literalSupplier = { ReelPlayerFooter } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/startupshortsreset/DisableShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/startupshortsreset/DisableShortsOnStartupPatch.kt index 4d0b76421..157998b59 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/startupshortsreset/DisableShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/startupshortsreset/DisableShortsOnStartupPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.shorts.startupshortsreset -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,9 +8,10 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.shorts.startupshortsreset.fingerprints.UserWasInShortsFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.bytecode.getWide32LiteralIndex -import app.revanced.util.integrations.Constants.SHORTS +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( @@ -54,7 +54,7 @@ object DisableShortsOnStartupPatch : BytecodePatch( UserWasInShortsFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = getWide32LiteralIndex(45381394) + val insertIndex = getWideLiteralInstructionIndex(45381394) val insertRegister = getInstruction(insertIndex).registerA addInstructionsWithLabels( diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/startupshortsreset/fingerprints/UserWasInShortsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/startupshortsreset/fingerprints/UserWasInShortsFingerprint.kt index 12676951c..f85088131 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/startupshortsreset/fingerprints/UserWasInShortsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/startupshortsreset/fingerprints/UserWasInShortsFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.shorts.startupshortsreset.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object UserWasInShortsFingerprint : MethodFingerprint( +object UserWasInShortsFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Ljava/lang/Object;"), strings = listOf("Failed to read user_was_in_shorts proto after successful warmup"), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45381394) } + literalSupplier = { 45381394 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/swipe/controls/SwipeControlsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/swipe/controls/SwipeControlsPatch.kt index e254a2f15..4db10ac1c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/swipe/controls/SwipeControlsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/swipe/controls/SwipeControlsPatch.kt @@ -1,8 +1,5 @@ package app.revanced.patches.youtube.swipe.controls -import app.revanced.extensions.exception -import app.revanced.extensions.transformMethods -import app.revanced.extensions.traverseClassHierarchy import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -13,15 +10,18 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMu import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.swipe.controls.fingerprints.HDRBrightnessFingerprint import app.revanced.patches.youtube.swipe.controls.fingerprints.SwipeControlsHostActivityFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.SWIPE_PATH import app.revanced.patches.youtube.utils.lockmodestate.LockModeStateHookPatch import app.revanced.patches.youtube.utils.mainactivity.MainActivityResolvePatch import app.revanced.patches.youtube.utils.mainactivity.MainActivityResolvePatch.mainActivityMutableClass import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch.contexts -import app.revanced.util.integrations.Constants.SWIPE_PATH -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import app.revanced.util.exception +import app.revanced.util.transformMethods +import app.revanced.util.traverseClassHierarchy import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.immutable.ImmutableMethod @@ -122,7 +122,7 @@ object SwipeControlsPatch : BytecodePatch( contexts.copyResources( "youtube/swipecontrols", - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable", "ic_sc_brightness_auto.xml", "ic_sc_brightness_manual.xml", diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/browseid/BrowseIdHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/browseid/BrowseIdHookPatch.kt index dcf2b28cb..1c3c2efde 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/browseid/BrowseIdHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/browseid/BrowseIdHookPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.browseid -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -10,9 +9,10 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.litho.ComponentParserPatch import app.revanced.patches.youtube.utils.browseid.fingerprints.BrowseIdClassFingerprint import app.revanced.patches.youtube.utils.browseid.fingerprints.SetToolBarPaddingFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/browseid/fingerprints/SetToolBarPaddingFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/browseid/fingerprints/SetToolBarPaddingFingerprint.kt index acade84e4..81061cef0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/browseid/fingerprints/SetToolBarPaddingFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/browseid/fingerprints/SetToolBarPaddingFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.youtube.utils.browseid.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ToolBarPaddingHome -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object SetToolBarPaddingFingerprint : MethodFingerprint( +object SetToolBarPaddingFingerprint : LiteralValueFingerprint( returnType = "V", parameters = listOf("I", "I"), opcodes = listOf( @@ -13,5 +12,5 @@ object SetToolBarPaddingFingerprint : MethodFingerprint( Opcode.IGET_OBJECT, Opcode.INVOKE_STATIC ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ToolBarPaddingHome) } + literalSupplier = { ToolBarPaddingHome } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/PivotBarCreateButtonViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/PivotBarCreateButtonViewFingerprint.kt index b7259bcad..1a4acc547 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/PivotBarCreateButtonViewFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/PivotBarCreateButtonViewFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.utils.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ImageOnlyTab -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object PivotBarCreateButtonViewFingerprint : MethodFingerprint( +object PivotBarCreateButtonViewFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ImageOnlyTab) } + literalSupplier = { ImageOnlyTab } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/PlayerSeekbarColorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/PlayerSeekbarColorFingerprint.kt index 45d05fa6c..74ffca3a8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/PlayerSeekbarColorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/PlayerSeekbarColorFingerprint.kt @@ -4,14 +4,16 @@ import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.InlineTimeBarColorizedBarPlayedColorDark import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.InlineTimeBarPlayedNotHighlightedColor -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags object PlayerSeekbarColorFingerprint : MethodFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists(InlineTimeBarColorizedBarPlayedColorDark) - && methodDef.isWideLiteralExists(InlineTimeBarPlayedNotHighlightedColor) + methodDef.containsWideLiteralInstructionIndex(InlineTimeBarColorizedBarPlayedColorDark) + && methodDef.containsWideLiteralInstructionIndex( + InlineTimeBarPlayedNotHighlightedColor + ) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/QualityMenuViewInflateFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/QualityMenuViewInflateFingerprint.kt index 50be01c48..5bd9e0b15 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/QualityMenuViewInflateFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/QualityMenuViewInflateFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.utils.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.VideoQualityBottomSheet -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object QualityMenuViewInflateFingerprint : MethodFingerprint( +object QualityMenuViewInflateFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L", "L", "L"), returnType = "L", @@ -27,5 +26,5 @@ object QualityMenuViewInflateFingerprint : MethodFingerprint( Opcode.MOVE_RESULT_OBJECT, Opcode.CHECK_CAST ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(VideoQualityBottomSheet) } + literalSupplier = { VideoQualityBottomSheet } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/SubtitleButtonControllerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/SubtitleButtonControllerFingerprint.kt index 614604164..ed66013cb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/SubtitleButtonControllerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/SubtitleButtonControllerFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.utils.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AccessibilityCaptionsButtonName -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object SubtitleButtonControllerFingerprint : MethodFingerprint( +object SubtitleButtonControllerFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Lcom/google/android/libraries/youtube/player/subtitles/model/SubtitleTrack;"), @@ -22,9 +21,5 @@ object SubtitleButtonControllerFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.IGET_OBJECT ), - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - AccessibilityCaptionsButtonName - ) - } + literalSupplier = { AccessibilityCaptionsButtonName } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/ThumbnailPreviewConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/ThumbnailPreviewConfigFingerprint.kt index 5477dc16a..1d9f3e56d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/ThumbnailPreviewConfigFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/ThumbnailPreviewConfigFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.youtube.utils.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object ThumbnailPreviewConfigFingerprint : MethodFingerprint( +object ThumbnailPreviewConfigFingerprint : LiteralValueFingerprint( returnType = "Z", parameters = emptyList(), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45398577) } + literalSupplier = { 45398577 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/TotalTimeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/TotalTimeFingerprint.kt index c8bb85f63..db1477120 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/TotalTimeFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/TotalTimeFingerprint.kt @@ -1,10 +1,9 @@ package app.revanced.patches.youtube.utils.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.TotalTime -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint -object TotalTimeFingerprint : MethodFingerprint( +object TotalTimeFingerprint : LiteralValueFingerprint( returnType = "V", - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(TotalTime) } + literalSupplier = { TotalTime } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/YouTubeControlsOverlayFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/YouTubeControlsOverlayFingerprint.kt index bc454158e..9c9aaf635 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/YouTubeControlsOverlayFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/YouTubeControlsOverlayFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.utils.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.YoutubeControlsOverlay -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object YouTubeControlsOverlayFingerprint : MethodFingerprint( +object YouTubeControlsOverlayFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = emptyList(), @@ -16,9 +15,5 @@ object YouTubeControlsOverlayFingerprint : MethodFingerprint( Opcode.MOVE_RESULT, Opcode.IF_EQZ ), - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - YoutubeControlsOverlay - ) - } + literalSupplier = { YoutubeControlsOverlay } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/clientspoof/ClientSpoofPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/clientspoof/ClientSpoofPatch.kt index 7586a1058..a2890e4be 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/clientspoof/ClientSpoofPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/clientspoof/ClientSpoofPatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.youtube.utils.fix.clientspoof -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patches.youtube.utils.fix.clientspoof.fingerprints.UserAgentHeaderBuilderFingerprint import app.revanced.patches.youtube.utils.microg.Constants.PACKAGE_NAME +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction object ClientSpoofPatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/doublebacktoclose/DoubleBackToClosePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/doublebacktoclose/DoubleBackToClosePatch.kt index 31637c513..75ab54959 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/doublebacktoclose/DoubleBackToClosePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/doublebacktoclose/DoubleBackToClosePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.fix.doublebacktoclose -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch @@ -9,9 +8,10 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.utils.fix.doublebacktoclose.fingerprint.ScrollPositionFingerprint import app.revanced.patches.youtube.utils.fix.doublebacktoclose.fingerprint.ScrollTopFingerprint import app.revanced.patches.youtube.utils.fix.doublebacktoclose.fingerprint.ScrollTopParentFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.mainactivity.MainActivityResolvePatch import app.revanced.patches.youtube.utils.mainactivity.MainActivityResolvePatch.onBackPressedMethod -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode @Patch(dependencies = [MainActivityResolvePatch::class]) diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/SpoofPlayerParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/SpoofPlayerParameterPatch.kt index 2e85463bf..b3faeb83e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/SpoofPlayerParameterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/SpoofPlayerParameterPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.fix.parameter -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels @@ -18,11 +17,12 @@ import app.revanced.patches.youtube.utils.fix.parameter.fingerprints.StoryboardR import app.revanced.patches.youtube.utils.fix.parameter.fingerprints.StoryboardRendererSpecRecommendedLevelFingerprint import app.revanced.patches.youtube.utils.fix.parameter.fingerprints.StoryboardThumbnailFingerprint import app.revanced.patches.youtube.utils.fix.parameter.fingerprints.StoryboardThumbnailParentFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH import app.revanced.patches.youtube.utils.playerresponse.PlayerResponsePatch import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.videoid.general.VideoIdPatch -import app.revanced.util.integrations.Constants.MISC_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt index f55d1ed19..098809084 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.utils.fix.parameter.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -15,9 +15,10 @@ object PlayerResponseModelImplGeneralFingerprint : MethodFingerprint( Opcode.CONST_4, Opcode.RETURN_OBJECT ), - customFingerprint = { methodDef, _ -> - methodDef.definingClass.endsWith("/PlayerResponseModelImpl;") && methodDef.isWideLiteralExists( - 55735497 - ) + customFingerprint = handler@{ methodDef, _ -> + if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) + return@handler false + + methodDef.containsWideLiteralInstructionIndex(55735497) } ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt index 07fd11bca..c51252dba 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.utils.fix.parameter.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -15,9 +15,10 @@ object PlayerResponseModelImplLiveStreamFingerprint : MethodFingerprint( Opcode.CONST_4, Opcode.RETURN_OBJECT ), - customFingerprint = { methodDef, _ -> - methodDef.definingClass.endsWith("/PlayerResponseModelImpl;") && methodDef.isWideLiteralExists( - 70276274 - ) + customFingerprint = handler@{ methodDef, _ -> + if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) + return@handler false + + methodDef.containsWideLiteralInstructionIndex(70276274) } ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplRecommendedLevel.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplRecommendedLevel.kt index 8958016f5..4bcc03390 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplRecommendedLevel.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/parameter/fingerprints/PlayerResponseModelImplRecommendedLevel.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.utils.fix.parameter.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -15,9 +15,10 @@ object PlayerResponseModelImplRecommendedLevel : MethodFingerprint( Opcode.IGET, Opcode.RETURN ), - customFingerprint = { methodDef, _ -> - methodDef.definingClass.endsWith("/PlayerResponseModelImpl;") && methodDef.isWideLiteralExists( - 55735497 - ) + customFingerprint = handler@{ methodDef, _ -> + if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) + return@handler false + + methodDef.containsWideLiteralInstructionIndex(55735497) } ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/swiperefresh/SwipeRefreshPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/swiperefresh/SwipeRefreshPatch.kt index 2864f84f4..60fecba57 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/swiperefresh/SwipeRefreshPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/swiperefresh/SwipeRefreshPatch.kt @@ -1,11 +1,11 @@ package app.revanced.patches.youtube.utils.fix.swiperefresh -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patches.youtube.utils.fix.swiperefresh.fingerprint.SwipeRefreshLayoutFingerprint +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction object SwipeRefreshPatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/integrations/Constants.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/integrations/Constants.kt new file mode 100644 index 000000000..0a391c31c --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/integrations/Constants.kt @@ -0,0 +1,32 @@ +package app.revanced.patches.youtube.utils.integrations + +@Suppress("MemberVisibilityCanBePrivate") +object Constants { + const val INTEGRATIONS_PATH = "Lapp/revanced/integrations" + const val PATCHES_PATH = "$INTEGRATIONS_PATH/patches" + + const val ADS_PATH = "$PATCHES_PATH/ads" + const val ALTERNATIVE_THUMBNAILS_PATH = "$PATCHES_PATH/alternativethumbnails" + const val COMPONENTS_PATH = "$PATCHES_PATH/components" + const val FLYOUT_PANEL_PATH = "$PATCHES_PATH/flyoutpanel" + const val FULLSCREEN_PATH = "$PATCHES_PATH/fullscreen" + const val GENERAL_PATH = "$PATCHES_PATH/general" + const val MISC_PATH = "$PATCHES_PATH/misc" + const val NAVIGATION_PATH = "$PATCHES_PATH/navigation" + const val OVERLAY_BUTTONS_PATH = "$PATCHES_PATH/overlaybutton" + const val PLAYER_PATH = "$PATCHES_PATH/player" + const val SEEKBAR_PATH = "$PATCHES_PATH/seekbar" + const val SHORTS_PATH = "$PATCHES_PATH/shorts" + const val SWIPE_PATH = "$PATCHES_PATH/swipe" + const val UTILS_PATH = "$PATCHES_PATH/utils" + const val VIDEO_PATH = "$PATCHES_PATH/video" + + const val ALTERNATIVE_THUMBNAILS = "$ALTERNATIVE_THUMBNAILS_PATH/AlternativeThumbnailsPatch;" + const val FLYOUT_PANEL = "$FLYOUT_PANEL_PATH/FlyoutPanelPatch;" + const val FULLSCREEN = "$FULLSCREEN_PATH/FullscreenPatch;" + const val GENERAL = "$GENERAL_PATH/GeneralPatch;" + const val NAVIGATION = "$NAVIGATION_PATH/NavigationPatch;" + const val PLAYER = "$PLAYER_PATH/PlayerPatch;" + const val SEEKBAR = "$SEEKBAR_PATH/SeekBarPatch;" + const val SHORTS = "$SHORTS_PATH/ShortsPatch;" +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/integrations/IntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/integrations/IntegrationsPatch.kt index 91b61256e..6326786f5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/integrations/IntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/integrations/IntegrationsPatch.kt @@ -2,6 +2,7 @@ package app.revanced.patches.youtube.utils.integrations import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.integrations.AbstractIntegrationsPatch +import app.revanced.patches.youtube.utils.integrations.Constants.INTEGRATIONS_PATH import app.revanced.patches.youtube.utils.integrations.fingerprints.APIPlayerServiceFingerprint import app.revanced.patches.youtube.utils.integrations.fingerprints.ApplicationInitFingerprint import app.revanced.patches.youtube.utils.integrations.fingerprints.EmbeddedPlayerControlsOverlayFingerprint @@ -9,7 +10,6 @@ import app.revanced.patches.youtube.utils.integrations.fingerprints.EmbeddedPlay import app.revanced.patches.youtube.utils.integrations.fingerprints.RemoteEmbedFragmentFingerprint import app.revanced.patches.youtube.utils.integrations.fingerprints.RemoteEmbeddedPlayerFingerprint import app.revanced.patches.youtube.utils.integrations.fingerprints.StandalonePlayerActivityFingerprint -import app.revanced.util.integrations.Constants.INTEGRATIONS_PATH @Patch(requiresIntegrations = true) object IntegrationsPatch : AbstractIntegrationsPatch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/litho/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/litho/LithoFilterPatch.kt index b965fb238..ca1f9e20e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/litho/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/litho/LithoFilterPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.litho -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -9,9 +8,10 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.litho.ComponentParserPatch import app.revanced.patches.shared.patch.litho.ComponentParserPatch.generalHook +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.litho.fingerprints.GeneralByteBufferFingerprint import app.revanced.patches.youtube.utils.litho.fingerprints.LithoFilterFingerprint -import app.revanced.util.integrations.Constants.COMPONENTS_PATH +import app.revanced.util.exception import java.io.Closeable @Patch(dependencies = [ComponentParserPatch::class]) diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/lockmodestate/LockModeStateHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/lockmodestate/LockModeStateHookPatch.kt index dfccbf927..23a43c9c6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/lockmodestate/LockModeStateHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/lockmodestate/LockModeStateHookPatch.kt @@ -1,13 +1,13 @@ package app.revanced.patches.youtube.utils.lockmodestate -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.lockmodestate.fingerprint.LockModeStateFingerprint -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction object LockModeStateHookPatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/mainactivity/MainActivityResolvePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/mainactivity/MainActivityResolvePatch.kt index 738300217..384ed4a5d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/mainactivity/MainActivityResolvePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/mainactivity/MainActivityResolvePatch.kt @@ -1,14 +1,14 @@ package app.revanced.patches.youtube.utils.mainactivity -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.util.proxy.mutableTypes.MutableClass import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.mainactivity.fingerprints.MainActivityFingerprint -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.ClassDef object MainActivityResolvePatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/microg/MicroGBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/microg/MicroGBytecodePatch.kt index 3b4514fea..ed12980f1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/microg/MicroGBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/microg/MicroGBytecodePatch.kt @@ -4,6 +4,7 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.shared.patch.microg.MicroGBytecodeHelper import app.revanced.patches.shared.patch.packagename.PackageNamePatch import app.revanced.patches.youtube.utils.fix.clientspoof.ClientSpoofPatch import app.revanced.patches.youtube.utils.fix.parameter.SpoofPlayerParameterPatch @@ -16,7 +17,6 @@ import app.revanced.patches.youtube.utils.microg.fingerprints.CastDynamiteModule import app.revanced.patches.youtube.utils.microg.fingerprints.GooglePlayUtilityFingerprint import app.revanced.patches.youtube.utils.microg.fingerprints.PrimeFingerprint import app.revanced.patches.youtube.utils.microg.fingerprints.ServiceCheckFingerprint -import app.revanced.util.microg.MicroGBytecodeHelper @Patch( dependencies = [ diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/microg/MicroGPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/microg/MicroGPatch.kt index d376f83a6..91b6a154e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/microg/MicroGPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/microg/MicroGPatch.kt @@ -5,15 +5,15 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.shared.patch.microg.MicroGManifestHelper.addSpoofingMetadata +import app.revanced.patches.shared.patch.microg.MicroGResourceHelper.patchManifest +import app.revanced.patches.shared.patch.microg.MicroGResourceHelper.patchSetting import app.revanced.patches.shared.patch.packagename.PackageNamePatch import app.revanced.patches.youtube.utils.microg.Constants.PACKAGE_NAME import app.revanced.patches.youtube.utils.microg.Constants.SPOOFED_PACKAGE_NAME import app.revanced.patches.youtube.utils.microg.Constants.SPOOFED_PACKAGE_SIGNATURE +import app.revanced.patches.youtube.utils.settings.ResourceUtils.setMicroG import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.microg.MicroGManifestHelper.addSpoofingMetadata -import app.revanced.util.microg.MicroGResourceHelper.patchManifest -import app.revanced.util.microg.MicroGResourceHelper.patchSetting -import app.revanced.util.resources.ResourceHelper.setMicroG @Patch( name = "MicroG support", diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/navbarindex/NavBarIndexHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/navbarindex/NavBarIndexHookPatch.kt index c1f5a01ac..9d612057b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/navbarindex/NavBarIndexHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/navbarindex/NavBarIndexHookPatch.kt @@ -1,16 +1,16 @@ package app.revanced.patches.youtube.utils.navbarindex -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.navbarindex.fingerprints.MobileTopBarButtonOnClickFingerprint import app.revanced.patches.youtube.utils.navbarindex.fingerprints.PivotBarIndexFingerprint import app.revanced.patches.youtube.utils.navbarindex.fingerprints.SettingsActivityOnBackPressedFingerprint -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @Suppress("unused") diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/overridequality/OverrideQualityHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/overridequality/OverrideQualityHookPatch.kt index 7d3614985..507a19a0e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/overridequality/OverrideQualityHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/overridequality/OverrideQualityHookPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.overridequality -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -10,14 +9,15 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable +import app.revanced.patches.youtube.utils.integrations.Constants.INTEGRATIONS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.youtube.utils.overridequality.fingerprints.VideoQualityListFingerprint import app.revanced.patches.youtube.utils.overridequality.fingerprints.VideoQualityPatchFingerprint import app.revanced.patches.youtube.utils.overridequality.fingerprints.VideoQualityTextFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.QualityAuto -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.INTEGRATIONS_PATH -import app.revanced.util.integrations.Constants.VIDEO_PATH +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -56,7 +56,7 @@ object OverrideQualityHookPatch : BytecodePatch( val listIndex = it.scanResult.patternScanResult!!.startIndex val listRegister = getInstruction(listIndex).registerD - val qualityAutoIndex = getWideLiteralIndex(QualityAuto) + 2 + val qualityAutoIndex = getWideLiteralInstructionIndex(QualityAuto) + 2 val qualityAutoRegister = getInstruction(qualityAutoIndex).registerA diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/overridequality/fingerprints/VideoQualityListFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/overridequality/fingerprints/VideoQualityListFingerprint.kt index 7821edd74..279501311 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/overridequality/fingerprints/VideoQualityListFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/overridequality/fingerprints/VideoQualityListFingerprint.kt @@ -1,16 +1,15 @@ package app.revanced.patches.youtube.utils.overridequality.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.QualityAuto -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object VideoQualityListFingerprint : MethodFingerprint( +object VideoQualityListFingerprint : LiteralValueFingerprint( returnType = "V", parameters = listOf("L"), opcodes = listOf( Opcode.INVOKE_INTERFACE, Opcode.RETURN_VOID ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(QualityAuto) } + literalSupplier = { QualityAuto } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/overridespeed/OverrideSpeedHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/overridespeed/OverrideSpeedHookPatch.kt index 4c1f86d24..9f249a831 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/overridespeed/OverrideSpeedHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/overridespeed/OverrideSpeedHookPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.overridespeed -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -13,12 +12,13 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMut import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patcher.util.smali.toInstructions +import app.revanced.patches.youtube.utils.integrations.Constants.INTEGRATIONS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.youtube.utils.overridespeed.fingerprints.PlaybackSpeedChangedFingerprint import app.revanced.patches.youtube.utils.overridespeed.fingerprints.PlaybackSpeedParentFingerprint import app.revanced.patches.youtube.utils.overridespeed.fingerprints.PlaybackSpeedPatchFingerprint import app.revanced.patches.youtube.utils.overridespeed.fingerprints.SpeedClassFingerprint -import app.revanced.util.integrations.Constants.INTEGRATIONS_PATH -import app.revanced.util.integrations.Constants.VIDEO_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/playerbutton/PlayerButtonHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/playerbutton/PlayerButtonHookPatch.kt index b01a2fb06..2cb9c5107 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/playerbutton/PlayerButtonHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/playerbutton/PlayerButtonHookPatch.kt @@ -1,15 +1,15 @@ package app.revanced.patches.youtube.utils.playerbutton -import app.revanced.extensions.exception -import app.revanced.extensions.findMutableMethodOf import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER import app.revanced.patches.youtube.utils.playerbutton.fingerprints.LiveChatFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch -import app.revanced.util.integrations.Constants.PLAYER +import app.revanced.util.exception +import app.revanced.util.findMutableMethodOf import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/playerbutton/fingerprints/LiveChatFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/playerbutton/fingerprints/LiveChatFingerprint.kt index df0224352..ea834712a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/playerbutton/fingerprints/LiveChatFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/playerbutton/fingerprints/LiveChatFingerprint.kt @@ -1,11 +1,10 @@ package app.revanced.patches.youtube.utils.playerbutton.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.LiveChatButton -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object LiveChatFingerprint : MethodFingerprint( +object LiveChatFingerprint : LiteralValueFingerprint( opcodes = listOf(Opcode.NEW_INSTANCE), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(LiveChatButton) } + literalSupplier = { LiveChatButton } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/PlayerControlsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/PlayerControlsPatch.kt index 3cde1a06a..807c43620 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/PlayerControlsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/PlayerControlsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.playercontrols -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -21,7 +20,8 @@ import app.revanced.patches.youtube.utils.playercontrols.fingerprints.QuickSeekV import app.revanced.patches.youtube.utils.playercontrols.fingerprints.SeekEDUVisibleFingerprint import app.revanced.patches.youtube.utils.playercontrols.fingerprints.UserScrubbingFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch -import app.revanced.util.bytecode.getStringIndex +import app.revanced.util.exception +import app.revanced.util.getStringInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -43,7 +43,7 @@ object PlayerControlsPatch : BytecodePatch( override fun execute(context: BytecodeContext) { fun MutableMethod.findReference(targetString: String): Reference { - val targetIndex = getStringIndex(targetString) + 2 + val targetIndex = getStringInstructionIndex(targetString) + 2 val targetOpcode = getInstruction(targetIndex).opcode if (targetOpcode == Opcode.INVOKE_VIRTUAL) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt index 172f9b57a..29fc39bcc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.utils.playercontrols.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BottomUiContainerStub -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object BottomControlsInflateFingerprint : MethodFingerprint( +object BottomControlsInflateFingerprint : LiteralValueFingerprint( returnType = "Ljava/lang/Object;", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC, parameters = emptyList(), @@ -16,5 +15,5 @@ object BottomControlsInflateFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(BottomUiContainerStub) } + literalSupplier = { BottomUiContainerStub } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/fingerprints/ControlsLayoutInflateFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/fingerprints/ControlsLayoutInflateFingerprint.kt index 37464a281..cb7fc6807 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/fingerprints/ControlsLayoutInflateFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/playercontrols/fingerprints/ControlsLayoutInflateFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.utils.playercontrols.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ControlsLayoutStub -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object ControlsLayoutInflateFingerprint : MethodFingerprint( +object ControlsLayoutInflateFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = emptyList(), @@ -18,5 +17,5 @@ object ControlsLayoutInflateFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ControlsLayoutStub) } + literalSupplier = { ControlsLayoutStub } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/playerresponse/PlayerResponsePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/playerresponse/PlayerResponsePatch.kt index 7d31c4a42..c0b1741f9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/playerresponse/PlayerResponsePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/playerresponse/PlayerResponsePatch.kt @@ -1,12 +1,12 @@ package app.revanced.patches.youtube.utils.playerresponse -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.utils.fingerprints.PlayerParameterBuilderFingerprint +import app.revanced.util.exception import java.io.Closeable object PlayerResponsePatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/playertype/PlayerTypeHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/playertype/PlayerTypeHookPatch.kt index 6acf215a6..1387157ed 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/playertype/PlayerTypeHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/playertype/PlayerTypeHookPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.playertype -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -8,10 +7,11 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.fingerprints.YouTubeControlsOverlayFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.playertype.fingerprint.PlayerTypeFingerprint import app.revanced.patches.youtube.utils.playertype.fingerprint.VideoStateFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @Patch(dependencies = [SharedResourceIdPatch::class]) diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/quickactions/QuickActionsHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/quickactions/QuickActionsHookPatch.kt index 8f9117f7d..4b1775a6e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/quickactions/QuickActionsHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/quickactions/QuickActionsHookPatch.kt @@ -1,16 +1,16 @@ package app.revanced.patches.youtube.utils.quickactions -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod +import app.revanced.patches.youtube.utils.integrations.Constants.FULLSCREEN import app.revanced.patches.youtube.utils.quickactions.fingerprints.QuickActionsElementFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.QuickActionsElementContainer -import app.revanced.util.integrations.Constants.FULLSCREEN +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/quickactions/fingerprints/QuickActionsElementFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/quickactions/fingerprints/QuickActionsElementFingerprint.kt index fa6b44532..11110fec4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/quickactions/fingerprints/QuickActionsElementFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/quickactions/fingerprints/QuickActionsElementFingerprint.kt @@ -1,18 +1,13 @@ package app.revanced.patches.youtube.utils.quickactions.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.QuickActionsElementContainer -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object QuickActionsElementFingerprint : MethodFingerprint( +object QuickActionsElementFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Landroid/view/View;"), returnType = "V", - customFingerprint = { methodDef, _ -> - methodDef.isWideLiteralExists( - QuickActionsElementContainer - ) - } + literalSupplier = { QuickActionsElementContainer } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt index b9adbaacd..f229ae2e8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt @@ -4,13 +4,13 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch -import app.revanced.util.enum.ResourceType -import app.revanced.util.enum.ResourceType.COLOR -import app.revanced.util.enum.ResourceType.DIMEN -import app.revanced.util.enum.ResourceType.DRAWABLE -import app.revanced.util.enum.ResourceType.ID -import app.revanced.util.enum.ResourceType.LAYOUT -import app.revanced.util.enum.ResourceType.STRING +import app.revanced.patches.shared.patch.mapping.ResourceType +import app.revanced.patches.shared.patch.mapping.ResourceType.COLOR +import app.revanced.patches.shared.patch.mapping.ResourceType.DIMEN +import app.revanced.patches.shared.patch.mapping.ResourceType.DRAWABLE +import app.revanced.patches.shared.patch.mapping.ResourceType.ID +import app.revanced.patches.shared.patch.mapping.ResourceType.LAYOUT +import app.revanced.patches.shared.patch.mapping.ResourceType.STRING @Patch(dependencies = [ResourceMappingPatch::class]) object SharedResourceIdPatch : ResourcePatch() { @@ -75,7 +75,6 @@ object SharedResourceIdPatch : ResourcePatch() { var Scrubbing: Long = -1 var SeekUndoEduOverlayStub: Long = -1 var SettingsBooleanTimeRangeDialog: Long = -1 - var SpeedOverlayText: Long = -1 var SubtitleMenuSettingsFooterInfo: Long = -1 var SuggestedAction: Long = -1 var ToolBarPaddingHome: Long = -1 @@ -158,7 +157,6 @@ object SharedResourceIdPatch : ResourcePatch() { Scrubbing = find(DIMEN, "vertical_touch_offset_to_enter_fine_scrubbing") SeekUndoEduOverlayStub = find(ID, "seek_undo_edu_overlay_stub") SettingsBooleanTimeRangeDialog = find(LAYOUT, "setting_boolean_time_range_dialog") - SpeedOverlayText = find(ID, "speedmaster_edu_text") SubtitleMenuSettingsFooterInfo = find(STRING, "subtitle_menu_settings_footer_info") SuggestedAction = find(LAYOUT, "suggested_action") ToolBarPaddingHome = find(DIMEN, "toolbar_padding_home_action_up") diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/general/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/general/ReturnYouTubeDislikePatch.kt index c29deb6de..e59f998e7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/general/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/general/ReturnYouTubeDislikePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.returnyoutubedislike.general -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -10,6 +9,8 @@ import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.litho.LithoFilterPatch import app.revanced.patches.youtube.utils.playerresponse.PlayerResponsePatch import app.revanced.patches.youtube.utils.returnyoutubedislike.general.fingerprints.DislikeFingerprint @@ -25,8 +26,7 @@ import app.revanced.patches.youtube.utils.returnyoutubedislike.rollingnumber.Ret import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.ReturnYouTubeDislikeShortsPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.videoid.general.VideoIdPatch -import app.revanced.util.integrations.Constants.COMPONENTS_PATH -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/oldlayout/ReturnYouTubeDislikeOldLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/oldlayout/ReturnYouTubeDislikeOldLayoutPatch.kt index d298e7c50..c114d0e9d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/oldlayout/ReturnYouTubeDislikeOldLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/oldlayout/ReturnYouTubeDislikeOldLayoutPatch.kt @@ -1,16 +1,16 @@ package app.revanced.patches.youtube.utils.returnyoutubedislike.oldlayout -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.DislikeButton import app.revanced.patches.youtube.utils.returnyoutubedislike.oldlayout.fingerprints.ButtonTagFingerprint -import app.revanced.util.bytecode.getWideLiteralIndex -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch(dependencies = [SharedResourceIdPatch::class]) @@ -21,7 +21,7 @@ object ReturnYouTubeDislikeOldLayoutPatch : BytecodePatch( ButtonTagFingerprint.result?.let { it.mutableMethod.apply { - val dislikeButtonIndex = getWideLiteralIndex(DislikeButton) + val dislikeButtonIndex = getWideLiteralInstructionIndex(DislikeButton) val resourceIdentifierRegister = getInstruction(dislikeButtonIndex).registerA diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/oldlayout/fingerprints/ButtonTagFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/oldlayout/fingerprints/ButtonTagFingerprint.kt index 3eb5353f7..eba68deb7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/oldlayout/fingerprints/ButtonTagFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/oldlayout/fingerprints/ButtonTagFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.utils.returnyoutubedislike.oldlayout.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.DislikeButton -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -object ButtonTagFingerprint : MethodFingerprint( +object ButtonTagFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L"), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(DislikeButton) } + literalSupplier = { DislikeButton } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/rollingnumber/ReturnYouTubeDislikeRollingNumberPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/rollingnumber/ReturnYouTubeDislikeRollingNumberPatch.kt index b2a7e6707..f654e6e84 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/rollingnumber/ReturnYouTubeDislikeRollingNumberPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/rollingnumber/ReturnYouTubeDislikeRollingNumberPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.returnyoutubedislike.rollingnumber -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,13 +8,14 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.fingerprints.RollingNumberTextViewAnimationUpdateFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.returnyoutubedislike.rollingnumber.fingerprints.RollingNumberMeasureAnimatedTextFingerprint import app.revanced.patches.youtube.utils.returnyoutubedislike.rollingnumber.fingerprints.RollingNumberMeasureStaticLabelFingerprint import app.revanced.patches.youtube.utils.returnyoutubedislike.rollingnumber.fingerprints.RollingNumberMeasureTextParentFingerprint import app.revanced.patches.youtube.utils.returnyoutubedislike.rollingnumber.fingerprints.RollingNumberSetterFingerprint import app.revanced.patches.youtube.utils.returnyoutubedislike.rollingnumber.fingerprints.RollingNumberTextViewFingerprint import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/shorts/ReturnYouTubeDislikeShortsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/shorts/ReturnYouTubeDislikeShortsPatch.kt index d02539bc5..59ce78848 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/shorts/ReturnYouTubeDislikeShortsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/shorts/ReturnYouTubeDislikeShortsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.returnyoutubedislike.shorts -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -12,11 +11,12 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.fingerprints.IncognitoFingerprint import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.fingerprints.ShortsTextViewFingerprint import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.fingerprints.TextComponentSpecFingerprint import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction diff --git a/src/main/kotlin/app/revanced/util/resources/ResourceHelper.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/ResourceUtils.kt similarity index 67% rename from src/main/kotlin/app/revanced/util/resources/ResourceHelper.kt rename to src/main/kotlin/app/revanced/patches/youtube/utils/settings/ResourceUtils.kt index 589a3a0c6..1f7012db1 100644 --- a/src/main/kotlin/app/revanced/util/resources/ResourceHelper.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/ResourceUtils.kt @@ -1,32 +1,24 @@ -package app.revanced.util.resources +package app.revanced.patches.youtube.utils.settings -import app.revanced.extensions.doRecursively import app.revanced.patcher.data.ResourceContext +import app.revanced.util.doRecursively +import app.revanced.util.insertNode import org.w3c.dom.Element -import org.w3c.dom.Node -import java.nio.file.Files -import java.nio.file.StandardCopyOption -private fun Node.insertNode(tagName: String, targetNode: Node, block: Element.() -> Unit) { - val child = ownerDocument.createElement(tagName) - child.block() - parentNode.insertBefore(child, targetNode) -} +@Suppress("MemberVisibilityCanBePrivate") +object ResourceUtils { + const val TARGET_PREFERENCE_PATH = "res/xml/revanced_prefs.xml" -internal object ResourceHelper { + const val YOUTUBE_SETTINGS_PATH = "res/xml/settings_fragment.xml" - private const val TARGET_PREFERENCE_PATH = "res/xml/revanced_prefs.xml" + var targetPackage = "com.google.android.youtube" - private const val YOUTUBE_SETTINGS_PATH = "res/xml/settings_fragment.xml" - - private var targetPackage = "com.google.android.youtube" - - internal fun setMicroG(newPackage: String) { + fun setMicroG(newPackage: String) { targetPackage = newPackage } - internal fun ResourceContext.addEntryValues( + fun ResourceContext.addEntryValues( path: String, speedEntryValues: String, attributeName: String @@ -50,7 +42,7 @@ internal object ResourceHelper { } } - internal fun ResourceContext.addPreference(settingArray: Array) { + fun ResourceContext.addPreference(settingArray: Array) { val prefs = this[TARGET_PREFERENCE_PATH] settingArray.forEach preferenceLoop@{ preference -> @@ -62,27 +54,27 @@ internal object ResourceHelper { } } - internal fun ResourceContext.updatePatchStatus(patchTitle: String) { + fun ResourceContext.updatePatchStatus(patchTitle: String) { updatePatchStatusSettings(patchTitle, "@string/revanced_patches_included") } - internal fun ResourceContext.updatePatchStatusHeader(headerName: String) { + fun ResourceContext.updatePatchStatusHeader(headerName: String) { updatePatchStatusSettings("Header", headerName) } - internal fun ResourceContext.updatePatchStatusIcon(iconName: String) { + fun ResourceContext.updatePatchStatusIcon(iconName: String) { updatePatchStatusSettings("Icon", "@string/revanced_icon_$iconName") } - internal fun ResourceContext.updatePatchStatusLabel(appName: String) { + fun ResourceContext.updatePatchStatusLabel(appName: String) { updatePatchStatusSettings("Label", appName) } - internal fun ResourceContext.updatePatchStatusTheme(themeName: String) { + fun ResourceContext.updatePatchStatusTheme(themeName: String) { updatePatchStatusSettings("Theme", themeName) } - internal fun ResourceContext.updatePatchStatusSettings( + fun ResourceContext.updatePatchStatusSettings( patchTitle: String, updateText: String ) { @@ -99,7 +91,7 @@ internal object ResourceHelper { } } - internal fun ResourceContext.addReVancedPreference(key: String) { + fun ResourceContext.addReVancedPreference(key: String) { val targetClass = "com.google.android.apps.youtube.app.settings.videoquality.VideoQualitySettingsActivity" @@ -139,22 +131,4 @@ internal object ResourceHelper { } } } - - internal fun ResourceContext.addTranslations( - sourceDirectory: String, - languageArray: Array - ) { - languageArray.forEach { language -> - val directory = "values-$language-v21" - val relativePath = "$language/strings.xml" - - this["res/$directory"].mkdir() - - Files.copy( - ResourceUtils.javaClass.classLoader.getResourceAsStream("$sourceDirectory/translations/$relativePath")!!, - this["res"].resolve("$directory/strings.xml").toPath(), - StandardCopyOption.REPLACE_EXISTING - ) - } - } } \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsBytecodePatch.kt index 3e509ce5b..5bd9866c6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsBytecodePatch.kt @@ -1,18 +1,18 @@ package app.revanced.patches.youtube.utils.settings -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch +import app.revanced.patches.youtube.utils.integrations.Constants.INTEGRATIONS_PATH import app.revanced.patches.youtube.utils.integrations.IntegrationsPatch import app.revanced.patches.youtube.utils.mainactivity.MainActivityResolvePatch import app.revanced.patches.youtube.utils.mainactivity.MainActivityResolvePatch.injectInit import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.fingerprints.ThemeSetterSystemFingerprint -import app.revanced.util.integrations.Constants.INTEGRATIONS_PATH +import app.revanced.util.exception @Patch( dependencies = [ diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt index 6d862949a..6bb180746 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt @@ -7,19 +7,14 @@ import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch import app.revanced.patches.shared.patch.settings.AbstractSettingsResourcePatch import app.revanced.patches.youtube.utils.integrations.IntegrationsPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch -import app.revanced.util.resources.IconHelper.YOUTUBE_LAUNCHER_ICON_ARRAY -import app.revanced.util.resources.IconHelper.copyFiles -import app.revanced.util.resources.IconHelper.makeDirectoryAndCopyFiles -import app.revanced.util.resources.ResourceHelper.addPreference -import app.revanced.util.resources.ResourceHelper.addReVancedPreference -import app.revanced.util.resources.ResourceHelper.updatePatchStatus -import app.revanced.util.resources.ResourceHelper.updatePatchStatusSettings -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources +import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference +import app.revanced.patches.youtube.utils.settings.ResourceUtils.addReVancedPreference +import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatus +import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatusSettings +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources import org.w3c.dom.Element import java.io.Closeable -import java.io.File -import java.nio.file.Paths import java.util.concurrent.Executors import java.util.concurrent.TimeUnit @@ -63,9 +58,7 @@ import java.util.concurrent.TimeUnit ) @Suppress("unused") object SettingsPatch : AbstractSettingsResourcePatch( - "youtube/settings", - "youtube/settings/host", - true + "youtube/settings" ), Closeable { override fun execute(context: ResourceContext) { super.execute(context) @@ -99,6 +92,7 @@ object SettingsPatch : AbstractSettingsResourcePatch( is1836 = playServicesVersion in 233700000..233801999 upward1828 = 232900000 <= playServicesVersion + upward1831 = 233200000 <= playServicesVersion upward1834 = 233502000 <= playServicesVersion upward1839 = 234002000 <= playServicesVersion upward1841 = 234200000 <= playServicesVersion @@ -119,11 +113,11 @@ object SettingsPatch : AbstractSettingsResourcePatch( context["res/values-v21"].mkdirs() arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "layout", "revanced_settings_with_toolbar.xml" ), - ResourceUtils.ResourceGroup( + ResourceGroup( "values-v21", "strings.xml" ) @@ -160,36 +154,6 @@ object SettingsPatch : AbstractSettingsResourcePatch( } } - /** - * If a custom branding icon path exists, merge it - */ - val iconPath = "branding" - val targetDirectory = Paths.get("").toAbsolutePath().toString() + "/$iconPath" - - if (File(targetDirectory).exists()) { - fun copyResources(resourceGroups: List) { - try { - context.copyFiles(resourceGroups, iconPath) - } catch (_: Exception) { - context.makeDirectoryAndCopyFiles(resourceGroups, iconPath) - } - } - - val iconResourceFileNames = - YOUTUBE_LAUNCHER_ICON_ARRAY - .map { "$it.png" } - .toTypedArray() - - fun createGroup(directory: String) = ResourceUtils.ResourceGroup( - directory, *iconResourceFileNames - ) - - arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi") - .map { "mipmap-$it" } - .map(::createGroup) - .let(::copyResources) - } - } private val THREAD_COUNT = Runtime.getRuntime().availableProcessors() @@ -198,6 +162,7 @@ object SettingsPatch : AbstractSettingsResourcePatch( internal lateinit var contexts: ResourceContext internal var is1836: Boolean = false internal var upward1828: Boolean = false + internal var upward1831: Boolean = false internal var upward1834: Boolean = false internal var upward1839: Boolean = false internal var upward1841: Boolean = false diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/settings/fingerprints/ThemeSetterSystemFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/fingerprints/ThemeSetterSystemFingerprint.kt index f86bdcc76..e8eda98cc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/settings/fingerprints/ThemeSetterSystemFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/fingerprints/ThemeSetterSystemFingerprint.kt @@ -1,12 +1,11 @@ package app.revanced.patches.youtube.utils.settings.fingerprints -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.Appearance -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.Opcode -object ThemeSetterSystemFingerprint : MethodFingerprint( +object ThemeSetterSystemFingerprint : LiteralValueFingerprint( returnType = "L", opcodes = listOf(Opcode.RETURN_OBJECT), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(Appearance) } + literalSupplier = { Appearance } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockBytecodePatch.kt index 26fd5ce62..d118d8263 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockBytecodePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.sponsorblock -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -22,7 +21,8 @@ import app.revanced.patches.youtube.utils.sponsorblock.fingerprints.RectangleFie import app.revanced.patches.youtube.utils.sponsorblock.fingerprints.SegmentPlaybackControllerFingerprint import app.revanced.patches.youtube.utils.videoid.general.VideoIdPatch import app.revanced.patches.youtube.utils.videoid.withoutshorts.VideoIdWithoutShortsPatch -import app.revanced.util.bytecode.getWideLiteralIndex +import app.revanced.util.exception +import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.BuilderInstruction import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction3rc @@ -150,7 +150,7 @@ object SponsorBlockBytecodePatch : BytecodePatch( */ TotalTimeFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(TotalTime) + 2 + val targetIndex = getWideLiteralInstructionIndex(TotalTime) + 2 val targetRegister = getInstruction(targetIndex).registerA addInstructions( @@ -168,7 +168,7 @@ object SponsorBlockBytecodePatch : BytecodePatch( */ YouTubeControlsOverlayFingerprint.result?.let { it.mutableMethod.apply { - val targetIndex = getWideLiteralIndex(InsetOverlayViewLayout) + 3 + val targetIndex = getWideLiteralInstructionIndex(InsetOverlayViewLayout) + 3 val targetRegister = getInstruction(targetIndex).registerA addInstruction( diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockPatch.kt index 1b05ec2bd..4d8126710 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockPatch.kt @@ -6,9 +6,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.booleanPatchOption import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.resources.ResourceUtils -import app.revanced.util.resources.ResourceUtils.copyResources -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources +import app.revanced.util.copyXmlNode @Patch( name = "SponsorBlock", @@ -60,7 +60,7 @@ object SponsorBlockPatch : ResourcePatch() { * merge SponsorBlock drawables to main drawables */ arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "layout", "inline_sponsor_overlay.xml", "skip_sponsor_button.xml" @@ -71,11 +71,11 @@ object SponsorBlockPatch : ResourcePatch() { if (OutlineIcon == true) { arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "layout", "new_segment.xml" ), - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable", "ic_sb_adjust.xml", "ic_sb_backward.xml", @@ -92,11 +92,11 @@ object SponsorBlockPatch : ResourcePatch() { } } else { arrayOf( - ResourceUtils.ResourceGroup( + ResourceGroup( "layout", "new_segment.xml" ), - ResourceUtils.ResourceGroup( + ResourceGroup( "drawable", "ic_sb_adjust.xml", "ic_sb_compare.xml", @@ -113,44 +113,39 @@ object SponsorBlockPatch : ResourcePatch() { /** * merge xml nodes from the host to their real xml files */ - // collect all host resources - val hostingXmlResources = mapOf("layout" to arrayOf("youtube_controls_layout")) - // copy nodes from host resources to their real xml files - hostingXmlResources.forEach { (path, resources) -> - resources.forEach { resource -> - val hostingResourceStream = - this.javaClass.classLoader.getResourceAsStream("youtube/sponsorblock/shared/host/$path/$resource.xml")!! + val hostingResourceStream = + this.javaClass.classLoader.getResourceAsStream("youtube/sponsorblock/shared/host/layout/youtube_controls_layout.xml")!! - val targetXmlEditor = context.xmlEditor["res/$path/$resource.xml"] - "RelativeLayout".copyXmlNode( - context.xmlEditor[hostingResourceStream], - targetXmlEditor - ).also { - val children = targetXmlEditor.file.getElementsByTagName("RelativeLayout") - .item(0).childNodes + val targetXmlEditor = context.xmlEditor["res/layout/youtube_controls_layout.xml"] - // Replace the startOf with the voting button view so that the button does not overlap - for (i in 1 until children.length) { - val view = children.item(i) + "RelativeLayout".copyXmlNode( + context.xmlEditor[hostingResourceStream], + targetXmlEditor + ).also { + val children = targetXmlEditor.file.getElementsByTagName("RelativeLayout") + .item(0).childNodes - // Replace the attribute for a specific node only - if (!(view.hasAttributes() && view.attributes.getNamedItem("android:id").nodeValue.endsWith( - "player_video_heading" - )) - ) continue + // Replace the startOf with the voting button view so that the button does not overlap + for (i in 1 until children.length) { + val view = children.item(i) - // voting button id from the voting button view from the youtube_controls_layout.xml host file - val votingButtonId = "@+id/sb_voting_button" + // Replace the attribute for a specific node only + if (!(view.hasAttributes() && view.attributes.getNamedItem("android:id").nodeValue.endsWith( + "player_video_heading" + )) + ) continue - view.attributes.getNamedItem("android:layout_toStartOf").nodeValue = - votingButtonId + // voting button id from the voting button view from the youtube_controls_layout.xml host file + val votingButtonId = "@+id/sb_voting_button" - break - } - }.close() // close afterwards + view.attributes.getNamedItem("android:layout_toStartOf").nodeValue = + votingButtonId + + break } - } + }.close() // close afterwards + /** * Add ReVanced Extended Settings diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/ToolBarHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/ToolBarHookPatch.kt index 005b8b128..0d9c7bfb1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/ToolBarHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/ToolBarHookPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.toolbar -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,10 +7,11 @@ import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.toolbar.fingerprints.ToolBarButtonFingerprint import app.revanced.patches.youtube.utils.toolbar.fingerprints.ToolBarPatchFingerprint -import app.revanced.util.integrations.Constants.UTILS_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/fingerprints/ToolBarButtonFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/fingerprints/ToolBarButtonFingerprint.kt index 3cf6f25fa..ed6b2e3ee 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/fingerprints/ToolBarButtonFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/fingerprints/ToolBarButtonFingerprint.kt @@ -1,13 +1,12 @@ package app.revanced.patches.youtube.utils.toolbar.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.MenuItemView -import app.revanced.util.bytecode.isWideLiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object ToolBarButtonFingerprint : MethodFingerprint( +object ToolBarButtonFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Landroid/view/MenuItem;"), returnType = "V", @@ -18,5 +17,5 @@ object ToolBarButtonFingerprint : MethodFingerprint( Opcode.IGET_OBJECT, Opcode.INVOKE_VIRTUAL ), - customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(MenuItemView) } + literalSupplier = { MenuItemView } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/videocpn/VideoCpnPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/videocpn/VideoCpnPatch.kt index 791d76811..a5fe347fc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/videocpn/VideoCpnPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/videocpn/VideoCpnPatch.kt @@ -1,11 +1,11 @@ package app.revanced.patches.youtube.utils.videocpn -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.utils.fingerprints.OrganicPlaybackContextModelFingerprint +import app.revanced.util.exception object VideoCpnPatch : BytecodePatch( setOf(OrganicPlaybackContextModelFingerprint) diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/general/VideoIdPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/general/VideoIdPatch.kt index ef3b3ee08..a8d3ece77 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/general/VideoIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/general/VideoIdPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.utils.videoid.general -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -13,6 +12,7 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.utils.fingerprints.OrganicPlaybackContextModelFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.youtube.utils.playerresponse.PlayerResponsePatch import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.utils.videoid.general.fingerprint.PlayerControllerSetTimeReferenceFingerprint @@ -20,7 +20,7 @@ import app.revanced.patches.youtube.utils.videoid.general.fingerprint.VideoEndFi import app.revanced.patches.youtube.utils.videoid.general.fingerprint.VideoIdFingerprint import app.revanced.patches.youtube.utils.videoid.general.fingerprint.VideoIdParentFingerprint import app.revanced.patches.youtube.utils.videoid.general.fingerprint.VideoLengthFingerprint -import app.revanced.util.integrations.Constants.VIDEO_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/general/fingerprint/VideoLengthFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/general/fingerprint/VideoLengthFingerprint.kt index 48c79793a..fa7dc376c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/general/fingerprint/VideoLengthFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/general/fingerprint/VideoLengthFingerprint.kt @@ -1,12 +1,11 @@ package app.revanced.patches.youtube.utils.videoid.general.fingerprint import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.bytecode.isWide32LiteralExists +import app.revanced.util.fingerprint.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -object VideoLengthFingerprint : MethodFingerprint( +object VideoLengthFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = emptyList(), @@ -15,5 +14,5 @@ object VideoLengthFingerprint : MethodFingerprint( Opcode.CONST_4, Opcode.INVOKE_VIRTUAL ), - customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45388753) } + literalSupplier = { 45388753 } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/withoutshorts/VideoIdWithoutShortsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/withoutshorts/VideoIdWithoutShortsPatch.kt index ca301501e..2accd95bd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/withoutshorts/VideoIdWithoutShortsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/videoid/withoutshorts/VideoIdWithoutShortsPatch.kt @@ -1,13 +1,13 @@ package app.revanced.patches.youtube.utils.videoid.withoutshorts -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod +import app.revanced.patches.youtube.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.youtube.utils.videoid.withoutshorts.fingerprint.VideoIdWithoutShortsFingerprint -import app.revanced.util.integrations.Constants.VIDEO_PATH +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/customspeed/CustomPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/customspeed/CustomPlaybackSpeedPatch.kt index 06e47e231..cfa30b833 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/customspeed/CustomPlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/customspeed/CustomPlaybackSpeedPatch.kt @@ -5,9 +5,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.patch.customspeed.AbstractCustomPlaybackSpeedPatch import app.revanced.patches.youtube.flyoutpanel.oldspeedlayout.OldSpeedLayoutPatch +import app.revanced.patches.youtube.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.youtube.utils.overridespeed.OverrideSpeedHookPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch -import app.revanced.util.integrations.Constants.VIDEO_PATH @Patch( name = "Custom playback speed", diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/hdr/DisableHdrVideoPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/hdr/DisableHdrVideoPatch.kt index 6691c86ff..c2142cbac 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/hdr/DisableHdrVideoPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/hdr/DisableHdrVideoPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.video.hdr -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,9 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel +import app.revanced.patches.youtube.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.video.hdr.fingerprints.HdrCapabilitiesFingerprint -import app.revanced.util.integrations.Constants.VIDEO_PATH +import app.revanced.util.exception @Patch( name = "Disable HDR video", diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/VideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/VideoQualityPatch.kt index eca56b714..13a2de7d1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/VideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/VideoQualityPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.video.quality -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -9,6 +8,7 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.fingerprints.NewVideoQualityChangedFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.youtube.utils.overridequality.OverrideQualityHookPatch import app.revanced.patches.youtube.utils.overridespeed.OverrideSpeedHookPatch import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch @@ -17,8 +17,8 @@ import app.revanced.patches.youtube.utils.settings.SettingsPatch.contexts import app.revanced.patches.youtube.utils.videoid.general.VideoIdPatch import app.revanced.patches.youtube.utils.videoid.withoutshorts.VideoIdWithoutShortsPatch import app.revanced.patches.youtube.video.quality.fingerprints.VideoQualitySetterFingerprint -import app.revanced.util.integrations.Constants.VIDEO_PATH -import app.revanced.util.resources.ResourceUtils.copyXmlNode +import app.revanced.util.copyXmlNode +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Patch( diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt index f411484e6..9f508e548 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.video.speed -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction @@ -8,12 +7,14 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.youtube.utils.fingerprints.NewVideoQualityChangedFingerprint +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH +import app.revanced.patches.youtube.utils.integrations.Constants.VIDEO_PATH import app.revanced.patches.youtube.utils.overridespeed.OverrideSpeedHookPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.videocpn.VideoCpnPatch import app.revanced.patches.youtube.video.speed.fingerprints.NewPlaybackSpeedChangedFingerprint -import app.revanced.util.bytecode.BytecodeHelper.updatePatchStatus -import app.revanced.util.integrations.Constants.VIDEO_PATH +import app.revanced.util.exception +import app.revanced.util.updatePatchStatus import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @Patch( @@ -93,7 +94,7 @@ object PlaybackSpeedPatch : BytecodePatch( SettingsPatch.updatePatchStatus("Default playback speed") - context.updatePatchStatus("DefaultPlaybackSpeed", true) + context.updatePatchStatus("$UTILS_PATH/PatchStatus;", "DefaultPlaybackSpeed") } diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt new file mode 100644 index 000000000..24842a1bb --- /dev/null +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -0,0 +1,183 @@ +package app.revanced.util + +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +import app.revanced.patcher.extensions.InstructionExtensions.addInstructions +import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.patcher.patch.PatchException +import app.revanced.patcher.util.proxy.mutableTypes.MutableClass +import app.revanced.patcher.util.proxy.mutableTypes.MutableField +import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c +import com.android.tools.smali.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.iface.instruction.Instruction +import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction +import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction +import com.android.tools.smali.dexlib2.iface.reference.Reference +import com.android.tools.smali.dexlib2.util.MethodUtil + +/** + * The [PatchException] of failing to resolve a [MethodFingerprint]. + * + * @return The [PatchException]. + */ +val MethodFingerprint.exception + get() = PatchException("Failed to resolve ${this.javaClass.simpleName}") + +/** + * Find the [MutableMethod] from a given [Method] in a [MutableClass]. + * + * @param method The [Method] to find. + * @return The [MutableMethod]. + */ +fun MutableClass.findMutableMethodOf(method: Method) = this.methods.first { + MethodUtil.methodSignaturesMatch(it, method) +} + +/** + * Apply a transform to all fields of the class. + * + * @param transform The transformation function. Accepts a [MutableField] and returns a transformed [MutableField]. + */ +fun MutableClass.transformFields(transform: MutableField.() -> MutableField) { + val transformedFields = fields.map { it.transform() } + fields.clear() + fields.addAll(transformedFields) +} + +/** + * Apply a transform to all methods of the class. + * + * @param transform The transformation function. Accepts a [MutableMethod] and returns a transformed [MutableMethod]. + */ +fun MutableClass.transformMethods(transform: MutableMethod.() -> MutableMethod) { + val transformedMethods = methods.map { it.transform() } + methods.clear() + methods.addAll(transformedMethods) +} + +/** + * Inject a call to a method that hides a view. + * + * @param insertIndex The index to insert the call at. + * @param viewRegister The register of the view to hide. + * @param classDescriptor The descriptor of the class that contains the method. + * @param targetMethod The name of the method to call. + */ +fun MutableMethod.injectHideViewCall( + insertIndex: Int, + viewRegister: Int, + classDescriptor: String, + targetMethod: String +) = addInstruction( + insertIndex, + "invoke-static { v$viewRegister }, $classDescriptor->$targetMethod(Landroid/view/View;)V" +) + +/** + * Find the index of the first wide literal instruction with the given value. + * + * @return the first literal instruction with the value, or -1 if not found. + */ +fun Method.getWideLiteralInstructionIndex(literal: Long) = implementation?.let { + it.instructions.indexOfFirst { instruction -> + (instruction as? WideLiteralInstruction)?.wideLiteral == literal + } +} ?: -1 + +fun Method.getStringInstructionIndex(value: String) = implementation?.let { + it.instructions.indexOfFirst { instruction -> + instruction.opcode == Opcode.CONST_STRING + && (instruction as? BuilderInstruction21c)?.reference.toString() == value + } +} ?: -1 + +/** + * Check if the method contains a literal with the given value. + * + * @return if the method contains a literal with the given value. + */ +fun Method.containsWideLiteralInstructionIndex(literal: Long) = + getWideLiteralInstructionIndex(literal) >= 0 + +/** + * Traverse the class hierarchy starting from the given root class. + * + * @param targetClass the class to start traversing the class hierarchy from. + * @param callback function that is called for every class in the hierarchy. + */ +fun BytecodeContext.traverseClassHierarchy( + targetClass: MutableClass, + callback: MutableClass.() -> Unit +) { + callback(targetClass) + this.findClass(targetClass.superclass ?: return)?.mutableClass?.let { + traverseClassHierarchy(it, callback) + } +} + +/** + * Get the [Reference] of an [Instruction] as [T]. + * + * @param T The type of [Reference] to cast to. + * @return The [Reference] as [T] or null + * if the [Instruction] is not a [ReferenceInstruction] or the [Reference] is not of type [T]. + * @see ReferenceInstruction + */ +inline fun Instruction.getReference() = + (this as? ReferenceInstruction)?.reference as? T + +/** + * Get the index of the first [Instruction] that matches the predicate. + * + * @param predicate The predicate to match. + * @return The index of the first [Instruction] that matches the predicate. + */ +fun Method.indexOfFirstInstruction(predicate: Instruction.() -> Boolean) = + this.implementation!!.instructions.indexOfFirst(predicate) + +/** + * Return the resolved methods of [MethodFingerprint]s early. + */ +fun List.returnEarly(bool: Boolean = false) { + val const = if (bool) "0x1" else "0x0" + this.forEach { fingerprint -> + fingerprint.result?.let { result -> + val stringInstructions = when (result.method.returnType.first()) { + 'L' -> """ + const/4 v0, $const + return-object v0 + """ + + 'V' -> "return-void" + 'I', 'Z' -> """ + const/4 v0, $const + return v0 + """ + + else -> throw Exception("This case should never happen.") + } + + result.mutableMethod.addInstructions(0, stringInstructions) + } ?: throw fingerprint.exception + } +} + +fun BytecodeContext.updatePatchStatus( + className: String, + methodName: String +) { + this.classes.forEach { classDef -> + if (classDef.type.endsWith(className)) { + val patchStatusMethod = + this.proxy(classDef).mutableClass.methods.first { it.name == methodName } + + patchStatusMethod.replaceInstruction( + 0, + "const/4 v0, 0x1" + ) + } + } +} diff --git a/src/main/kotlin/app/revanced/util/ResourceUtils.kt b/src/main/kotlin/app/revanced/util/ResourceUtils.kt new file mode 100644 index 000000000..f0aaad58f --- /dev/null +++ b/src/main/kotlin/app/revanced/util/ResourceUtils.kt @@ -0,0 +1,121 @@ +package app.revanced.util + +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.util.DomFileEditor +import org.w3c.dom.Element +import org.w3c.dom.Node +import java.nio.file.Files +import java.nio.file.StandardCopyOption + +val classLoader: ClassLoader = object {}.javaClass.classLoader + +fun Node.adoptChild(tagName: String, block: Element.() -> Unit) { + val child = ownerDocument.createElement(tagName) + child.block() + appendChild(child) +} + +fun Node.cloneNodes(parent: Node) { + val node = cloneNode(true) + parent.appendChild(node) + parent.removeChild(this) +} + +/** + * Recursively traverse the DOM tree starting from the given root node. + * + * @param action function that is called for every node in the tree. + */ +fun Node.doRecursively(action: (Node) -> Unit) { + action(this) + for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action) +} + +fun Node.insertNode(tagName: String, targetNode: Node, block: Element.() -> Unit) { + val child = ownerDocument.createElement(tagName) + child.block() + parentNode.insertBefore(child, targetNode) +} + +fun String.startsWithAny(vararg prefixes: String): Boolean { + for (prefix in prefixes) + if (this.startsWith(prefix)) + return true + + return false +} + +/** + * Copy resources from the current class loader to the resource directory. + * @param sourceResourceDirectory The source resource directory name. + * @param resources The resources to copy. + */ +fun ResourceContext.copyResources( + sourceResourceDirectory: String, + vararg resources: ResourceGroup +) { + val targetResourceDirectory = this["res"] + + for (resourceGroup in resources) { + resourceGroup.resources.forEach { resource -> + val resourceFile = "${resourceGroup.resourceDirectoryName}/$resource" + Files.copy( + classLoader.getResourceAsStream("$sourceResourceDirectory/$resourceFile")!!, + targetResourceDirectory.resolve(resourceFile).toPath(), + StandardCopyOption.REPLACE_EXISTING + ) + } + } +} + +/** + * Resource names mapped to their corresponding resource data. + * @param resourceDirectoryName The name of the directory of the resource. + * @param resources A list of resource names. + */ +class ResourceGroup(val resourceDirectoryName: String, vararg val resources: String) + +/** + * Copy resources from the current class loader to the resource directory. + * @param resourceDirectory The directory of the resource. + * @param targetResource The target resource. + * @param elementTag The element to copy. + */ +fun ResourceContext.copyXmlNode( + resourceDirectory: String, + targetResource: String, + elementTag: String +) { + val stringsResourceInputStream = + classLoader.getResourceAsStream("$resourceDirectory/$targetResource")!! + + // Copy nodes from the resources node to the real resource node + elementTag.copyXmlNode( + this.xmlEditor[stringsResourceInputStream], + this.xmlEditor["res/$targetResource"] + ).close() +} + +/** + * Copies the specified node of the source [DomFileEditor] to the target [DomFileEditor]. + * @param source the source [DomFileEditor]. + * @param target the target [DomFileEditor]- + * @return AutoCloseable that closes the target [DomFileEditor]s. + */ +fun String.copyXmlNode(source: DomFileEditor, target: DomFileEditor): AutoCloseable { + val hostNodes = source.file.getElementsByTagName(this).item(0).childNodes + + val destinationResourceFile = target.file + val destinationNode = destinationResourceFile.getElementsByTagName(this).item(0) + + for (index in 0 until hostNodes.length) { + val node = hostNodes.item(index).cloneNode(true) + destinationResourceFile.adoptNode(node) + destinationNode.appendChild(node) + } + + return AutoCloseable { + source.close() + target.close() + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/bytecode/BytecodeHelper.kt b/src/main/kotlin/app/revanced/util/bytecode/BytecodeHelper.kt deleted file mode 100644 index 1e46c4b52..000000000 --- a/src/main/kotlin/app/revanced/util/bytecode/BytecodeHelper.kt +++ /dev/null @@ -1,32 +0,0 @@ -package app.revanced.util.bytecode - -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction -import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH -import app.revanced.util.integrations.Constants.UTILS_PATH - -internal object BytecodeHelper { - - internal fun BytecodeContext.updatePatchStatus( - methodName: String, - isYouTube: Boolean - ) { - val integrationPath = - if (isYouTube) - UTILS_PATH - else - MUSIC_UTILS_PATH - - this.classes.forEach { classDef -> - if (classDef.type.endsWith("$integrationPath/PatchStatus;")) { - val patchStatusMethod = - this.proxy(classDef).mutableClass.methods.first { it.name == methodName } - - patchStatusMethod.replaceInstruction( - 0, - "const/4 v0, 0x1" - ) - } - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/bytecode/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/bytecode/BytecodeUtils.kt deleted file mode 100644 index acefb3b05..000000000 --- a/src/main/kotlin/app/revanced/util/bytecode/BytecodeUtils.kt +++ /dev/null @@ -1,56 +0,0 @@ -package app.revanced.util.bytecode - -import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c -import com.android.tools.smali.dexlib2.iface.Method -import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction -import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction - -fun Method.isNarrowLiteralExists(value: Int): Boolean { - return getNarrowLiteralIndex(value) != -1 -} - -fun Method.isWideLiteralExists(value: Long): Boolean { - return getWideLiteralIndex(value) != -1 -} - -fun Method.isWide32LiteralExists(value: Long): Boolean { - return getWide32LiteralIndex(value) != -1 -} - -fun Method.getNarrowLiteralIndex(value: Int): Int { - return implementation?.let { - it.instructions.indexOfFirst { instruction -> - instruction.opcode == Opcode.CONST - && (instruction as NarrowLiteralInstruction).narrowLiteral == value - } - } ?: -1 -} - -fun Method.getStringIndex(value: String): Int { - return implementation?.let { - it.instructions.indexOfFirst { instruction -> - instruction.opcode == Opcode.CONST_STRING - && (instruction as BuilderInstruction21c).reference.toString() == value - } - } ?: -1 -} - -fun Method.getWideLiteralIndex(value: Long): Int { - return implementation?.let { - it.instructions.indexOfFirst { instruction -> - instruction.opcode == Opcode.CONST - && (instruction as WideLiteralInstruction).wideLiteral == value - } - } ?: -1 -} - -fun Method.getWide32LiteralIndex(value: Long): Int { - return implementation?.let { - it.instructions.indexOfFirst { instruction -> - instruction.opcode == Opcode.CONST_WIDE_32 - && (instruction as WideLiteralInstruction).wideLiteral == value - } - } ?: -1 -} - diff --git a/src/main/kotlin/app/revanced/util/fingerprint/LiteralValueFingerprint.kt b/src/main/kotlin/app/revanced/util/fingerprint/LiteralValueFingerprint.kt new file mode 100644 index 000000000..293855da4 --- /dev/null +++ b/src/main/kotlin/app/revanced/util/fingerprint/LiteralValueFingerprint.kt @@ -0,0 +1,34 @@ +package app.revanced.util.fingerprint + +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.util.containsWideLiteralInstructionIndex +import com.android.tools.smali.dexlib2.Opcode + +/** + * A fingerprint to resolve methods that contain a specific literal value. + * + * @param returnType The method's return type compared using String.startsWith. + * @param accessFlags The method's exact access flags using values of AccessFlags. + * @param parameters The parameters of the method. Partial matches allowed and follow the same rules as returnType. + * @param opcodes An opcode pattern of the method's instructions. Wildcard or unknown opcodes can be specified by null. + * @param strings A list of the method's strings compared each using String.contains. + * @param literalSupplier A supplier for the literal value to check for. + */ +abstract class LiteralValueFingerprint( + returnType: String? = null, + accessFlags: Int? = null, + parameters: Iterable? = null, + opcodes: Iterable? = null, + strings: Iterable? = null, + // Has to be a supplier because the fingerprint is created before patches can set literals. + literalSupplier: () -> Long +) : MethodFingerprint( + returnType = returnType, + accessFlags = accessFlags, + parameters = parameters, + opcodes = opcodes, + strings = strings, + customFingerprint = { methodDef, _ -> + methodDef.containsWideLiteralInstructionIndex(literalSupplier()) + } +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/integrations/Constants.kt b/src/main/kotlin/app/revanced/util/integrations/Constants.kt deleted file mode 100644 index 0278498d0..000000000 --- a/src/main/kotlin/app/revanced/util/integrations/Constants.kt +++ /dev/null @@ -1,38 +0,0 @@ -package app.revanced.util.integrations - -internal object Constants { - const val INTEGRATIONS_PATH = "Lapp/revanced/integrations" - const val PATCHES_PATH = "$INTEGRATIONS_PATH/patches" - - const val ADS_PATH = "$PATCHES_PATH/ads" - const val ALTERNATIVE_THUMBNAILS = "$PATCHES_PATH/layout/AlternativeThumbnailsPatch;" - const val COMPONENTS_PATH = "$PATCHES_PATH/components" - const val SWIPE_PATH = "$PATCHES_PATH/swipe" - const val FLYOUT_PANEL = "$PATCHES_PATH/layout/FlyoutPanelPatch;" - const val FULLSCREEN = "$PATCHES_PATH/layout/FullscreenPatch;" - const val GENERAL = "$PATCHES_PATH/layout/GeneralPatch;" - const val NAVIGATION = "$PATCHES_PATH/layout/NavigationPatch;" - const val PLAYER = "$PATCHES_PATH/layout/PlayerPatch;" - const val SEEKBAR = "$PATCHES_PATH/layout/SeekBarPatch;" - const val SHORTS = "$PATCHES_PATH/layout/ShortsPatch;" - const val MISC_PATH = "$PATCHES_PATH/misc" - const val BUTTON_PATH = "$PATCHES_PATH/button" - const val VIDEO_PATH = "$PATCHES_PATH/video" - const val UTILS_PATH = "$PATCHES_PATH/utils" - - const val MUSIC_INTEGRATIONS_PATH = "Lapp/revanced/music" - private const val MUSIC_PATCHES_PATH = "$MUSIC_INTEGRATIONS_PATH/patches" - - const val MUSIC_ACCOUNT = "$MUSIC_PATCHES_PATH/account/AccountPatch;" - const val MUSIC_ACTIONBAR = "$MUSIC_PATCHES_PATH/actionbar/ActionBarPatch;" - const val MUSIC_ADS_PATH = "$MUSIC_PATCHES_PATH/ads" - const val MUSIC_COMPONENTS_PATH = "$MUSIC_PATCHES_PATH/components" - const val MUSIC_FLYOUT = "$MUSIC_PATCHES_PATH/flyout/FlyoutPatch;" - const val MUSIC_GENERAL = "$MUSIC_PATCHES_PATH/general/GeneralPatch;" - const val MUSIC_MISC_PATH = "$MUSIC_PATCHES_PATH/misc" - const val MUSIC_NAVIGATION = "$MUSIC_PATCHES_PATH/navigation/NavigationPatch;" - const val MUSIC_PLAYER = "$MUSIC_PATCHES_PATH/player/PlayerPatch;" - const val MUSIC_VIDEO_PATH = "$MUSIC_PATCHES_PATH/video" - - const val MUSIC_UTILS_PATH = "$MUSIC_PATCHES_PATH/utils" -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/pivotbar/InjectionUtils.kt b/src/main/kotlin/app/revanced/util/pivotbar/InjectionUtils.kt deleted file mode 100644 index f095d34e7..000000000 --- a/src/main/kotlin/app/revanced/util/pivotbar/InjectionUtils.kt +++ /dev/null @@ -1,30 +0,0 @@ -package app.revanced.util.pivotbar - -import app.revanced.patcher.extensions.InstructionExtensions.addInstruction -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod -import com.android.tools.smali.dexlib2.Opcode.MOVE_RESULT_OBJECT -import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction - -internal object InjectionUtils { - const val REGISTER_TEMPLATE_REPLACEMENT: String = "REGISTER_INDEX" - - /** - * Injects an instruction into insertIndex of the hook. - * @param hook The hook to insert. - * @param insertIndex The index to insert the instruction at. - * [MOVE_RESULT_OBJECT] has to be the previous instruction before [insertIndex]. - */ - fun MutableMethod.injectHook(hook: String, insertIndex: Int) { - val injectTarget = this - - // Register to pass to the hook - val registerIndex = insertIndex - 1 // MOVE_RESULT_OBJECT is always the previous instruction - val register = injectTarget.getInstruction(registerIndex).registerA - - injectTarget.addInstruction( - insertIndex, - hook.replace("REGISTER_INDEX", register.toString()), - ) - } -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/resources/IconHelper.kt b/src/main/kotlin/app/revanced/util/resources/IconHelper.kt deleted file mode 100644 index 51b790060..000000000 --- a/src/main/kotlin/app/revanced/util/resources/IconHelper.kt +++ /dev/null @@ -1,235 +0,0 @@ -package app.revanced.util.resources - -import app.revanced.patcher.data.ResourceContext -import org.w3c.dom.Element -import java.io.File -import java.nio.file.Files -import java.nio.file.Paths -import java.nio.file.StandardCopyOption - -internal object IconHelper { - internal var YOUTUBE_LAUNCHER_ICON_ARRAY = - arrayOf( - "adaptiveproduct_youtube_background_color_108", - "adaptiveproduct_youtube_foreground_color_108", - "ic_launcher", - "ic_launcher_round" - ) - - internal var YOUTUBE_MUSIC_LAUNCHER_ICON_ARRAY = - arrayOf( - "adaptiveproduct_youtube_music_background_color_108", - "adaptiveproduct_youtube_music_foreground_color_108", - "ic_launcher_release" - ) - - internal fun ResourceContext.copyFiles( - resourceGroups: List, - path: String - ) { - val iconPath = File(Paths.get("").toAbsolutePath().toString()).resolve(path) - val resourceDirectory = this["res"] - - resourceGroups.forEach { group -> - val fromDirectory = iconPath.resolve(group.resourceDirectoryName) - val toDirectory = resourceDirectory.resolve(group.resourceDirectoryName) - - group.resources.forEach { iconFileName -> - Files.write( - toDirectory.resolve(iconFileName).toPath(), - fromDirectory.resolve(iconFileName).readBytes() - ) - } - } - } - - internal fun ResourceContext.makeDirectoryAndCopyFiles( - resourceGroups: List, - path: String - ) { - val newDirectory = Paths.get("").toAbsolutePath().toString() + "/$path" - this[newDirectory].mkdir() - - val iconPath = File(Paths.get("").toAbsolutePath().toString()).resolve(path) - val resourceDirectory = this["res"] - - resourceGroups.forEach { group -> - this[newDirectory + "/${group.resourceDirectoryName}"].mkdir() - val fromDirectory = iconPath.resolve(group.resourceDirectoryName) - val toDirectory = resourceDirectory.resolve(group.resourceDirectoryName) - - group.resources.forEach { iconFileName -> - Files.write( - fromDirectory.resolve(iconFileName).toPath(), - toDirectory.resolve(iconFileName).readBytes() - ) - } - } - } - - internal fun ResourceContext.customIcon(iconName: String) { - val launchIcon = YOUTUBE_LAUNCHER_ICON_ARRAY - - val splashIcon = arrayOf( - "product_logo_youtube_color_24", - "product_logo_youtube_color_36", - "product_logo_youtube_color_144", - "product_logo_youtube_color_192" - ) - - copyResources( - "youtube", - iconName, - "launchericon", - "mipmap", - launchIcon - ) - - copyResources( - "youtube", - iconName, - "splashicon", - "drawable", - splashIcon - ) - - monochromeIcon( - "youtube", - "adaptive_monochrome_ic_youtube_launcher", - iconName - ) - - this.disableSplashAnimation() - } - - internal fun ResourceContext.customIconMusic(iconName: String) { - val launchIcon = YOUTUBE_MUSIC_LAUNCHER_ICON_ARRAY - - copyResources( - "music", - iconName, - "launchericon", - "mipmap", - launchIcon - ) - - monochromeIcon( - "music", - "ic_app_icons_themed_youtube_music", - iconName - ) - } - - internal fun ResourceContext.customIconMusicAdditional(iconName: String) { - val record = arrayOf( - "hdpi", - "large-hdpi", - "large-mdpi", - "large-xhdpi", - "mdpi", - "xhdpi", - "xlarge-hdpi", - "xlarge-mdpi", - "xxhdpi" - ) - - val actionbarLogo = arrayOf( - "hdpi", - "mdpi", - "xhdpi", - "xxhdpi", - "xxxhdpi" - ) - - val actionbarLogoRelease = arrayOf( - "hdpi" - ) - - copyMusicResources( - iconName, - record, - "record" - ) - - copyMusicResources( - iconName, - actionbarLogo, - "action_bar_logo" - ) - - copyMusicResources( - iconName, - actionbarLogoRelease, - "action_bar_logo_release" - ) - } - - private fun ResourceContext.copyResources( - appName: String, - iconName: String, - iconPath: String, - directory: String, - iconArray: Array - ) { - arrayOf( - "xxxhdpi", - "xxhdpi", - "xhdpi", - "hdpi", - "mdpi" - ).forEach { size -> - iconArray.forEach iconLoop@{ name -> - Files.copy( - ResourceUtils.javaClass.classLoader.getResourceAsStream("$appName/branding/$iconName/$iconPath/$size/$name.png")!!, - this["res"].resolve("$directory-$size").resolve("$name.png").toPath(), - StandardCopyOption.REPLACE_EXISTING - ) - } - } - } - - private fun ResourceContext.monochromeIcon( - appName: String, - monochromeIconName: String, - iconName: String - ) { - try { - val relativePath = "drawable/$monochromeIconName.xml" - Files.copy( - ResourceUtils.javaClass.classLoader.getResourceAsStream("$appName/branding/$iconName/monochromeicon/$relativePath")!!, - this["res"].resolve(relativePath).toPath(), - StandardCopyOption.REPLACE_EXISTING - ) - } catch (_: Exception) { - } - } - - private fun ResourceContext.copyMusicResources( - iconName: String, - iconArray: Array, - resourceNames: String - ) { - iconArray.forEach { path -> - val relativePath = "drawable-$path/$resourceNames.png" - - Files.copy( - ResourceUtils.javaClass.classLoader.getResourceAsStream("music/branding/$iconName/resource/$relativePath")!!, - this["res"].resolve(relativePath).toPath(), - StandardCopyOption.REPLACE_EXISTING - ) - } - } - - private fun ResourceContext.disableSplashAnimation() { - val targetPath = "res/values-v31/styles.xml" - - xmlEditor[targetPath].use { editor -> - val tags = editor.file.getElementsByTagName("item") - List(tags.length) { tags.item(it) as Element } - .filter { - it.getAttribute("name").contains("android:windowSplashScreenAnimatedIcon") - } - .forEach { it.parentNode.removeChild(it) } - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/resources/ResourceUtils.kt b/src/main/kotlin/app/revanced/util/resources/ResourceUtils.kt deleted file mode 100644 index 1839cd13a..000000000 --- a/src/main/kotlin/app/revanced/util/resources/ResourceUtils.kt +++ /dev/null @@ -1,85 +0,0 @@ -package app.revanced.util.resources - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.util.DomFileEditor -import java.nio.file.Files -import java.nio.file.StandardCopyOption - -@Suppress("MemberVisibilityCanBePrivate") -object ResourceUtils { - /** - * Copy resources from the current class loader to the resource directory. - * @param sourceResourceDirectory The source resource directory name. - * @param resources The resources to copy. - */ - fun ResourceContext.copyResources( - sourceResourceDirectory: String, - vararg resources: ResourceGroup - ) { - val classLoader = ResourceUtils.javaClass.classLoader - val targetResourceDirectory = this["res"] - - for (resourceGroup in resources) { - resourceGroup.resources.forEach { resource -> - val resourceFile = "${resourceGroup.resourceDirectoryName}/$resource" - Files.copy( - classLoader.getResourceAsStream("$sourceResourceDirectory/$resourceFile")!!, - targetResourceDirectory.resolve(resourceFile).toPath(), - StandardCopyOption.REPLACE_EXISTING - ) - } - } - } - - /** - * Resource names mapped to their corresponding resource data. - * @param resourceDirectoryName The name of the directory of the resource. - * @param resources A list of resource names. - */ - class ResourceGroup(val resourceDirectoryName: String, vararg val resources: String) - - /** - * Copy resources from the current class loader to the resource directory. - * @param resourceDirectory The directory of the resource. - * @param targetResource The target resource. - * @param elementTag The element to copy. - */ - fun ResourceContext.copyXmlNode( - resourceDirectory: String, - targetResource: String, - elementTag: String - ) { - val stringsResourceInputStream = - ResourceUtils.javaClass.classLoader.getResourceAsStream("$resourceDirectory/$targetResource")!! - - // Copy nodes from the resources node to the real resource node - elementTag.copyXmlNode( - this.xmlEditor[stringsResourceInputStream], - this.xmlEditor["res/$targetResource"] - ).close() - } - - /** - * Copies the specified node of the source [DomFileEditor] to the target [DomFileEditor]. - * @param source the source [DomFileEditor]. - * @param target the target [DomFileEditor]- - * @return AutoCloseable that closes the target [DomFileEditor]s. - */ - fun String.copyXmlNode(source: DomFileEditor, target: DomFileEditor): AutoCloseable { - val hostNodes = source.file.getElementsByTagName(this).item(0).childNodes - - val destinationResourceFile = target.file - val destinationNode = destinationResourceFile.getElementsByTagName(this).item(0) - - for (index in 0 until hostNodes.length) { - val node = hostNodes.item(index).cloneNode(true) - destinationResourceFile.adoptNode(node) - destinationNode.appendChild(node) - } - - return AutoCloseable { - source.close() - target.close() - } - } -} \ No newline at end of file diff --git a/src/main/resources/music/branding/mmt/launchericon/hdpi/adaptiveproduct_youtube_music_background_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-hdpi/adaptiveproduct_youtube_music_background_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/hdpi/adaptiveproduct_youtube_music_background_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-hdpi/adaptiveproduct_youtube_music_background_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/hdpi/adaptiveproduct_youtube_music_foreground_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-hdpi/adaptiveproduct_youtube_music_foreground_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/hdpi/adaptiveproduct_youtube_music_foreground_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-hdpi/adaptiveproduct_youtube_music_foreground_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/hdpi/ic_launcher_release.png b/src/main/resources/music/branding/mmt/launcher/mipmap-hdpi/ic_launcher_release.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/hdpi/ic_launcher_release.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-hdpi/ic_launcher_release.png diff --git a/src/main/resources/music/branding/mmt/launchericon/mdpi/adaptiveproduct_youtube_music_background_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-mdpi/adaptiveproduct_youtube_music_background_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/mdpi/adaptiveproduct_youtube_music_background_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-mdpi/adaptiveproduct_youtube_music_background_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/mdpi/adaptiveproduct_youtube_music_foreground_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-mdpi/adaptiveproduct_youtube_music_foreground_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/mdpi/adaptiveproduct_youtube_music_foreground_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-mdpi/adaptiveproduct_youtube_music_foreground_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/mdpi/ic_launcher_release.png b/src/main/resources/music/branding/mmt/launcher/mipmap-mdpi/ic_launcher_release.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/mdpi/ic_launcher_release.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-mdpi/ic_launcher_release.png diff --git a/src/main/resources/music/branding/mmt/launchericon/xhdpi/adaptiveproduct_youtube_music_background_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-xhdpi/adaptiveproduct_youtube_music_background_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/xhdpi/adaptiveproduct_youtube_music_background_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-xhdpi/adaptiveproduct_youtube_music_background_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/xhdpi/adaptiveproduct_youtube_music_foreground_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-xhdpi/adaptiveproduct_youtube_music_foreground_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/xhdpi/adaptiveproduct_youtube_music_foreground_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-xhdpi/adaptiveproduct_youtube_music_foreground_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/xhdpi/ic_launcher_release.png b/src/main/resources/music/branding/mmt/launcher/mipmap-xhdpi/ic_launcher_release.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/xhdpi/ic_launcher_release.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-xhdpi/ic_launcher_release.png diff --git a/src/main/resources/music/branding/mmt/launchericon/xxhdpi/adaptiveproduct_youtube_music_background_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-xxhdpi/adaptiveproduct_youtube_music_background_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/xxhdpi/adaptiveproduct_youtube_music_background_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-xxhdpi/adaptiveproduct_youtube_music_background_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/xxhdpi/adaptiveproduct_youtube_music_foreground_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-xxhdpi/adaptiveproduct_youtube_music_foreground_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/xxhdpi/adaptiveproduct_youtube_music_foreground_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-xxhdpi/adaptiveproduct_youtube_music_foreground_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/xxhdpi/ic_launcher_release.png b/src/main/resources/music/branding/mmt/launcher/mipmap-xxhdpi/ic_launcher_release.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/xxhdpi/ic_launcher_release.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-xxhdpi/ic_launcher_release.png diff --git a/src/main/resources/music/branding/mmt/launchericon/xxxhdpi/adaptiveproduct_youtube_music_background_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-xxxhdpi/adaptiveproduct_youtube_music_background_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/xxxhdpi/adaptiveproduct_youtube_music_background_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-xxxhdpi/adaptiveproduct_youtube_music_background_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/xxxhdpi/adaptiveproduct_youtube_music_foreground_color_108.png b/src/main/resources/music/branding/mmt/launcher/mipmap-xxxhdpi/adaptiveproduct_youtube_music_foreground_color_108.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/xxxhdpi/adaptiveproduct_youtube_music_foreground_color_108.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-xxxhdpi/adaptiveproduct_youtube_music_foreground_color_108.png diff --git a/src/main/resources/music/branding/mmt/launchericon/xxxhdpi/ic_launcher_release.png b/src/main/resources/music/branding/mmt/launcher/mipmap-xxxhdpi/ic_launcher_release.png similarity index 100% rename from src/main/resources/music/branding/mmt/launchericon/xxxhdpi/ic_launcher_release.png rename to src/main/resources/music/branding/mmt/launcher/mipmap-xxxhdpi/ic_launcher_release.png diff --git a/src/main/resources/music/branding/mmt/monochromeicon/drawable/ic_app_icons_themed_youtube_music.xml b/src/main/resources/music/branding/mmt/monochrome/drawable/ic_app_icons_themed_youtube_music.xml similarity index 100% rename from src/main/resources/music/branding/mmt/monochromeicon/drawable/ic_app_icons_themed_youtube_music.xml rename to src/main/resources/music/branding/mmt/monochrome/drawable/ic_app_icons_themed_youtube_music.xml diff --git a/src/main/resources/music/branding/mmt/resource/drawable-hdpi/action_bar_logo.png b/src/main/resources/music/branding/mmt/resource/drawable-hdpi/action_bar_logo.png deleted file mode 100644 index c7b06e5a29b0375faca6e54ea38ba5a1395d8372..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6044 zcmV;N7h~v&P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC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C~8C zf6U6vgLRZLQfoG%Ywj_pAc0e@iE8?kojyC%d{y9<-s2sstEht=_=EIrfYa15GYPg;rl);%Epg5@(Mu5p+GkYjCsSkj0G zU%@LSZAB!)2E97;C^LMxg*z+70_LbYU`flmTXAv}E)Be{n%3B3wn6(6Kc{TWm%xJY zkkwok$;3R$Z(dSW1o*f0VliHaAWiMS6FtZo(?U%c^}eL5v6wPTTlJQT#bQ>-vh>&(RAETzDsvq15X8Q ir{SdjUl{q{y#vrgn{y)FZ{q)r6F^l_O93fo75YE><{H2N diff --git a/src/main/resources/music/branding/mmt/resource/drawable-hdpi/record.png b/src/main/resources/music/branding/mmt/resource/drawable-hdpi/record.png deleted file mode 100644 index 68e2e652f651eb544dd42aa368262c0bb1f34b07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5639 zcmbtY2{@GR+MgK)*}_rP?YoP-@oge?>gUiuJ4?=u6N#dp6B=6%kRFQ`?=pq^YU<#lU^ka zfk5P3ob9)O_Y2FHlmz&Fq$3m!-d1p({do|G3}X3$LeAx?Lm+T9hOZyr&)tnk;jl1d zDkp@7iDhv?Gz7BAI+jbOM9}!i5LzgMO+roHx{X3Is3g>OGk2^z*Nzs(aE_0n`NVtp zQsN^h1S-nf3b`qk2nt})_+(@(i^=8@V@ar=a*5#c@~{yK`4hsAAfarR6(arIy^waC zC>qingGE!YSaYNW0YfE+kSQS{hDc+qG0q5UYJ@XIW3faN0@2hI`RjuM)kRV1#4YxY zzm$Q$NT@JApG!0{iiwHA#F$_>QK3dS0)b$JH8wIfMuP}6FOJP8$D-Lhoxdd5(|D99 z2A9v^u#w9W$swF*J_!Yy`lk;p?r*Vd-Y=d&#*AXgTq7I?yX@0XAeHhP$Bm9+{!~t- z7}1zC7LCp4fmqycEH{k9=kUTf|BL9~)BmIZ?-|7a_aK@1AIn+ZnajCDbY}3t zsK));IzF_>Ur$U1@@Kjb$&}@7KtfTL<4>caehoAJV+Q^d8xuwYh5jFT@h6POq4Q(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jH|HiQ{Qz3aiGc3nNw)2ci=+?T}G zE>;%Vh-d%@HL`@dZ(Wk(dA*mKa6nAd5574*cSL+>CyG2;ROeLn(xok0YLX#Z542re zeFTmYsXn4Ni5=e$++Tc|+EzZq6{%C*BC{^~Zqw;HHzVlJ!*`BAG9`P&@sO|Z``wD8 z^6xh6yPJQqKipSA-YJ!5l|f3)@RX#(r?8!Ufv`;Q2EjO>#iT7up^vi9;1pt#vx2beCgS_E1mp+YwH zQCdMvz-NPZo3}zU!LEb>Oaprk9e))-b$Xd$^Dbe+9o_!CGm?q4IdV_jA>c&#*yd6Q t+OZN=qkd2NX^66c%@ObaVqka)>T)Ww&c>^G`7d9Hi-U)K`R3r1zXNZFnh5{^ diff --git a/src/main/resources/music/branding/mmt/resource/drawable-large-hdpi/record.png b/src/main/resources/music/branding/mmt/resource/drawable-large-hdpi/record.png deleted file mode 100644 index ce08eebe4212433929c4110018334edea706fea1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8017 zcmcI}2UJsQvuJ3c2GA%VHFTBULkWU_G(ka%AVNY2og_d)3rG@4kZ-PyW=VAzi<8T{p;PeZq`cn&i>|`KJ(4Y&OGgC4dD~#1A#yg zTN_Jf;JV8C@_>O~@z+kgz=aoY;}Ho0@k3c(Hc(-)7zo5A8su`8aMt0Z5gHe!j`G9# zV$@^8@BlOjWO6J9k3xrF2ryqvKoAxox7_hW4i@BxkaO2_&~(6CU;=||;vz6-;v8Mj zaUp0!Ke=P3Fq0S~06`drfP%$@g<>O(Vi0n_@EQU4tj8L1uwNjA5QLmLiy-W*!)cfW zE&>D7SJzZSYijDl3=Gx%P`)U%udgahTT@$0LsM5nOIJ-((@4kANLLs3*GCQ@7vbk` zng{kJeGgMFePQ85$aDXliR{YpVeeYLT&60xCug8!7)c z21`sNIwA;92*P1uEQ}~$9Fc&K16ci2hA{j;Xt9xh=?T!7MhptCp{1_LlIa(qANn6S zJTW5l7jZwd1|}2}hQSgd0a&enVDW)C0xm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DNSkd}^%vewdi(NUS=~rgO(m zb-Fxzuo_BH%A4dCCu;oQ6O-zz^W<)H!Bx(g%*T6I1vuzYhN_>pb1E{mA+@u%SC7`# z5{>YoZI9xjFP4eHpuFs-KGeRMF$nne>Op~~isfHKOWKGmhn3QKT4qhJJVM$}|bMQay z_nD=_+;FL8d68|nW0rNK4dj_{&3Kc8!kk6yeeC~UvHgDbSMENgc`g@dhVaaV&l~o0 zn7LLXI=v>`u^Y#hg(i)yhWq5o+-}k7tcEvG1wa?{Q$-ak1hxIF-<=Q>S zF?h25irpy;ojzgxR_)=@w{FS?=8MfM-bhzDN|L5^wQMGnXJ4L=d8lXevaVXfJz$J% z?8huFLOZ&N`N0Mq3P+gcyPJ6S%a^+SoX zbHrepO-NHy&!axqbX}SluM;&~y)-QmZdLeI3;FUP? zj74UsK^v~6eLOwIqy88-JRGx8CZ9QDq-UlqL`hEPcIAIZ`xr%GBa+uzpShMQ%kp0%N2>Q#`FKV0fZE0 gm*kbk%L0Z6VrQI diff --git a/src/main/resources/music/branding/mmt/resource/drawable-mdpi/record.png b/src/main/resources/music/branding/mmt/resource/drawable-mdpi/record.png deleted file mode 100644 index 59ddfc26b9816b6393eb69c81b161e71ba412c26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4135 zcmbVP2UJtpx(>Z4B1I4ohyf7^sf3acL`p&;MJIsLB_u}(kU|owf&oEMY$z5K5GS*34b=-n@6S*2&pt|KI-0_m_3fzRf-!8tR7X z5C}wrN^z%w_n5^?RT=!}HSAmp-qd)MKmi1@L}&4mgPbl{34ti-v-|>t0p4B&2A7Sb zGr17}GKtLt(GUpHIf+MS!~jBQ1Q5yMIKf`rY=A*oOefe@TW_>C&kcxTQBwGTZ;Fo} zBPE7`XTqG4wIWGSofy`fID3X zIKjZIVG$TK0%PZg!4NR^1Y0~DZAU<(zd*gYOxE_~zk^~I6Z{t_STjtzkp7QgCWEk@ z%V*QUfLUyMB!J>^B4N<)G!opnv0OfA81&B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QWnS1SR*5x|y&-HuV#YLwjTa?e0&*|}&)AGuzSKU@= zY)IE=`~&Lg8h5USqvp&vEM9T@54^_F|KmI0oavd2JuBez2+`uFJeB0*Ug;X1@o!Ny B$yERV diff --git a/src/main/resources/music/branding/mmt/resource/drawable-xhdpi/action_bar_logo.png b/src/main/resources/music/branding/mmt/resource/drawable-xhdpi/action_bar_logo.png deleted file mode 100644 index 02a48437998e1c033292b24ba4a1f728e121f7f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4968 zcmbVQ3pmq#-=9-Nk`$se3nhnb#@G;LPUXxTqB7fP%r@IFXDV_?$f3!xa;P~)rIJ`A z$EcoXN~o1n2WL6t_)K?q*Zn@%{l3rjKD(~}{=fhK_xXK4-^1to-E}R&&c<9^R8ABC z0Ek;!pd5JjLf!=t*~0tIx*b5`-L_IJ+-LxRnAGOQ2e_6i3jheo5S(1;uGUsaEZJWZ zgCl$4H5vXC9vT2JFk(1{R}}zHwl5R)^

zG8GSmYeF=z5C|Noi_pYjyf9cVFLj_6L<D z`$fikG6bEa(~xruu-P2m}HQ(E@8}Y48vlv=9;15hj^8aG`_xArF;N{lZ`Zvel`r_~Zn}S9+4dR9IDyHhA5d#Dj^G{gcTkwtze9PN!C~l_ z{|Lrmk=|sgKZX}D!5`y;2UAEsAmHybB2CCdGL=Wn^A7gc_m(Cmc2u%AfympSIhY>< zTAG@`p$Ir!LrW9-(_L$8q$P<)$B?jiOOzpqmmEz30f*G~^2U4VK;Rk>T|86+kI>fA zz-Zy{8oC%=Jv<%?M__O~qMsE*qR805O$q#Y9{2w|Z%ZZcdJseWukCDh=B9R#76clv zsv*Bx#}Oa!Yegggf64`k!EUyJAqcx!e>@KK>owuO&cGjLgU{l5M*k08`~jnpz3IUi zD*mVsFI)dncVM3L;LV2pBM$Jthxl{vFU|cYoHsExm%nEf@8S2f!;^R;j>?;5kW(pU zym`84i8|`U$eqZGqC0W&*hU}Pt1N-WJB@Qgk(C&Gb*!ZO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{9F(B)ES|MhoTR4xzt^n&FLZ^sPsHSwy~5}8KIQ(cXJhGTQD)|Q`Tqdf CpzB`% diff --git a/src/main/resources/music/branding/mmt/resource/drawable-xlarge-hdpi/record.png b/src/main/resources/music/branding/mmt/resource/drawable-xlarge-hdpi/record.png deleted file mode 100644 index 5297964bd1d273e65e558378c41586d2482fb9ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10433 zcmdUVc{tSl-|vjUWN#%~CX|Gku``y*9U?^``tN3 z)*jKm9@;o*tUf|F5(60cdxp9rBK`dWLNJkf(!cm(!0+sjQPPNCB%!`~(gy4c5q2j} zA&wG)JrNp6w2}uJt%1TezV1OH(g5b~FufW=Ue?tv&}B$}<$FG8Hh zKXid%!G6Ck$9bSU{XG3W142Upt@1y#fj)##LWmFHf5ZBp$N%X9VB3=?|GDGe%Hr?; z&lMq|M&Uq>zYOwksY9%z0zFZdo*{&=U=L5Da3H1(Tbn@4(O^&aP(rXZf#CPIr%wGX zGD1ZKsfIXYix0pNB0}W<<$$N5d#IR*pPL>%dMcRUh4%vwLM)H{fiN{Xs-di{p`oOLRQ@II$&(nFrht7$2FDJ!X>Rn?Td)YZ^RS}H2)O73cBRW+2)dT67SJ^ns#Nbm?_hrr+G zasQX+ErRhN2i^Vt$9&kC$&MY22|fgPHR`X_vGNT1>o-3<;#as}+&$Q7peOCY_P-}i z`mc}i|6>dMW*gz-37GyL;^H@12*E2f!adm2z#CZWzl}Q-5FW)&*x!1f{;P_=p8ZR5 z|4j}m2K(24Y8Ck7pK9kB07_gisAXqT`Wqk+nNy~Q2G)^Y1bqtL(Px>{ zeOoleb8v8ZbET@hBFr|zwy1JhJFIwZal9_&bETC<*7resq8Y95s9~v3pB;Srj=MKj zcV+%zxt?sY{|?KrG{c%GZE12CyF*?!n{sJ)R=n?+8hfK&!gAR_zPyW}VR+A`r4?=Jr6HLsdF79NNUKPu@xrpIkmrH@`JZlwi8jvW~ZY4ZVKT z$Z2m4uOF}9w(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zfU|g9Bt1&XoN8PU~(UiGtyNzQu+Da+7|K>KlR4)mZjGQ5O}A za*L5HM@;@|_Mw3K0960X^kGbO&)q;cF}JwS$E(fdzM)Xkx(nKc?v>ZYb0ZW>krB_#x|1HJT`4BhoiqLTF$=){aIj@X{>%Z)iCJ(qh8Xk9RC z9>EGP@_fq!ezSSl%Gu$?mUEg!Lt@qf^?Eb<+RP;%`uL{3OG3yQq`gtfK#j}%zC*(# zjscJn$Lna^o}ng7$@MqNAf(?_b8SY-M?;CQ$@h{^pXpQAi`5LvcT;EjVjm+#mzAIQ zP5L<}G_)C)n6wHY#6b4V!RV0^XRsqB1;`mEfew+=`JIq!b#g%y+fJ8Tg6Wg~S|5~w zrq4;@zDfSyLk9|G#+X{nOjVnl;L?7fAd~#tdFWC$-&&AyPCnDzL7Luw#gAMS$2$iF zp8@*;{VgFwrUIpyBBN^Ka&f)@A8#6YWKzui-l68rA0#2{DYJAsRK-q?uHEFL6c6E94&ok+n zJB2`1b1>CtMT)WRb15a!PHtV0BL{?3l)k*mD>zwkA@g$T>mN_jq$pc(*@6!Ko$k-x zXU!|^3qe5nphR=Jas_#FU6m+LOln_MZW&y1XqkgWh>_oj3@m_Bn|CwQAUkwMlv>RDt+4myGQeHAwx4iPiHYx)BC^g_muz)HE_11=| z1?bgs6ZDk`VI7o0x$2|<1uvts+Mu0A{34R4i#*+cR*&wU<)Khb+*H$Rng`+#i#}R* z3z4zsO*TqUX%^4gDoQ-A`M=k!{V#Ndw@*dql)lDi_dMnPt!HI!Z&qsJbLIa4D+%o5 diff --git a/src/main/resources/music/branding/mmt/resource/drawable-xxhdpi/action_bar_logo.png b/src/main/resources/music/branding/mmt/resource/drawable-xxhdpi/action_bar_logo.png deleted file mode 100644 index 167b7d83d78762816dbe30f18b15266fc1e85e17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6995 zcmbVR2{=^mzqbq7_p&u4$}*OQ8HUQfCT1)tVGJg-F=OAAqOtF?geXR>5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ources/music/branding/mmt/resource/drawable-xxhdpi/record.png b/src/main/resources/music/branding/mmt/resource/drawable-xxhdpi/record.png deleted file mode 100644 index fffb40d2e89b00ff2335a4da6605f9441f3a1ff8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10433 zcmdUVc{tSl-|vjUWN#%~CX|F3`!bfv9U?^``Q#1Ommdf3|UhPn64htH6IeL8cA_2!wAJ`v(fSUbq(m;S#~w*oWGmJc0Ja2OvGL z__JQf$bcX~4T0!kB7;0U{k%dEXT5xIf%?+R?OoCc99Cc2PUEEV$)KZNzBtq95HIU! z3mea9KTjR3G{yj-7l{T80=z;!5Rn1?fdq7aIrGvzJob~WLdsY#ls;sJlQdUQ)s4FQeqt$fK>gtHU{z-%D zLa^RwDSegc=eb;)7Dr(a}LEtD;m@l>mhjAu2G`BT^}l zAoDi|BQJty2reiThYv)sIeMJMhlT1(15tnL5D@ea+d#r!b^;bdMS29GRFKMSoqiEw zJ^!H#3JdZ7bvf1(<>l`c;1w830JJLq&<6S9L-7P({QrjaKac;@1;Dl^PyTbqzm+8* z;GZi9p~m4rjlT@?Z>b43Q9)iPD=z{*EX32xI2?#6!`3DUeKf?&BNQKEgU9>-?Wt3L zi;PfJMXDnX+2I1Q_y~ghzZ~!~@(A_Pmj+%_RZ>w_QqinekCg6&+1YB~_%#FL6(vM4JT?LOlXKz08dC zrGasfI2;zOqNb|iq3)rql~;t>Mc5TpF6)F9uPu((rF^cmw#@oI=s+~56&^Jz_3g8VZ{KnE z#_F!jKdjc1P50kn8I@+(5T&h54`X)7%Vtw9?au1AG~zX*%Sk7d{y#@H8XFhCErF_f z(ezl0vZI9kos~wtQ`|XAYmMsl+Vu$K+Lfk9aGe(^ees=R%t}}tM;&xb%uVA4?+LDQ zZZlT&kF8W$fgv4^1&Qa;>u3DFC6U+35r^rcx*s0x5)~CO@g$ugX^=F?eFFW4A@tuY9w~=p_gc_RQQKsB^4JhlWF&xDCi#N#c{s2kPdxhKUkPH(J*5)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P(E4_@R{ AumAu6 diff --git a/src/main/resources/music/branding/mmt/resource/drawable-xxxhdpi/action_bar_logo.png b/src/main/resources/music/branding/mmt/resource/drawable-xxxhdpi/action_bar_logo.png deleted file mode 100644 index f20b6aa15e5b6d4f54384e6cac45e7500b52f87e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8840 zcmbVy2RPep+jm0E7L8pLcN8^a@7=VxjaErx6T~JFdz7GvwpOW8N?U5g-qZ@MJxi^k zR@Gy#TD9J|*YP~x@qXWXd~c2;$(8^Acb)q>|JQY%iGHB3Nkh#>4FCXWw6&lQ0RW&H zacoUVPW*J$DZEYmqC#t#cme=d87|*Iz^e>a0Dz3e$;jBtSWj2M7Ud?2utV7(Mg82+ zL^J@Pr0R!8*t#ISxNVRQPVUO!t%epbx09VR7%r_RriZ?Rbac`Rz#t6+^o?u-Tx{j- zz^W?TN`4AN0&Ykz1h=1?tGlOypECFlx(dYcU#1tgu6{MuN|9XLm>@arr3J;<8 z{$fV_r3`lT@Ailo7qP~)%D2xL{TwY!tA|?TmkPsmvL_Gc7y%2sP?w&k0r-_*-Od2?

)i~ zlbwPLLJVn(kU@yZOWVtd$RnhrMC9!4#YGTyNC`VxgtUY-QugopP?W9rWeEH|-|qi& z{(X!SaSb9||JQUbSLS8xC}=r(620pG*U~XWdi*tVb>jXbToe$tm&-sIYrqjr=k;Ui+sSjlLv=$e4LEiOieZ^MA=DG{D3qATC7a55&)wV7s#Gz(pdL0K2ITC+bnOmccVQNRCM;BO{I-dxuCbnm{g zBrvITO_Fns*FJ*&IN|1hM~M%(B^I?H{-K4OFIp>byHJqEiiv2)X)3>r%)sv=9a0>3 zCzua3jQ0KKTvTu$?m=^pxE4#_RE4+T}RI#|_qhHfAN@=23+*X#}6-m`%RAGIeA4+g;Vo!uTh+ev?M z>AzFKZ4!Ntux|sk*t~`4@9||U3k=OdYSwU$DFf&}x@hSLM3`3>zD21dqy|4$j+rUF zbAP#zFdKlQ=P1V8K2DxY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