mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-06 16:36:59 +01:00
feat(vsco): add unlock-pro
patch (#2168)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
ca59f65da8
commit
7ffd1a09a7
@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.vsco.misc.pro.fingerprints
|
||||
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object RevCatSubscriptionFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
strings = listOf("use_debug_subscription_settings"),
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass.endsWith("/RevCatSubscriptionSettingsRepository;")
|
||||
}
|
||||
)
|
@ -0,0 +1,35 @@
|
||||
package app.revanced.patches.vsco.misc.pro.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.*
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.vsco.misc.pro.fingerprints.RevCatSubscriptionFingerprint
|
||||
|
||||
|
||||
@Patch
|
||||
@Name("unlock-pro")
|
||||
@Description("Unlocks pro features.")
|
||||
@Compatibility([Package("com.vsco.cam")])
|
||||
@Version("0.0.1")
|
||||
class UnlockProPatch : BytecodePatch(
|
||||
listOf(RevCatSubscriptionFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
RevCatSubscriptionFingerprint.result?.mutableMethod?.apply {
|
||||
// Set isSubscribed to true.
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
const p1, 0x1
|
||||
"""
|
||||
)
|
||||
} ?: return RevCatSubscriptionFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user