forked from ReVanced/revanced-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Custom playback speed): Update fingerprint
- Loading branch information
1 parent
46f28df
commit 6d60bfd
Showing
3 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...otlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedResourcePatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
9 changes: 6 additions & 3 deletions
9
...ed/patches/youtube/video/speed/custom/fingerprints/ShowOldPlaybackSpeedMenuFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
) |