mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-01 23:24:28 +02:00
remove hide-fullscreen-buttoncontainer
patch
This commit is contained in:
parent
490edc93d9
commit
c2cef20998
@ -1,60 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.fullscreen.fullscreenbuttoncontainer.bytecode.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.shared.extensions.findMutableMethodOf
|
||||
import app.revanced.shared.extensions.injectHideCall
|
||||
import app.revanced.shared.extensions.toResult
|
||||
import app.revanced.shared.patches.mapping.ResourceMappingPatch
|
||||
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-bytecode-patch")
|
||||
@DependsOn([ResourceMappingPatch::class])
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class FullscreenButtonContainerBytecodePatch : BytecodePatch() {
|
||||
private val resourceIds = arrayOf(
|
||||
"quick_actions_element_container"
|
||||
).map { name ->
|
||||
ResourceMappingPatch.resourceMappings.single { it.name == name }.id
|
||||
}
|
||||
private var patchSuccessArray = Array(resourceIds.size) {false}
|
||||
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
context.classes.forEach { classDef ->
|
||||
classDef.methods.forEach { method ->
|
||||
with(method.implementation) {
|
||||
this?.instructions?.forEachIndexed { index, instruction ->
|
||||
when (instruction.opcode) {
|
||||
Opcode.CONST -> {
|
||||
when ((instruction as Instruction31i).wideLiteral) {
|
||||
resourceIds[0] -> { // fullscreen panel
|
||||
val insertIndex = index + 3
|
||||
val invokeInstruction = instructions.elementAt(insertIndex)
|
||||
if (invokeInstruction.opcode != Opcode.CHECK_CAST) return@forEachIndexed
|
||||
|
||||
val mutableMethod = context.proxy(classDef).mutableClass.findMutableMethodOf(method)
|
||||
|
||||
val viewRegister = (invokeInstruction as Instruction21c).registerA
|
||||
mutableMethod.implementation!!.injectHideCall(insertIndex, viewRegister, "layout/FullscreenLayoutPatch", "hideFullscreenButtonContainer")
|
||||
|
||||
patchSuccessArray[0] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> return@forEachIndexed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return toResult(patchSuccessArray.indexOf(false))
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
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.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.layout.fullscreen.fullscreenbuttoncontainer.bytecode.patch.FullscreenButtonContainerBytecodePatch
|
||||
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-fullscreen-buttoncontainer")
|
||||
@Description("Hides the button containers in fullscreen.")
|
||||
@DependsOn(
|
||||
[
|
||||
FullscreenButtonContainerBytecodePatch::class,
|
||||
SettingsPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class FullscreenButtonContainerPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
|
||||
/*
|
||||
add settings
|
||||
*/
|
||||
ResourceHelper.addSettings2(
|
||||
context,
|
||||
"PREFERENCE_CATEGORY: REVANCED_SETTINGS",
|
||||
"PREFERENCE: LAYOUT_SETTINGS",
|
||||
"PREFERENCE_HEADER: FULLSCREEN",
|
||||
"SETTINGS: HIDE_FULLSCREEN_BUTTON_CONTAINER"
|
||||
)
|
||||
|
||||
ResourceHelper.patchSuccess(
|
||||
context,
|
||||
"hide-fullscreen-buttoncontainer"
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -331,9 +331,6 @@ Is it ready to submit?"</string>
|
||||
<string name="revanced_hide_filmstrip_overlay_summary_off">Film strip overlay are shown</string>
|
||||
<string name="revanced_hide_filmstrip_overlay_summary_on">Film strip overlay are hidden</string>
|
||||
<string name="revanced_hide_filmstrip_overlay_title">Hide film strip overlay</string>
|
||||
<string name="revanced_hide_fullscreen_button_container_summary_off">Fullscreen button container is shown</string>
|
||||
<string name="revanced_hide_fullscreen_button_container_summary_on">Fullscreen button container is hidden</string>
|
||||
<string name="revanced_hide_fullscreen_button_container_title">Hide fullscreen button container</string>
|
||||
<string name="revanced_hide_info_cards_summary_off">Info cards are shown</string>
|
||||
<string name="revanced_hide_info_cards_summary_on">Info cards are hidden</string>
|
||||
<string name="revanced_hide_info_cards_title">Hide info cards</string>
|
||||
|
@ -185,8 +185,6 @@
|
||||
<!-- PREFERENCE_HEADER: FULLSCREEN
|
||||
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_layout_settings_fullscreen" />PREFERENCE_HEADER: FULLSCREEN -->
|
||||
|
||||
<!-- SETTINGS: HIDE_FULLSCREEN_BUTTON_CONTAINER
|
||||
<SwitchPreference android:title="@string/revanced_hide_fullscreen_button_container_title" android:key="revanced_hide_fullscreen_button_container" android:defaultValue="false" android:summaryOn="@string/revanced_hide_fullscreen_button_container_summary_on" android:summaryOff="@string/revanced_hide_fullscreen_button_container_summary_off" />SETTINGS: HIDE_FULLSCREEN_BUTTON_CONTAINER -->
|
||||
|
||||
<!-- SETTINGS: HIDE_ENDSCREEN_OVERLAY
|
||||
<SwitchPreference android:title="@string/revanced_hide_endscreen_overlay_title" android:key="revanced_hide_endscreen_overlay" android:defaultValue="false" android:summaryOn="@string/revanced_hide_endscreen_overlay_summary_on" android:summaryOff="@string/revanced_hide_endscreen_overlay_summary_off" />SETTINGS: HIDE_ENDSCREEN_OVERLAY -->
|
||||
@ -388,7 +386,6 @@
|
||||
<Preference android:title="hide-player-overlay-filter" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
|
||||
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_layout_settings_fullscreen" />
|
||||
<Preference android:title="hide-fullscreen-buttoncontainer" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="hide-endscreen-overlay" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="hide-filmstrip-overlay" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="disable-haptic-feedback" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user