mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-13 05:37:40 +02:00
add Disable default video speed in live stream
settings https://github.com/inotia00/ReVanced_Extended/issues/626
This commit is contained in:
@ -0,0 +1,8 @@
|
|||||||
|
package app.revanced.patches.youtube.video.livestream.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object OrganicPlaybackContextModelFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
strings = listOf("Null contentCpn")
|
||||||
|
)
|
@ -0,0 +1,38 @@
|
|||||||
|
package app.revanced.patches.youtube.video.livestream.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.toErrorResult
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||||
|
import app.revanced.patches.youtube.video.livestream.fingerprints.OrganicPlaybackContextModelFingerprint
|
||||||
|
import app.revanced.util.integrations.Constants.VIDEO_PATH
|
||||||
|
|
||||||
|
@Name("live-stream-speed")
|
||||||
|
@YouTubeCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class LiveStreamPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
OrganicPlaybackContextModelFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
|
||||||
|
OrganicPlaybackContextModelFingerprint.result?.mutableMethod?.addInstruction(
|
||||||
|
2,
|
||||||
|
"invoke-static { p2 }, $INTEGRATIONS_VIDEO_SPEED_CLASS_DESCRIPTOR->liveStreamObserver(Z)V"
|
||||||
|
) ?: return OrganicPlaybackContextModelFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val INTEGRATIONS_VIDEO_SPEED_CLASS_DESCRIPTOR =
|
||||||
|
"$VIDEO_PATH/VideoSpeedPatch;"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -14,6 +14,7 @@ import app.revanced.patches.youtube.misc.overridespeed.bytecode.fingerprints.Vid
|
|||||||
import app.revanced.patches.youtube.misc.overridespeed.bytecode.patch.OverrideSpeedHookPatch
|
import app.revanced.patches.youtube.misc.overridespeed.bytecode.patch.OverrideSpeedHookPatch
|
||||||
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch
|
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch
|
||||||
import app.revanced.patches.youtube.misc.videoid.legacy.patch.LegacyVideoIdPatch
|
import app.revanced.patches.youtube.misc.videoid.legacy.patch.LegacyVideoIdPatch
|
||||||
|
import app.revanced.patches.youtube.video.livestream.patch.LiveStreamPatch
|
||||||
import app.revanced.patches.youtube.video.speed.bytecode.fingerprints.*
|
import app.revanced.patches.youtube.video.speed.bytecode.fingerprints.*
|
||||||
import app.revanced.util.bytecode.BytecodeHelper.updatePatchStatus
|
import app.revanced.util.bytecode.BytecodeHelper.updatePatchStatus
|
||||||
import app.revanced.util.integrations.Constants.VIDEO_PATH
|
import app.revanced.util.integrations.Constants.VIDEO_PATH
|
||||||
@ -23,6 +24,7 @@ import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||||||
@DependsOn(
|
@DependsOn(
|
||||||
[
|
[
|
||||||
LegacyVideoIdPatch::class,
|
LegacyVideoIdPatch::class,
|
||||||
|
LiveStreamPatch::class,
|
||||||
OverrideSpeedHookPatch::class,
|
OverrideSpeedHookPatch::class,
|
||||||
SharedResourceIdPatch::class
|
SharedResourceIdPatch::class
|
||||||
]
|
]
|
||||||
@ -64,6 +66,5 @@ class VideoSpeedBytecodePatch : BytecodePatch(
|
|||||||
private companion object {
|
private companion object {
|
||||||
const val INTEGRATIONS_VIDEO_SPEED_CLASS_DESCRIPTOR =
|
const val INTEGRATIONS_VIDEO_SPEED_CLASS_DESCRIPTOR =
|
||||||
"$VIDEO_PATH/VideoSpeedPatch;"
|
"$VIDEO_PATH/VideoSpeedPatch;"
|
||||||
var insertIndex: Int = 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -101,6 +101,9 @@ Is it ready to submit?"</string>
|
|||||||
<string name="revanced_default_video_quality_mobile_title">Default video quality Cellular</string>
|
<string name="revanced_default_video_quality_mobile_title">Default video quality Cellular</string>
|
||||||
<string name="revanced_default_video_quality_wifi_title">Default video quality Wi-Fi</string>
|
<string name="revanced_default_video_quality_wifi_title">Default video quality Wi-Fi</string>
|
||||||
<string name="revanced_default_video_speed_title">Default video speed</string>
|
<string name="revanced_default_video_speed_title">Default video speed</string>
|
||||||
|
<string name="revanced_disable_default_video_speed_live_summary_off">Default video speed is enabled in live stream</string>
|
||||||
|
<string name="revanced_disable_default_video_speed_live_summary_on">Default video speed is disabled in live stream</string>
|
||||||
|
<string name="revanced_disable_default_video_speed_live_title">Disable default video speed in live stream</string>
|
||||||
<string name="revanced_disable_haptic_feedback_chapters_summary_off">Chapters haptic feedback is enabled</string>
|
<string name="revanced_disable_haptic_feedback_chapters_summary_off">Chapters haptic feedback is enabled</string>
|
||||||
<string name="revanced_disable_haptic_feedback_chapters_summary_on">Chapters haptic feedback is disabled</string>
|
<string name="revanced_disable_haptic_feedback_chapters_summary_on">Chapters haptic feedback is disabled</string>
|
||||||
<string name="revanced_disable_haptic_feedback_chapters_title">Disable chapters haptic feedback</string>
|
<string name="revanced_disable_haptic_feedback_chapters_title">Disable chapters haptic feedback</string>
|
||||||
|
@ -388,6 +388,9 @@
|
|||||||
<!-- SETTINGS: CUSTOM_VIDEO_SPEED
|
<!-- SETTINGS: CUSTOM_VIDEO_SPEED
|
||||||
<SwitchPreference android:title="@string/revanced_enable_custom_video_speed_title" android:key="revanced_enable_custom_video_speed" android:defaultValue="false" android:summaryOn="@string/revanced_enable_custom_video_speed_summary_on" android:summaryOff="@string/revanced_enable_custom_video_speed_summary_off" />SETTINGS: CUSTOM_VIDEO_SPEED -->
|
<SwitchPreference android:title="@string/revanced_enable_custom_video_speed_title" android:key="revanced_enable_custom_video_speed" android:defaultValue="false" android:summaryOn="@string/revanced_enable_custom_video_speed_summary_on" android:summaryOff="@string/revanced_enable_custom_video_speed_summary_off" />SETTINGS: CUSTOM_VIDEO_SPEED -->
|
||||||
|
|
||||||
|
<!-- SETTINGS: DEFAULT_VIDEO_SPEED
|
||||||
|
<SwitchPreference android:title="@string/revanced_disable_default_video_speed_live_title" android:key="revanced_disable_default_video_speed_live" android:defaultValue="true" android:summaryOn="@string/revanced_disable_default_video_speed_live_summary_on" android:summaryOff="@string/revanced_disable_default_video_speed_live_summary_off" />SETTINGS: DEFAULT_VIDEO_SPEED -->
|
||||||
|
|
||||||
<!-- SETTINGS: VERTICAL_VIDEO_RESTRICTIONS
|
<!-- SETTINGS: VERTICAL_VIDEO_RESTRICTIONS
|
||||||
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_experimental_flag" />
|
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_experimental_flag" />
|
||||||
<SwitchPreference android:title="@string/revanced_vertical_video_restrictions_title" android:key="revanced_vertical_video_restrictions" android:defaultValue="false" android:summary="@string/revanced_vertical_video_restrictions_summary" />SETTINGS: VERTICAL_VIDEO_RESTRICTIONS -->
|
<SwitchPreference android:title="@string/revanced_vertical_video_restrictions_title" android:key="revanced_vertical_video_restrictions" android:defaultValue="false" android:summary="@string/revanced_vertical_video_restrictions_summary" />SETTINGS: VERTICAL_VIDEO_RESTRICTIONS -->
|
||||||
|
Reference in New Issue
Block a user