mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-29 13:41:03 +00:00
refactor(rar): HidePurchaseReminderPatch
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user