mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-20 16:27:17 +02:00
fix(Litho filter): move to the correct path
This commit is contained in:
parent
d9ab09f303
commit
fb09b7fe36
@ -8,6 +8,7 @@ import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.patches.shared.patch.ads.AbstractAdsPatch
|
||||
import app.revanced.util.enum.CategoryType
|
||||
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
|
||||
import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide music ads",
|
||||
@ -42,5 +43,5 @@ object MusicAdsPatch : AbstractAdsPatch(
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$MUSIC_ADS_PATH/AdsFilter;"
|
||||
"$MUSIC_COMPONENTS_PATH/AdsFilter;"
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.util.enum.CategoryType
|
||||
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
|
||||
import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide button shelf",
|
||||
@ -43,5 +43,5 @@ object HideButtonShelfPatch : BytecodePatch() {
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$MUSIC_ADS_PATH/ButtonShelfFilter;"
|
||||
"$MUSIC_COMPONENTS_PATH/ButtonShelfFilter;"
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.util.enum.CategoryType
|
||||
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
|
||||
import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide carousel shelf",
|
||||
@ -43,5 +43,5 @@ object HideCarouselShelfPatch : BytecodePatch() {
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$MUSIC_ADS_PATH/CarouselShelfFilter;"
|
||||
"$MUSIC_COMPONENTS_PATH/CarouselShelfFilter;"
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.util.enum.CategoryType
|
||||
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
|
||||
import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide channel guidelines",
|
||||
@ -43,5 +43,5 @@ object HideChannelGuidelinesPatch : BytecodePatch() {
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$MUSIC_ADS_PATH/ChannelGuidelinesFilter;"
|
||||
"$MUSIC_COMPONENTS_PATH/ChannelGuidelinesFilter;"
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.util.enum.CategoryType
|
||||
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
|
||||
import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Enable custom filter",
|
||||
@ -48,5 +48,5 @@ object CustomFilterPatch : BytecodePatch() {
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$MUSIC_ADS_PATH/CustomFilter;"
|
||||
"$MUSIC_COMPONENTS_PATH/CustomFilter;"
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.util.enum.CategoryType
|
||||
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
|
||||
import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide emoji picker",
|
||||
@ -43,5 +43,5 @@ object HideEmojiPickerPatch : BytecodePatch() {
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$MUSIC_ADS_PATH/EmojiPickerFilter;"
|
||||
"$MUSIC_COMPONENTS_PATH/EmojiPickerFilter;"
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.util.enum.CategoryType
|
||||
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
|
||||
import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide playlist card",
|
||||
@ -43,5 +43,5 @@ object HidePlaylistCardPatch : BytecodePatch() {
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$MUSIC_ADS_PATH/PlaylistCardFilter;"
|
||||
"$MUSIC_COMPONENTS_PATH/PlaylistCardFilter;"
|
||||
}
|
||||
|
@ -9,20 +9,23 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.litho.fingerprints.LithoFilterFingerprint
|
||||
import app.revanced.patches.shared.patch.litho.ComponentParserPatch
|
||||
import app.revanced.patches.shared.patch.litho.ComponentParserPatch.pathBuilderHook
|
||||
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
|
||||
import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH
|
||||
import java.io.Closeable
|
||||
|
||||
@Patch(dependencies = [ComponentParserPatch::class])
|
||||
object LithoFilterPatch : BytecodePatch(
|
||||
setOf(LithoFilterFingerprint)
|
||||
), Closeable {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"$MUSIC_COMPONENTS_PATH/LithoFilterPatch;"
|
||||
|
||||
internal lateinit var addFilter: (String) -> Unit
|
||||
private set
|
||||
|
||||
private var filterCount = 0
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
pathBuilderHook("$MUSIC_ADS_PATH/LithoFilterPatch;->filter")
|
||||
pathBuilderHook("$INTEGRATIONS_CLASS_DESCRIPTOR->filter")
|
||||
|
||||
LithoFilterFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
@ -47,7 +50,7 @@ object LithoFilterPatch : BytecodePatch(
|
||||
.mutableMethod.addInstructions(
|
||||
0, """
|
||||
const/16 v1, $filterCount
|
||||
new-array v2, v1, [Lapp/revanced/music/patches/ads/Filter;
|
||||
new-array v2, v1, [$MUSIC_COMPONENTS_PATH/Filter;
|
||||
const/4 v1, 0x1
|
||||
"""
|
||||
)
|
||||
|
@ -8,6 +8,6 @@ object LithoFilterFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.STATIC or AccessFlags.CONSTRUCTOR,
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass == "Lapp/revanced/music/patches/ads/LithoFilterPatch;"
|
||||
methodDef.definingClass == "Lapp/revanced/music/patches/components/LithoFilterPatch;"
|
||||
}
|
||||
)
|
@ -11,7 +11,7 @@ import app.revanced.patches.youtube.utils.fix.doublebacktoclose.DoubleBackToClos
|
||||
import app.revanced.patches.youtube.utils.fix.swiperefresh.SwipeRefreshPatch
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.resources.ResourceUtils.copyXmlNode
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@ -73,7 +73,7 @@ object GeneralAdsPatch : ResourcePatch() {
|
||||
)
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/AdsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/AdsFilter;")
|
||||
|
||||
context.forEach {
|
||||
|
||||
|
@ -7,7 +7,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.ads.getpremium.fingerprints.CompactYpcOfferModuleViewFingerprint
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
object HideGetPremiumPatch : BytecodePatch(
|
||||
@ -27,7 +27,7 @@ object HideGetPremiumPatch : BytecodePatch(
|
||||
|
||||
addInstructionsWithLabels(
|
||||
startIndex + 2, """
|
||||
invoke-static {}, $PATCHES_PATH/ads/AdsFilter;->hideGetPremium()Z
|
||||
invoke-static {}, $COMPONENTS_PATH/AdsFilter;->hideGetPremium()Z
|
||||
move-result v$tempRegister
|
||||
if-eqz v$tempRegister, :show
|
||||
const/4 v$measuredWidthRegister, 0x0
|
||||
|
@ -6,7 +6,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide button container",
|
||||
@ -42,7 +42,7 @@ import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
object ButtonContainerPatch : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/ButtonsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/ButtonsFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -6,7 +6,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide comment component",
|
||||
@ -41,8 +41,8 @@ import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
@Suppress("unused")
|
||||
object CommentComponentPatch : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/CommentsFilter;")
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/CommentsPreviewDotsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/CommentsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/CommentsPreviewDotsFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -13,8 +13,8 @@ import app.revanced.patches.youtube.utils.fingerprints.RecyclerViewTreeObserverF
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.FLYOUT_PANEL
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
@ -88,7 +88,7 @@ object OldQualityLayoutPatch : BytecodePatch(
|
||||
}
|
||||
} ?: throw RecyclerViewTreeObserverFingerprint.exception
|
||||
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/VideoQualityMenuFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/VideoQualityMenuFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -15,7 +15,7 @@ import app.revanced.patches.youtube.flyoutpanel.oldspeedlayout.fingerprints.Play
|
||||
import app.revanced.patches.youtube.flyoutpanel.recyclerview.BottomSheetRecyclerViewPatch
|
||||
import app.revanced.patches.youtube.utils.fingerprints.RecyclerViewTreeObserverFingerprint
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.VIDEO_PATH
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.immutable.ImmutableField
|
||||
@ -108,7 +108,7 @@ object OldSpeedLayoutPatch : BytecodePatch(
|
||||
}
|
||||
} ?: throw RecyclerViewTreeObserverFingerprint.exception
|
||||
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/PlaybackSpeedMenuFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/PlaybackSpeedMenuFilter;")
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,8 @@ import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BottomSheetFooterText
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.bytecode.getWideLiteralIndex
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.FLYOUT_PANEL
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
@ -70,8 +70,8 @@ object PlayerFlyoutPanelPatch : BytecodePatch(
|
||||
fingerprint.injectCall(name)
|
||||
}
|
||||
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/PlayerFlyoutPanelsFilter;")
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/PlayerFlyoutPanelsFooterFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/PlayerFlyoutPanelsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/PlayerFlyoutPanelsFooterFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -7,7 +7,7 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.quickactions.QuickActionsHookPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide quick actions",
|
||||
@ -43,7 +43,7 @@ import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
@Suppress("unused")
|
||||
object QuickActionsPatch : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/QuickActionFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/QuickActionFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -6,7 +6,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide description components",
|
||||
@ -41,7 +41,7 @@ import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
@Suppress("unused")
|
||||
object DescriptionComponentsPatch : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/DescriptionsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/DescriptionsFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -11,8 +11,8 @@ import app.revanced.patches.youtube.general.handle.fingerprints.AccountSwitcherA
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
@ -51,7 +51,7 @@ object HideHandlePatch : BytecodePatch(
|
||||
setOf(AccountSwitcherAccessibilityLabelFingerprint)
|
||||
) {
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$PATCHES_PATH/ads/HandlesFilter;"
|
||||
"$COMPONENTS_PATH/HandlesFilter;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
|
||||
@Patch(
|
||||
name = "Hide layout components",
|
||||
@ -41,10 +41,10 @@ import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
@Suppress("unused")
|
||||
object LayoutComponentsPatch : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/BrowseStoreButtonFilter;")
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/CommunityPostFilter;")
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/LayoutComponentsFilter;")
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/LayoutComponentsUniversalFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/BrowseStoreButtonFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/CommunityPostFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/LayoutComponentsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/LayoutComponentsUniversalFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -16,8 +16,8 @@ import app.revanced.patches.youtube.general.mixplaylists.fingerprints.EmptyFlatB
|
||||
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 app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
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
|
||||
@ -146,7 +146,7 @@ object MixPlaylistsPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$PATCHES_PATH/ads/MixPlaylistsFilter;"
|
||||
"$COMPONENTS_PATH/MixPlaylistsFilter;"
|
||||
|
||||
private fun MutableMethod.inject(
|
||||
freeIndex: Int,
|
||||
|
@ -15,7 +15,7 @@ import app.revanced.patches.youtube.general.suggestions.fingerprints.SuggestionC
|
||||
import app.revanced.patches.youtube.general.suggestions.fingerprints.SuggestionContentsBuilderLegacyFingerprint
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
@ -111,5 +111,5 @@ object SuggestionsShelfPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$PATCHES_PATH/ads/SuggestionsShelfFilter;"
|
||||
"$COMPONENTS_PATH/SuggestionsShelfFilter;"
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.player.infocards.fingerprints.InfoCardsIncognitoFingerprint
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.PLAYER
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
@ -64,7 +64,7 @@ object HideInfoCardsPatch : BytecodePatch(
|
||||
}
|
||||
} ?: throw InfoCardsIncognitoFingerprint.exception
|
||||
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/InfoCardsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/InfoCardsFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -12,6 +12,7 @@ import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@ -82,5 +83,5 @@ object SuggestedActionsPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$PATCHES_PATH/ads/SuggestedActionFilter;"
|
||||
"$COMPONENTS_PATH/SuggestedActionFilter;"
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import app.revanced.patches.youtube.player.watermark.fingerprints.HideWatermarkF
|
||||
import app.revanced.patches.youtube.player.watermark.fingerprints.HideWatermarkParentFingerprint
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.PLAYER
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
@ -74,7 +74,7 @@ object HideChannelWatermarkBytecodePatch : BytecodePatch(
|
||||
} ?: throw HideWatermarkFingerprint.exception
|
||||
} ?: throw HideWatermarkParentFingerprint.exception
|
||||
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/WaterMarkFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/WaterMarkFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -35,7 +35,7 @@ import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelR
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.RightComment
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.bytecode.getWideLiteralIndex
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.SHORTS
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@ -247,8 +247,8 @@ object ShortsComponentPatch : BytecodePatch(
|
||||
}
|
||||
} ?: throw ShortsShareFingerprint.exception
|
||||
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/ShortsFilter;")
|
||||
LithoFilterPatch.addFilter("$PATCHES_PATH/ads/ShortsButtonsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/ShortsFilter;")
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/ShortsButtonsFilter;")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
|
@ -11,7 +11,7 @@ import app.revanced.patches.shared.patch.litho.ComponentParserPatch
|
||||
import app.revanced.patches.shared.patch.litho.ComponentParserPatch.generalHook
|
||||
import app.revanced.patches.youtube.utils.litho.fingerprints.GeneralByteBufferFingerprint
|
||||
import app.revanced.patches.youtube.utils.litho.fingerprints.LithoFilterFingerprint
|
||||
import app.revanced.util.integrations.Constants.ADS_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import java.io.Closeable
|
||||
|
||||
@Patch(dependencies = [ComponentParserPatch::class])
|
||||
@ -22,6 +22,9 @@ object LithoFilterPatch : BytecodePatch(
|
||||
LithoFilterFingerprint
|
||||
)
|
||||
), Closeable {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"$COMPONENTS_PATH/LithoFilterPatch;"
|
||||
|
||||
internal lateinit var addFilter: (String) -> Unit
|
||||
private set
|
||||
|
||||
@ -32,12 +35,12 @@ object LithoFilterPatch : BytecodePatch(
|
||||
it.mutableMethod.apply {
|
||||
addInstruction(
|
||||
0,
|
||||
"invoke-static { p2 }, $ADS_PATH/LithoFilterPatch;->setProtoBuffer(Ljava/nio/ByteBuffer;)V"
|
||||
"invoke-static { p2 }, $INTEGRATIONS_CLASS_DESCRIPTOR->setProtoBuffer(Ljava/nio/ByteBuffer;)V"
|
||||
)
|
||||
}
|
||||
} ?: throw GeneralByteBufferFingerprint.exception
|
||||
|
||||
generalHook("$ADS_PATH/LithoFilterPatch;->filter")
|
||||
generalHook("$INTEGRATIONS_CLASS_DESCRIPTOR->filter")
|
||||
|
||||
LithoFilterFingerprint.result?.mutableMethod?.apply {
|
||||
removeInstructions(0, 6)
|
||||
@ -60,7 +63,7 @@ object LithoFilterPatch : BytecodePatch(
|
||||
.mutableMethod.addInstructions(
|
||||
0, """
|
||||
const/16 v1, $filterCount
|
||||
new-array v2, v1, [Lapp/revanced/integrations/patches/ads/Filter;
|
||||
new-array v2, v1, [$COMPONENTS_PATH/Filter;
|
||||
const/4 v1, 0x1
|
||||
"""
|
||||
)
|
||||
|
@ -8,6 +8,6 @@ object LithoFilterFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.STATIC or AccessFlags.CONSTRUCTOR,
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass == "Lapp/revanced/integrations/patches/ads/LithoFilterPatch;"
|
||||
methodDef.definingClass == "Lapp/revanced/integrations/patches/components/LithoFilterPatch;"
|
||||
}
|
||||
)
|
@ -24,7 +24,7 @@ import app.revanced.patches.youtube.utils.returnyoutubedislike.oldlayout.ReturnY
|
||||
import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.ReturnYouTubeDislikeShortsPatch
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.utils.videoid.general.VideoIdPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.util.integrations.Constants.UTILS_PATH
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
@ -210,7 +210,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
||||
"$UTILS_PATH/ReturnYouTubeDislikePatch;"
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"$PATCHES_PATH/ads/ReturnYouTubeDislikeFilterPatch;"
|
||||
"$COMPONENTS_PATH/ReturnYouTubeDislikeFilterPatch;"
|
||||
|
||||
private lateinit var conversionContextFieldReference: Reference
|
||||
private var tmpRegister: Int = 12
|
||||
|
@ -6,6 +6,7 @@ internal object Constants {
|
||||
|
||||
const val ADS_PATH = "$PATCHES_PATH/ads"
|
||||
const val ALTERNATIVE_THUMBNAILS = "$PATCHES_PATH/layout/AlternativeThumbnailsPatch;"
|
||||
const val COMPONENTS_PATH = "$PATCHES_PATH/components"
|
||||
const val SWIPE_PATH = "$PATCHES_PATH/swipe"
|
||||
const val FLYOUT_PANEL = "$PATCHES_PATH/layout/FlyoutPanelPatch;"
|
||||
const val FULLSCREEN = "$PATCHES_PATH/layout/FullscreenPatch;"
|
||||
@ -25,6 +26,7 @@ internal object Constants {
|
||||
const val MUSIC_ACCOUNT = "$MUSIC_PATCHES_PATH/account/AccountPatch;"
|
||||
const val MUSIC_ACTIONBAR = "$MUSIC_PATCHES_PATH/actionbar/ActionBarPatch;"
|
||||
const val MUSIC_ADS_PATH = "$MUSIC_PATCHES_PATH/ads"
|
||||
const val MUSIC_COMPONENTS_PATH = "$MUSIC_PATCHES_PATH/components"
|
||||
const val MUSIC_FLYOUT = "$MUSIC_PATCHES_PATH/flyout/FlyoutPatch;"
|
||||
const val MUSIC_GENERAL = "$MUSIC_PATCHES_PATH/general/GeneralPatch;"
|
||||
const val MUSIC_MISC_PATH = "$MUSIC_PATCHES_PATH/misc"
|
||||
|
Loading…
x
Reference in New Issue
Block a user