diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenpanels/patch/HideFullscreenButtonContainerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenbuttoncontainer/bytecode/patch/HideFullscreenButtonContainerBytecodePatch.kt similarity index 92% rename from src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenpanels/patch/HideFullscreenButtonContainerPatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenbuttoncontainer/bytecode/patch/HideFullscreenButtonContainerBytecodePatch.kt index d2d11fc0c..b5bb020fb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenpanels/patch/HideFullscreenButtonContainerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenbuttoncontainer/bytecode/patch/HideFullscreenButtonContainerBytecodePatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.fullscreen.fullscreenpanels.patch +package app.revanced.patches.youtube.layout.fullscreen.fullscreenbuttoncontainer.bytecode.patch import app.revanced.extensions.findMutableMethodOf import app.revanced.extensions.injectHideCall @@ -15,11 +15,11 @@ import org.jf.dexlib2.Opcode import org.jf.dexlib2.iface.instruction.formats.Instruction21c import org.jf.dexlib2.iface.instruction.formats.Instruction31i -@Name("hide-fullscreen-buttoncontainer") +@Name("hide-fullscreen-buttoncontainer-bytecode-patch") @DependsOn([ResourceMappingPatch::class]) @YouTubeCompatibility @Version("0.0.1") -class HideFullscreenButtonContainerPatch : BytecodePatch() { +class HideFullscreenButtonContainerBytecodePatch : BytecodePatch() { private val resourceIds = arrayOf( "quick_actions_element_container" ).map { name -> @@ -43,7 +43,7 @@ class HideFullscreenButtonContainerPatch : BytecodePatch() { val mutableMethod = context.proxy(classDef).mutableClass.findMutableMethodOf(method) val viewRegister = (invokeInstruction as Instruction21c).registerA - mutableMethod.implementation!!.injectHideCall(insertIndex, viewRegister, "layout/FullscreenLayoutPatch", "hideFullscreenPanels") + mutableMethod.implementation!!.injectHideCall(insertIndex, viewRegister, "layout/FullscreenLayoutPatch", "hideFullscreenButtonContainer") patchSuccessArray[0] = true; } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenbuttoncontainer/resource/patch/HideFullscreenButtonContainerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenbuttoncontainer/resource/patch/HideFullscreenButtonContainerPatch.kt new file mode 100644 index 000000000..a1f624597 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenbuttoncontainer/resource/patch/HideFullscreenButtonContainerPatch.kt @@ -0,0 +1,46 @@ +package app.revanced.patches.youtube.layout.fullscreen.fullscreenbuttoncontainer.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.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patches.shared.annotation.YouTubeCompatibility +import app.revanced.patches.youtube.layout.fullscreen.fullscreenbuttoncontainer.bytecode.patch.HideFullscreenButtonContainerBytecodePatch +import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch + +@Patch +@Name("hide-fullscreen-buttoncontainer") +@Description("Hides the button containers in fullscreen.") +@DependsOn( + [ + HideFullscreenButtonContainerBytecodePatch::class, + SettingsPatch::class + ] +) +@YouTubeCompatibility +@Version("0.0.1") +class HideFullscreenButtonContainerPatch : ResourcePatch { + + override fun execute(context: ResourceContext): PatchResult { + + /* + * Add ReVanced Settings + */ + SettingsPatch.addPreference( + arrayOf( + "PREFERENCE: OTHER_LAYOUT_SETTINGS", + "PREFERENCE_HEADER: FULLSCREEN", + "SETTINGS: HIDE_FULLSCREEN_BUTTON_CONTAINER" + ) + ) + + SettingsPatch.updatePatchStatus("hide-fullscreen-buttoncontainer") + + return PatchResultSuccess() + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenpanels/patch/HideFullscreenPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenpanels/patch/HideFullscreenPanelsPatch.kt index 589a7633f..844813552 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenpanels/patch/HideFullscreenPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreen/fullscreenpanels/patch/HideFullscreenPanelsPatch.kt @@ -16,6 +16,7 @@ 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.shared.fingerprints.LayoutConstructorFingerprint +import app.revanced.patches.youtube.layout.fullscreen.fullscreenbuttoncontainer.bytecode.patch.HideFullscreenButtonContainerBytecodePatch import app.revanced.patches.youtube.layout.fullscreen.fullscreenpanels.fingerprints.FullscreenViewAdderFingerprint import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch import app.revanced.util.integrations.Constants.FULLSCREEN_LAYOUT @@ -30,7 +31,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c @Description("Hides video description and comments panel in fullscreen view.") @DependsOn( [ - HideFullscreenButtonContainerPatch::class, + HideFullscreenButtonContainerBytecodePatch::class, SettingsPatch::class ] )