Skip to content

Commit 55556f3

Browse files
TwinovoSumAtrIX
andauthored
feat(RAR): Add Hide purchase reminder patch (#3321)
Co-authored-by: oSumAtrIX <[email protected]>
1 parent 70e54f8 commit 55556f3

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

api/revanced-patches.api

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,16 @@ public final class app/revanced/patches/pixiv/ads/HideAdsPatch : app/revanced/pa
535535
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
536536
}
537537

538+
public final class app/revanced/patches/rar/misc/annoyances/purchasereminder/HidePurchaseReminderPatch : app/revanced/patcher/patch/BytecodePatch {
539+
public static final field INSTANCE Lapp/revanced/patches/rar/misc/annoyances/purchasereminder/HidePurchaseReminderPatch;
540+
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
541+
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
542+
}
543+
544+
public final class app/revanced/patches/rar/misc/annoyances/purchasereminder/fingerprints/ShowReminderFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
545+
public static final field INSTANCE Lapp/revanced/patches/rar/misc/annoyances/purchasereminder/fingerprints/ShowReminderFingerprint;
546+
}
547+
538548
public final class app/revanced/patches/reddit/ad/banner/HideBannerPatch : app/revanced/patcher/patch/ResourcePatch {
539549
public static final field INSTANCE Lapp/revanced/patches/reddit/ad/banner/HideBannerPatch;
540550
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package app.revanced.patches.rar.misc.annoyances.purchasereminder
2+
3+
import app.revanced.patcher.data.BytecodeContext
4+
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
5+
import app.revanced.patcher.patch.BytecodePatch
6+
import app.revanced.patcher.patch.annotation.CompatiblePackage
7+
import app.revanced.patcher.patch.annotation.Patch
8+
import app.revanced.patches.rar.misc.annoyances.purchasereminder.fingerprints.ShowReminderFingerprint
9+
import app.revanced.util.exception
10+
11+
@Patch(
12+
name = "Hide purchase reminder",
13+
description = "Hides the popup that reminds you to purchase the app.",
14+
compatiblePackages = [CompatiblePackage("com.rarlab.rar")],
15+
)
16+
@Suppress("unused")
17+
object HidePurchaseReminderPatch : BytecodePatch(
18+
setOf(ShowReminderFingerprint),
19+
) {
20+
override fun execute(context: BytecodeContext) {
21+
ShowReminderFingerprint.result?.mutableMethod?.addInstruction(0, "return-void")
22+
?: throw ShowReminderFingerprint.exception
23+
}
24+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package app.revanced.patches.rar.misc.annoyances.purchasereminder.fingerprints
2+
3+
import app.revanced.patcher.extensions.or
4+
import app.revanced.patcher.fingerprint.MethodFingerprint
5+
import com.android.tools.smali.dexlib2.AccessFlags
6+
7+
object ShowReminderFingerprint : MethodFingerprint(
8+
returnType = "V",
9+
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
10+
customFingerprint = { methodDef, _ ->
11+
methodDef.definingClass.endsWith("AdsNotify;") && methodDef.name == "show"
12+
},
13+
)

0 commit comments

Comments
 (0)