feat(RAR): Add Hide purchase reminder patch (#3321)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
Twin 2024-06-27 16:27:59 -04:00 committed by GitHub
parent 9414122816
commit 8fbe7e3d38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 0 deletions

View file

@ -535,6 +535,16 @@ public final class app/revanced/patches/pixiv/ads/HideAdsPatch : app/revanced/pa
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
} }
public final class app/revanced/patches/rar/misc/annoyances/purchasereminder/HidePurchaseReminderPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/rar/misc/annoyances/purchasereminder/HidePurchaseReminderPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
public final class app/revanced/patches/rar/misc/annoyances/purchasereminder/fingerprints/ShowReminderFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
public static final field INSTANCE Lapp/revanced/patches/rar/misc/annoyances/purchasereminder/fingerprints/ShowReminderFingerprint;
}
public final class app/revanced/patches/reddit/ad/banner/HideBannerPatch : app/revanced/patcher/patch/ResourcePatch { public final class app/revanced/patches/reddit/ad/banner/HideBannerPatch : app/revanced/patcher/patch/ResourcePatch {
public static final field INSTANCE Lapp/revanced/patches/reddit/ad/banner/HideBannerPatch; public static final field INSTANCE Lapp/revanced/patches/reddit/ad/banner/HideBannerPatch;
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V

View file

@ -0,0 +1,24 @@
package app.revanced.patches.rar.misc.annoyances.purchasereminder
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.rar.misc.annoyances.purchasereminder.fingerprints.ShowReminderFingerprint
import app.revanced.util.exception
@Patch(
name = "Hide purchase reminder",
description = "Hides the popup that reminds you to purchase the app.",
compatiblePackages = [CompatiblePackage("com.rarlab.rar")],
)
@Suppress("unused")
object HidePurchaseReminderPatch : BytecodePatch(
setOf(ShowReminderFingerprint),
) {
override fun execute(context: BytecodeContext) {
ShowReminderFingerprint.result?.mutableMethod?.addInstruction(0, "return-void")
?: throw ShowReminderFingerprint.exception
}
}

View file

@ -0,0 +1,13 @@
package app.revanced.patches.rar.misc.annoyances.purchasereminder.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
object ShowReminderFingerprint : MethodFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("AdsNotify;") && methodDef.name == "show"
},
)