mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
fix(YouTube/Hide feed components): Hide subscriptions channel section
setting does not support tablet layout
This commit is contained in:
@ -11,6 +11,8 @@ import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.feed.components.fingerprints.BreakingNewsFingerprint
|
||||
import app.revanced.patches.youtube.feed.components.fingerprints.ChannelListSubMenuFingerprint
|
||||
import app.revanced.patches.youtube.feed.components.fingerprints.ChannelListSubMenuTabletFingerprint
|
||||
import app.revanced.patches.youtube.feed.components.fingerprints.ChannelListSubMenuTabletSyntheticFingerprint
|
||||
import app.revanced.patches.youtube.feed.components.fingerprints.DefaultsTabsBarFingerprint
|
||||
import app.revanced.patches.youtube.feed.components.fingerprints.ElementParserFingerprint
|
||||
import app.revanced.patches.youtube.feed.components.fingerprints.ElementParserParentFingerprint
|
||||
@ -51,6 +53,8 @@ object FeedComponentsPatch : BaseBytecodePatch(
|
||||
fingerprints = setOf(
|
||||
BreakingNewsFingerprint,
|
||||
ChannelListSubMenuFingerprint,
|
||||
ChannelListSubMenuTabletFingerprint,
|
||||
ChannelListSubMenuTabletSyntheticFingerprint,
|
||||
DefaultsTabsBarFingerprint,
|
||||
ElementParserParentFingerprint,
|
||||
FilterBarHeightFingerprint,
|
||||
@ -93,6 +97,26 @@ object FeedComponentsPatch : BaseBytecodePatch(
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for hide subscriptions channel section for tablet
|
||||
|
||||
arrayOf(
|
||||
ChannelListSubMenuTabletFingerprint,
|
||||
ChannelListSubMenuTabletSyntheticFingerprint
|
||||
).forEach { fingerprint ->
|
||||
fingerprint.resultOrThrow().mutableMethod.apply {
|
||||
addInstructionsWithLabels(
|
||||
0, """
|
||||
invoke-static {}, $FEED_CLASS_DESCRIPTOR->hideSubscriptionsChannelSection()Z
|
||||
move-result v0
|
||||
if-eqz v0, :show
|
||||
return-void
|
||||
""", ExternalLabel("show", getInstruction(0))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for hide category bar
|
||||
|
||||
FilterBarHeightFingerprint.patch<TwoRegisterInstruction> { register ->
|
||||
|
@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.feed.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.DrawerResults
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal object ChannelListSubMenuTabletFingerprint : LiteralValueFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = emptyList(),
|
||||
returnType = "V",
|
||||
literalSupplier = { DrawerResults }
|
||||
)
|
@ -0,0 +1,11 @@
|
||||
package app.revanced.patches.youtube.feed.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal object ChannelListSubMenuTabletSyntheticFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC,
|
||||
strings = listOf("is_horizontal_drawer_context")
|
||||
)
|
@ -35,6 +35,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
var ControlsLayoutStub = -1L
|
||||
var DarkSplashAnimation = -1L
|
||||
var DonationCompanion = -1L
|
||||
var DrawerResults = -1L
|
||||
var EasySeekEduContainer = -1L
|
||||
var EditSettingsAction = -1L
|
||||
var EndScreenElementLayoutCircle = -1L
|
||||
@ -107,6 +108,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
ControlsLayoutStub = getId(ID, "controls_layout_stub")
|
||||
DarkSplashAnimation = getId(ID, "dark_splash_animation")
|
||||
DonationCompanion = getId(LAYOUT, "donation_companion")
|
||||
DrawerResults = getId(ID, "drawer_results")
|
||||
EasySeekEduContainer = getId(ID, "easy_seek_edu_container")
|
||||
EditSettingsAction = getId(STRING, "edit_settings_action")
|
||||
EndScreenElementLayoutCircle = getId(LAYOUT, "endscreen_element_layout_circle")
|
||||
|
Reference in New Issue
Block a user