generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RAR): Add
Hide purchase reminder
patch (#3321)
Co-authored-by: oSumAtrIX <[email protected]>
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
...in/app/revanced/patches/rar/misc/annoyances/purchasereminder/HidePurchaseReminderPatch.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.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 | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...nced/patches/rar/misc/annoyances/purchasereminder/fingerprints/ShowReminderFingerprint.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,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" | ||
}, | ||
) |