generated from ReVanced/revanced-patches-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d24e1b
commit ee6d248
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/dropped/patches/tasker/trial/unlock/fingerprints/CheckLicenseFingerprint.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,7 @@ | ||
package app.revanced.patches.tasker.trial.unlock.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
|
||
object CheckLicenseFingerprint : MethodFingerprint( | ||
strings = listOf("Can't check license") | ||
) |
29 changes: 29 additions & 0 deletions
29
src/main/kotlin/dropped/patches/tasker/trial/unlock/patch/UnlockLicensePatch.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,29 @@ | ||
package app.revanced.patches.tasker.trial.unlock.patch | ||
|
||
import app.revanced.util.exception | ||
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.Patch | ||
import app.revanced.patcher.patch.annotation.CompatiblePackage | ||
import app.revanced.patches.tasker.trial.unlock.fingerprints.CheckLicenseFingerprint | ||
|
||
@Patch( | ||
name = "Unlock trial", | ||
description = "Unlocks the trial version.", | ||
compatiblePackages = [ | ||
CompatiblePackage("net.dinglisch.android.taskerm") | ||
] | ||
) | ||
object UnlockLicensePatch : BytecodePatch( | ||
setOf( | ||
CheckLicenseFingerprint | ||
) | ||
) { | ||
override fun execute(context: BytecodeContext) = CheckLicenseFingerprint | ||
.result | ||
?.mutableMethod | ||
// Return the method early, which prompts the user with a non dismissible dialog, when the trial period is over. | ||
?.addInstruction(0, "return-void") | ||
?: throw CheckLicenseFingerprint.exception | ||
} |