Skip to content

Commit

Permalink
feat(tasker): bypass trial check
Browse files Browse the repository at this point in the history
  • Loading branch information
indrastorms committed Feb 10, 2024
1 parent 4d24e1b commit 91200f1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package app.revanced.patches.tasker.trial.unlock.annotations

import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package

@Compatibility([Package("net.dinglisch.android.taskerm")])
@Target(AnnotationTarget.CLASS)
internal annotation class UnlockTrialCompatibility
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.method.impl.MethodFingerprint

object CheckLicenseFingerprint : MethodFingerprint(
strings = listOf("Can't check license")
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package app.revanced.patches.tasker.trial.unlock.patch

import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.tasker.trial.unlock.annotations.UnlockTrialCompatibility
import app.revanced.patches.tasker.trial.unlock.fingerprints.CheckLicenseFingerprint

@Patch
@Name("Unlock trial")
@Description("Unlocks the trial version.")
@UnlockTrialCompatibility
class UnlockLicensePatch : BytecodePatch(
listOf(
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")
?.let { PatchResultSuccess() }
?: CheckLicenseFingerprint.toErrorResult()
}

0 comments on commit 91200f1

Please sign in to comment.