Skip to content

Commit

Permalink
feat(tasker): Add trial bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
indrastorms committed Feb 10, 2024
1 parent 4d24e1b commit ee6d248
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
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")
)
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
}

0 comments on commit ee6d248

Please sign in to comment.