feat(Strava): Add Disable subscription suggestions patch (#2997)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
xehpuk
2023-09-25 16:29:06 +02:00
committed by GitHub
co-authored by oSumAtrIX
parent 096fc12123
commit ef241671bd
4 changed files with 86 additions and 3 deletions
@@ -10,7 +10,7 @@ import app.revanced.patches.strava.subscription.fingerprints.GetSubscribedFinger
@Patch(
name = "Unlock subscription features",
description = "Unlocks \"Matched Runs\" and \"Segment Efforts\".",
description = "Unlocks \"Routes\", \"Matched Runs\" and \"Segment Efforts\".",
compatiblePackages = [CompatiblePackage("com.strava", ["320.12"])]
)
@Suppress("unused")
@@ -19,4 +19,4 @@ object UnlockSubscriptionPatch : BytecodePatch(setOf(GetSubscribedFingerprint))
val isSubscribedIndex = result.scanResult.patternScanResult!!.startIndex
result.mutableMethod.replaceInstruction(isSubscribedIndex, "const/4 v0, 0x1")
} ?: throw GetSubscribedFingerprint.exception
}
}
@@ -6,6 +6,6 @@ import com.android.tools.smali.dexlib2.Opcode
object GetSubscribedFingerprint : MethodFingerprint(
opcodes = listOf(Opcode.IGET_BOOLEAN),
customFingerprint = { methodDef, classDef ->
classDef.type.endsWith("SubscriptionDetailResponse;") && methodDef.name == "getSubscribed"
classDef.type.endsWith("/SubscriptionDetailResponse;") && methodDef.name == "getSubscribed"
}
)