mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 21:30:19 +02:00
feat(youtube): remove custom-speed-overlay
patch (dropped from server side)
This commit is contained in:
parent
cdf45b3a95
commit
049e698999
@ -1,16 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.player.customspeedoverlay.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object SpeedOverlayHookFingerprint : MethodFingerprint(
|
|
||||||
returnType = "V",
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.CMPL_FLOAT,
|
|
||||||
Opcode.IF_GEZ,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL
|
|
||||||
),
|
|
||||||
strings = listOf("Failed to easy seek haptics vibrate."),
|
|
||||||
customFingerprint = { methodDef, _ -> methodDef.name == "run" }
|
|
||||||
)
|
|
@ -1,10 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.player.customspeedoverlay.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object YouTubeTextViewFingerprint : MethodFingerprint(
|
|
||||||
returnType = "V",
|
|
||||||
opcodes = listOf(Opcode.INVOKE_SUPER),
|
|
||||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("YouTubeTextView;") && methodDef.name == "setText" }
|
|
||||||
)
|
|
@ -1,85 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.player.customspeedoverlay.patch
|
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
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.replaceInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.youtube.player.customspeedoverlay.fingerprints.SpeedOverlayHookFingerprint
|
|
||||||
import app.revanced.patches.youtube.player.customspeedoverlay.fingerprints.YouTubeTextViewFingerprint
|
|
||||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
|
||||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
|
||||||
import app.revanced.util.integrations.Constants.PLAYER
|
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("custom-speed-overlay")
|
|
||||||
@Description("Customize the video speed that changes when pressing and holding the player.")
|
|
||||||
@DependsOn([SettingsPatch::class])
|
|
||||||
@YouTubeCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class CustomSpeedOverlayPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
SpeedOverlayHookFingerprint,
|
|
||||||
YouTubeTextViewFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
|
|
||||||
SpeedOverlayHookFingerprint.result?.let {
|
|
||||||
it.mutableMethod.apply {
|
|
||||||
val insertIndex = it.scanResult.patternScanResult!!.endIndex
|
|
||||||
val insertRegister = getInstruction<Instruction35c>(insertIndex).registerD
|
|
||||||
|
|
||||||
addInstructions(
|
|
||||||
insertIndex, """
|
|
||||||
invoke-static {v$insertRegister}, $PLAYER->customSpeedOverlay(F)F
|
|
||||||
move-result v$insertRegister
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} ?: return SpeedOverlayHookFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
YouTubeTextViewFingerprint.result?.let {
|
|
||||||
it.mutableMethod.apply {
|
|
||||||
val targetIndex = it.scanResult.patternScanResult!!.startIndex
|
|
||||||
val targetInstruction = getInstruction<Instruction35c>(targetIndex)
|
|
||||||
val targetReference = getInstruction<ReferenceInstruction>(targetIndex).reference
|
|
||||||
|
|
||||||
replaceInstruction(
|
|
||||||
targetIndex,
|
|
||||||
"invoke-static {v${targetInstruction.registerC}, v${targetInstruction.registerD}}, $PLAYER->customSpeedOverlay(Landroid/widget/TextView;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;"
|
|
||||||
)
|
|
||||||
addInstructions(
|
|
||||||
targetIndex + 1, """
|
|
||||||
move-result-object v${targetInstruction.registerD}
|
|
||||||
invoke-super {v${targetInstruction.registerC}, v${targetInstruction.registerD}, v${targetInstruction.registerE}}, $targetReference
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} ?: return YouTubeTextViewFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add settings
|
|
||||||
*/
|
|
||||||
SettingsPatch.addPreference(
|
|
||||||
arrayOf(
|
|
||||||
"PREFERENCE: PLAYER_SETTINGS",
|
|
||||||
"SETTINGS: CUSTOM_SPEED_OVERLAY"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
SettingsPatch.updatePatchStatus("custom-speed-overlay")
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
@ -24,9 +24,6 @@
|
|||||||
<string name="revanced_custom_filter_title">Enable custom filter</string>
|
<string name="revanced_custom_filter_title">Enable custom filter</string>
|
||||||
<string name="revanced_custom_seekbar_color_value_summary">Type the hex code of the seekbar color</string>
|
<string name="revanced_custom_seekbar_color_value_summary">Type the hex code of the seekbar color</string>
|
||||||
<string name="revanced_custom_seekbar_color_value_title">Custom seekbar color value</string>
|
<string name="revanced_custom_seekbar_color_value_title">Custom seekbar color value</string>
|
||||||
<string name="revanced_custom_speed_overlay_value_summary">Type the video speed to change when pressing and holding the player</string>
|
|
||||||
<string name="revanced_custom_speed_overlay_value_title">Custom speed overlay value</string>
|
|
||||||
<string name="revanced_custom_speed_overlay_text" formatted="false">Playing at %sx speed</string>
|
|
||||||
<string name="revanced_custom_video_speeds_summary">Add or change the video speeds available</string>
|
<string name="revanced_custom_video_speeds_summary">Add or change the video speeds available</string>
|
||||||
<string name="revanced_custom_video_speeds_title">Edit custom video speeds</string>
|
<string name="revanced_custom_video_speeds_title">Edit custom video speeds</string>
|
||||||
<string name="revanced_default_app_settings_summary">To open RVX in an external browser, turn on \'Open supported links\' and enable supported web addresses</string>
|
<string name="revanced_default_app_settings_summary">To open RVX in an external browser, turn on \'Open supported links\' and enable supported web addresses</string>
|
||||||
|
@ -279,7 +279,6 @@
|
|||||||
<Preference android:title="hide-flyout-panel" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="hide-flyout-panel" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
|
|
||||||
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_fullscreen" />
|
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_fullscreen" />
|
||||||
<Preference android:title="custom-speed-overlay" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
|
||||||
<Preference android:title="disable-haptic-feedback" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="disable-haptic-feedback" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="disable-landscape-mode" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="disable-landscape-mode" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="hide-autoplay-preview" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="hide-autoplay-preview" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
@ -431,9 +430,6 @@
|
|||||||
<PreferenceScreen android:title="@string/revanced_player" android:key="player">
|
<PreferenceScreen android:title="@string/revanced_player" android:key="player">
|
||||||
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_player" />PREFERENCE: PLAYER_SETTINGS -->
|
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_player" />PREFERENCE: PLAYER_SETTINGS -->
|
||||||
|
|
||||||
<!-- SETTINGS: CUSTOM_SPEED_OVERLAY
|
|
||||||
<app.revanced.integrations.settingsmenu.ResettableEditTextPreference android:hint="2.0" android:title="@string/revanced_custom_speed_overlay_value_title" android:key="revanced_custom_speed_overlay_value" android:summary="@string/revanced_custom_speed_overlay_value_summary" android:defaultValue="2.0" android:inputType="text" />SETTINGS: CUSTOM_SPEED_OVERLAY -->
|
|
||||||
|
|
||||||
<!-- SETTINGS: HIDE_AUDIO_TRACK_BUTTON
|
<!-- SETTINGS: HIDE_AUDIO_TRACK_BUTTON
|
||||||
<SwitchPreference android:title="@string/revanced_hide_audio_track_button_title" android:key="revanced_hide_audio_track_button" android:defaultValue="true" android:summaryOn="@string/revanced_hide_audio_track_button_summary_on" android:summaryOff="@string/revanced_hide_audio_track_button_summary_off" />SETTINGS: HIDE_AUDIO_TRACK_BUTTON -->
|
<SwitchPreference android:title="@string/revanced_hide_audio_track_button_title" android:key="revanced_hide_audio_track_button" android:defaultValue="true" android:summaryOn="@string/revanced_hide_audio_track_button_summary_on" android:summaryOff="@string/revanced_hide_audio_track_button_summary_off" />SETTINGS: HIDE_AUDIO_TRACK_BUTTON -->
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user