generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(YouTube - SponsorBlock): Skip segments when casting (#3331)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
- Loading branch information
1 parent
7a63b73
commit d9395fd
Showing
3 changed files
with
116 additions
and
28 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
8 changes: 8 additions & 0 deletions
8
...tches/youtube/video/information/fingerprints/MdxPlayerDirectorSetVideoStageFingerprint.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,8 @@ | ||
package app.revanced.patches.youtube.video.information.fingerprints | ||
|
||
|
||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
|
||
internal object MdxPlayerDirectorSetVideoStageFingerprint : MethodFingerprint( | ||
strings = listOf("MdxDirector setVideoStage ad should be null when videoStage is not an Ad state ") | ||
) |
23 changes: 23 additions & 0 deletions
23
.../kotlin/app/revanced/patches/youtube/video/information/fingerprints/MdxSeekFingerprint.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,23 @@ | ||
package app.revanced.patches.youtube.video.information.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
internal object MdxSeekFingerprint : MethodFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
returnType = "Z", | ||
parameters = listOf("J", "L"), | ||
opcodes = listOf( | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT, | ||
Opcode.RETURN, | ||
), | ||
customFingerprint = { methodDef, _ -> | ||
// The instruction count is necessary here to avoid matching the relative version | ||
// of the seek method we're after, which has the same function signature as the | ||
// regular one, is in the same class, and even has the exact same 3 opcodes pattern. | ||
methodDef.implementation!!.instructions.count() == 3 | ||
} | ||
) |