mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-21 10:03:55 +00:00
refactor(infinityforreddit): UnlockSubscriptionPatch
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package app.revanced.patches.reddit.customclients.infinityforreddit.subscription
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
|
||||
import app.revanced.patcher.instructions
|
||||
import app.revanced.patcher.literal
|
||||
import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val billingClientOnServiceConnectedFingerprint = fingerprint {
|
||||
strings("Billing service connected")
|
||||
}
|
||||
internal val BytecodePatchContext.billingClientOnServiceConnectedMethod by gettingFirstMutableMethodDeclaratively("Billing service connected")
|
||||
|
||||
internal val startSubscriptionActivityFingerprint = fingerprint {
|
||||
internal val BytecodePatchContext.startSubscriptionActivityMethod by gettingFirstMutableMethodDeclaratively {
|
||||
instructions(
|
||||
literal(0x10008000) // Intent start flag only used in the subscription activity
|
||||
literal(0x10008000)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package app.revanced.patches.reddit.customclients.infinityforreddit.subscription
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.patch.creatingBytecodePatch
|
||||
import app.revanced.patches.reddit.customclients.infinityforreddit.api.spoofClientPatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val unlockSubscriptionPatch = bytecodePatch(
|
||||
name = "Unlock subscription",
|
||||
@Suppress("unused", "ObjectPropertyName")
|
||||
val `Unlock subscription` by creatingBytecodePatch(
|
||||
description = "Unlocks the subscription feature but requires a custom client ID.",
|
||||
) {
|
||||
dependsOn(spoofClientPatch)
|
||||
@@ -19,8 +18,8 @@ val unlockSubscriptionPatch = bytecodePatch(
|
||||
|
||||
apply {
|
||||
setOf(
|
||||
startSubscriptionActivityFingerprint,
|
||||
billingClientOnServiceConnectedFingerprint,
|
||||
).forEach { it.method.returnEarly() }
|
||||
billingClientOnServiceConnectedMethod,
|
||||
startSubscriptionActivityMethod,
|
||||
).forEach { it.returnEarly() }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user