remove hide-time-and-seekbar patch

This commit is contained in:
inotia00 2023-02-22 23:35:37 +09:00
parent 04c4adaad0
commit c297601a49
5 changed files with 0 additions and 117 deletions

View File

@ -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
)
)

View File

@ -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
}
)

View File

@ -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()
}
}

View File

@ -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")

View File

@ -284,8 +284,6 @@
<!-- SETTINGS: ENABLE_SEEKBAR_TAPPING
<SwitchPreference android:title="@string/revanced_enable_seekbar_tapping_title" android:key="revanced_enable_seekbar_tapping" android:defaultValue="true" android:summaryOn="@string/revanced_enable_seekbar_tapping_summary_on" android:summaryOff="@string/revanced_enable_seekbar_tapping_summary_off" />SETTINGS: ENABLE_SEEKBAR_TAPPING -->
<!-- SETTINGS: HIDE_TIME_AND_SEEKBAR
<SwitchPreference android:title="@string/revanced_hide_time_and_seekbar_title" android:key="revanced_hide_time_and_seekbar" android:defaultValue="false" android:summaryOn="@string/revanced_hide_time_and_seekbar_summary_on" android:summaryOff="@string/revanced_hide_time_and_seekbar_summary_off" />SETTINGS: HIDE_TIME_AND_SEEKBAR -->
<!-- PREFERENCE: OTHER_LAYOUT_SETTINGS
</PreferenceScreen>PREFERENCE: OTHER_LAYOUT_SETTINGS -->
@ -420,7 +418,6 @@
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_layout_settings_seekbar" />
<Preference android:title="custom-seekbar-color" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
<Preference android:title="enable-seekbar-tapping" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
<Preference android:title="hide-time-and-seekbar" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_overlay_button_title" />
<Preference android:title="overlay-buttons" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>