mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 09:07:46 +01:00
fix(Infinity for Reddit - Unlock subscription): Do not crash by patching billing client
This commit is contained in:
parent
d7451579ee
commit
7d76e2e43c
3 changed files with 12 additions and 18 deletions
|
@ -5,22 +5,22 @@ 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.BillingClientOnServiceConnected
|
||||
import app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints.StartSubscriptionActivityFingerprint
|
||||
import app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints.SubscriptionActivityOnCreateFingerprint
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Patch(
|
||||
name = "Unlock subscription",
|
||||
description = "Unlocks the subscription feature but requires a custom client ID.",
|
||||
compatiblePackages = [
|
||||
CompatiblePackage("ml.docilealligator.infinityforreddit")
|
||||
CompatiblePackage("ml.docilealligator.infinityforreddit"),
|
||||
],
|
||||
dependencies = [SpoofClientPatch::class]
|
||||
dependencies = [SpoofClientPatch::class],
|
||||
)
|
||||
@Suppress("unused")
|
||||
object UnlockSubscriptionPatch : BytecodePatch(
|
||||
setOf(StartSubscriptionActivityFingerprint, SubscriptionActivityOnCreateFingerprint)
|
||||
setOf(StartSubscriptionActivityFingerprint, BillingClientOnServiceConnected),
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) =
|
||||
listOf(StartSubscriptionActivityFingerprint, SubscriptionActivityOnCreateFingerprint).returnEarly()
|
||||
listOf(StartSubscriptionActivityFingerprint, BillingClientOnServiceConnected).returnEarly()
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
||||
internal object BillingClientOnServiceConnected : MethodFingerprint(
|
||||
strings = listOf("Billing service connected"),
|
||||
)
|
|
@ -1,13 +0,0 @@
|
|||
package app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal object SubscriptionActivityOnCreateFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC.value,
|
||||
parameters = listOf("Landroid/os/Bundle;"),
|
||||
customFingerprint = { method, classDef ->
|
||||
method.name == "onCreate" && classDef.type.endsWith("SubscriptionActivity;")
|
||||
}
|
||||
)
|
Loading…
Reference in a new issue