fix(Infinity for Reddit - Unlock subscription): Restore functionality on v7.0.0

This commit is contained in:
oSumAtrIX 2024-02-02 00:10:00 +01:00
parent 82e226d124
commit bf19af99cb
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 17 additions and 2 deletions

View File

@ -6,6 +6,7 @@ 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.patches.reddit.customclients.infinityforreddit.subscription.fingerprints.SubscriptionActivityOnCreateFingerprint
import app.revanced.util.returnEarly
@Patch(
@ -18,7 +19,8 @@ import app.revanced.util.returnEarly
)
@Suppress("unused")
object UnlockSubscriptionPatch : BytecodePatch(
setOf(StartSubscriptionActivityFingerprint)
setOf(StartSubscriptionActivityFingerprint, SubscriptionActivityOnCreateFingerprint)
) {
override fun execute(context: BytecodeContext) = listOf(StartSubscriptionActivityFingerprint).returnEarly()
override fun execute(context: BytecodeContext) =
listOf(StartSubscriptionActivityFingerprint, SubscriptionActivityOnCreateFingerprint).returnEarly()
}

View File

@ -0,0 +1,13 @@
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;")
}
)