generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(release): 2.5.1-dev.1 [skip ci] ## [2.5.1-dev.1](v2.5.0...v2.5.1-dev.1) (2022-06-30) ### Bug Fixes * freezing panels when watching video in fullscreen ([#89](#89)) ([f5d4f6c](f5d4f6c)) * invalid version in compatibility annotation ([#90](#90)) ([df43547](df43547)) * feat: migrate to breaking changes of patcher * chore(release): 2.6.0-dev.1 [skip ci] # [2.6.0-dev.1](v2.5.1-dev.1...v2.6.0-dev.1) (2022-07-02) ### Features * migrate to breaking changes of patcher ([a116852](a116852)) * refactor: add package for fingerprints * feat: partial `sponsorblock` patch * feat: add `Name` annotation to `sponsorblock-resource-patch` * fix: `sponsorblock-resource-patch` * refactor: remove unused resources * refactor: remove `locale-config-fix` dependency * fix: broken fingerprints * feat: general fixes on `sponsorblock` patch * feat: more fixes on `sponsorblock` patch * feat: update `sponsorblock` patch to 17.26.35 * style: use better wording and fix spelling mistakes * fix: finish `sponsorblock` patch Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
- Loading branch information
1 parent
8f06ea9
commit 36af4cc
Showing
27 changed files
with
1,149 additions
and
7 deletions.
There are no files selected for viewing
Empty file.
13 changes: 13 additions & 0 deletions
13
...app/revanced/patches/youtube/layout/sponsorblock/annotations/SponsorBlockCompatibility.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,13 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.annotations | ||
|
||
import app.revanced.patcher.annotation.Compatibility | ||
import app.revanced.patcher.annotation.Package | ||
|
||
@Compatibility( | ||
[Package( | ||
"com.google.android.youtube", arrayOf("17.22.36", "17.26.35", "17.27.39") | ||
)] | ||
) | ||
@Target(AnnotationTarget.CLASS) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
internal annotation class SponsorBlockCompatibility |
41 changes: 41 additions & 0 deletions
41
...vanced/patches/youtube/layout/sponsorblock/bytecode/fingerprints/AppendTimeFingerprint.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,41 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
import org.jf.dexlib2.AccessFlags | ||
import org.jf.dexlib2.Opcode | ||
|
||
@Name("append-time-fingerprint") | ||
@MatchingMethod( | ||
"Liet;", "e" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object AppendTimeFingerprint : MethodFingerprint( | ||
"V", | ||
AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
listOf("L", "L", "L"), | ||
listOf( | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT_OBJECT, | ||
Opcode.IGET_OBJECT, | ||
Opcode.IGET_OBJECT, | ||
Opcode.CHECK_CAST, | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT_OBJECT, | ||
Opcode.INVOKE_STATIC, | ||
Opcode.MOVE_RESULT, | ||
Opcode.IF_NEZ, | ||
Opcode.IGET_OBJECT, | ||
Opcode.IGET_OBJECT, | ||
Opcode.CHECK_CAST, | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.RETURN_VOID | ||
) | ||
) |
21 changes: 21 additions & 0 deletions
21
.../youtube/layout/sponsorblock/bytecode/fingerprints/CreateVideoPlayerSeekbarFingerprint.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,21 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
|
||
@Name("create-video-player-seekbar-fingerprint") | ||
@MatchingMethod( | ||
"Lfcm;", "onDraw" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object CreateVideoPlayerSeekbarFingerprint : MethodFingerprint( | ||
"V", null, null, | ||
null, | ||
listOf("timed_markers_width") | ||
) |
24 changes: 24 additions & 0 deletions
24
...atches/youtube/layout/sponsorblock/bytecode/fingerprints/NextGenWatchLayoutFingerprint.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,24 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
import org.jf.dexlib2.util.MethodUtil | ||
|
||
@Name("next-gen-watch-layout-fingerprint") | ||
@MatchingMethod( | ||
"LNextGenWatchLayout;", "<init>" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object NextGenWatchLayoutFingerprint : MethodFingerprint( | ||
"V", // constructors return void, in favour of speed of matching, this fingerprint has been added | ||
null, | ||
null, | ||
null, | ||
customFingerprint = { methodDef -> MethodUtil.isConstructor(methodDef) && methodDef.parameterTypes.size == 3 && methodDef.definingClass.endsWith("NextGenWatchLayout;") } | ||
) |
22 changes: 22 additions & 0 deletions
22
.../layout/sponsorblock/bytecode/fingerprints/PlayerControllerSetTimeReferenceFingerprint.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,22 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
import org.jf.dexlib2.Opcode | ||
|
||
@Name("player-controller-set-time-reference-fingerprint") | ||
@MatchingMethod( | ||
"Lxqm;", "<init>" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object PlayerControllerSetTimeReferenceFingerprint : MethodFingerprint( | ||
null, null, null, | ||
listOf(Opcode.INVOKE_DIRECT_RANGE, Opcode.IGET_OBJECT), | ||
listOf("Media progress reported outside media playback: ") | ||
) |
23 changes: 23 additions & 0 deletions
23
...vanced/patches/youtube/layout/sponsorblock/bytecode/fingerprints/PlayerInitFingerprint.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.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
|
||
@Name("player-init-fingerprint") | ||
@MatchingMethod( | ||
"Laajv;", "aG" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object PlayerInitFingerprint : MethodFingerprint( | ||
null, null, null, | ||
null, | ||
strings = listOf( | ||
"playVideo called on player response with no videoStreamingData." | ||
), | ||
) |
22 changes: 22 additions & 0 deletions
22
.../youtube/layout/sponsorblock/bytecode/fingerprints/PlayerOverlaysLayoutInitFingerprint.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,22 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
|
||
@Name("player-overlays-layout-init-fingerprint") | ||
@MatchingMethod( | ||
"Lihh;", "u" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object PlayerOverlaysLayoutInitFingerprint : MethodFingerprint( | ||
null, null, null, | ||
null, | ||
null, | ||
{ methodDef -> methodDef.returnType.endsWith("YouTubePlayerOverlaysLayout;") } | ||
) |
37 changes: 37 additions & 0 deletions
37
...youtube/layout/sponsorblock/bytecode/fingerprints/RectangleFieldInvalidatorFingerprint.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,37 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction | ||
import org.jf.dexlib2.iface.reference.MethodReference | ||
|
||
@Name("rectangle-field-invalidator-fingerprint") | ||
@MatchingMethod( | ||
"Lfcm;", "kY" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object RectangleFieldInvalidatorFingerprint : MethodFingerprint( | ||
"V", | ||
null, | ||
null, | ||
null, | ||
null, | ||
custom@{ methodDef -> | ||
val instructions = methodDef.implementation?.instructions!! | ||
val instructionCount = instructions.count() | ||
|
||
// the method has definitely more than 5 instructions | ||
if (instructionCount < 5) return@custom false | ||
|
||
val referenceInstruction = instructions.elementAt(instructionCount - 2) // the second to last instruction | ||
val reference = ((referenceInstruction as? ReferenceInstruction)?.reference as? MethodReference) | ||
|
||
reference?.parameterTypes?.size == 1 && reference.name == "invalidate" // the reference is the invalidate(..) method | ||
} | ||
) |
23 changes: 23 additions & 0 deletions
23
...app/revanced/patches/youtube/layout/sponsorblock/bytecode/fingerprints/SeekFingerprint.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.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
|
||
@Name("seek-fingerprint") | ||
@MatchingMethod( | ||
"Laajv;", "af" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object SeekFingerprint : MethodFingerprint( | ||
null, | ||
null, | ||
null, | ||
null, | ||
listOf("Attempting to seek during an ad") | ||
) |
19 changes: 19 additions & 0 deletions
19
...atches/youtube/layout/sponsorblock/bytecode/fingerprints/ShowPlayerControlsFingerprint.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,19 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
|
||
@Name("show-player-controls-fingerprint") | ||
@MatchingMethod( | ||
"LYouTubeControlsOverlay;", "ac" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object ShowPlayerControlsFingerprint : MethodFingerprint( | ||
"V", null, listOf("Z","Z"), null, null | ||
) |
34 changes: 34 additions & 0 deletions
34
...anced/patches/youtube/layout/sponsorblock/bytecode/fingerprints/VideoLengthFingerprint.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,34 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
import org.jf.dexlib2.Opcode | ||
|
||
@Name("video-length-fingerprint") | ||
@MatchingMethod( | ||
"Lyfh;", "z" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object VideoLengthFingerprint : MethodFingerprint( | ||
null, null, null, | ||
listOf( | ||
Opcode.MOVE_RESULT_WIDE, | ||
Opcode.CMP_LONG, | ||
Opcode.IF_LEZ, | ||
Opcode.IGET_OBJECT, | ||
Opcode.CHECK_CAST, | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT_WIDE, | ||
Opcode.GOTO, | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT_WIDE, | ||
Opcode.CONST_4, | ||
Opcode.INVOKE_VIRTUAL | ||
) | ||
) |
20 changes: 20 additions & 0 deletions
20
...evanced/patches/youtube/layout/sponsorblock/bytecode/fingerprints/VideoTimeFingerprint.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,20 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Version | ||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility | ||
|
||
@Name("video-time-fingerprint") | ||
@MatchingMethod( | ||
"Lwyh;", "<init>" | ||
) | ||
@DirectPatternScanMethod | ||
@SponsorBlockCompatibility | ||
@Version("0.0.1") | ||
object VideoTimeFingerprint : MethodFingerprint( | ||
null, null, null, null, | ||
listOf("MedialibPlayerTimeInfo{currentPositionMillis=") | ||
) |
Oops, something went wrong.