mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
remove hide-time-and-seekbar
patch
This commit is contained in:
@ -1,15 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.seekbar.timeandseekbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object TimeCounterFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
opcodes = listOf(
|
||||
Opcode.CONST_WIDE_16,
|
||||
Opcode.CMP_LONG
|
||||
)
|
||||
)
|
@ -1,19 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.seekbar.timeandseekbar.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.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
|
||||
object TimeCounterParentFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
access = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.implementation?.instructions?.any {
|
||||
it.opcode.ordinal == Opcode.CONST.ordinal &&
|
||||
(it as? WideLiteralInstruction)?.wideLiteral == SharedResourcdIdPatch.timebarColorLabelId
|
||||
} == true
|
||||
}
|
||||
)
|
@ -1,78 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.seekbar.timeandseekbar.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
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.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.layout.seekbar.timeandseekbar.fingerprints.TimeCounterFingerprint
|
||||
import app.revanced.patches.youtube.layout.seekbar.timeandseekbar.fingerprints.TimeCounterParentFingerprint
|
||||
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourcdIdPatch
|
||||
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.timebar.patch.HookTimebarPatch
|
||||
import app.revanced.util.integrations.Constants.SEEKBAR_LAYOUT
|
||||
|
||||
@Patch
|
||||
@Name("hide-time-and-seekbar")
|
||||
@Description("Hides progress bar and time counter on videos.")
|
||||
@DependsOn(
|
||||
[
|
||||
HookTimebarPatch::class,
|
||||
SettingsPatch::class,
|
||||
SharedResourcdIdPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideTimeAndSeekbarPatch : BytecodePatch(
|
||||
listOf(
|
||||
TimeCounterParentFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
|
||||
TimeCounterParentFingerprint.result?.let { parentResult ->
|
||||
TimeCounterFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.mutableMethod?.let { method ->
|
||||
listOf(
|
||||
HookTimebarPatch.setTimebarMethod,
|
||||
method
|
||||
).forEach {
|
||||
it.addInstructions(
|
||||
0, """
|
||||
invoke-static {}, $SEEKBAR_LAYOUT->hideTimeAndSeekbar()Z
|
||||
move-result v0
|
||||
if-eqz v0, :hide_time_and_seekbar
|
||||
return-void
|
||||
""", listOf(ExternalLabel("hide_time_and_seekbar", it.instruction(0)))
|
||||
)
|
||||
}
|
||||
|
||||
} ?: return TimeCounterFingerprint.toErrorResult()
|
||||
} ?: return TimeCounterParentFingerprint.toErrorResult()
|
||||
|
||||
/*
|
||||
* Add settings
|
||||
*/
|
||||
SettingsPatch.addPreference(
|
||||
arrayOf(
|
||||
"PREFERENCE: OTHER_LAYOUT_SETTINGS",
|
||||
"PREFERENCE_HEADER: SEEKBAR",
|
||||
"SETTINGS: HIDE_TIME_AND_SEEKBAR"
|
||||
)
|
||||
)
|
||||
|
||||
SettingsPatch.updatePatchStatus("hide-time-and-seekbar")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -35,7 +35,6 @@ class SharedResourcdIdPatch : ResourcePatch {
|
||||
var layoutVideo: Long = -1
|
||||
var liveChatButtonId: Long = -1
|
||||
var scrubbingLabelId: Long = -1
|
||||
var timebarColorLabelId: Long = -1
|
||||
var tooltipLabelId: Long = -1
|
||||
var videoqualityfragmentLabelId: Long = -1
|
||||
}
|
||||
@ -65,7 +64,6 @@ class SharedResourcdIdPatch : ResourcePatch {
|
||||
layoutVideo = findSharedResourceId("layout", "endscreen_element_layout_video")
|
||||
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")
|
||||
|
||||
|
Reference in New Issue
Block a user