From 414f503e493f2dc27edf134f5db723da77636d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Richter?= Date: Mon, 12 Dec 2022 14:27:10 +0100 Subject: [PATCH] feat(sleepasandroid): remove `unlock-premium` patch (#1253) --- .../annotations/UnlockPremiumCompatibility.kt | 9 ----- .../fingerprints/IsTrialFingerprint.kt | 8 ----- .../patch/UnlockPremiumPatch.kt | 36 ------------------- 3 files changed, 53 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/sleepasandroid/annotations/UnlockPremiumCompatibility.kt delete mode 100644 src/main/kotlin/app/revanced/patches/sleepasandroid/fingerprints/IsTrialFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/sleepasandroid/patch/UnlockPremiumPatch.kt diff --git a/src/main/kotlin/app/revanced/patches/sleepasandroid/annotations/UnlockPremiumCompatibility.kt b/src/main/kotlin/app/revanced/patches/sleepasandroid/annotations/UnlockPremiumCompatibility.kt deleted file mode 100644 index 577c232f9..000000000 --- a/src/main/kotlin/app/revanced/patches/sleepasandroid/annotations/UnlockPremiumCompatibility.kt +++ /dev/null @@ -1,9 +0,0 @@ -package app.revanced.patches.sleepasandroid.annotations - -import app.revanced.patcher.annotation.Compatibility -import app.revanced.patcher.annotation.Package - -@Compatibility([Package("com.urbandroid.sleep")]) -@Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -internal annotation class UnlockPremiumCompatibility diff --git a/src/main/kotlin/app/revanced/patches/sleepasandroid/fingerprints/IsTrialFingerprint.kt b/src/main/kotlin/app/revanced/patches/sleepasandroid/fingerprints/IsTrialFingerprint.kt deleted file mode 100644 index 73099b073..000000000 --- a/src/main/kotlin/app/revanced/patches/sleepasandroid/fingerprints/IsTrialFingerprint.kt +++ /dev/null @@ -1,8 +0,0 @@ -package app.revanced.patches.sleepasandroid.fingerprints - -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint - -object IsTrialFingerprint : MethodFingerprint( - "Z", - customFingerprint = { it.name == "isTrial" } -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/sleepasandroid/patch/UnlockPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/sleepasandroid/patch/UnlockPremiumPatch.kt deleted file mode 100644 index 45ffbd040..000000000 --- a/src/main/kotlin/app/revanced/patches/sleepasandroid/patch/UnlockPremiumPatch.kt +++ /dev/null @@ -1,36 +0,0 @@ -package app.revanced.patches.sleepasandroid.patch - -import app.revanced.patcher.annotation.Description -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patches.sleepasandroid.annotations.UnlockPremiumCompatibility -import app.revanced.patches.sleepasandroid.fingerprints.IsTrialFingerprint - -@Patch -@Name("unlock-premium") -@Description("Unlocks all premium features.") -@UnlockPremiumCompatibility -class UnlockPremiumPatch : BytecodePatch( - listOf( - IsTrialFingerprint - ) -) { - override fun execute(context: BytecodeContext): PatchResult { - val method = IsTrialFingerprint.result!!.mutableMethod - - method.addInstructions( - 0, - """ - const/4 v0, 0x0 - return v0 - """ - ) - - return PatchResultSuccess() - } -} \ No newline at end of file