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 deleted file mode 100644 index 1a038149e..000000000 --- a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/playbackspeed/PlaybackSpeedPatch.kt +++ /dev/null @@ -1,78 +0,0 @@ -package app.revanced.patches.music.flyoutpanel.playbackspeed - -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.flyoutpanel.playbackspeed.fingerprints.TouchOutsideFingerprint -import app.revanced.patches.music.utils.flyoutbutton.FlyoutButtonContainerPatch -import app.revanced.patches.music.utils.integrations.Constants.FLYOUT -import app.revanced.patches.music.utils.overridespeed.OverrideSpeedHookPatch -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.patches.music.video.information.VideoInformationPatch -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 - -@Patch( - name = "Enable playback speed", - description = "Adds an option to add a playback speed button to the flyout panel.", - dependencies = [ - FlyoutButtonContainerPatch::class, - OverrideSpeedHookPatch::class, - SettingsPatch::class, - SharedResourceIdPatch::class, - VideoInformationPatch::class - ], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.apps.youtube.music", - [ - "6.21.52", - "6.22.52", - "6.23.56", - "6.25.53", - "6.26.51", - "6.27.54", - "6.28.53", - "6.29.58", - "6.31.55", - "6.33.52" - ] - ) - ] -) -@Suppress("unused") -object PlaybackSpeedPatch : BytecodePatch( - setOf(TouchOutsideFingerprint) -) { - override fun execute(context: BytecodeContext) { - - TouchOutsideFingerprint.result?.let { - it.mutableMethod.apply { - val setOnClickListenerIndex = - implementation!!.instructions.indexOfFirst { instruction -> - ((instruction as? ReferenceInstruction)?.reference as? MethodReference)?.name == "setOnClickListener" - } - val setOnClickListenerRegister = getInstruction(setOnClickListenerIndex).registerC - - addInstruction( - setOnClickListenerIndex + 1, - "sput-object v$setOnClickListenerRegister, $FLYOUT->touchOutSideView:Landroid/view/View;" - ) - } - } ?: throw TouchOutsideFingerprint.exception - - SettingsPatch.addMusicPreference( - CategoryType.FLYOUT, - "revanced_enable_flyout_panel_playback_speed", - "false" - ) - - } -} diff --git a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/playbackspeed/fingerprints/TouchOutsideFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/replace/fingerprints/TouchOutsideFingerprint.kt similarity index 79% rename from src/main/kotlin/app/revanced/patches/music/flyoutpanel/playbackspeed/fingerprints/TouchOutsideFingerprint.kt rename to src/main/kotlin/app/revanced/patches/music/flyoutpanel/replace/fingerprints/TouchOutsideFingerprint.kt index f7f80daa4..09b634178 100644 --- a/src/main/kotlin/app/revanced/patches/music/flyoutpanel/playbackspeed/fingerprints/TouchOutsideFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/flyoutpanel/replace/fingerprints/TouchOutsideFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.music.flyoutpanel.playbackspeed.fingerprints +package app.revanced.patches.music.flyoutpanel.replace.fingerprints import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.TouchOutside import app.revanced.util.fingerprint.LiteralValueFingerprint 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 454232413..9c4fdf79c 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 @@ -17,7 +17,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Patch( dependencies = [ - FlyoutButtonContainerResourcePatch::class, SharedResourceIdPatch::class ] ) 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 deleted file mode 100644 index 1a37ad47b..000000000 --- a/src/main/kotlin/app/revanced/patches/music/utils/flyoutbutton/FlyoutButtonContainerResourcePatch.kt +++ /dev/null @@ -1,43 +0,0 @@ -package app.revanced.patches.music.utils.flyoutbutton - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.util.ResourceGroup -import app.revanced.util.copyResources - -object FlyoutButtonContainerResourcePatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - - /** - * create directory for flyout button container - */ - context["res/layout-v21"].mkdirs() - - arrayOf( - ResourceGroup( - "layout-v21", - "music_menu_like_buttons.xml" - ) - ).forEach { resourceGroup -> - context.copyResources("music/flyout", resourceGroup) - } - - fun copyResources(resourceGroups: List) { - resourceGroups.forEach { context.copyResources("music/flyout", it) } - } - - val resourceFileNames = arrayOf( - "yt_outline_play_arrow_half_circle_black_24" - ).map { "$it.png" }.toTypedArray() - - fun createGroup(directory: String) = ResourceGroup( - directory, *resourceFileNames - ) - - arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi") - .map { "drawable-$it" } - .map(::createGroup) - .let(::copyResources) - - } -} \ No newline at end of file diff --git a/src/main/resources/music/flyout/layout-v21/music_menu_like_buttons.xml b/src/main/resources/music/flyout/layout-v21/music_menu_like_buttons.xml deleted file mode 100644 index 56ba44cc2..000000000 --- a/src/main/resources/music/flyout/layout-v21/music_menu_like_buttons.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/main/resources/music/settings/host/values/strings.xml b/src/main/resources/music/settings/host/values/strings.xml index 214393b43..1ca4bb026 100644 --- a/src/main/resources/music/settings/host/values/strings.xml +++ b/src/main/resources/music/settings/host/values/strings.xml @@ -50,8 +50,6 @@ Known issues: Enable debug buffer logging Prints the debug log. Enable debug logging - Adds a playback speed button to the flyout panel. - Enable playback speed Keeps the player minimized even when another track is played. Enable force minimized player Enables landscape mode when rotating the screen on phones.