mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
fix(YouTube/Hide mix playlist): Hide mix playlist also hides playlist from music section
This commit is contained in:
@ -10,14 +10,12 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.general.mixplaylists.fingerprints.BottomPanelOverlayTextFingerprint
|
||||
import app.revanced.patches.youtube.general.mixplaylists.fingerprints.ElementParserFingerprint
|
||||
import app.revanced.patches.youtube.general.mixplaylists.fingerprints.EmptyFlatBufferFingerprint
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.bytecode.getStringIndex
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
@ -57,29 +55,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
@Suppress("unused")
|
||||
object MixPlaylistsPatch : BytecodePatch(
|
||||
setOf(
|
||||
BottomPanelOverlayTextFingerprint,
|
||||
ElementParserFingerprint,
|
||||
EmptyFlatBufferFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
/**
|
||||
* Hide MixPlaylists when tablet UI is turned on
|
||||
* Required only for RVX Patches
|
||||
*/
|
||||
BottomPanelOverlayTextFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val insertIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
val insertRegister = getInstruction<TwoRegisterInstruction>(insertIndex).registerA
|
||||
|
||||
addInstruction(
|
||||
insertIndex,
|
||||
"invoke-static {v$insertRegister}, $GENERAL->hideMixPlaylists(Landroid/view/View;)V"
|
||||
)
|
||||
}
|
||||
} ?: throw BottomPanelOverlayTextFingerprint.exception
|
||||
|
||||
/**
|
||||
* Separated from bytebuffer patch
|
||||
* Target method is only used for Hide MixPlaylists patch
|
||||
|
@ -1,15 +0,0 @@
|
||||
package app.revanced.patches.youtube.general.mixplaylists.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BottomPanelOverlayText
|
||||
import app.revanced.util.bytecode.isWideLiteralExists
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object BottomPanelOverlayTextFingerprint : MethodFingerprint(
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IPUT_OBJECT
|
||||
),
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(BottomPanelOverlayText) }
|
||||
)
|
@ -26,7 +26,6 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
var BackgroundCategory: Long = -1
|
||||
var Bar: Long = -1
|
||||
var BarContainerHeight: Long = -1
|
||||
var BottomPanelOverlayText: Long = -1
|
||||
var BottomSheetFooterText: Long = -1
|
||||
var BottomUiContainerStub: Long = -1
|
||||
var ChannelListSubMenu: Long = -1
|
||||
@ -108,7 +107,6 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
BackgroundCategory = find(STRING, "pref_background_and_offline_category")
|
||||
Bar = find(LAYOUT, "bar")
|
||||
BarContainerHeight = find(DIMEN, "bar_container_height")
|
||||
BottomPanelOverlayText = find(ID, "bottom_panel_overlay_text")
|
||||
BottomSheetFooterText = find(ID, "bottom_sheet_footer_text")
|
||||
BottomUiContainerStub = find(ID, "bottom_ui_container_stub")
|
||||
ChannelListSubMenu = find(LAYOUT, "channel_list_sub_menu")
|
||||
|
Reference in New Issue
Block a user