mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-09 11:04:36 +02:00
feat(YouTube): remove Hide player overlay filter
patch
This commit is contained in:
parent
96fd06f114
commit
b24b1c3474
@ -1,84 +0,0 @@
|
||||
package app.revanced.patches.youtube.player.playeroverlayfilter
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
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.Patch
|
||||
import app.revanced.patches.youtube.utils.fingerprints.YouTubeControlsOverlayFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ScrimOverlay
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.bytecode.getWideLiteralIndex
|
||||
import app.revanced.util.integrations.Constants.PLAYER
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Hide player overlay filter",
|
||||
description = "Hides the dark filter layer from the player's background.",
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
SharedResourceIdPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
[
|
||||
"18.24.37",
|
||||
"18.25.40",
|
||||
"18.27.36",
|
||||
"18.29.38",
|
||||
"18.30.37",
|
||||
"18.31.40",
|
||||
"18.32.39",
|
||||
"18.33.40",
|
||||
"18.34.38",
|
||||
"18.35.36",
|
||||
"18.36.39",
|
||||
"18.37.36",
|
||||
"18.38.44",
|
||||
"18.39.41"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object PlayerOverlayFilterPatch : BytecodePatch(
|
||||
setOf(YouTubeControlsOverlayFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
YouTubeControlsOverlayFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val targetIndex = getWideLiteralIndex(ScrimOverlay) + 3
|
||||
val targetParameter = getInstruction<ReferenceInstruction>(targetIndex).reference
|
||||
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
||||
|
||||
if (!targetParameter.toString().endsWith("Landroid/widget/ImageView;"))
|
||||
throw PatchException("Method signature parameter did not match: $targetParameter")
|
||||
|
||||
addInstruction(
|
||||
targetIndex + 1,
|
||||
"invoke-static {v$targetRegister}, $PLAYER->hidePlayerOverlayFilter(Landroid/widget/ImageView;)V"
|
||||
)
|
||||
}
|
||||
} ?: throw YouTubeControlsOverlayFingerprint.exception
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
*/
|
||||
SettingsPatch.addPreference(
|
||||
arrayOf(
|
||||
"PREFERENCE: PLAYER_SETTINGS",
|
||||
"SETTINGS: HIDE_PLAYER_OVERLAY_FILTER"
|
||||
)
|
||||
)
|
||||
|
||||
SettingsPatch.updatePatchStatus("Hide player overlay filter")
|
||||
|
||||
}
|
||||
}
|
@ -453,9 +453,6 @@
|
||||
<string name="revanced_hide_player_flyout_panel_watch_in_vr_summary_off">Watch in VR menu is shown</string>
|
||||
<string name="revanced_hide_player_flyout_panel_watch_in_vr_summary_on">Watch in VR menu is hidden</string>
|
||||
<string name="revanced_hide_player_flyout_panel_watch_in_vr_title">Hide watch in VR menu</string>
|
||||
<string name="revanced_hide_player_overlay_filter_summary_off">Player overlay filter is shown</string>
|
||||
<string name="revanced_hide_player_overlay_filter_summary_on">Player overlay filter is hidden</string>
|
||||
<string name="revanced_hide_player_overlay_filter_title">Hide player overlay filter</string>
|
||||
<string name="revanced_hide_preview_comment_off">Preview comment is shown</string>
|
||||
<string name="revanced_hide_preview_comment_on">Preview comment is hidden</string>
|
||||
<string name="revanced_hide_preview_comment_title">Hide preview comment</string>
|
||||
|
@ -401,7 +401,6 @@
|
||||
<Preference android:title="Hide info cards" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Hide music button" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Hide player button background" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Hide player overlay filter" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Hide previous next button" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Hide seek message" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Hide suggested actions" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
@ -522,9 +521,6 @@
|
||||
<!-- SETTINGS: HIDE_PLAYER_BUTTON_BACKGROUND
|
||||
<SwitchPreference android:title="@string/revanced_hide_player_button_background_title" android:key="revanced_hide_player_button_background" android:defaultValue="false" android:summaryOn="@string/revanced_hide_player_button_background_summary_on" android:summaryOff="@string/revanced_hide_player_button_background_summary_off" />SETTINGS: HIDE_PLAYER_BUTTON_BACKGROUND -->
|
||||
|
||||
<!-- SETTINGS: HIDE_PLAYER_OVERLAY_FILTER
|
||||
<SwitchPreference android:title="@string/revanced_hide_player_overlay_filter_title" android:key="revanced_hide_player_overlay_filter" android:defaultValue="false" android:summaryOn="@string/revanced_hide_player_overlay_filter_summary_on" android:summaryOff="@string/revanced_hide_player_overlay_filter_summary_off" />SETTINGS: HIDE_PLAYER_OVERLAY_FILTER -->
|
||||
|
||||
<!-- SETTINGS: HIDE_PREVIOUS_NEXT_BUTTON
|
||||
<SwitchPreference android:title="@string/revanced_hide_previous_next_button_title" android:key="revanced_hide_previous_next_button" android:defaultValue="false" android:summaryOn="@string/revanced_hide_previous_next_button_summary_on" android:summaryOff="@string/revanced_hide_previous_next_button_summary_off" />SETTINGS: HIDE_PREVIOUS_NEXT_BUTTON -->
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user