Skip to content

Commit

Permalink
fix(Custom playback speed): Update fingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Jan 10, 2024
1 parent 46f28df commit 6d60bfd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableField

@Patch(
description = "Adds custom playback speed options.",
dependencies = [IntegrationsPatch::class, LithoFilterPatch::class, SettingsPatch::class, RecyclerViewTreeHookPatch::class]
dependencies = [
IntegrationsPatch::class,
LithoFilterPatch::class,
SettingsPatch::class,
RecyclerViewTreeHookPatch::class,
CustomPlaybackSpeedResourcePatch::class
]
)
object CustomPlaybackSpeedPatch : BytecodePatch(
setOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package app.revanced.patches.youtube.video.speed.custom

import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch

internal object CustomPlaybackSpeedResourcePatch : ResourcePatch() {
var speedUnavailableId: Long = -1

override fun execute(context: ResourceContext) {
speedUnavailableId = ResourceMappingPatch.resourceMappings.single {
it.type == "string" && it.name == "varispeed_unavailable_message"
}.id
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package app.revanced.patches.youtube.video.speed.custom.fingerprints

import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.youtube.video.speed.custom.CustomPlaybackSpeedResourcePatch
import app.revanced.util.patch.LiteralValueFingerprint

internal object ShowOldPlaybackSpeedMenuFingerprint : MethodFingerprint(
strings = listOf("PLAYBACK_RATE_MENU_BOTTOM_SHEET_FRAGMENT")
internal object ShowOldPlaybackSpeedMenuFingerprint : LiteralValueFingerprint(
literalSupplier = {
CustomPlaybackSpeedResourcePatch.speedUnavailableId
}
)

0 comments on commit 6d60bfd

Please sign in to comment.