mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 18:03:55 +01:00
Compare commits
14 Commits
v2.191.0-d
...
v2.191.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ac18e6e23 | ||
|
|
54aa358b9f | ||
|
|
147d0eef34 | ||
|
|
fb60603782 | ||
|
|
18a2a4ceb4 | ||
|
|
7d822ddbec | ||
|
|
e74e65364a | ||
|
|
ef241671bd | ||
|
|
096fc12123 | ||
|
|
f166bd7ea7 | ||
|
|
df43cea4f8 | ||
|
|
444b196f41 | ||
|
|
884bf29804 | ||
|
|
144fabe571 |
43
CHANGELOG.md
43
CHANGELOG.md
@@ -1,3 +1,46 @@
|
||||
# [2.191.0-dev.12](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.11...v2.191.0-dev.12) (2023-09-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Client spoof:** Display seekbar thumbnails in high quality ([5e8a2d3](https://github.com/ReVanced/revanced-patches/commit/5e8a2d3fe77a4a08ea32e7dc22f2c8e4048b7a6b))
|
||||
|
||||
# [2.191.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.10...v2.191.0-dev.11) (2023-09-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add notice for thumbnails for age restricted or paid videos ([f7cf70b](https://github.com/ReVanced/revanced-patches/commit/f7cf70b5d3f415411fa767931a33e84df9df6c16))
|
||||
|
||||
# [2.191.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.9...v2.191.0-dev.10) (2023-09-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Client spoof:** Restore seekbar thumbnails ([bf4a115](https://github.com/ReVanced/revanced-patches/commit/bf4a1159ff745f8f91e11f30db4651d85769227b))
|
||||
|
||||
# [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)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 2.191.0-dev.6
|
||||
version = 2.191.0-dev.12
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -54,8 +54,8 @@ object UnlockDuolingoSuperPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
private fun MutableMethod.indexOfReference(reference: Reference) = getInstructions()
|
||||
.filterIsInstance<BuilderInstruction22c>()
|
||||
.filter { it.opcode == Opcode.IPUT_BOOLEAN }.indexOfFirst { it.reference == reference }.let {
|
||||
.indexOfFirst { it is BuilderInstruction22c && it.opcode == Opcode.IPUT_BOOLEAN && it.reference == reference }
|
||||
.let {
|
||||
if (it == -1) throw PatchException("Could not find index of instruction with supplied reference.")
|
||||
else it
|
||||
}
|
||||
|
||||
@@ -14,9 +14,11 @@ abstract class AbstractSpoofClientPatch(
|
||||
private val redirectUri: String,
|
||||
private val clientIdFingerprints: List<MethodFingerprint>,
|
||||
private val userAgentFingerprints: List<MethodFingerprint>? = null,
|
||||
private val miscellaneousFingerprints: List<MethodFingerprint>? = null
|
||||
) : BytecodePatch(buildSet {
|
||||
addAll(clientIdFingerprints)
|
||||
userAgentFingerprints?.let(::addAll)
|
||||
miscellaneousFingerprints?.let(::addAll)
|
||||
}) {
|
||||
var clientId by stringPatchOption(
|
||||
"client-id",
|
||||
@@ -56,10 +58,12 @@ abstract class AbstractSpoofClientPatch(
|
||||
|
||||
clientIdFingerprints.executePatch { patchClientId(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].
|
||||
*
|
||||
@@ -67,10 +71,19 @@ abstract class AbstractSpoofClientPatch(
|
||||
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].
|
||||
*/
|
||||
// Not every client needs to patch the user agent.
|
||||
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) { }
|
||||
}
|
||||
@@ -1,16 +1,14 @@
|
||||
package app.revanced.patches.reddit.customclients.relayforreddit.api
|
||||
|
||||
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.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
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.GetLoggedOutBearerTokenFingerprint
|
||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetRefreshTokenFingerprint
|
||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.LoginActivityClientIdFingerprint
|
||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.*
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
@@ -31,7 +29,8 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
|
||||
GetLoggedInBearerTokenFingerprint,
|
||||
GetLoggedOutBearerTokenFingerprint,
|
||||
GetRefreshTokenFingerprint
|
||||
)
|
||||
),
|
||||
miscellaneousFingerprints = listOf(SetRemoteConfigFingerprint)
|
||||
) {
|
||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||
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")
|
||||
}
|
||||
@@ -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;")
|
||||
)
|
||||
@@ -9,7 +9,7 @@ import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
||||
|
||||
@Patch(
|
||||
name = "Slide client spoof",
|
||||
name = "Spoof client",
|
||||
description = "Spoofs the client in order to allow logging in. " +
|
||||
"The OAuth application type has to be \"Installed app\" " +
|
||||
"and the redirect URI has to be set to \"http://www.ccrama.me\".",
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
)
|
||||
@@ -3,40 +3,43 @@ package app.revanced.patches.youtube.misc.fix.playback
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ScrubbedPreviewLayoutFingerprint
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.StoryboardThumbnailFingerprint
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.StoryboardThumbnailParentFingerprint
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.*
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
description = "Spoofs the signature to prevent playback issues.",
|
||||
dependencies = [
|
||||
SpoofSignatureResourcePatch::class,
|
||||
IntegrationsPatch::class,
|
||||
PlayerTypeHookPatch::class
|
||||
PlayerTypeHookPatch::class,
|
||||
VideoInformationPatch::class,
|
||||
]
|
||||
)
|
||||
object SpoofSignaturePatch : BytecodePatch(
|
||||
setOf(
|
||||
ProtobufParameterBuilderFingerprint,
|
||||
PlayerResponseModelImplFingerprint,
|
||||
StoryboardThumbnailParentFingerprint,
|
||||
ScrubbedPreviewLayoutFingerprint
|
||||
StoryboardRendererSpecFingerprint,
|
||||
StoryboardRendererInitFingerprint
|
||||
)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/SpoofSignaturePatch;"
|
||||
"Lapp/revanced/integrations/patches/spoof/SpoofSignaturePatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// hook parameter
|
||||
// Hook parameter.
|
||||
ProtobufParameterBuilderFingerprint.result?.let {
|
||||
val setParamMethod = context
|
||||
.toMethodWalker(it.method)
|
||||
@@ -55,51 +58,89 @@ object SpoofSignaturePatch : BytecodePatch(
|
||||
}
|
||||
} ?: throw ProtobufParameterBuilderFingerprint.exception
|
||||
|
||||
|
||||
// When signature spoofing is enabled, the seekbar when tapped does not show
|
||||
// the video time, chapter names, or the video thumbnail.
|
||||
// Changing the value returned of this method forces all of these to show up,
|
||||
// except the thumbnails are blank, which is handled with the patch below.
|
||||
StoryboardThumbnailParentFingerprint.result ?: throw StoryboardThumbnailParentFingerprint.exception
|
||||
StoryboardThumbnailFingerprint.resolve(context, StoryboardThumbnailParentFingerprint.result!!.classDef)
|
||||
StoryboardThumbnailFingerprint.result?.apply {
|
||||
val endIndex = scanResult.patternScanResult!!.endIndex
|
||||
// Replace existing instruction to preserve control flow label.
|
||||
// The replaced return instruction always returns false
|
||||
// (it is the 'no thumbnails found' control path),
|
||||
// so there is no need to pass the existing return value to integrations.
|
||||
mutableMethod.replaceInstruction(
|
||||
endIndex,
|
||||
"""
|
||||
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->getSeekbarThumbnailOverrideValue()Z
|
||||
"""
|
||||
)
|
||||
// Since this is end of the method must replace one line then add the rest.
|
||||
mutableMethod.addInstructions(
|
||||
endIndex + 1,
|
||||
"""
|
||||
move-result v0
|
||||
return v0
|
||||
"""
|
||||
)
|
||||
} ?: throw StoryboardThumbnailFingerprint.exception
|
||||
|
||||
|
||||
// Seekbar thumbnail now show up but are always a blank image.
|
||||
// Additional changes are needed to force the client to generate the thumbnails (assuming it's possible),
|
||||
// but for now hide the empty thumbnail.
|
||||
ScrubbedPreviewLayoutFingerprint.result?.apply {
|
||||
val endIndex = scanResult.patternScanResult!!.endIndex
|
||||
mutableMethod.apply {
|
||||
val imageViewFieldName = getInstruction<ReferenceInstruction>(endIndex).reference
|
||||
addInstructions(
|
||||
implementation!!.instructions.lastIndex,
|
||||
StoryboardThumbnailParentFingerprint.result?.classDef?.let { classDef ->
|
||||
StoryboardThumbnailFingerprint.also {
|
||||
it.resolve(
|
||||
context,
|
||||
classDef
|
||||
)
|
||||
}.result?.let {
|
||||
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
// Replace existing instruction to preserve control flow label.
|
||||
// The replaced return instruction always returns false
|
||||
// (it is the 'no thumbnails found' control path),
|
||||
// so there is no need to pass the existing return value to integrations.
|
||||
it.mutableMethod.replaceInstruction(
|
||||
endIndex,
|
||||
"""
|
||||
iget-object v0, p0, $imageViewFieldName # copy imageview field to a register
|
||||
invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->seekbarImageViewCreated(Landroid/widget/ImageView;)V
|
||||
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->getSeekbarThumbnailOverrideValue()Z
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: throw ScrubbedPreviewLayoutFingerprint.exception
|
||||
// Since this is end of the method must replace one line then add the rest.
|
||||
it.mutableMethod.addInstructions(
|
||||
endIndex + 1,
|
||||
"""
|
||||
move-result v0
|
||||
return v0
|
||||
"""
|
||||
)
|
||||
} ?: throw StoryboardThumbnailFingerprint.exception
|
||||
|
||||
/**
|
||||
* Hook StoryBoard renderer url
|
||||
*/
|
||||
PlayerResponseModelImplFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val getStoryBoardIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
val getStoryBoardRegister = getInstruction<OneRegisterInstruction>(getStoryBoardIndex).registerA
|
||||
|
||||
addInstructions(
|
||||
getStoryBoardIndex,
|
||||
"""
|
||||
invoke-static { v$getStoryBoardRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec(Ljava/lang/String;)Ljava/lang/String;
|
||||
move-result-object v$getStoryBoardRegister
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: throw PlayerResponseModelImplFingerprint.exception
|
||||
|
||||
StoryboardRendererSpecFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val storyBoardUrlParams = 0
|
||||
|
||||
addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
if-nez p$storyBoardUrlParams, :ignore
|
||||
invoke-static { p$storyBoardUrlParams }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec(Ljava/lang/String;)Ljava/lang/String;
|
||||
move-result-object p$storyBoardUrlParams
|
||||
""",
|
||||
ExternalLabel("ignore", getInstruction(0))
|
||||
)
|
||||
}
|
||||
} ?: throw StoryboardRendererSpecFingerprint.exception
|
||||
|
||||
// Hook recommended value
|
||||
StoryboardRendererInitFingerprint.result?.let {
|
||||
val moveOriginalRecommendedValueIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
val originalValueRegister = it.mutableMethod
|
||||
.getInstruction<OneRegisterInstruction>(moveOriginalRecommendedValueIndex).registerA
|
||||
|
||||
it.mutableMethod.apply {
|
||||
addInstructions(
|
||||
moveOriginalRecommendedValueIndex + 1,
|
||||
"""
|
||||
invoke-static { v$originalValueRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getRecommendedLevel(I)I
|
||||
move-result v$originalValueRegister
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: throw StoryboardRendererInitFingerprint.exception
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,7 @@ object SpoofSignatureResourcePatch : ResourcePatch() {
|
||||
"App signature spoofed\\n\\n"
|
||||
+ "Side effects include:\\n"
|
||||
+ "• No ambient mode\\n"
|
||||
+ "• Videos can't be downloaded\\n"
|
||||
+ "• Seekbar thumbnails are hidden"
|
||||
+ "• Videos cannot be downloaded"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_spoof_signature_verification_enabled_summary_off",
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
import app.revanced.extensions.containsConstantInstructionValue
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object PlayerResponseModelImplFingerprint : MethodFingerprint(
|
||||
returnType = "Ljava/lang/String;",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = emptyList(),
|
||||
opcodes = listOf(
|
||||
Opcode.RETURN_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.RETURN_OBJECT
|
||||
),
|
||||
customFingerprint = handler@{ methodDef, _ ->
|
||||
if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) return@handler false
|
||||
|
||||
methodDef.containsConstantInstructionValue(55735497)
|
||||
}
|
||||
)
|
||||
@@ -10,4 +10,4 @@ object ProtobufParameterBuilderFingerprint : MethodFingerprint(
|
||||
Opcode.IPUT_OBJECT
|
||||
),
|
||||
strings = listOf("Unexpected empty videoId.", "Prefetch request are disabled.")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.misc.fix.playback.SpoofSignatureResourcePatch
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object ScrubbedPreviewLayoutFingerprint : LiteralValueFingerprint(
|
||||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
returnType = "V",
|
||||
parameters = listOf("Landroid/content/Context;", "Landroid/util/AttributeSet;", "I", "I"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IPUT_OBJECT, // preview imageview
|
||||
),
|
||||
// This resource is used in ~ 40 different locations, but this method has a distinct list of parameters to match to.
|
||||
literalSupplier = { SpoofSignatureResourcePatch.scrubbedPreviewThumbnailResourceId }
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object StoryboardRendererInitFingerprint : MethodFingerprint(
|
||||
strings = listOf("#-1#"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object StoryboardRendererSpecFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
returnType = "L",
|
||||
parameters = listOf("Ljava/lang/String;", "J"),
|
||||
strings = listOf("\\|"),
|
||||
)
|
||||
@@ -122,7 +122,6 @@ object RememberVideoQualityPatch : BytecodePatch(
|
||||
* It also hooks the method which is called when the video quality to set is determined.
|
||||
* Conveniently, at this point the video quality is overridden to the remembered playback speed.
|
||||
*/
|
||||
|
||||
VideoInformationPatch.onCreateHook(INTEGRATIONS_CLASS_DESCRIPTOR, "newVideoStarted")
|
||||
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ object VideoIdPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Adds an invoke-static instruction, called with the new id when the video changes.
|
||||
*
|
||||
* Supports all videos (regular videos, Shorts and Stories).
|
||||
|
||||
Reference in New Issue
Block a user