mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
add hide-tooltip-content
patch
This commit is contained in:
@ -35,6 +35,7 @@ class SharedResourcdIdPatch : ResourcePatch {
|
||||
var liveChatButtonId: Long = -1
|
||||
var scrubbingLabelId: Long = -1
|
||||
var timebarColorLabelId: Long = -1
|
||||
var tooltipLabelId: Long = -1
|
||||
var videoqualityfragmentLabelId: Long = -1
|
||||
}
|
||||
|
||||
@ -63,6 +64,7 @@ class SharedResourcdIdPatch : ResourcePatch {
|
||||
liveChatButtonId = findSharedResourceId("id", "live_chat_overlay_button")
|
||||
scrubbingLabelId = findSharedResourceId("dimen", "vertical_touch_offset_to_enter_fine_scrubbing")
|
||||
timebarColorLabelId = findSharedResourceId("color", "inline_time_bar_progress_color")
|
||||
tooltipLabelId = findSharedResourceId("layout", "tooltip_content_view")
|
||||
videoqualityfragmentLabelId = findSharedResourceId("layout", "video_quality_bottom_sheet_list_fragment_title")
|
||||
|
||||
return PatchResultSuccess()
|
||||
|
@ -0,0 +1,20 @@
|
||||
package app.revanced.patches.youtube.misc.tooltip.bytecode.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourcdIdPatch
|
||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object TooltipContentViewFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L"),
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.implementation?.instructions?.any { instruction ->
|
||||
instruction.opcode.ordinal == Opcode.CONST.ordinal &&
|
||||
(instruction as? WideLiteralInstruction)?.wideLiteral == SharedResourcdIdPatch.tooltipLabelId
|
||||
} == true
|
||||
}
|
||||
)
|
@ -0,0 +1,34 @@
|
||||
package app.revanced.patches.youtube.misc.tooltip.bytecode.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourcdIdPatch
|
||||
import app.revanced.patches.youtube.misc.tooltip.bytecode.fingerprints.TooltipContentViewFingerprint
|
||||
import app.revanced.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.shared.extensions.toErrorResult
|
||||
|
||||
@Name("hide-tooltip-content-bytecode-patch")
|
||||
@DependsOn([SharedResourcdIdPatch::class])
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class TooltipContentViewBytecodePatch : BytecodePatch(
|
||||
listOf(
|
||||
TooltipContentViewFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
|
||||
TooltipContentViewFingerprint.result?.mutableMethod?.addInstruction(
|
||||
0,
|
||||
"return-void"
|
||||
) ?: return TooltipContentViewFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package app.revanced.patches.youtube.misc.tooltip.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patches.youtube.misc.tooltip.bytecode.patch.TooltipContentViewBytecodePatch
|
||||
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.shared.util.resources.ResourceHelper
|
||||
|
||||
@Patch
|
||||
@Name("hide-tooltip-content")
|
||||
@Description("Hides the tooltip box that appears on first install.")
|
||||
@DependsOn(
|
||||
[
|
||||
TooltipContentViewBytecodePatch::class,
|
||||
SettingsPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class MinimizedPlaybackPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
|
||||
ResourceHelper.patchSuccess(
|
||||
context,
|
||||
"hide-tooltip-content"
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user