add support YouTube v18.17.43

This commit is contained in:
inotia00 2023-05-12 08:16:52 +09:00
parent 7252e32005
commit 2b5b28003f
2 changed files with 14 additions and 11 deletions

View File

@ -10,7 +10,8 @@ import app.revanced.patcher.annotation.Package
"18.13.38", "18.13.38",
"18.14.41", "18.14.41",
"18.15.40", "18.15.40",
"18.16.39" "18.16.39",
"18.17.43"
) )
)] )]
) )

View File

@ -10,7 +10,6 @@ import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
@ -118,9 +117,11 @@ class SponsorBlockBytecodePatch : BytecodePatch(
insertInstructions.indexOf(it) to (it as FiveRegisterInstruction).registerD insertInstructions.indexOf(it) to (it as FiveRegisterInstruction).registerD
} }
if (drawRectangleInstructions.size < 4) /**
return PatchResultError("Couldn't find drawRect reference") * Deprecated in YouTube v18.17.43+.
* TODO: remove code from integrations
*/
if (drawRectangleInstructions.size > 3) {
mapOf( mapOf(
"setSponsorBarAbsoluteLeft" to 3, "setSponsorBarAbsoluteLeft" to 3,
"setSponsorBarAbsoluteRight" to 0 "setSponsorBarAbsoluteRight" to 0
@ -128,6 +129,7 @@ class SponsorBlockBytecodePatch : BytecodePatch(
val (index, register) = drawRectangleInstructions[int] val (index, register) = drawRectangleInstructions[int]
injectCallRectangle(index, register, string) injectCallRectangle(index, register, string)
} }
}
/** /**
* Draw segment * Draw segment