mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-09 11:04:36 +02:00
feat(youtube/hide-suggested-video-overlay): no longer dependent on overlay-buttons
patches
This commit is contained in:
parent
a58a05a287
commit
837a54c0f5
@ -7,15 +7,17 @@ import app.revanced.patcher.annotation.Version
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
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.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.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.youtube.overlaybutton.general.patch.OverlayButtonsPatch
|
|
||||||
import app.revanced.patches.youtube.player.suggestedvideooverlay.fingerprints.CoreConatinerBuilderFingerprint
|
import app.revanced.patches.youtube.player.suggestedvideooverlay.fingerprints.CoreConatinerBuilderFingerprint
|
||||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||||
|
import app.revanced.patches.youtube.utils.fingerprints.VideoEndFingerprint
|
||||||
|
import app.revanced.patches.youtube.utils.fingerprints.VideoEndParentFingerprint
|
||||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.CoreContainer
|
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.CoreContainer
|
||||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||||
@ -29,7 +31,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
@Description("Hide the suggested video overlay to play next.")
|
@Description("Hide the suggested video overlay to play next.")
|
||||||
@DependsOn(
|
@DependsOn(
|
||||||
[
|
[
|
||||||
OverlayButtonsPatch::class,
|
|
||||||
SettingsPatch::class,
|
SettingsPatch::class,
|
||||||
SharedResourceIdPatch::class
|
SharedResourceIdPatch::class
|
||||||
]
|
]
|
||||||
@ -37,7 +38,10 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
@YouTubeCompatibility
|
@YouTubeCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class SuggestedVideoOverlayPatch : BytecodePatch(
|
class SuggestedVideoOverlayPatch : BytecodePatch(
|
||||||
listOf(CoreConatinerBuilderFingerprint)
|
listOf(
|
||||||
|
CoreConatinerBuilderFingerprint,
|
||||||
|
VideoEndParentFingerprint
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
|
||||||
@ -55,11 +59,22 @@ class SuggestedVideoOverlayPatch : BytecodePatch(
|
|||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
targetIndex,
|
targetIndex,
|
||||||
"invoke-static {v$targetRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR"
|
"invoke-static {v$targetRegister}, $PLAYER->hideSuggestedVideoOverlay(Landroid/view/ViewGroup;)V"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: return CoreConatinerBuilderFingerprint.toErrorResult()
|
} ?: return CoreConatinerBuilderFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
VideoEndParentFingerprint.result?.classDef?.let { classDef ->
|
||||||
|
VideoEndFingerprint.also { it.resolve(context, classDef) }.result?.let {
|
||||||
|
it.mutableMethod.apply {
|
||||||
|
addInstruction(
|
||||||
|
implementation!!.instructions.size - 1,
|
||||||
|
"invoke-static {},$PLAYER->hideSuggestedVideoOverlay()V"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: return VideoEndFingerprint.toErrorResult()
|
||||||
|
} ?: return VideoEndParentFingerprint.toErrorResult()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add settings
|
* Add settings
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user