diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/breakingnews/fingerprints/BreakingNewsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/breakingnews/fingerprints/BreakingNewsFingerprint.kt deleted file mode 100644 index 59d5b995a..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/general/breakingnews/fingerprints/BreakingNewsFingerprint.kt +++ /dev/null @@ -1,16 +0,0 @@ -package app.revanced.patches.youtube.general.breakingnews.fingerprints - -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.HorizontalCardList -import app.revanced.util.bytecode.isWideLiteralExists -import org.jf.dexlib2.Opcode - -object BreakingNewsFingerprint : MethodFingerprint( - opcodes = listOf( - Opcode.CONST, - Opcode.CONST_4, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT - ), - customFingerprint = { it, _ -> it.isWideLiteralExists(HorizontalCardList) } -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/breakingnews/patch/BreakingNewsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/breakingnews/patch/BreakingNewsPatch.kt deleted file mode 100644 index 1d2f8e444..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/general/breakingnews/patch/BreakingNewsPatch.kt +++ /dev/null @@ -1,64 +0,0 @@ -package app.revanced.patches.youtube.general.breakingnews.patch - -import app.revanced.extensions.toErrorResult -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.InstructionExtensions.addInstruction -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -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.patcher.patch.annotations.Patch -import app.revanced.patches.shared.annotation.YouTubeCompatibility -import app.revanced.patches.youtube.general.breakingnews.fingerprints.BreakingNewsFingerprint -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 -import org.jf.dexlib2.iface.instruction.OneRegisterInstruction - -@Patch -@Name("hide-breaking-news-shelf") -@Description("Hides the breaking news shelf on the homepage tab.") -@DependsOn( - [ - SettingsPatch::class, - SharedResourceIdPatch::class, - ] -) -@YouTubeCompatibility -@Version("0.0.1") -class BreakingNewsPatch : BytecodePatch( - listOf( - BreakingNewsFingerprint, - ) -) { - override fun execute(context: BytecodeContext): PatchResult { - BreakingNewsFingerprint.result?.let { - it.mutableMethod.apply { - val targetIndex = it.scanResult.patternScanResult!!.endIndex - val targetRegister = getInstruction(targetIndex).registerA - addInstruction( - targetIndex + 1, - "invoke-static {v$targetRegister}, $GENERAL->hideBreakingNewsShelf(Landroid/view/View;)V" - ) - } - }?: return BreakingNewsFingerprint.toErrorResult() - - /** - * Add settings - */ - SettingsPatch.addPreference( - arrayOf( - "PREFERENCE: GENERAL_SETTINGS", - "SETTINGS: HIDE_BREAKING_NEWS_SHELF" - ) - ) - - SettingsPatch.updatePatchStatus("hide-breaking-news-shelf") - - return PatchResultSuccess() - } -}