mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-11 12:04:39 +02:00
add support YouTube v18.17.43
This commit is contained in:
parent
7252e32005
commit
2b5b28003f
@ -10,7 +10,8 @@ import app.revanced.patcher.annotation.Package
|
||||
"18.13.38",
|
||||
"18.14.41",
|
||||
"18.15.40",
|
||||
"18.16.39"
|
||||
"18.16.39",
|
||||
"18.17.43"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
@ -10,7 +10,6 @@ import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.extensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
@ -118,15 +117,18 @@ class SponsorBlockBytecodePatch : BytecodePatch(
|
||||
insertInstructions.indexOf(it) to (it as FiveRegisterInstruction).registerD
|
||||
}
|
||||
|
||||
if (drawRectangleInstructions.size < 4)
|
||||
return PatchResultError("Couldn't find drawRect reference")
|
||||
|
||||
mapOf(
|
||||
"setSponsorBarAbsoluteLeft" to 3,
|
||||
"setSponsorBarAbsoluteRight" to 0
|
||||
).forEach { (string, int) ->
|
||||
val (index, register) = drawRectangleInstructions[int]
|
||||
injectCallRectangle(index, register, string)
|
||||
/**
|
||||
* Deprecated in YouTube v18.17.43+.
|
||||
* TODO: remove code from integrations
|
||||
*/
|
||||
if (drawRectangleInstructions.size > 3) {
|
||||
mapOf(
|
||||
"setSponsorBarAbsoluteLeft" to 3,
|
||||
"setSponsorBarAbsoluteRight" to 0
|
||||
).forEach { (string, int) ->
|
||||
val (index, register) = drawRectangleInstructions[int]
|
||||
injectCallRectangle(index, register, string)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user