Compare commits

...

8 Commits

Author SHA1 Message Date
semantic-release-bot
e74e65364a chore(release): 2.191.0-dev.9 [skip ci]
# [2.191.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.8...v2.191.0-dev.9) (2023-09-25)

### Features

* **Strava:** Add `Disable subscription suggestions` patch ([#2997](https://github.com/ReVanced/revanced-patches/issues/2997)) ([ef24167](ef241671bd))
2023-09-25 14:32:01 +00:00
xehpuk
ef241671bd feat(Strava): Add Disable subscription suggestions patch (#2997)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-09-25 16:29:06 +02:00
LisoUseInAIKyrios
096fc12123 build: fix aapt compilation error 2023-09-25 14:03:48 +04:00
semantic-release-bot
f166bd7ea7 chore(release): 2.191.0-dev.8 [skip ci]
# [2.191.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.7...v2.191.0-dev.8) (2023-09-24)

### Bug Fixes

* **Relay - Spoof client:** Restore OAuth login ([df43cea](df43cea4f8))
* **Slide - Spoof client:** Use correct patch name ([444b196](444b196f41))
2023-09-24 21:57:15 +00:00
oSumAtrIX
df43cea4f8 fix(Relay - Spoof client): Restore OAuth login 2023-09-24 23:54:26 +02:00
oSumAtrIX
444b196f41 fix(Slide - Spoof client): Use correct patch name 2023-09-24 23:52:46 +02:00
semantic-release-bot
884bf29804 chore(release): 2.191.0-dev.7 [skip ci]
# [2.191.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.6...v2.191.0-dev.7) (2023-09-24)

### Bug Fixes

* **Duolingo - Unlock Super:** Get correct instruction offset ([#3023](https://github.com/ReVanced/revanced-patches/issues/3023)) ([144fabe](144fabe571))
2023-09-24 15:10:12 +00:00
Oyssale
144fabe571 fix(Duolingo - Unlock Super): Get correct instruction offset (#3023) 2023-09-24 17:07:10 +02:00
13 changed files with 145 additions and 16 deletions

View File

@@ -1,3 +1,25 @@
# [2.191.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.8...v2.191.0-dev.9) (2023-09-25)
### Features
* **Strava:** Add `Disable subscription suggestions` patch ([#2997](https://github.com/ReVanced/revanced-patches/issues/2997)) ([af02175](https://github.com/ReVanced/revanced-patches/commit/af0217594d9c7526f550fc7e6f09f8a9232e72cf))
# [2.191.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.7...v2.191.0-dev.8) (2023-09-24)
### Bug Fixes
* **Relay - Spoof client:** Restore OAuth login ([96e01f7](https://github.com/ReVanced/revanced-patches/commit/96e01f7a7b87f468776fbde48e114a3f51630a46))
* **Slide - Spoof client:** Use correct patch name ([f355dbf](https://github.com/ReVanced/revanced-patches/commit/f355dbf1d2af3075c6a3f13d8bf5f8dca22e6005))
# [2.191.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.6...v2.191.0-dev.7) (2023-09-24)
### Bug Fixes
* **Duolingo - Unlock Super:** Get correct instruction offset ([#3023](https://github.com/ReVanced/revanced-patches/issues/3023)) ([5146de8](https://github.com/ReVanced/revanced-patches/commit/5146de872acb17d7c21019ac7ed531f27361038f))
# [2.191.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.5...v2.191.0-dev.6) (2023-09-23) # [2.191.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.5...v2.191.0-dev.6) (2023-09-23)

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true org.gradle.parallel = true
org.gradle.caching = true org.gradle.caching = true
kotlin.code.style = official kotlin.code.style = official
version = 2.191.0-dev.6 version = 2.191.0-dev.9

File diff suppressed because one or more lines are too long

View File

@@ -54,8 +54,8 @@ object UnlockDuolingoSuperPatch : BytecodePatch(
} }
private fun MutableMethod.indexOfReference(reference: Reference) = getInstructions() private fun MutableMethod.indexOfReference(reference: Reference) = getInstructions()
.filterIsInstance<BuilderInstruction22c>() .indexOfFirst { it is BuilderInstruction22c && it.opcode == Opcode.IPUT_BOOLEAN && it.reference == reference }
.filter { it.opcode == Opcode.IPUT_BOOLEAN }.indexOfFirst { it.reference == reference }.let { .let {
if (it == -1) throw PatchException("Could not find index of instruction with supplied reference.") if (it == -1) throw PatchException("Could not find index of instruction with supplied reference.")
else it else it
} }

View File

@@ -14,9 +14,11 @@ abstract class AbstractSpoofClientPatch(
private val redirectUri: String, private val redirectUri: String,
private val clientIdFingerprints: List<MethodFingerprint>, private val clientIdFingerprints: List<MethodFingerprint>,
private val userAgentFingerprints: List<MethodFingerprint>? = null, private val userAgentFingerprints: List<MethodFingerprint>? = null,
private val miscellaneousFingerprints: List<MethodFingerprint>? = null
) : BytecodePatch(buildSet { ) : BytecodePatch(buildSet {
addAll(clientIdFingerprints) addAll(clientIdFingerprints)
userAgentFingerprints?.let(::addAll) userAgentFingerprints?.let(::addAll)
miscellaneousFingerprints?.let(::addAll)
}) { }) {
var clientId by stringPatchOption( var clientId by stringPatchOption(
"client-id", "client-id",
@@ -56,10 +58,12 @@ abstract class AbstractSpoofClientPatch(
clientIdFingerprints.executePatch { patchClientId(context) } clientIdFingerprints.executePatch { patchClientId(context) }
userAgentFingerprints.executePatch { patchUserAgent(context) } userAgentFingerprints.executePatch { patchUserAgent(context) }
miscellaneousFingerprints.executePatch { patchMiscellaneous(context) }
} }
/** /**
* Patch the client ID. The fingerprints are guaranteed to be in the same order as in [clientIdFingerprints]. * Patch the client ID.
* The fingerprints are guaranteed to be in the same order as in [clientIdFingerprints].
* *
* @param context The current [BytecodeContext]. * @param context The current [BytecodeContext].
* *
@@ -67,10 +71,19 @@ abstract class AbstractSpoofClientPatch(
abstract fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) abstract fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext)
/** /**
* Patch the user agent. The fingerprints are guaranteed to be in the same order as in [userAgentFingerprints]. * Patch the user agent.
* The fingerprints are guaranteed to be in the same order as in [userAgentFingerprints].
* *
* @param context The current [BytecodeContext]. * @param context The current [BytecodeContext].
*/ */
// Not every client needs to patch the user agent. // Not every client needs to patch the user agent.
open fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {} open fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {}
/**
* Patch miscellaneous things such as protection measures.
* The fingerprints are guaranteed to be in the same order as in [miscellaneousFingerprints].
*
* @param context The current [BytecodeContext].
*/
open fun List<MethodFingerprintResult>.patchMiscellaneous(context: BytecodeContext) { }
} }

View File

@@ -1,16 +1,14 @@
package app.revanced.patches.reddit.customclients.relayforreddit.api package app.revanced.patches.reddit.customclients.relayforreddit.api
import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedInBearerTokenFingerprint import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.*
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedOutBearerTokenFingerprint
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetRefreshTokenFingerprint
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.LoginActivityClientIdFingerprint
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@Patch( @Patch(
@@ -31,7 +29,8 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
GetLoggedInBearerTokenFingerprint, GetLoggedInBearerTokenFingerprint,
GetLoggedOutBearerTokenFingerprint, GetLoggedOutBearerTokenFingerprint,
GetRefreshTokenFingerprint GetRefreshTokenFingerprint
) ),
miscellaneousFingerprints = listOf(SetRemoteConfigFingerprint)
) { ) {
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) { override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
forEach { forEach {
@@ -46,4 +45,8 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
} }
} }
} }
override fun List<MethodFingerprintResult>.patchMiscellaneous(context: BytecodeContext) =
// Do not load remote config which disables OAuth login remotely
first().mutableMethod.addInstructions(0, "return-void")
} }

View File

@@ -0,0 +1,8 @@
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object SetRemoteConfigFingerprint : MethodFingerprint(
strings = listOf("reddit_oauth_url"),
parameters = listOf("Lcom/google/firebase/remoteconfig/FirebaseRemoteConfig;")
)

View File

@@ -9,7 +9,7 @@ import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
@Patch( @Patch(
name = "Slide client spoof", name = "Spoof client",
description = "Spoofs the client in order to allow logging in. " + description = "Spoofs the client in order to allow logging in. " +
"The OAuth application type has to be \"Installed app\" " + "The OAuth application type has to be \"Installed app\" " +
"and the redirect URI has to be set to \"http://www.ccrama.me\".", "and the redirect URI has to be set to \"http://www.ccrama.me\".",

View File

@@ -10,7 +10,7 @@ import app.revanced.patches.strava.subscription.fingerprints.GetSubscribedFinger
@Patch( @Patch(
name = "Unlock subscription features", 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"])] compatiblePackages = [CompatiblePackage("com.strava", ["320.12"])]
) )
@Suppress("unused") @Suppress("unused")
@@ -19,4 +19,4 @@ object UnlockSubscriptionPatch : BytecodePatch(setOf(GetSubscribedFingerprint))
val isSubscribedIndex = result.scanResult.patternScanResult!!.startIndex val isSubscribedIndex = result.scanResult.patternScanResult!!.startIndex
result.mutableMethod.replaceInstruction(isSubscribedIndex, "const/4 v0, 0x1") result.mutableMethod.replaceInstruction(isSubscribedIndex, "const/4 v0, 0x1")
} ?: throw GetSubscribedFingerprint.exception } ?: throw GetSubscribedFingerprint.exception
} }

View File

@@ -6,6 +6,6 @@ import com.android.tools.smali.dexlib2.Opcode
object GetSubscribedFingerprint : MethodFingerprint( object GetSubscribedFingerprint : MethodFingerprint(
opcodes = listOf(Opcode.IGET_BOOLEAN), opcodes = listOf(Opcode.IGET_BOOLEAN),
customFingerprint = { methodDef, classDef -> customFingerprint = { methodDef, classDef ->
classDef.type.endsWith("SubscriptionDetailResponse;") && methodDef.name == "getSubscribed" classDef.type.endsWith("/SubscriptionDetailResponse;") && methodDef.name == "getSubscribed"
} }
) )

View File

@@ -0,0 +1,72 @@
package app.revanced.patches.strava.upselling
import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
import app.revanced.patches.strava.upselling.fingerprints.GetModulesFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation
import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
@Patch(
name = "Disable subscription suggestions",
compatiblePackages = [CompatiblePackage("com.strava", ["320.12"])]
)
@Suppress("unused")
object DisableSubscriptionSuggestionsPatch : BytecodePatch(
setOf(GetModulesFingerprint)
) {
private const val HELPER_METHOD_NAME = "getModulesIfNotUpselling"
private const val PAGE_SUFFIX = "_upsell"
private const val LABEL = "original"
override fun execute(context: BytecodeContext) = GetModulesFingerprint.result?.let { result ->
val className = result.classDef.type
val originalMethod = result.mutableMethod
val returnType = originalMethod.returnType
result.mutableClass.methods.add(ImmutableMethod(
className,
HELPER_METHOD_NAME,
emptyList(),
returnType,
AccessFlags.PRIVATE.value,
null,
null,
MutableMethodImplementation(3)
).toMutable().apply {
addInstructions(
"""
iget-object v0, p0, $className->page:Ljava/lang/String;
const-string v1, "$PAGE_SUFFIX"
invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :$LABEL
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
move-result-object v0
return-object v0
:$LABEL
iget-object v0, p0, $className->modules:Ljava/util/List;
return-object v0
"""
)
})
val getModulesIndex = result.scanResult.patternScanResult!!.startIndex
with(originalMethod) {
removeInstruction(getModulesIndex)
addInstructions(
getModulesIndex,
"""
invoke-direct {p0}, $className->$HELPER_METHOD_NAME()$returnType
move-result-object v0
"""
)
}
} ?: throw GetModulesFingerprint.exception
}

View File

@@ -0,0 +1,11 @@
package app.revanced.patches.strava.upselling.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import com.android.tools.smali.dexlib2.Opcode
object GetModulesFingerprint : MethodFingerprint(
opcodes = listOf(Opcode.IGET_OBJECT),
customFingerprint = { methodDef, classDef ->
classDef.type.endsWith("/GenericLayoutEntry;") && methodDef.name == "getModules"
}
)

View File

@@ -30,7 +30,7 @@ object SpoofSignatureResourcePatch : ResourcePatch() {
"App signature spoofed\\n\\n" "App signature spoofed\\n\\n"
+ "Side effects include:\\n" + "Side effects include:\\n"
+ "• No ambient mode\\n" + "• No ambient mode\\n"
+ "• Videos can't be downloaded\\n" + "• Videos cannot be downloaded\\n"
+ "• Seekbar thumbnails are hidden" + "• Seekbar thumbnails are hidden"
), ),
StringResource( StringResource(