mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
fix(youtube): separate hide-general-ads
to hide-layout-components
patch
This commit is contained in:
@ -14,8 +14,11 @@ import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.ads.general.bytecode.patch.GeneralAdsBytecodePatch
|
||||
import app.revanced.patches.youtube.ads.getpremium.patch.HideGetPremiumPatch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fix.doublebacktoclose.patch.DoubleBackToClosePatch
|
||||
import app.revanced.patches.youtube.utils.fix.swiperefresh.patch.SwipeRefreshPatch
|
||||
import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.resources.ResourceUtils.copyXmlNode
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@ -24,10 +27,12 @@ import org.w3c.dom.Element
|
||||
@Description("Removes general ads.")
|
||||
@DependsOn(
|
||||
[
|
||||
DoubleBackToClosePatch::class,
|
||||
GeneralAdsBytecodePatch::class,
|
||||
HideGetPremiumPatch::class,
|
||||
LithoFilterPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
SwipeRefreshPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
@ -55,6 +60,8 @@ class GeneralAdsPatch : ResourcePatch {
|
||||
)
|
||||
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/AdsFilter;")
|
||||
|
||||
context.forEach {
|
||||
|
||||
if (!it.name.startsWithAny(*resourceFileNames)) return@forEach
|
||||
@ -90,7 +97,7 @@ class GeneralAdsPatch : ResourcePatch {
|
||||
*/
|
||||
context.copyXmlNode("youtube/doubleback/host", "values/arrays.xml", "resources")
|
||||
|
||||
/*
|
||||
/**
|
||||
* Add settings
|
||||
*/
|
||||
SettingsPatch.addPreference(
|
||||
@ -98,17 +105,7 @@ class GeneralAdsPatch : ResourcePatch {
|
||||
"PREFERENCE: ADS_SETTINGS",
|
||||
"SETTINGS: HIDE_GENERAL_ADS",
|
||||
|
||||
"PREFERENCE: GENERAL_SETTINGS",
|
||||
"SETTINGS: HIDE_GENERAL_ADS",
|
||||
|
||||
"PREFERENCE: GENERAL_SETTINGS",
|
||||
"PREFERENCE_HEADER: PLAYER",
|
||||
"SETTINGS: HIDE_AUDIO_TRACK_BUTTON",
|
||||
"SETTINGS: HIDE_VIEW_PRODUCT",
|
||||
"SETTINGS: DOUBLE_BACK_TIMEOUT",
|
||||
|
||||
"PREFERENCE: BOTTOM_PLAYER_SETTINGS",
|
||||
"SETTINGS: COMMENT_COMPONENT_PARENT"
|
||||
"SETTINGS: DOUBLE_BACK_TIMEOUT"
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -15,5 +15,5 @@ object CompactYpcOfferModuleViewFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("CompactYpcOfferModuleView;") && it.name == "onMeasure" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("CompactYpcOfferModuleView;") && methodDef.name == "onMeasure" }
|
||||
)
|
@ -11,7 +11,9 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.ads.general.bytecode.patch.GeneralAdsBytecodePatch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
|
||||
@Patch
|
||||
@Name("hide-comment-component")
|
||||
@ -26,6 +28,7 @@ import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
@Version("0.0.1")
|
||||
class CommentComponentPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/CommentsFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.flyoutpanel.flyoutpanel.patch
|
||||
package app.revanced.patches.youtube.flyoutpanel.general.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
@ -9,16 +9,17 @@ 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.youtube.ads.general.resource.patch.GeneralAdsPatch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
|
||||
@Patch
|
||||
@Name("hide-flyout-panel")
|
||||
@Description("Adds options to hide player settings flyout panel.")
|
||||
@DependsOn(
|
||||
[
|
||||
GeneralAdsPatch::class,
|
||||
LithoFilterPatch::class,
|
||||
SettingsPatch::class
|
||||
]
|
||||
)
|
||||
@ -26,6 +27,7 @@ import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
@Version("0.0.1")
|
||||
class FlyoutPanelPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/FlyoutPanelsFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
@ -22,5 +22,5 @@ object QualityMenuViewInflateFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(VideoQualityBottomSheet) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(VideoQualityBottomSheet) }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.flyoutpanel.oldqualitylayout.fingerprints.QualityMenuViewInflateFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.FLYOUT_PANEL
|
||||
|
@ -13,18 +13,16 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.AutoNavPreviewStub
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.AutoNavToggle
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.bytecode.getStringIndex
|
||||
import app.revanced.util.bytecode.getWideLiteralIndex
|
||||
import app.revanced.util.integrations.Constants.FULLSCREEN
|
||||
import org.jf.dexlib2.iface.instruction.Instruction
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.FieldReference
|
||||
|
||||
@Patch
|
||||
@Name("hide-autoplay-preview")
|
||||
@ -43,26 +41,17 @@ class HideAutoplayPreviewPatch : BytecodePatch(
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
LayoutConstructorFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val insertInstruction = implementation!!.instructions
|
||||
|
||||
val dummyRegister =
|
||||
getInstruction<OneRegisterInstruction>(getStringIndex("1.0x")).registerA
|
||||
val insertIndex = getWideLiteralIndex(AutoNavPreviewStub)
|
||||
|
||||
val branchIndex =
|
||||
insertInstruction.subList(insertIndex + 1, insertInstruction.size - 1)
|
||||
.indexOfFirst { instruction ->
|
||||
((instruction as? ReferenceInstruction)?.reference as? FieldReference)?.type == "Lcom/google/android/apps/youtube/app/player/autonav/AutonavToggleController;"
|
||||
} + 1
|
||||
|
||||
val jumpInstruction = getInstruction<Instruction>(insertIndex + branchIndex)
|
||||
val jumpIndex = getWideLiteralIndex(AutoNavToggle) - 1
|
||||
|
||||
addInstructionsWithLabels(
|
||||
insertIndex, """
|
||||
invoke-static {}, $FULLSCREEN->hideAutoPlayPreview()Z
|
||||
move-result v$dummyRegister
|
||||
if-nez v$dummyRegister, :hidden
|
||||
""", ExternalLabel("hidden", jumpInstruction)
|
||||
""", ExternalLabel("hidden", getInstruction(jumpIndex))
|
||||
)
|
||||
}
|
||||
} ?: return LayoutConstructorFingerprint.toErrorResult()
|
||||
|
@ -15,7 +15,7 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.fullscreen.compactcontrolsoverlay.fingerprints.YouTubeControlsOverlayFingerprint
|
||||
import app.revanced.patches.youtube.utils.fingerprints.YouTubeControlsOverlayFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.FULLSCREEN
|
||||
|
@ -6,5 +6,5 @@ import app.revanced.util.bytecode.isWideLiteralExists
|
||||
|
||||
object EndScreenResultsFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(AppRelatedEndScreenResults) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(AppRelatedEndScreenResults) }
|
||||
)
|
@ -13,8 +13,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.fullscreen.endscreenoverlay.fingerprints.EndScreenResultsFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.FULLSCREEN
|
||||
|
@ -6,8 +6,9 @@ import app.revanced.util.bytecode.isWideLiteralExists
|
||||
|
||||
object FullscreenEngagementPanelFingerprint : MethodFingerprint(
|
||||
returnType = "L",
|
||||
customFingerprint = { it, _ ->
|
||||
it.definingClass.endsWith("FullscreenEngagementPanelOverlay;") && it.isWideLiteralExists(
|
||||
parameters = listOf("L"),
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.isWideLiteralExists(
|
||||
FullScreenEngagementPanel
|
||||
)
|
||||
}
|
||||
|
@ -12,5 +12,5 @@ object FullscreenViewAdderFingerprint : MethodFingerprint(
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("FullscreenEngagementPanelOverlay;") }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("FullscreenEngagementPanelOverlay;") }
|
||||
)
|
@ -16,10 +16,10 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.fullscreen.fullscreenpanels.fingerprints.FullscreenEngagementPanelFingerprint
|
||||
import app.revanced.patches.youtube.fullscreen.fullscreenpanels.fingerprints.FullscreenViewAdderFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint
|
||||
import app.revanced.patches.youtube.utils.quickactionscontainer.patch.HideQuickActionsContainerPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.FullScreenEngagementPanel
|
||||
|
@ -13,5 +13,5 @@ object OrientationPrimaryFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.name == "<init>" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.name == "<init>" }
|
||||
)
|
@ -14,10 +14,10 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.OrientationParentFingerprint
|
||||
import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.OrientationPrimaryFingerprint
|
||||
import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.OrientationSecondaryFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.FULLSCREEN
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
@ -9,17 +9,18 @@ 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.youtube.ads.general.resource.patch.GeneralAdsPatch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.quickactionscontainer.patch.HideQuickActionsContainerPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
|
||||
@Patch
|
||||
@Name("hide-quick-actions")
|
||||
@Description("Adds the options to hide quick actions components in the fullscreen.")
|
||||
@DependsOn(
|
||||
[
|
||||
GeneralAdsPatch::class,
|
||||
LithoFilterPatch::class,
|
||||
HideQuickActionsContainerPatch::class,
|
||||
SettingsPatch::class
|
||||
]
|
||||
@ -28,6 +29,7 @@ import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
@Version("0.0.1")
|
||||
class QuickActionsPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/QuickActionButtonsFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -12,5 +12,5 @@ object AccountMenuParentFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(CompactLink) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(CompactLink) }
|
||||
)
|
@ -13,9 +13,9 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.accountmenu.fingerprints.AccountMenuFingerprint
|
||||
import app.revanced.patches.youtube.general.accountmenu.fingerprints.AccountMenuParentFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
@ -15,11 +15,12 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.fingerprints.SubtitleButtonControllerFingerprint
|
||||
import app.revanced.patches.shared.fingerprints.captions.SubtitleTrackFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.autocaptions.fingerprints.StartVideoInformerFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.SubtitleButtonControllerFingerprint
|
||||
import app.revanced.patches.youtube.utils.playertype.patch.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
||||
@ -29,7 +30,8 @@ import app.revanced.util.integrations.Constants.GENERAL
|
||||
@DependsOn(
|
||||
[
|
||||
PlayerTypeHookPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
SharedResourceIdPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
|
@ -13,8 +13,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.autopopuppanels.fingerprints.EngagementPanelControllerFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
||||
|
@ -12,5 +12,5 @@ object FilterBarHeightFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IPUT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(FilterBarHeight) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(FilterBarHeight) }
|
||||
)
|
@ -11,5 +11,5 @@ object RelatedChipCloudFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(RelatedChipCloudMargin) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(RelatedChipCloudMargin) }
|
||||
)
|
@ -13,5 +13,5 @@ object SearchResultsChipBarFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(BarContainerHeight) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(BarContainerHeight) }
|
||||
)
|
@ -13,10 +13,10 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.categorybar.fingerprints.FilterBarHeightFingerprint
|
||||
import app.revanced.patches.youtube.general.categorybar.fingerprints.RelatedChipCloudFingerprint
|
||||
import app.revanced.patches.youtube.general.categorybar.fingerprints.SearchResultsChipBarFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
@ -12,5 +12,5 @@ object ChannelListSubMenuFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(ChannelListSubMenu) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ChannelListSubMenu) }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.channellistsubmenu.fingerprints.ChannelListSubMenuFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
@ -11,5 +11,5 @@ object CrowdfundingBoxFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IPUT_OBJECT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(DonationCompanion) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(DonationCompanion) }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.crowdfundingbox.fingerprints.CrowdfundingBoxFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
@ -11,5 +11,5 @@ object FloatingMicrophoneFingerprint : MethodFingerprint(
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.RETURN_VOID
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(Fab) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(Fab) }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.floatingmicrophone.fingerprints.FloatingMicrophoneFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
@ -0,0 +1,54 @@
|
||||
package app.revanced.patches.youtube.general.layout.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.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
|
||||
@Patch
|
||||
@Name("hide-layout-components")
|
||||
@Description("Hides general layout components.")
|
||||
@DependsOn(
|
||||
[
|
||||
LithoFilterPatch::class,
|
||||
SettingsPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class LayoutComponentsPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/CommunityPostFilter;")
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/LayoutComponentsFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
*/
|
||||
SettingsPatch.addPreference(
|
||||
arrayOf(
|
||||
"PREFERENCE: BOTTOM_PLAYER_SETTINGS",
|
||||
"PREFERENCE: GENERAL_SETTINGS",
|
||||
"PREFERENCE: PLAYER",
|
||||
|
||||
"SETTINGS: COMMENT_COMPONENT_PARENT",
|
||||
|
||||
"SETTINGS: HIDE_AUDIO_TRACK_BUTTON",
|
||||
"SETTINGS: HIDE_LAYOUT_COMPONENTS",
|
||||
"SETTINGS: HIDE_VIEW_PRODUCT"
|
||||
)
|
||||
)
|
||||
|
||||
SettingsPatch.updatePatchStatus("hide-layout-components")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -12,5 +12,5 @@ object LoadMoreButtonFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(ExpandButtonDown) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ExpandButtonDown) }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.loadmorebutton.fingerprints.LoadMoreButtonFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
@ -11,5 +11,5 @@ object BottomPanelOverlayTextFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IPUT_OBJECT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(BottomPanelOverlayText) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(BottomPanelOverlayText) }
|
||||
)
|
@ -15,8 +15,8 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.fingerprints.litho.EmptyComponentBuilderFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.mixplaylists.fingerprints.BottomPanelOverlayTextFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.bytecode.getStringIndex
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
@ -15,5 +15,5 @@ object AccountSwitcherAccessibilityLabelFingerprint : MethodFingerprint(
|
||||
Opcode.APUT_OBJECT,
|
||||
Opcode.CONST
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(AccountSwitcherAccessibility) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(AccountSwitcherAccessibility) }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.personalinformation.fingerprints.AccountSwitcherAccessibilityLabelFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
@ -5,5 +5,5 @@ import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.util.bytecode.isWideLiteralExists
|
||||
|
||||
object SearchSuggestionEntryFingerprint : MethodFingerprint(
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(SearchSuggestionEntry) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(SearchSuggestionEntry) }
|
||||
)
|
@ -13,10 +13,10 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.searchterms.fingerprints.SearchEndpointFingerprint
|
||||
import app.revanced.patches.youtube.general.searchterms.fingerprints.SearchEndpointParentFingerprint
|
||||
import app.revanced.patches.youtube.general.searchterms.fingerprints.SearchSuggestionEntryFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.SearchSuggestionEntry
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
|
@ -8,5 +8,5 @@ object HideSnackBarFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L", "L"),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("BottomUiContainer;") }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("BottomUiContainer;") }
|
||||
)
|
@ -13,8 +13,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.snackbar.fingerprints.HideSnackBarFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
||||
|
@ -12,5 +12,5 @@ object BreakingNewsFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(HorizontalCardList) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(HorizontalCardList) }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.suggestions.fingerprints.BreakingNewsFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.navbarindex.patch.NavBarIndexPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
|
@ -9,5 +9,5 @@ import org.jf.dexlib2.AccessFlags
|
||||
object MiniPlayerDimensionsCalculatorFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(FloatyBarTopMargin) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(FloatyBarTopMargin) }
|
||||
)
|
@ -16,11 +16,11 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.tabletminiplayer.fingerprints.MiniPlayerDimensionsCalculatorFingerprint
|
||||
import app.revanced.patches.youtube.general.tabletminiplayer.fingerprints.MiniPlayerOverrideFingerprint
|
||||
import app.revanced.patches.youtube.general.tabletminiplayer.fingerprints.MiniPlayerOverrideNoContextFingerprint
|
||||
import app.revanced.patches.youtube.general.tabletminiplayer.fingerprints.MiniPlayerResponseModelSizeCheckFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.bytecode.getStringIndex
|
||||
|
@ -14,5 +14,5 @@ object SetActionBarRingoFingerprint : MethodFingerprint(
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_STATIC
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(ActionBarRingo) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ActionBarRingo) }
|
||||
)
|
@ -13,5 +13,5 @@ object SetToolBarPaddingFingerprint : MethodFingerprint(
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_STATIC
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(ToolBarPaddingHome) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ToolBarPaddingHome) }
|
||||
)
|
@ -14,9 +14,9 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.general.widesearchbar.fingerprints.SetActionBarRingoFingerprint
|
||||
import app.revanced.patches.youtube.general.widesearchbar.fingerprints.SetToolBarPaddingFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch.Companion.contexts
|
||||
|
@ -9,9 +9,9 @@ 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.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.layout.theme.patch.GeneralThemePatch
|
||||
import app.revanced.patches.youtube.layout.theme.patch.GeneralThemePatch.Companion.isMonetPatchIncluded
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceHelper.updatePatchStatusTheme
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
|
@ -11,9 +11,9 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.layout.pipnotification.fingerprints.PrimaryPiPFingerprint
|
||||
import app.revanced.patches.youtube.layout.pipnotification.fingerprints.SecondaryPiPFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
|
||||
@Patch
|
||||
|
@ -11,8 +11,8 @@ 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.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.layout.theme.patch.GeneralThemePatch.Companion.isMonetPatchIncluded
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceHelper.updatePatchStatusTheme
|
||||
import org.w3c.dom.Element
|
||||
|
@ -10,5 +10,5 @@ object TooltipContentViewFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L"),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(ToolTipContentView) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ToolTipContentView) }
|
||||
)
|
||||
|
@ -11,8 +11,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.layout.tooltip.fingerprints.TooltipContentViewFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
|
||||
|
@ -21,5 +21,5 @@ object PowerSaveModeFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
),
|
||||
customFingerprint = { it, _ -> it.name == "accept" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.name == "accept" }
|
||||
)
|
@ -13,8 +13,8 @@ import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.ambientmode.fingerprints.PowerSaveModeFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.MISC_PATH
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
@ -12,10 +12,10 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.externalbrowser.fingerprints.ExternalBrowserPrimaryFingerprint
|
||||
import app.revanced.patches.youtube.misc.externalbrowser.fingerprints.ExternalBrowserSecondaryFingerprint
|
||||
import app.revanced.patches.youtube.misc.externalbrowser.fingerprints.ExternalBrowserTertiaryFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.MISC_PATH
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
@ -11,5 +11,5 @@ object VideoCapabilitiesFingerprint : MethodFingerprint(
|
||||
Opcode.IPUT,
|
||||
Opcode.IPUT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.name == "<init>" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.name == "<init>" }
|
||||
)
|
||||
|
@ -16,14 +16,14 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutSwitchFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.forcevp9.fingerprints.VideoCapabilitiesFingerprint
|
||||
import app.revanced.patches.youtube.misc.forcevp9.fingerprints.VideoCapabilitiesParentFingerprint
|
||||
import app.revanced.patches.youtube.misc.forcevp9.fingerprints.Vp9PrimaryFingerprint
|
||||
import app.revanced.patches.youtube.misc.forcevp9.fingerprints.Vp9PropsFingerprint
|
||||
import app.revanced.patches.youtube.misc.forcevp9.fingerprints.Vp9PropsParentFingerprint
|
||||
import app.revanced.patches.youtube.misc.forcevp9.fingerprints.Vp9SecondaryFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutSwitchFingerprint
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.MISC_PATH
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
@ -14,5 +14,5 @@ object GeneralPrefsFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
),
|
||||
strings = listOf("bedtime_reminder_toggle"),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("GeneralPrefsFragment;") }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("GeneralPrefsFragment;") }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.language.fingerprints.GeneralPrefsFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
|
@ -17,11 +17,11 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutSwitchFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.layoutswitch.fingerprints.ClientFormFactorFingerprint
|
||||
import app.revanced.patches.youtube.misc.layoutswitch.fingerprints.ClientFormFactorParentFingerprint
|
||||
import app.revanced.patches.youtube.misc.layoutswitch.fingerprints.ClientFormFactorWalkerFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutSwitchFingerprint
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.MISC_PATH
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
@ -4,6 +4,7 @@ import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
|
||||
object KidsMinimizedPlaybackPolicyControllerFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
@ -17,7 +18,29 @@ object KidsMinimizedPlaybackPolicyControllerFingerprint : MethodFingerprint(
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET,
|
||||
Opcode.INVOKE_STATIC
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.GOTO,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_NE,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_NE,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IF_EQ,
|
||||
Opcode.GOTO,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("MinimizedPlaybackPolicyController;") }
|
||||
)
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.implementation!!.instructions.any {
|
||||
((it as? NarrowLiteralInstruction)?.narrowLiteral == 5)
|
||||
}
|
||||
})
|
||||
|
@ -11,5 +11,5 @@ object MinimizedPlaybackManagerFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
parameters = listOf("L"),
|
||||
opcodes = listOf(Opcode.AND_INT_LIT16),
|
||||
customFingerprint = { it, _ -> it.isNarrowLiteralExists(64657230) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isNarrowLiteralExists(64657230) }
|
||||
)
|
@ -19,5 +19,5 @@ object MinimizedPlaybackSettingsFingerprint : MethodFingerprint(
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.GOTO
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(BackgroundCategory) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(BackgroundCategory) }
|
||||
)
|
||||
|
@ -14,10 +14,10 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.KidsMinimizedPlaybackPolicyControllerFingerprint
|
||||
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
||||
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackSettingsFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.utils.playertype.patch.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
|
@ -12,9 +12,9 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyFingerprintPrimary
|
||||
import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyFingerprintSecondary
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.MISC_PATH
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
@ -7,5 +7,5 @@ object CronetEngineBuilderFingerprint : MethodFingerprint(
|
||||
returnType = "L",
|
||||
accessFlags = AccessFlags.PUBLIC.value,
|
||||
parameters = listOf("Z"),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("CronetEngine\$Builder;") && it.name == "enableQuic" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("CronetEngine\$Builder;") && methodDef.name == "enableQuic" }
|
||||
)
|
@ -7,5 +7,5 @@ object ExperimentalCronetEngineBuilderFingerprint : MethodFingerprint(
|
||||
returnType = "L",
|
||||
accessFlags = AccessFlags.PUBLIC.value,
|
||||
parameters = listOf("Z"),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("ExperimentalCronetEngine\$Builder;") && it.name == "enableQuic" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("ExperimentalCronetEngine\$Builder;") && methodDef.name == "enableQuic" }
|
||||
)
|
@ -11,9 +11,9 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.quic.fingerprints.CronetEngineBuilderFingerprint
|
||||
import app.revanced.patches.youtube.misc.quic.fingerprints.ExperimentalCronetEngineBuilderFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.MISC_PATH
|
||||
|
||||
|
@ -5,5 +5,5 @@ import app.revanced.util.bytecode.isWide32LiteralExists
|
||||
|
||||
object SplashAnimationBuilderFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
customFingerprint = { it, _ -> it.isWide32LiteralExists(45407550) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45407550) }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.splashanimation.fingerprints.SplashAnimationBuilderFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.bytecode.getWide32LiteralIndex
|
||||
import app.revanced.util.integrations.Constants.MISC_PATH
|
||||
|
@ -14,9 +14,9 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.navigation.homepage.fingerprints.IntentExceptionFingerprint
|
||||
import app.revanced.patches.youtube.navigation.homepage.fingerprints.LauncherActivityFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.NAVIGATION
|
||||
|
||||
|
@ -19,5 +19,5 @@ object PivotBarSetTextFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
),
|
||||
customFingerprint = { it, _ -> it.name == "<init>" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.name == "<init>" }
|
||||
)
|
@ -12,8 +12,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.navigation.label.fingerprints.PivotBarSetTextFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.NAVIGATION
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
@ -13,11 +13,11 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.navigation.navigationbuttons.fingerprints.AutoMotiveFingerprint
|
||||
import app.revanced.patches.youtube.navigation.navigationbuttons.fingerprints.PivotBarEnumFingerprint
|
||||
import app.revanced.patches.youtube.navigation.navigationbuttons.fingerprints.PivotBarShortsButtonViewFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.NAVIGATION
|
||||
|
@ -4,5 +4,5 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object ReelWatchEndpointFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
customFingerprint = { it, _ -> it.name == "<init>" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.name == "<init>" }
|
||||
)
|
@ -16,13 +16,13 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.NavigationEndpointFingerprint
|
||||
import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.ReelWatchBundleFingerprint
|
||||
import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.ReelWatchEndpointFingerprint
|
||||
import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.ReelWatchEndpointParentFingerprint
|
||||
import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.SetPivotBarFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.NAVIGATION
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
@ -9,5 +9,5 @@ object PivotBarChangedFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT
|
||||
),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("PivotBar;") && it.name == "onConfigurationChanged" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("PivotBar;") && methodDef.name == "onConfigurationChanged" }
|
||||
)
|
@ -11,5 +11,5 @@ object PivotBarStyleFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.XOR_INT_2ADDR
|
||||
),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("PivotBar;") }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("PivotBar;") }
|
||||
)
|
@ -13,9 +13,9 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.navigation.tabletnavbar.fingerprints.PivotBarChangedFingerprint
|
||||
import app.revanced.patches.youtube.navigation.tabletnavbar.fingerprints.PivotBarStyleFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.NAVIGATION
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
@ -2,11 +2,23 @@ package app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.SettingsBooleanTimeRangeDialog
|
||||
import app.revanced.util.bytecode.isWideLiteralExists
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object AutoNavInformerFingerprint : MethodFingerprint(
|
||||
returnType = "Z",
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf(),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("WillAutonavInformer;") }
|
||||
parameters = listOf("L"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.XOR_INT_2ADDR
|
||||
),
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.isWideLiteralExists(
|
||||
SettingsBooleanTimeRangeDialog
|
||||
)
|
||||
}
|
||||
)
|
@ -8,5 +8,5 @@ object VideoEndFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf(),
|
||||
customFingerprint = { it, _ -> it.implementation!!.instructions.count() == 3 && it.annotations.isEmpty() }
|
||||
customFingerprint = { methodDef, _ -> methodDef.implementation!!.instructions.count() == 3 && methodDef.annotations.isEmpty() }
|
||||
)
|
@ -4,6 +4,7 @@ import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.data.toMethodWalker
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
@ -12,12 +13,13 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints.AutoNavInformerFingerprint
|
||||
import app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints.RepeatListenerFingerprint
|
||||
import app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints.VideoEndFingerprint
|
||||
import app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints.VideoEndParentFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.util.integrations.Constants.UTILS_PATH
|
||||
import app.revanced.util.integrations.Constants.VIDEO_PATH
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
||||
@ -74,7 +76,12 @@ class AutoRepeatPatch : BytecodePatch(
|
||||
} ?: return RepeatListenerFingerprint.toErrorResult()
|
||||
|
||||
AutoNavInformerFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
with(
|
||||
context
|
||||
.toMethodWalker(it.method)
|
||||
.nextMethod(it.scanResult.patternScanResult!!.startIndex, true)
|
||||
.getMethod() as MutableMethod
|
||||
) {
|
||||
val index = implementation!!.instructions.size - 1 - 1
|
||||
val register = getInstruction<OneRegisterInstruction>(index).registerA
|
||||
|
||||
|
@ -10,10 +10,11 @@ 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.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.overlaybutton.autorepeat.patch.AutoRepeatPatch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.overridespeed.patch.OverrideSpeedHookPatch
|
||||
import app.revanced.patches.youtube.utils.playercontrols.patch.PlayerControlsPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.utils.videoid.mainstream.patch.MainstreamVideoIdPatch
|
||||
import app.revanced.util.integrations.Constants.BUTTON_PATH
|
||||
@ -31,7 +32,8 @@ import org.w3c.dom.Element
|
||||
MainstreamVideoIdPatch::class,
|
||||
OverrideSpeedHookPatch::class,
|
||||
PlayerControlsPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
SharedResourceIdPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
|
@ -13,18 +13,16 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.AutoNavPreviewStub
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.VideoZoomIndicatorLayout
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.bytecode.getStringIndex
|
||||
import app.revanced.util.bytecode.getWideLiteralIndex
|
||||
import app.revanced.util.integrations.Constants.PLAYER
|
||||
import org.jf.dexlib2.iface.instruction.Instruction
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.MethodReference
|
||||
|
||||
@Patch
|
||||
@Name("hide-autoplay-button")
|
||||
@ -47,22 +45,14 @@ class HideAutoplayButtonPatch : BytecodePatch(
|
||||
val dummyRegister =
|
||||
getInstruction<OneRegisterInstruction>(getStringIndex("1.0x")).registerA
|
||||
val insertIndex = getWideLiteralIndex(AutoNavPreviewStub)
|
||||
|
||||
val branchIndex = implementation!!.instructions.subList(
|
||||
insertIndex + 1,
|
||||
implementation!!.instructions.size - 1
|
||||
).indexOfFirst { instruction ->
|
||||
((instruction as? ReferenceInstruction)?.reference as? MethodReference)?.name == "addOnLayoutChangeListener"
|
||||
} + 2
|
||||
|
||||
val jumpInstruction = getInstruction<Instruction>(insertIndex + branchIndex)
|
||||
val jumpIndex = getWideLiteralIndex(VideoZoomIndicatorLayout) - 1
|
||||
|
||||
addInstructionsWithLabels(
|
||||
insertIndex, """
|
||||
invoke-static {}, $PLAYER->hideAutoPlayButton()Z
|
||||
move-result v$dummyRegister
|
||||
if-nez v$dummyRegister, :hidden
|
||||
""", ExternalLabel("hidden", jumpInstruction)
|
||||
""", ExternalLabel("hidden", getInstruction(jumpIndex))
|
||||
)
|
||||
}
|
||||
} ?: return LayoutConstructorFingerprint.toErrorResult()
|
||||
|
@ -12,8 +12,9 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.fingerprints.SubtitleButtonControllerFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.SubtitleButtonControllerFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PLAYER
|
||||
import org.jf.dexlib2.Opcode
|
||||
@ -22,7 +23,12 @@ import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
@Patch
|
||||
@Name("hide-captions-button")
|
||||
@Description("Hides the captions button in the video player.")
|
||||
@DependsOn([SettingsPatch::class])
|
||||
@DependsOn(
|
||||
[
|
||||
SettingsPatch::class,
|
||||
SharedResourceIdPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideCaptionsButtonBytecodePatch : BytecodePatch(
|
||||
|
@ -3,5 +3,5 @@ package app.revanced.patches.youtube.player.castbutton.fingerprints
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object CastButtonFingerprint : MethodFingerprint(
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("MediaRouteButton;") && it.name == "setVisibility" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("MediaRouteButton;") && methodDef.name == "setVisibility" }
|
||||
)
|
@ -11,8 +11,8 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.player.castbutton.fingerprints.CastButtonFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PLAYER
|
||||
|
||||
|
@ -12,5 +12,5 @@ object SpeedOverlayHookFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
),
|
||||
strings = listOf("Failed to easy seek haptics vibrate."),
|
||||
customFingerprint = { it, _ -> it.name == "run" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.name == "run" }
|
||||
)
|
@ -6,5 +6,5 @@ import org.jf.dexlib2.Opcode
|
||||
object YouTubeTextViewFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
opcodes = listOf(Opcode.INVOKE_SUPER),
|
||||
customFingerprint = { it, _ -> it.definingClass.endsWith("YouTubeTextView;") && it.name == "setText" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("YouTubeTextView;") && methodDef.name == "setText" }
|
||||
)
|
@ -13,9 +13,9 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.player.customspeedoverlay.fingerprints.SpeedOverlayHookFingerprint
|
||||
import app.revanced.patches.youtube.player.customspeedoverlay.fingerprints.YouTubeTextViewFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PLAYER
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
|
@ -13,5 +13,5 @@ object LayoutCircleFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(EndScreenElementLayoutCircle) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(EndScreenElementLayoutCircle) }
|
||||
)
|
@ -13,5 +13,5 @@ object LayoutIconFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(EndScreenElementLayoutIcon) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(EndScreenElementLayoutIcon) }
|
||||
)
|
@ -13,5 +13,5 @@ object LayoutVideoFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
),
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(EndScreenElementLayoutVideo) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(EndScreenElementLayoutVideo) }
|
||||
)
|
@ -13,10 +13,10 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.player.endscreencards.fingerprints.LayoutCircleFingerprint
|
||||
import app.revanced.patches.youtube.player.endscreencards.fingerprints.LayoutIconFingerprint
|
||||
import app.revanced.patches.youtube.player.endscreencards.fingerprints.LayoutVideoFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
@ -6,5 +6,5 @@ import app.revanced.util.bytecode.isWide32LiteralExists
|
||||
object FilmStripOverlayConfigFingerprint : MethodFingerprint(
|
||||
returnType = "Z",
|
||||
parameters = listOf(),
|
||||
customFingerprint = { it, _ -> it.isWide32LiteralExists(45381958) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45381958) }
|
||||
)
|
@ -9,5 +9,5 @@ import org.jf.dexlib2.AccessFlags
|
||||
object FilmStripOverlayParentFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
customFingerprint = { it, _ -> it.isWideLiteralExists(Scrubbing) }
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(Scrubbing) }
|
||||
)
|
@ -1,14 +0,0 @@
|
||||
package app.revanced.patches.youtube.player.filmstripoverlay.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.WatchWhileTimeBarOverlayStub
|
||||
import app.revanced.util.bytecode.isWideLiteralExists
|
||||
|
||||
object TimeBarOnClickListenerFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
customFingerprint = { it, _ ->
|
||||
it.definingClass.endsWith("YouTubeControlsOverlay;") && it.isWideLiteralExists(
|
||||
WatchWhileTimeBarOverlayStub
|
||||
)
|
||||
}
|
||||
)
|
@ -15,19 +15,19 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.player.filmstripoverlay.fingerprints.FilmStripOverlayConfigFingerprint
|
||||
import app.revanced.patches.youtube.player.filmstripoverlay.fingerprints.FilmStripOverlayInteractionFingerprint
|
||||
import app.revanced.patches.youtube.player.filmstripoverlay.fingerprints.FilmStripOverlayParentFingerprint
|
||||
import app.revanced.patches.youtube.player.filmstripoverlay.fingerprints.FilmStripOverlayPreviewFingerprint
|
||||
import app.revanced.patches.youtube.player.filmstripoverlay.fingerprints.TimeBarOnClickListenerFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.fingerprints.YouTubeControlsOverlayFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.WatchWhileTimeBarOverlayStub
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.bytecode.getWideLiteralIndex
|
||||
import app.revanced.util.integrations.Constants.PLAYER
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import org.jf.dexlib2.iface.reference.MethodReference
|
||||
|
||||
@ -45,7 +45,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
|
||||
class HideFilmstripOverlayPatch : BytecodePatch(
|
||||
listOf(
|
||||
FilmStripOverlayParentFingerprint,
|
||||
TimeBarOnClickListenerFingerprint
|
||||
YouTubeControlsOverlayFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
@ -66,23 +66,27 @@ class HideFilmstripOverlayPatch : BytecodePatch(
|
||||
}
|
||||
} ?: return FilmStripOverlayParentFingerprint.toErrorResult()
|
||||
|
||||
TimeBarOnClickListenerFingerprint.result?.let {
|
||||
YouTubeControlsOverlayFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val freeIndex = getWideLiteralIndex(WatchWhileTimeBarOverlayStub)
|
||||
val freeRegister = getInstruction<OneRegisterInstruction>(freeIndex).registerA
|
||||
|
||||
val insertIndex = getIndex("bringChildToFront") + 1
|
||||
val insertRegister = getInstruction<TwoRegisterInstruction>(insertIndex).registerA
|
||||
|
||||
val jumpIndex = getIndex("setOnClickListener") + 3
|
||||
|
||||
val fixIndex =
|
||||
implementation!!.instructions.indexOfFirst { instruction -> (instruction as? NarrowLiteralInstruction)?.narrowLiteral == 12 }
|
||||
val fixRegister = getInstruction<OneRegisterInstruction>(fixIndex).registerA
|
||||
|
||||
addInstructionsWithLabels(
|
||||
insertIndex, """
|
||||
const/16 v$fixRegister, 0xc
|
||||
invoke-static {}, $PLAYER->hideFilmstripOverlay()Z
|
||||
move-result v$freeRegister
|
||||
if-nez v$freeRegister, :hidden
|
||||
move-result v$insertRegister
|
||||
if-nez v$insertRegister, :hidden
|
||||
""", ExternalLabel("hidden", getInstruction(jumpIndex))
|
||||
)
|
||||
}
|
||||
} ?: return TimeBarOnClickListenerFingerprint.toErrorResult()
|
||||
} ?: return YouTubeControlsOverlayFingerprint.toErrorResult()
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -11,5 +11,5 @@ object SeekHapticsFingerprint : MethodFingerprint(
|
||||
Opcode.IF_LE
|
||||
),
|
||||
strings = listOf("Failed to easy seek haptics vibrate."),
|
||||
customFingerprint = { it, _ -> it.name == "run" }
|
||||
customFingerprint = { methodDef, _ -> methodDef.name == "run" }
|
||||
)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user