diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/reels/fingerprints/HideReelsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/reels/fingerprints/HideReelsFingerprint.kt deleted file mode 100644 index af24744e..00000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/reels/fingerprints/HideReelsFingerprint.kt +++ /dev/null @@ -1,10 +0,0 @@ -package app.revanced.patches.youtube.layout.reels.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import org.jf.dexlib2.AccessFlags - -object HideReelsFingerprint : MethodFingerprint( - access = AccessFlags.PROTECTED or AccessFlags.FINAL, parameters = listOf("L", "L"), - strings = listOf("multiReelDismissalCallback", "reelItemRenderers", "reelDismissalInfo") -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/reels/patch/HideReelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/reels/patch/HideReelsPatch.kt deleted file mode 100644 index 65ed14c9..00000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/reels/patch/HideReelsPatch.kt +++ /dev/null @@ -1,51 +0,0 @@ -package app.revanced.patches.youtube.layout.reels.patch - -import app.revanced.patcher.annotation.Description -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.addInstruction -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.annotations.DependsOn -import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility -import app.revanced.patches.youtube.layout.reels.fingerprints.HideReelsFingerprint -import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch -import app.revanced.patches.shared.settings.preference.impl.StringResource -import app.revanced.patches.shared.settings.preference.impl.SwitchPreference - -//@Patch TODO: this is currently in the general-bytecode-ads patch due to the integrations having a preference for including reels or not. Move it here. -@Name("hide-reels") -@Description("Hides reels on the home page.") -@DependsOn([SettingsPatch::class]) -@HideReelsCompatibility -@Version("0.0.1") -class HideReelsPatch : BytecodePatch( - listOf( - HideReelsFingerprint - ) -) { - override fun execute(context: BytecodeContext): PatchResult { - SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( - SwitchPreference( - "revanced_hide_reel_button", - StringResource("revanced_hide_reel_button_title", "Hide reels button"), - true, - StringResource("revanced_hide_reel_button_summary_on", "Reels button is hidden"), - StringResource("revanced_hide_reel_button_summary_off", "Reels button is shown") - ) - ) - - val result = HideReelsFingerprint.result!! - - // HideReel will hide the reel view before it is being used, - // so we pass the view to the HideReel method - result.mutableMethod.addInstruction( - result.scanResult.patternScanResult!!.endIndex, - "invoke-static { v2 }, Lapp/revanced/integrations/patches/HideReelsPatch;->HideReel(Landroid/view/View;)V" - ) - - return PatchResultSuccess() - } -}