Files
revancedpatches/src/main/kotlin/app/revanced/patches/songpal/badge/RemoveNotificationBadgePatch.kt
T
8c8dff9078 build(Needs bump): Bump dependencies (#2946)
Co-authored-by: Ushie <ushiekane@gmail.com>
Co-authored-by: aAbed <aabedhkhan@gmail.com>
Co-authored-by: CnC-Robert <CnC.Rob3rt@gmail.com>
2023-09-20 06:27:29 +02:00

23 lines
978 B
Kotlin

package app.revanced.patches.songpal.badge
import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.songpal.badge.fingerprints.ShowNotificationFingerprint
@Patch(
name = "Remove notification badge",
description = "Removes the red notification badge from the activity tab.",
compatiblePackages = [CompatiblePackage("com.sony.songpal.mdr")]
)
@Suppress("unused")
object RemoveNotificationBadgePatch : BytecodePatch(setOf(ShowNotificationFingerprint)) {
override fun execute(context: BytecodeContext) {
ShowNotificationFingerprint.result?.mutableMethod?.addInstructions(0, "return-void")
?: throw ShowNotificationFingerprint.exception
}
}