mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 13:20:19 +02:00
feat(YouTube Music): remove Enable playback speed
patch
This commit is contained in:
parent
3d8e3bb0be
commit
3f7803c5b8
@ -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<FiveRegisterInstruction>(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"
|
||||
)
|
||||
|
||||
}
|
||||
}
|
@ -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
|
@ -17,7 +17,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
FlyoutButtonContainerResourcePatch::class,
|
||||
SharedResourceIdPatch::class
|
||||
]
|
||||
)
|
||||
|
@ -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<ResourceGroup>) {
|
||||
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)
|
||||
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/playback_speed_button" android:padding="@dimen/remix_overlay_player_control_button_padding" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/yt_outline_play_arrow_half_circle_black_24" android:tint="@color/ytm_icon_color_active" android:contentDescription="@string/action_add_to_offline_songs" style="@style/MusicPlayerButton" />
|
||||
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@id/dislike_button" android:padding="@dimen/remix_overlay_player_control_button_padding" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ytdislike_drawable" android:tint="@color/ytm_icon_color_active" android:contentDescription="@string/accessibility_dislike_video" style="@style/MusicPlayerButton" />
|
||||
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@id/like_button" android:padding="@dimen/remix_overlay_player_control_button_padding" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ytlike_drawable" android:tint="@color/ytm_icon_color_active" android:contentDescription="@string/accessibility_like_video" style="@style/MusicPlayerButton" />
|
||||
</LinearLayout>
|
@ -50,8 +50,6 @@ Known issues:
|
||||
<string name="revanced_enable_debug_buffer_logging_title">Enable debug buffer logging</string>
|
||||
<string name="revanced_enable_debug_logging_summary">Prints the debug log.</string>
|
||||
<string name="revanced_enable_debug_logging_title">Enable debug logging</string>
|
||||
<string name="revanced_enable_flyout_panel_playback_speed_summary">Adds a playback speed button to the flyout panel.</string>
|
||||
<string name="revanced_enable_flyout_panel_playback_speed_title">Enable playback speed</string>
|
||||
<string name="revanced_enable_force_minimized_player_summary">Keeps the player minimized even when another track is played.</string>
|
||||
<string name="revanced_enable_force_minimized_player_title">Enable force minimized player</string>
|
||||
<string name="revanced_enable_landscape_mode_summary">Enables landscape mode when rotating the screen on phones.</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user