mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-10 22:39:38 +01:00
fix(YouTube - Client spoof): Display seekbar thumbnails in high quality
This commit is contained in:
parent
7f1a1fc9fa
commit
5e8a2d3fe7
@ -23,15 +23,16 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
SpoofSignatureResourcePatch::class,
|
||||
IntegrationsPatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
VideoInformationPatch::class
|
||||
VideoInformationPatch::class,
|
||||
]
|
||||
)
|
||||
object SpoofSignaturePatch : BytecodePatch(
|
||||
setOf(
|
||||
ProtobufParameterBuilderFingerprint,
|
||||
PlayerResponseModelImplFingerprint,
|
||||
StoryboardThumbnailParentFingerprint,
|
||||
StoryboardRendererSpecFingerprint,
|
||||
PlayerResponseModelImplFingerprint
|
||||
StoryboardRendererInitFingerprint
|
||||
)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
@ -100,7 +101,7 @@ object SpoofSignaturePatch : BytecodePatch(
|
||||
addInstructions(
|
||||
getStoryBoardIndex,
|
||||
"""
|
||||
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec()Ljava/lang/String;
|
||||
invoke-static { v$getStoryBoardRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec(Ljava/lang/String;)Ljava/lang/String;
|
||||
move-result-object v$getStoryBoardRegister
|
||||
"""
|
||||
)
|
||||
@ -115,13 +116,31 @@ object SpoofSignaturePatch : BytecodePatch(
|
||||
0,
|
||||
"""
|
||||
if-nez p$storyBoardUrlParams, :ignore
|
||||
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec()Ljava/lang/String;
|
||||
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 cannot be downloaded\\n"
|
||||
+ "• Low quality seekbar thumbnails (No thumbnails for age restricted or paid videos)"
|
||||
+ "• Videos cannot be downloaded"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_spoof_signature_verification_enabled_summary_off",
|
||||
|
@ -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
|
||||
)
|
||||
)
|
Loading…
Reference in New Issue
Block a user