From ee6d24802b4ed6eb7df984461add703369a6a3d8 Mon Sep 17 00:00:00 2001 From: Indranil012 Date: Sat, 10 Feb 2024 22:01:38 +0530 Subject: [PATCH] feat(tasker): Add trial bypass --- .../fingerprints/CheckLicenseFingerprint.kt | 7 +++++ .../trial/unlock/patch/UnlockLicensePatch.kt | 29 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/main/kotlin/dropped/patches/tasker/trial/unlock/fingerprints/CheckLicenseFingerprint.kt create mode 100644 src/main/kotlin/dropped/patches/tasker/trial/unlock/patch/UnlockLicensePatch.kt diff --git a/src/main/kotlin/dropped/patches/tasker/trial/unlock/fingerprints/CheckLicenseFingerprint.kt b/src/main/kotlin/dropped/patches/tasker/trial/unlock/fingerprints/CheckLicenseFingerprint.kt new file mode 100644 index 0000000..2d3752b --- /dev/null +++ b/src/main/kotlin/dropped/patches/tasker/trial/unlock/fingerprints/CheckLicenseFingerprint.kt @@ -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") +) diff --git a/src/main/kotlin/dropped/patches/tasker/trial/unlock/patch/UnlockLicensePatch.kt b/src/main/kotlin/dropped/patches/tasker/trial/unlock/patch/UnlockLicensePatch.kt new file mode 100644 index 0000000..29959b8 --- /dev/null +++ b/src/main/kotlin/dropped/patches/tasker/trial/unlock/patch/UnlockLicensePatch.kt @@ -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 +}