mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-20 00:07:18 +02:00
feat(YouTube/Hide end screen overlay): support version 18.44.41
This commit is contained in:
parent
357555780f
commit
dc560eecf2
@ -5,10 +5,11 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchException
|
||||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.youtube.fullscreen.endscreenoverlay.fingerprints.EndScreenResultsFingerprint
|
import app.revanced.patches.youtube.fullscreen.endscreenoverlay.fingerprints.EndScreenResultsParentFingerprint
|
||||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||||
import app.revanced.util.integrations.Constants.FULLSCREEN
|
import app.revanced.util.integrations.Constants.FULLSCREEN
|
||||||
@ -40,18 +41,20 @@ import app.revanced.util.integrations.Constants.FULLSCREEN
|
|||||||
"18.40.34",
|
"18.40.34",
|
||||||
"18.41.39",
|
"18.41.39",
|
||||||
"18.42.41",
|
"18.42.41",
|
||||||
"18.43.45"
|
"18.43.45",
|
||||||
|
"18.44.41"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object HideEndScreenOverlayPatch : BytecodePatch(
|
object HideEndScreenOverlayPatch : BytecodePatch(
|
||||||
setOf(EndScreenResultsFingerprint)
|
setOf(EndScreenResultsParentFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
EndScreenResultsFingerprint.result?.let {
|
EndScreenResultsParentFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableClass.methods.find { method -> method.parameters == listOf("I", "Z", "I") }
|
||||||
|
?.apply {
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
0, """
|
0, """
|
||||||
invoke-static {}, $FULLSCREEN->hideEndScreenOverlay()Z
|
invoke-static {}, $FULLSCREEN->hideEndScreenOverlay()Z
|
||||||
@ -60,8 +63,8 @@ object HideEndScreenOverlayPatch : BytecodePatch(
|
|||||||
return-void
|
return-void
|
||||||
""", ExternalLabel("show", getInstruction(0))
|
""", ExternalLabel("show", getInstruction(0))
|
||||||
)
|
)
|
||||||
}
|
} ?: throw PatchException("Could not find targetMethod")
|
||||||
} ?: throw EndScreenResultsFingerprint.exception
|
} ?: throw EndScreenResultsParentFingerprint.exception
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add settings
|
* Add settings
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.fingerprint.MethodFingerprint
|
|||||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AppRelatedEndScreenResults
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AppRelatedEndScreenResults
|
||||||
import app.revanced.util.bytecode.isWideLiteralExists
|
import app.revanced.util.bytecode.isWideLiteralExists
|
||||||
|
|
||||||
object EndScreenResultsFingerprint : MethodFingerprint(
|
object EndScreenResultsParentFingerprint : MethodFingerprint(
|
||||||
returnType = "V",
|
returnType = "V",
|
||||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(AppRelatedEndScreenResults) }
|
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(AppRelatedEndScreenResults) }
|
||||||
)
|
)
|
Loading…
x
Reference in New Issue
Block a user