diff --git a/src/main/kotlin/app/revanced/patches/music/ads/video/patch/MusicVideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/music/ads/video/patch/VideoAdsPatch.kt similarity index 77% rename from src/main/kotlin/app/revanced/patches/music/ads/video/patch/MusicVideoAdsPatch.kt rename to src/main/kotlin/app/revanced/patches/music/ads/video/patch/VideoAdsPatch.kt index 068a48549..598454bbe 100644 --- a/src/main/kotlin/app/revanced/patches/music/ads/video/patch/MusicVideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/ads/video/patch/VideoAdsPatch.kt @@ -9,8 +9,8 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.litho.patch.LithoFilterPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.shared.patch.videoads.AbstractVideoAdsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH @@ -20,19 +20,19 @@ import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH @Description("Removes ads in the music player.") @DependsOn( [ - MusicLithoFilterPatch::class, - MusicSettingsPatch::class + LithoFilterPatch::class, + SettingsPatch::class ] ) @MusicCompatibility @Version("0.0.1") -class MusicVideoAdsPatch : AbstractVideoAdsPatch( +class VideoAdsPatch : AbstractVideoAdsPatch( "$MUSIC_ADS_PATH/HideMusicAdsPatch;->hideMusicAds()Z" ) { override fun execute(context: BytecodeContext): PatchResult { super.execute(context) - MusicSettingsPatch.addMusicPreference(CategoryType.ADS, "revanced_hide_music_ads", "true") + SettingsPatch.addMusicPreference(CategoryType.ADS, "revanced_hide_music_ads", "true") return PatchResultSuccess() } diff --git a/src/main/kotlin/app/revanced/patches/music/layout/autocaptions/patch/DisableAutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/autocaptions/patch/DisableAutoCaptionsPatch.kt index 756ce0276..b0832e777 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/autocaptions/patch/DisableAutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/autocaptions/patch/DisableAutoCaptionsPatch.kt @@ -13,7 +13,7 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.shared.fingerprints.captions.SubtitleTrackFingerprint import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Patch @Name("disable-auto-captions") @Description("Disable forced captions from automatically enabling in video player.") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class DisableAutoCaptionsPatch : BytecodePatch( @@ -44,7 +44,7 @@ class DisableAutoCaptionsPatch : BytecodePatch( } } ?: return SubtitleTrackFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_disable_auto_captions", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/blacknavbar/patch/BlackNavbarPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/blacknavbar/patch/BlackNavbarPatch.kt index 9e87e10c9..d58decd24 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/blacknavbar/patch/BlackNavbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/blacknavbar/patch/BlackNavbarPatch.kt @@ -15,7 +15,7 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.blacknavbar.fingerprints.TabLayoutFingerprint import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @@ -25,7 +25,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Description("Sets the navigation bar color to black.") @DependsOn( [ - MusicSettingsPatch::class, + SettingsPatch::class, SharedResourceIdPatch::class ] ) @@ -50,7 +50,7 @@ class BlackNavbarPatch : BytecodePatch( } } ?: return TabLayoutFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_black_navbar", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingMusicIconMMTPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingIconMMTPatch.kt similarity index 91% rename from src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingMusicIconMMTPatch.kt rename to src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingIconMMTPatch.kt index dfa3ea653..56a75f8c7 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingMusicIconMMTPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingIconMMTPatch.kt @@ -13,11 +13,11 @@ import app.revanced.util.resources.IconHelper.customIconMusic import app.revanced.util.resources.IconHelper.customIconMusicAdditional @Patch(false) -@Name("custom-branding-music-mmt") +@Name("custom-branding-icon-mmt") @Description("Changes the YouTube Music launcher icon to MMT.") @MusicCompatibility @Version("0.0.1") -class CustomBrandingMusicIconMMTPatch : ResourcePatch { +class CustomBrandingIconMMTPatch : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { context.customIconMusic("mmt") diff --git a/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingMusicIconRevancifyBluePatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingIconRevancifyBluePatch.kt similarity index 88% rename from src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingMusicIconRevancifyBluePatch.kt rename to src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingIconRevancifyBluePatch.kt index f6941f1b2..abface5a9 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingMusicIconRevancifyBluePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingIconRevancifyBluePatch.kt @@ -12,11 +12,11 @@ import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.util.resources.IconHelper.customIconMusic @Patch -@Name("custom-branding-music-revancify-blue") +@Name("custom-branding-icon-revancify-blue") @Description("Changes the YouTube Music launcher icon to Revancify Blue.") @MusicCompatibility @Version("0.0.1") -class CustomBrandingMusicIconRevancifyBluePatch : ResourcePatch { +class CustomBrandingIconRevancifyBluePatch : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { context.customIconMusic("revancify-blue") diff --git a/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingMusicIconRevancifyRedPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingIconRevancifyRedPatch.kt similarity index 88% rename from src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingMusicIconRevancifyRedPatch.kt rename to src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingIconRevancifyRedPatch.kt index f83d827fe..4e90f0c49 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingMusicIconRevancifyRedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/patch/CustomBrandingIconRevancifyRedPatch.kt @@ -12,11 +12,11 @@ import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.util.resources.IconHelper.customIconMusic @Patch(false) -@Name("custom-branding-music-revancify-red") +@Name("custom-branding-icon-revancify-red") @Description("Changes the YouTube Music launcher icon to Revancify Red.") @MusicCompatibility @Version("0.0.1") -class CustomBrandingMusicIconRevancifyRedPatch : ResourcePatch { +class CustomBrandingIconRevancifyRedPatch : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { context.customIconMusic("revancify-red") diff --git a/src/main/kotlin/app/revanced/patches/music/layout/branding/name/patch/CustomBrandingMusicNamePatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/branding/name/patch/CustomBrandingNamePatch.kt similarity index 98% rename from src/main/kotlin/app/revanced/patches/music/layout/branding/name/patch/CustomBrandingMusicNamePatch.kt rename to src/main/kotlin/app/revanced/patches/music/layout/branding/name/patch/CustomBrandingNamePatch.kt index 889e21c33..0d99cb65b 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/branding/name/patch/CustomBrandingMusicNamePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/branding/name/patch/CustomBrandingNamePatch.kt @@ -19,7 +19,7 @@ import org.w3c.dom.Element @Description("Changes the Music launcher name to your choice (defaults to YTM Extended, ReVanced Music Extended).") @MusicCompatibility @Version("0.0.1") -class CustomBrandingMusicNamePatch : ResourcePatch { +class CustomBrandingNamePatch : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { // App name diff --git a/src/main/kotlin/app/revanced/patches/music/layout/buttonshelf/patch/HideButtonShelfPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/buttonshelf/patch/HideButtonShelfPatch.kt index c9b54270e..1f482b78c 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/buttonshelf/patch/HideButtonShelfPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/buttonshelf/patch/HideButtonShelfPatch.kt @@ -10,8 +10,8 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.litho.patch.LithoFilterPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType @Patch @@ -19,8 +19,8 @@ import app.revanced.util.enum.CategoryType @Description("Hides the button shelf from homepage and explorer.") @DependsOn( [ - MusicLithoFilterPatch::class, - MusicSettingsPatch::class + LithoFilterPatch::class, + SettingsPatch::class ] ) @MusicCompatibility @@ -28,7 +28,7 @@ import app.revanced.util.enum.CategoryType class HideButtonShelfPatch : BytecodePatch() { override fun execute(context: BytecodeContext): PatchResult { - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_hide_button_shelf", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/carouselshelf/patch/HideCarouselShelfPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/carouselshelf/patch/HideCarouselShelfPatch.kt index 1771169ab..b88b2fec3 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/carouselshelf/patch/HideCarouselShelfPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/carouselshelf/patch/HideCarouselShelfPatch.kt @@ -10,8 +10,8 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.litho.patch.LithoFilterPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType @Patch @@ -19,8 +19,8 @@ import app.revanced.util.enum.CategoryType @Description("Hides the carousel shelf from homepage and explorer.") @DependsOn( [ - MusicLithoFilterPatch::class, - MusicSettingsPatch::class + LithoFilterPatch::class, + SettingsPatch::class ] ) @MusicCompatibility @@ -28,7 +28,7 @@ import app.revanced.util.enum.CategoryType class HideCarouselShelfPatch : BytecodePatch() { override fun execute(context: BytecodeContext): PatchResult { - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_hide_carousel_shelf", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/castbutton/patch/HideCastButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/castbutton/patch/HideCastButtonPatch.kt index 28db0c80c..fc93c08c7 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/castbutton/patch/HideCastButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/castbutton/patch/HideCastButtonPatch.kt @@ -15,14 +15,14 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.castbutton.fingerprints.HideCastButtonFingerprint import app.revanced.patches.music.layout.castbutton.fingerprints.HideCastButtonParentFingerprint -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @Patch -@Name("hide-music-cast-button") +@Name("hide-cast-button") @Description("Hides the cast button in the video player and header.") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class HideCastButtonPatch : BytecodePatch( @@ -44,7 +44,7 @@ class HideCastButtonPatch : BytecodePatch( ) ?: return HideCastButtonFingerprint.toErrorResult() } ?: return HideCastButtonParentFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_hide_cast_button", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/categorybar/patch/CategoryBarPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/categorybar/patch/CategoryBarPatch.kt index cc8ba612e..90ec99d7b 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/categorybar/patch/CategoryBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/categorybar/patch/CategoryBarPatch.kt @@ -15,7 +15,7 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.categorybar.fingerprints.ChipCloudFingerprint import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @@ -25,8 +25,8 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Description("Hides the music category bar at the top of the homepage.") @DependsOn( [ - SharedResourceIdPatch::class, - MusicSettingsPatch::class + SettingsPatch::class, + SharedResourceIdPatch::class ] ) @MusicCompatibility @@ -47,7 +47,7 @@ class CategoryBarPatch : BytecodePatch( } } ?: return ChipCloudFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_hide_category_bar", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/colormatchplayer/patch/ColorMatchPlayerPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/colormatchplayer/patch/ColorMatchPlayerPatch.kt index fa371d37e..759201233 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/colormatchplayer/patch/ColorMatchPlayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/colormatchplayer/patch/ColorMatchPlayerPatch.kt @@ -18,7 +18,7 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.colormatchplayer.fingerprints.ColorMatchPlayerFingerprint -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.music.utils.fingerprints.ColorMatchPlayerParentFingerprint import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @@ -28,7 +28,7 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction @Patch @Name("enable-color-match-player") @Description("Matches the fullscreen player color with the minimized one.") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class ColorMatchPlayerPatch : BytecodePatch( @@ -77,7 +77,7 @@ class ColorMatchPlayerPatch : BytecodePatch( } ?: return ColorMatchPlayerFingerprint.toErrorResult() } ?: return ColorMatchPlayerParentFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_color_match_player", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/compactdialog/patch/CompactDialogPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/compactdialog/patch/CompactDialogPatch.kt index 426204ac1..d77b239f8 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/compactdialog/patch/CompactDialogPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/compactdialog/patch/CompactDialogPatch.kt @@ -16,7 +16,7 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.compactdialog.fingerprints.DialogSolidFingerprint import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @@ -26,7 +26,7 @@ import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @Description("Enable compact dialog on phone.") @DependsOn( [ - MusicSettingsPatch::class, + SettingsPatch::class, SharedResourceIdPatch::class ] ) @@ -52,7 +52,7 @@ class CompactDialogPatch : BytecodePatch( } } ?: return DialogSolidFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_compact_dialog", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/patch/DismissQueuePatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/patch/DismissQueuePatch.kt index 49bd7501e..276dc183c 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/patch/DismissQueuePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/patch/DismissQueuePatch.kt @@ -14,7 +14,7 @@ import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.dismissqueue.fingerprints.DismissQueueFingerprint -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Patch @Name("enable-dismiss-queue") @Description("Add dismiss queue to flyout menu. (YT Music v6.04.51+)") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class DismissQueuePatch : BytecodePatch( @@ -44,7 +44,7 @@ class DismissQueuePatch : BytecodePatch( } } ?: return DismissQueueFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_dismiss_queue", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/floatingbutton/patch/NewPlaylistButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/floatingbutton/patch/NewPlaylistButtonPatch.kt index 13e09c212..f88a0cbd3 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/floatingbutton/patch/NewPlaylistButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/floatingbutton/patch/NewPlaylistButtonPatch.kt @@ -18,7 +18,7 @@ import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.floatingbutton.fingerprints.FloatingButtonFingerprint import app.revanced.patches.music.layout.floatingbutton.fingerprints.FloatingButtonParentFingerprint import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @@ -27,7 +27,7 @@ import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @Description("Hide the New Playlist button in the Library tab.") @DependsOn( [ - MusicSettingsPatch::class, + SettingsPatch::class, SharedResourceIdPatch::class ] ) @@ -58,7 +58,7 @@ class NewPlaylistButtonPatch : BytecodePatch( } ?: return FloatingButtonFingerprint.toErrorResult() } ?: return FloatingButtonParentFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_hide_new_playlist_button", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/landscapemode/patch/LandScapeModePatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/landscapemode/patch/LandScapeModePatch.kt index a73d90c88..4d1a2a71f 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/landscapemode/patch/LandScapeModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/landscapemode/patch/LandScapeModePatch.kt @@ -14,7 +14,7 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.landscapemode.fingerprints.TabletIdentifierFingerprint import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @@ -23,7 +23,7 @@ import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @Description("Enables entry into landscape mode by screen rotation on the phone.") @DependsOn( [ - MusicSettingsPatch::class, + SettingsPatch::class, SharedResourceIdPatch::class ] ) @@ -42,7 +42,7 @@ class LandScapeModePatch : BytecodePatch( ) } ?: return TabletIdentifierFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_landscape_mode", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/minimizedplayer/patch/MinimizedPlayerPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/minimizedplayer/patch/MinimizedPlayerPatch.kt index 7f9911136..69db4e758 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/minimizedplayer/patch/MinimizedPlayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/minimizedplayer/patch/MinimizedPlayerPatch.kt @@ -13,7 +13,7 @@ import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.minimizedplayer.fingerprints.MinimizedPlayerFingerprint -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @@ -21,7 +21,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Patch @Name("enable-force-minimized-player") @Description("Permanently keep player minimized even if another track is played.") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class MinimizedPlayerPatch : BytecodePatch( @@ -44,7 +44,7 @@ class MinimizedPlayerPatch : BytecodePatch( } } ?: return MinimizedPlayerFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_force_minimized_player", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/navigationlabel/patch/NavigationLabelPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/navigationlabel/patch/NavigationLabelPatch.kt index 53eb139b0..185decefa 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/navigationlabel/patch/NavigationLabelPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/navigationlabel/patch/NavigationLabelPatch.kt @@ -17,8 +17,8 @@ import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.navigationlabel.fingerprints.TabLayoutTextFingerprint import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch.Companion.Text1 -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch.Companion.contexts +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch.Companion.contexts import app.revanced.util.bytecode.getWideLiteralIndex import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @@ -30,8 +30,8 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction @Description("Hide navigation bar labels.") @DependsOn( [ - SharedResourceIdPatch::class, - MusicSettingsPatch::class + SettingsPatch::class, + SharedResourceIdPatch::class ] ) @MusicCompatibility @@ -68,7 +68,7 @@ class NavigationLabelPatch : BytecodePatch( } } - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_hide_navigation_label", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/newlayout/patch/NewLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/newlayout/patch/NewLayoutPatch.kt index 24923e3d1..cd883bd65 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/newlayout/patch/NewLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/newlayout/patch/NewLayoutPatch.kt @@ -14,7 +14,7 @@ import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.newlayout.fingerprints.NewLayoutFingerprint -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Patch @Name("enable-new-layout") @Description("Enable new player layouts. (YT Music v5.47.51+)") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class NewLayoutPatch : BytecodePatch( @@ -44,7 +44,7 @@ class NewLayoutPatch : BytecodePatch( } } ?: return NewLayoutFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_new_layout", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/oldstyleminiplayer/patch/OldStyleMiniPlayerPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/oldstyleminiplayer/patch/OldStyleMiniPlayerPatch.kt index 4ec3acdd5..88d40421b 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/oldstyleminiplayer/patch/OldStyleMiniPlayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/oldstyleminiplayer/patch/OldStyleMiniPlayerPatch.kt @@ -16,7 +16,7 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.oldstyleminiplayer.fingerprints.NextButtonVisibilityFingerprint import app.revanced.patches.music.layout.oldstyleminiplayer.fingerprints.SwipeToCloseFingerprint -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.music.utils.fingerprints.ColorMatchPlayerParentFingerprint import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @@ -25,7 +25,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Patch @Name("enable-old-style-miniplayer") @Description("Return the miniplayers to old style. (for YT Music v5.55.53+)") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class OldStyleMiniPlayerPatch : BytecodePatch( @@ -72,7 +72,7 @@ class OldStyleMiniPlayerPatch : BytecodePatch( } } ?: return SwipeToCloseFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_old_style_mini_player", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/playlistcard/patch/HidePlaylistCardPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/playlistcard/patch/HidePlaylistCardPatch.kt index 19645b00c..fad245f76 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/playlistcard/patch/HidePlaylistCardPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/playlistcard/patch/HidePlaylistCardPatch.kt @@ -10,8 +10,8 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.litho.patch.LithoFilterPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType @Patch @@ -19,8 +19,8 @@ import app.revanced.util.enum.CategoryType @Description("Hides the playlist card from homepage.") @DependsOn( [ - MusicLithoFilterPatch::class, - MusicSettingsPatch::class + LithoFilterPatch::class, + SettingsPatch::class ] ) @MusicCompatibility @@ -28,7 +28,7 @@ import app.revanced.util.enum.CategoryType class HidePlaylistCardPatch : BytecodePatch() { override fun execute(context: BytecodeContext): PatchResult { - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_hide_playlist_card", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/sleeptimer/patch/SleepTimerPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/sleeptimer/patch/SleepTimerPatch.kt index 86b0510f3..968127b93 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/sleeptimer/patch/SleepTimerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/sleeptimer/patch/SleepTimerPatch.kt @@ -14,7 +14,7 @@ import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.sleeptimer.fingerprints.SleepTimerFingerprint -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Patch @Name("enable-sleep-timer") @Description("Add sleep timer to flyout menu.") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class SleepTimerPatch : BytecodePatch( @@ -44,7 +44,7 @@ class SleepTimerPatch : BytecodePatch( } } ?: return SleepTimerFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_sleep_timer", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/zenmode/patch/ZenModePatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/zenmode/patch/ZenModePatch.kt index a6a442420..276bdc802 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/zenmode/patch/ZenModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/zenmode/patch/ZenModePatch.kt @@ -16,7 +16,7 @@ import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.layout.zenmode.fingerprints.ZenModeFingerprint -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.music.utils.fingerprints.ColorMatchPlayerParentFingerprint import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_LAYOUT @@ -26,7 +26,7 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction @Patch @Name("enable-zen-mode") @Description("Adds a grey tint to the video player to reduce eye strain.") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class ZenModePatch : BytecodePatch( @@ -68,7 +68,7 @@ class ZenModePatch : BytecodePatch( } ?: return ZenModeFingerprint.toErrorResult() } ?: return ColorMatchPlayerParentFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.LAYOUT, "revanced_enable_zen_mode", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/misc/codecs/patch/CodecsUnlockPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/codecs/patch/CodecsUnlockPatch.kt index 4050a8c19..474e1dfa0 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/codecs/patch/CodecsUnlockPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/codecs/patch/CodecsUnlockPatch.kt @@ -9,7 +9,7 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.shared.patch.opus.AbstractOpusCodecsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH @@ -17,7 +17,7 @@ import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH @Patch @Name("enable-opus-codec") @Description("Enable opus codec when playing audio.") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class CodecsUnlockPatch : AbstractOpusCodecsPatch( @@ -26,7 +26,7 @@ class CodecsUnlockPatch : AbstractOpusCodecsPatch( override fun execute(context: BytecodeContext): PatchResult { super.execute(context) - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.MISC, "revanced_enable_opus_codec", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/misc/quality/patch/VideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/quality/patch/VideoQualityPatch.kt index ea1a52c36..d425f0dc7 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/quality/patch/VideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/quality/patch/VideoQualityPatch.kt @@ -20,8 +20,8 @@ import app.revanced.patches.music.misc.quality.fingerprints.MusicVideoQualitySet import app.revanced.patches.music.misc.quality.fingerprints.MusicVideoQualitySettingsParentFingerprint import app.revanced.patches.music.misc.quality.fingerprints.UserQualityChangeFingerprint import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch -import app.revanced.patches.music.utils.videoid.patch.MusicVideoIdPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch +import app.revanced.patches.music.utils.videoid.patch.VideoIdPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH import org.jf.dexlib2.Opcode @@ -36,9 +36,9 @@ import org.jf.dexlib2.iface.reference.Reference @Description("Save the video quality value whenever you change the video quality.") @DependsOn( [ - MusicSettingsPatch::class, - MusicVideoIdPatch::class, - SharedResourceIdPatch::class + SettingsPatch::class, + SharedResourceIdPatch::class, + VideoIdPatch::class ] ) @MusicCompatibility @@ -101,8 +101,8 @@ class VideoQualityPatch : BytecodePatch( ) ?: return MusicVideoQualitySettingsFingerprint.toErrorResult() } ?: return MusicVideoQualitySettingsParentFingerprint.toErrorResult() - MusicVideoIdPatch.injectCall("$INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->newVideoStarted(Ljava/lang/String;)V") - MusicSettingsPatch.addMusicPreference( + VideoIdPatch.injectCall("$INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->newVideoStarted(Ljava/lang/String;)V") + SettingsPatch.addMusicPreference( CategoryType.MISC, "revanced_enable_save_video_quality", "true" @@ -113,7 +113,7 @@ class VideoQualityPatch : BytecodePatch( private companion object { const val INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR = - "$MUSIC_MISC_PATH/MusicVideoQualityPatch;" + "$MUSIC_MISC_PATH/VideoQualityPatch;" private lateinit var qIndexMethodName: String private lateinit var qualityReference: Reference diff --git a/src/main/kotlin/app/revanced/patches/music/misc/sharebuttonhook/patch/ShareButtonHookPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/sharebuttonhook/patch/ShareButtonHookPatch.kt index 2e60169fc..2c9ddb5e6 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/sharebuttonhook/patch/ShareButtonHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/sharebuttonhook/patch/ShareButtonHookPatch.kt @@ -20,8 +20,8 @@ import app.revanced.patches.music.misc.sharebuttonhook.fingerprints.ConnectionTr import app.revanced.patches.music.misc.sharebuttonhook.fingerprints.FullStackTraceActivityFingerprint import app.revanced.patches.music.misc.sharebuttonhook.fingerprints.SharePanelFingerprint import app.revanced.patches.music.misc.sharebuttonhook.fingerprints.ShowToastFingerprint -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch -import app.revanced.patches.music.utils.videoid.patch.MusicVideoIdPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch +import app.revanced.patches.music.utils.videoid.patch.VideoIdPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH @@ -31,8 +31,8 @@ import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH @Description("Replace share button with external download button or sleep timer dialog.") @DependsOn( [ - MusicSettingsPatch::class, - MusicVideoIdPatch::class + SettingsPatch::class, + VideoIdPatch::class ] ) @MusicCompatibility @@ -80,12 +80,12 @@ class ShareButtonHookPatch : BytecodePatch( """ ) ?: return FullStackTraceActivityFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.MISC, "revanced_hook_share_button", "false" ) - MusicSettingsPatch.addMusicPreferenceWithIntent( + SettingsPatch.addMusicPreferenceWithIntent( CategoryType.MISC, "revanced_default_downloader", "revanced_hook_share_button" diff --git a/src/main/kotlin/app/revanced/patches/music/misc/shuffle/patch/EnforceShufflePatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/shuffle/patch/EnforceShufflePatch.kt index 521c0c6f1..888890f6f 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/shuffle/patch/EnforceShufflePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/shuffle/patch/EnforceShufflePatch.kt @@ -24,7 +24,7 @@ import app.revanced.patches.music.misc.shuffle.fingerprints.MusicPlaybackControl import app.revanced.patches.music.misc.shuffle.fingerprints.ShuffleClassFingerprint import app.revanced.patches.music.misc.shuffle.fingerprints.ShuffleClassReferenceFingerprint import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH import org.jf.dexlib2.AccessFlags @@ -42,7 +42,7 @@ import org.jf.dexlib2.immutable.ImmutableMethodParameter @Description("Enable force shuffle even if another track is played.") @DependsOn( [ - MusicSettingsPatch::class, + SettingsPatch::class, SharedResourceIdPatch::class ] ) @@ -165,7 +165,7 @@ class EnforceShufflePatch : BytecodePatch( } } ?: return MusicPlaybackControlsFingerprint.toErrorResult() - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.MISC, "revanced_enable_force_shuffle", "true" diff --git a/src/main/kotlin/app/revanced/patches/music/misc/translations/patch/MusicTranslationsPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/translations/patch/MusicTranslationsPatch.kt index 05f614239..835ef5eac 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/translations/patch/MusicTranslationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/translations/patch/MusicTranslationsPatch.kt @@ -10,13 +10,13 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.util.resources.ResourceHelper.addTranslations @Patch @Name("translations-music") @Description("Add Crowdin translations for YouTube Music.") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class MusicTranslationsPatch : ResourcePatch { diff --git a/src/main/kotlin/app/revanced/patches/music/misc/upgradebutton/patch/RemoveUpgradeButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/upgradebutton/patch/RemoveUpgradeButtonPatch.kt index 40be5ca4a..b915a41db 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/upgradebutton/patch/RemoveUpgradeButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/upgradebutton/patch/RemoveUpgradeButtonPatch.kt @@ -17,7 +17,7 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility import app.revanced.patches.music.misc.upgradebutton.fingerprints.NotifierShelfFingerprint import app.revanced.patches.music.misc.upgradebutton.fingerprints.PivotBarConstructorFingerprint -import app.revanced.patches.music.utils.integrations.patch.MusicIntegrationsPatch +import app.revanced.patches.music.utils.integrations.patch.IntegrationsPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.ReferenceInstruction @@ -28,7 +28,7 @@ import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction @Description("Remove upgrade tab from pivot bar, hide upgrade banner from homepage.") @DependsOn( [ - MusicIntegrationsPatch::class, + IntegrationsPatch::class, SharedResourceIdPatch::class ] ) diff --git a/src/main/kotlin/app/revanced/patches/music/misc/versionspoof/patch/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/versionspoof/patch/SpoofAppVersionPatch.kt index 5fcba9e17..221608e6b 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/versionspoof/patch/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/versionspoof/patch/SpoofAppVersionPatch.kt @@ -9,7 +9,7 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.shared.patch.versionspoof.AbstractVersionSpoofPatch import app.revanced.util.enum.CategoryType import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH @@ -17,7 +17,7 @@ import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH @Patch @Name("spoof-app-version") @Description("Spoof the YouTube Music client version.") -@DependsOn([MusicSettingsPatch::class]) +@DependsOn([SettingsPatch::class]) @MusicCompatibility @Version("0.0.1") class SpoofAppVersionPatch : AbstractVersionSpoofPatch( @@ -25,7 +25,7 @@ class SpoofAppVersionPatch : AbstractVersionSpoofPatch( ) { override fun execute(context: BytecodeContext): PatchResult { - MusicSettingsPatch.addMusicPreference( + SettingsPatch.addMusicPreference( CategoryType.MISC, "revanced_spoof_app_version", "false" diff --git a/src/main/kotlin/app/revanced/patches/music/utils/integrations/patch/MusicIntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/integrations/patch/IntegrationsPatch.kt similarity index 87% rename from src/main/kotlin/app/revanced/patches/music/utils/integrations/patch/MusicIntegrationsPatch.kt rename to src/main/kotlin/app/revanced/patches/music/utils/integrations/patch/IntegrationsPatch.kt index a94967f1b..02422f055 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/integrations/patch/MusicIntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/integrations/patch/IntegrationsPatch.kt @@ -7,10 +7,10 @@ import app.revanced.patches.music.utils.integrations.fingerprints.InitFingerprin import app.revanced.patches.shared.patch.integrations.AbstractIntegrationsPatch import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH -@Name("music-integrations") +@Name("integrations") @MusicCompatibility @RequiresIntegrations -class MusicIntegrationsPatch : AbstractIntegrationsPatch( +class IntegrationsPatch : AbstractIntegrationsPatch( "$MUSIC_INTEGRATIONS_PATH/utils/ReVancedUtils;", listOf(InitFingerprint), ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/utils/litho/patch/MusicLithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/litho/patch/LithoFilterPatch.kt similarity index 78% rename from src/main/kotlin/app/revanced/patches/music/utils/litho/patch/MusicLithoFilterPatch.kt rename to src/main/kotlin/app/revanced/patches/music/utils/litho/patch/LithoFilterPatch.kt index 97b9556e0..94c27d132 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/litho/patch/MusicLithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/litho/patch/LithoFilterPatch.kt @@ -7,7 +7,6 @@ import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.shared.fingerprints.litho.IdentifierFingerprint import app.revanced.patches.shared.patch.litho.ComponentParserPatch import app.revanced.patches.shared.patch.litho.ComponentParserPatch.Companion.identifierHook import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH @@ -15,11 +14,9 @@ import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH @DependsOn([ComponentParserPatch::class]) @MusicCompatibility @Version("0.0.1") -class MusicLithoFilterPatch : BytecodePatch( - listOf(IdentifierFingerprint) -) { +class LithoFilterPatch : BytecodePatch() { override fun execute(context: BytecodeContext): PatchResult { - identifierHook("$MUSIC_ADS_PATH/MusicLithoFilterPatch;->filter") + identifierHook("$MUSIC_ADS_PATH/LithoFilterPatch;->filter") return PatchResultSuccess() } diff --git a/src/main/kotlin/app/revanced/patches/music/utils/microg/bytecode/patch/MusicMicroGBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/microg/bytecode/patch/MicroGPatch.kt similarity index 94% rename from src/main/kotlin/app/revanced/patches/music/utils/microg/bytecode/patch/MusicMicroGBytecodePatch.kt rename to src/main/kotlin/app/revanced/patches/music/utils/microg/bytecode/patch/MicroGPatch.kt index 932640d21..27b95c749 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/microg/bytecode/patch/MusicMicroGBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/microg/bytecode/patch/MicroGPatch.kt @@ -17,7 +17,7 @@ import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastDynamit import app.revanced.patches.music.utils.microg.bytecode.fingerprints.GooglePlayUtilityFingerprint import app.revanced.patches.music.utils.microg.bytecode.fingerprints.PrimeFingerprint import app.revanced.patches.music.utils.microg.bytecode.fingerprints.ServiceCheckFingerprint -import app.revanced.patches.music.utils.microg.resource.patch.MusicMicroGResourcePatch +import app.revanced.patches.music.utils.microg.resource.patch.MicroGResourcePatch import app.revanced.patches.music.utils.microg.shared.Constants.MUSIC_PACKAGE_NAME import app.revanced.patches.music.utils.microg.shared.Constants.YOUTUBE_PACKAGE_NAME import app.revanced.patches.shared.patch.packagename.PackageNamePatch @@ -27,15 +27,15 @@ import app.revanced.util.microg.MicroGBytecodeHelper @DependsOn( [ ClientSpoofMusicPatch::class, - MusicMicroGResourcePatch::class, + MicroGResourcePatch::class, PackageNamePatch::class ] ) -@Name("music-microg-support") +@Name("microg-support") @Description("Allows ReVanced Music to run without root and under a different package name with MicroG.") @MusicCompatibility @Version("0.0.2") -class MusicMicroGBytecodePatch : BytecodePatch( +class MicroGPatch : BytecodePatch( listOf( ServiceCheckFingerprint, GooglePlayUtilityFingerprint, diff --git a/src/main/kotlin/app/revanced/patches/music/utils/microg/resource/patch/MusicMicroGResourcePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/microg/resource/patch/MicroGResourcePatch.kt similarity index 95% rename from src/main/kotlin/app/revanced/patches/music/utils/microg/resource/patch/MusicMicroGResourcePatch.kt rename to src/main/kotlin/app/revanced/patches/music/utils/microg/resource/patch/MicroGResourcePatch.kt index 6dd4eff52..ec225fa60 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/microg/resource/patch/MusicMicroGResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/microg/resource/patch/MicroGResourcePatch.kt @@ -17,12 +17,12 @@ import app.revanced.util.microg.MicroGManifestHelper.addSpoofingMetadata import app.revanced.util.microg.MicroGResourceHelper.patchManifest import app.revanced.util.resources.MusicResourceHelper.setMicroG -@Name("music-microg-resource-patch") +@Name("microg-resource-patch") @Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.") @DependsOn([PackageNamePatch::class]) @MusicCompatibility @Version("0.0.2") -class MusicMicroGResourcePatch : ResourcePatch { +class MicroGResourcePatch : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { val packageNameMusic = PackageNamePatch.MusicPackageName!! diff --git a/src/main/kotlin/app/revanced/patches/music/utils/settings/bytecode/patch/MusicSettingsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/settings/bytecode/patch/SettingsBytecodePatch.kt similarity index 92% rename from src/main/kotlin/app/revanced/patches/music/utils/settings/bytecode/patch/MusicSettingsBytecodePatch.kt rename to src/main/kotlin/app/revanced/patches/music/utils/settings/bytecode/patch/SettingsBytecodePatch.kt index 928cee565..4e460ba22 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/settings/bytecode/patch/MusicSettingsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/settings/bytecode/patch/SettingsBytecodePatch.kt @@ -11,18 +11,18 @@ import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.integrations.patch.MusicIntegrationsPatch +import app.revanced.patches.music.utils.integrations.patch.IntegrationsPatch import app.revanced.patches.music.utils.settings.bytecode.fingerprints.PreferenceFingerprint import app.revanced.patches.music.utils.settings.bytecode.fingerprints.SettingsHeadersFragmentFingerprint import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction -@Name("music-settings-bytecode-patch") -@DependsOn([MusicIntegrationsPatch::class]) +@Name("settings-bytecode-patch") +@DependsOn([IntegrationsPatch::class]) @MusicCompatibility @Version("0.0.1") -class MusicSettingsBytecodePatch : BytecodePatch( +class SettingsBytecodePatch : BytecodePatch( listOf( PreferenceFingerprint, SettingsHeadersFragmentFingerprint diff --git a/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/MusicSettingsPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/MusicSettingsPatch.kt index d9b89e664..2591a31ba 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/MusicSettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/MusicSettingsPatch.kt @@ -9,7 +9,7 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.settings.bytecode.patch.MusicSettingsBytecodePatch +import app.revanced.patches.music.utils.settings.bytecode.patch.SettingsBytecodePatch import app.revanced.patches.shared.patch.settings.AbstractSettingsResourcePatch import app.revanced.util.enum.CategoryType import app.revanced.util.resources.IconHelper @@ -26,12 +26,12 @@ import java.io.File import java.nio.file.Paths @Patch -@Name("music-settings") +@Name("settings") @Description("Adds settings for ReVanced to YouTube Music.") -@DependsOn([MusicSettingsBytecodePatch::class]) +@DependsOn([SettingsBytecodePatch::class]) @MusicCompatibility @Version("0.0.1") -class MusicSettingsPatch : AbstractSettingsResourcePatch( +class SettingsPatch : AbstractSettingsResourcePatch( "music/settings", "music/settings/host", false diff --git a/src/main/kotlin/app/revanced/patches/music/utils/videoid/fingerprint/MusicVideoIdFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/utils/videoid/fingerprint/VideoIdFingerprint.kt similarity index 90% rename from src/main/kotlin/app/revanced/patches/music/utils/videoid/fingerprint/MusicVideoIdFingerprint.kt rename to src/main/kotlin/app/revanced/patches/music/utils/videoid/fingerprint/VideoIdFingerprint.kt index 2c4a90dbd..23db87420 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/videoid/fingerprint/MusicVideoIdFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/videoid/fingerprint/VideoIdFingerprint.kt @@ -3,7 +3,7 @@ package app.revanced.patches.music.utils.videoid.fingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import org.jf.dexlib2.Opcode -object MusicVideoIdFingerprint : MethodFingerprint( +object VideoIdFingerprint : MethodFingerprint( returnType = "V", parameters = listOf("L"), opcodes = listOf( diff --git a/src/main/kotlin/app/revanced/patches/music/utils/videoid/patch/MusicVideoIdPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/videoid/patch/VideoIdPatch.kt similarity index 88% rename from src/main/kotlin/app/revanced/patches/music/utils/videoid/patch/MusicVideoIdPatch.kt rename to src/main/kotlin/app/revanced/patches/music/utils/videoid/patch/VideoIdPatch.kt index 9ab1ca93d..cedda977b 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/videoid/patch/MusicVideoIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/videoid/patch/VideoIdPatch.kt @@ -12,27 +12,27 @@ import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.music.utils.annotations.MusicCompatibility -import app.revanced.patches.music.utils.videoid.fingerprint.MusicVideoIdFingerprint +import app.revanced.patches.music.utils.videoid.fingerprint.VideoIdFingerprint import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH import org.jf.dexlib2.iface.instruction.OneRegisterInstruction -@Name("music-video-id-hook") +@Name("video-id-hook") @Description("Hook to detect when the video id changes.") @MusicCompatibility @Version("0.0.1") -class MusicVideoIdPatch : BytecodePatch( - listOf(MusicVideoIdFingerprint) +class VideoIdPatch : BytecodePatch( + listOf(VideoIdFingerprint) ) { override fun execute(context: BytecodeContext): PatchResult { - MusicVideoIdFingerprint.result?.let { + VideoIdFingerprint.result?.let { it.mutableMethod.apply { insertIndex = it.scanResult.patternScanResult!!.endIndex insertMethod = this videoIdRegister = getInstruction(insertIndex).registerA } offset++ // offset so setVideoId is called before any injected call - } ?: return MusicVideoIdFingerprint.toErrorResult() + } ?: return VideoIdFingerprint.toErrorResult() injectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->setVideoId(Ljava/lang/String;)V")