diff --git a/src/main/kotlin/app/revanced/patches/music/ads/music/patch/MusicAdsPatch.kt b/src/main/kotlin/app/revanced/patches/music/ads/music/patch/MusicAdsPatch.kt index 648e4fa34..0b0b77777 100644 --- a/src/main/kotlin/app/revanced/patches/music/ads/music/patch/MusicAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/ads/music/patch/MusicAdsPatch.kt @@ -38,6 +38,7 @@ class MusicAdsPatch : AbstractAdsPatch( return PatchResultSuccess() } + private companion object { private const val FILTER_CLASS_DESCRIPTOR = "$MUSIC_ADS_PATH/AdsFilter;" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/buttonshelf/patch/HideButtonShelfPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/buttonshelf/patch/HideButtonShelfPatch.kt index 85911f7c2..f0a71f697 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/buttonshelf/patch/HideButtonShelfPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/buttonshelf/patch/HideButtonShelfPatch.kt @@ -39,6 +39,7 @@ class HideButtonShelfPatch : BytecodePatch() { return PatchResultSuccess() } + private companion object { private const val FILTER_CLASS_DESCRIPTOR = "$MUSIC_ADS_PATH/ButtonShelfFilter;" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/carouselshelf/patch/HideCarouselShelfPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/carouselshelf/patch/HideCarouselShelfPatch.kt index 62234f191..020ac8b04 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/carouselshelf/patch/HideCarouselShelfPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/carouselshelf/patch/HideCarouselShelfPatch.kt @@ -39,6 +39,7 @@ class HideCarouselShelfPatch : BytecodePatch() { return PatchResultSuccess() } + private companion object { private const val FILTER_CLASS_DESCRIPTOR = "$MUSIC_ADS_PATH/CarouselShelfFilter;" diff --git a/src/main/kotlin/app/revanced/patches/music/layout/playlistcard/patch/HidePlaylistCardPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/playlistcard/patch/HidePlaylistCardPatch.kt index 20ab225a4..249bd9d06 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/playlistcard/patch/HidePlaylistCardPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/playlistcard/patch/HidePlaylistCardPatch.kt @@ -39,6 +39,7 @@ class HidePlaylistCardPatch : BytecodePatch() { return PatchResultSuccess() } + private companion object { private const val FILTER_CLASS_DESCRIPTOR = "$MUSIC_ADS_PATH/PlaylistCardFilter;" diff --git a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/patch/FeedFlyoutPanelPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/patch/FeedFlyoutPanelPatch.kt index 53a47d8a7..db304cd1d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/patch/FeedFlyoutPanelPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/feed/patch/FeedFlyoutPanelPatch.kt @@ -36,7 +36,8 @@ class FeedFlyoutPanelPatch : BytecodePatch( val targetIndex = it.scanResult.patternScanResult!!.endIndex val targetRegister = getInstruction(targetIndex).registerA - val targetParameter = getInstruction(targetIndex - 1).reference + val targetParameter = + getInstruction(targetIndex - 1).reference if (!targetParameter.toString().endsWith("Ljava/lang/CharSequence;")) return PatchResultError("Method signature parameter did not match: $targetParameter") diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/patch/TrendingSearchesPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/patch/TrendingSearchesPatch.kt index b6605e059..ccf29d555 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/patch/TrendingSearchesPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/trendingsearches/patch/TrendingSearchesPatch.kt @@ -15,13 +15,13 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.youtube.general.trendingsearches.fingerprints.SearchBarEntryFingerprint 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.YtOutlineArrowTimeBlack +import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.YtOutlineFireBlack +import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.YtOutlineSearchBlack import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.util.bytecode.getWideLiteralIndex import app.revanced.util.integrations.Constants.GENERAL import org.jf.dexlib2.iface.instruction.OneRegisterInstruction -import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.YtOutlineArrowTimeBlack -import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.YtOutlineFireBlack -import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.YtOutlineSearchBlack import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction @Patch @@ -48,7 +48,8 @@ class TrendingSearchesPatch : BytecodePatch( .reversed() .forEach { (index, value) -> val freeRegister = getInstruction(index).registerA - val viewRegister = getInstruction(index - 1).registerA + val viewRegister = + getInstruction(index - 1).registerA addInstructions( index, """ @@ -74,6 +75,7 @@ class TrendingSearchesPatch : BytecodePatch( return PatchResultSuccess() } + private enum class SearchTerm(val resourceId: Long, val value: Int) { HISTORY(YtOutlineArrowTimeBlack, 0), SEARCH(YtOutlineSearchBlack, 0), diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/patch/WideSearchBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/patch/WideSearchBarPatch.kt index 22f03de6c..68baf4d5a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/patch/WideSearchBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/widesearchbar/patch/WideSearchBarPatch.kt @@ -15,8 +15,8 @@ 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.general.widesearchbar.fingerprints.SetActionBarRingoFingerprint -import app.revanced.patches.youtube.utils.fingerprints.SetToolBarPaddingFingerprint import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility +import app.revanced.patches.youtube.utils.fingerprints.SetToolBarPaddingFingerprint 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 diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsLikeButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsLikeButtonPatch.kt index f446d2eb6..3d0902ba0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsLikeButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsLikeButtonPatch.kt @@ -6,7 +6,6 @@ import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsToolBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsToolBarPatch.kt index 056028dd0..73f5ca173 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsToolBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsToolBarPatch.kt @@ -37,17 +37,17 @@ class ShortsToolBarPatch : BytecodePatch( (context.toMethodWalker(it.method) .nextMethod(targetIndex, true) .getMethod() as MutableMethod - ).apply { - val targetParameter = getInstruction(0).reference - if (!targetParameter.toString().endsWith("Landroid/support/v7/widget/Toolbar;")) - return PatchResultError("Method signature parameter did not match: $targetParameter") - val targetRegister = getInstruction(0).registerA + ).apply { + val targetParameter = getInstruction(0).reference + if (!targetParameter.toString().endsWith("Landroid/support/v7/widget/Toolbar;")) + return PatchResultError("Method signature parameter did not match: $targetParameter") + val targetRegister = getInstruction(0).registerA - addInstruction( - 1, - "invoke-static {v$targetRegister}, $SHORTS->hideShortsPlayerToolBar(Landroid/support/v7/widget/Toolbar;)V" - ) - } + addInstruction( + 1, + "invoke-static {v$targetRegister}, $SHORTS->hideShortsPlayerToolBar(Landroid/support/v7/widget/Toolbar;)V" + ) + } } ?: return SetToolBarPaddingFingerprint.toErrorResult()