generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Tumblr): Add
Disable gift message popup
patch
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...revanced/patches/tumblr/annoyances/popups/fingerprints/ShowGiftMessagePopupFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package app.revanced.patches.tumblr.annoyances.popups.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
|
||
// This method is responsible for loading and displaying the visual Layout of the Gift Message Popup. | ||
object ShowGiftMessagePopupFingerprint : MethodFingerprint( | ||
strings = listOf("activity", "anchorView"), | ||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("GiftMessagePopup;") } | ||
) |
24 changes: 24 additions & 0 deletions
24
...otlin/app/revanced/patches/tumblr/annoyances/popups/patch/DisableGiftMessagePopupPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package app.revanced.patches.tumblr.annoyances.popups.patch | ||
|
||
import app.revanced.extensions.exception | ||
import app.revanced.patcher.annotation.Compatibility | ||
import app.revanced.patcher.annotation.Description | ||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.annotation.Package | ||
import app.revanced.patcher.data.BytecodeContext | ||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions | ||
import app.revanced.patcher.patch.BytecodePatch | ||
import app.revanced.patcher.patch.annotations.Patch | ||
import app.revanced.patches.tumblr.annoyances.popups.fingerprints.ShowGiftMessagePopupFingerprint | ||
|
||
@Patch | ||
@Name("Disable gift message popup") | ||
@Description("Disables the popup suggesting to buy TumblrMart items for other people.") | ||
@Compatibility([Package("com.tumblr")]) | ||
class DisableGiftMessagePopupPatch : BytecodePatch( | ||
listOf(ShowGiftMessagePopupFingerprint) | ||
) { | ||
override fun execute(context: BytecodeContext) = | ||
ShowGiftMessagePopupFingerprint.result?.mutableMethod?.addInstructions(0, "return-void") | ||
?: throw ShowGiftMessagePopupFingerprint.exception | ||
} |