feat(Infinity for Reddit): Add Unlock subscription patch

This commit is contained in:
oSumAtrIX 2023-12-02 17:27:12 +01:00
parent ca42fd9365
commit 840b29e989
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package app.revanced.patches.reddit.customclients.infinityforreddit.subscription
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.reddit.customclients.infinityforreddit.api.SpoofClientPatch
import app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints.StartSubscriptionActivityFingerprint
import app.revanced.util.Utils.returnEarly
@Patch(
name = "Unlock subscription",
description = "Unlocks the subscription feature but requires a custom client ID.",
dependencies = [SpoofClientPatch::class],
compatiblePackages = [
CompatiblePackage("ml.docilealligator.infinityforreddit")
]
)
@Suppress("unused")
object UnlockSubscriptionPatch : BytecodePatch(
setOf(StartSubscriptionActivityFingerprint)
) {
override fun execute(context: BytecodeContext) = listOf(StartSubscriptionActivityFingerprint).returnEarly()
}

View File

@ -0,0 +1,7 @@
package app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints
import app.revanced.util.patch.LiteralValueFingerprint
internal object StartSubscriptionActivityFingerprint : LiteralValueFingerprint(
literalSupplier = { 0x10008000 } // Intent start flag only used in the subscription activity
)