refactor(rar): HidePurchaseReminderPatch

This commit is contained in:
Pun Butrach
2026-01-12 00:01:21 +07:00
parent e7d596e4d8
commit 1cecadf54c
2 changed files with 15 additions and 13 deletions

View File

@@ -1,12 +1,16 @@
package app.revanced.patches.rar.misc.annoyances.purchasereminder
import app.revanced.patcher.fingerprint
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.accessFlags
import app.revanced.patcher.definingClass
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags
internal val showReminderFingerprint = fingerprint {
internal val BytecodePatchContext.showReminderMethod by gettingFirstMutableMethodDeclaratively {
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
returns("V")
custom { method, _ ->
method.definingClass.endsWith("AdsNotify;") && method.name == "show"
}
returnType("V")
definingClass("AdsNotify;"::endsWith)
name("show")
}

View File

@@ -1,17 +1,15 @@
package app.revanced.patches.rar.misc.annoyances.purchasereminder
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.bytecodePatch
@Suppress("unused")
val hidePurchaseReminderPatch = bytecodePatch(
name = "Hide purchase reminder",
description = "Hides the popup that reminds you to purchase the app.",
import app.revanced.patcher.patch.creatingBytecodePatch
@Suppress("unused", "ObjectPropertyName")
val `Hide purchase reminder` by creatingBytecodePatch(
description = "Hides the popup that reminds you to purchase the app."
) {
compatibleWith("com.rarlab.rar")
apply {
showReminderFingerprint.method.addInstruction(0, "return-void")
showReminderMethod.addInstruction(0, "return-void")
}
}