Skip to content

Commit

Permalink
feat(Infinity for Reddit): Add Unlock subscription patch
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Dec 2, 2023
1 parent ca42fd9 commit 840b29e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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()
}
Original file line number Diff line number Diff line change
@@ -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
)

0 comments on commit 840b29e

Please sign in to comment.