mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-12 04:13:57 +01:00
Compare commits
4 Commits
v2.196.1-d
...
v2.196.1-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
524ed552a3 | ||
|
|
2532bff8e5 | ||
|
|
7236dee006 | ||
|
|
f9b7c31ba9 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
## [2.196.1-dev.6](https://github.com/ReVanced/revanced-patches/compare/v2.196.1-dev.5...v2.196.1-dev.6) (2023-11-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Client spoof:** Fix low resolution precise seeking thumbnails ([#3249](https://github.com/ReVanced/revanced-patches/issues/3249)) ([0cb41ef](https://github.com/ReVanced/revanced-patches/commit/0cb41efa067d74b873167718b25893cb2e1dd240))
|
||||||
|
|
||||||
|
## [2.196.1-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.196.1-dev.4...v2.196.1-dev.5) (2023-11-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Remove screenshot restriction:** Improve reliability ([#2938](https://github.com/ReVanced/revanced-patches/issues/2938)) ([6b7cb7b](https://github.com/ReVanced/revanced-patches/commit/6b7cb7bd38348dbe4a56385356df6ed97e81c319))
|
||||||
|
|
||||||
## [2.196.1-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.196.1-dev.3...v2.196.1-dev.4) (2023-11-09)
|
## [2.196.1-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.196.1-dev.3...v2.196.1-dev.4) (2023-11-09)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.196.1-dev.4
|
version = 2.196.1-dev.6
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
package app.revanced.patches.all.screenshot.removerestriction
|
package app.revanced.patches.all.screenshot.removerestriction
|
||||||
|
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.util.patch.AbstractTransformInstructionsPatch
|
import app.revanced.util.patch.AbstractTransformInstructionsPatch
|
||||||
import app.revanced.util.patch.IMethodCall
|
import app.revanced.util.patch.IMethodCall
|
||||||
import app.revanced.util.patch.Instruction35cInfo
|
import app.revanced.util.patch.Instruction35cInfo
|
||||||
import app.revanced.util.patch.filterMapInstruction35c
|
import app.revanced.util.patch.filterMapInstruction35c
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.iface.ClassDef
|
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||||
import com.android.tools.smali.dexlib2.iface.Method
|
import com.android.tools.smali.dexlib2.iface.Method
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||||
|
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Remove screenshot restriction",
|
name = "Remove screenshot restriction",
|
||||||
@@ -22,6 +27,11 @@ object RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch<Ins
|
|||||||
"Lapp/revanced/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch"
|
"Lapp/revanced/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch"
|
||||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "$INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX;"
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "$INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX;"
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext) {
|
||||||
|
super.execute(context)
|
||||||
|
ModifyLayoutParamsFlags().execute(context)
|
||||||
|
}
|
||||||
|
|
||||||
override fun filterMap(
|
override fun filterMap(
|
||||||
classDef: ClassDef,
|
classDef: ClassDef,
|
||||||
method: Method,
|
method: Method,
|
||||||
@@ -46,6 +56,12 @@ object RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch<Ins
|
|||||||
override val methodParams: Array<String>,
|
override val methodParams: Array<String>,
|
||||||
override val returnType: String
|
override val returnType: String
|
||||||
): IMethodCall {
|
): IMethodCall {
|
||||||
|
AddFlags(
|
||||||
|
"Landroid/view/Window;",
|
||||||
|
"addFlags",
|
||||||
|
arrayOf("I"),
|
||||||
|
"V",
|
||||||
|
),
|
||||||
SetFlags(
|
SetFlags(
|
||||||
"Landroid/view/Window;",
|
"Landroid/view/Window;",
|
||||||
"setFlags",
|
"setFlags",
|
||||||
@@ -54,3 +70,37 @@ object RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch<Ins
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ModifyLayoutParamsFlags : AbstractTransformInstructionsPatch<Pair<Instruction22c, Int>>() {
|
||||||
|
override fun filterMap(
|
||||||
|
classDef: ClassDef,
|
||||||
|
method: Method,
|
||||||
|
instruction: Instruction,
|
||||||
|
instructionIndex: Int
|
||||||
|
): Pair<Instruction22c, Int>? {
|
||||||
|
if (instruction.opcode != Opcode.IPUT) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
val instruction22c = instruction as Instruction22c
|
||||||
|
val fieldReference = instruction22c.reference as FieldReference
|
||||||
|
|
||||||
|
if (fieldReference.definingClass != "Landroid/view/WindowManager\$LayoutParams;"
|
||||||
|
|| fieldReference.name != "flags"
|
||||||
|
|| fieldReference.type != "I") {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return Pair(instruction22c, instructionIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun transform(mutableMethod: MutableMethod, entry: Pair<Instruction22c, Int>) {
|
||||||
|
val (instruction, index) = entry
|
||||||
|
val register = instruction.registerA
|
||||||
|
|
||||||
|
mutableMethod.addInstructions(
|
||||||
|
index,
|
||||||
|
"and-int/lit16 v$register, v$register, -0x2001"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
||||||
import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
|
import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
description = "Spoofs the signature to prevent playback issues.",
|
description = "Spoofs the signature to prevent playback issues.",
|
||||||
@@ -26,14 +27,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
PlayerTypeHookPatch::class,
|
PlayerTypeHookPatch::class,
|
||||||
PlayerResponseMethodHookPatch::class,
|
PlayerResponseMethodHookPatch::class,
|
||||||
VideoInformationPatch::class,
|
VideoInformationPatch::class,
|
||||||
|
SpoofSignatureResourcePatch::class
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
object SpoofSignaturePatch : BytecodePatch(
|
object SpoofSignaturePatch : BytecodePatch(
|
||||||
setOf(
|
setOf(
|
||||||
PlayerResponseModelImplFingerprint,
|
PlayerResponseModelImplGeneralFingerprint,
|
||||||
StoryboardThumbnailParentFingerprint,
|
PlayerResponseModelImplLiveStreamFingerprint,
|
||||||
|
PlayerResponseModelImplRecommendedLevel,
|
||||||
StoryboardRendererSpecFingerprint,
|
StoryboardRendererSpecFingerprint,
|
||||||
StoryboardRendererInitFingerprint
|
StoryboardRendererDecoderSpecFingerprint,
|
||||||
|
StoryboardRendererDecoderRecommendedLevelFingerprint,
|
||||||
|
StoryboardThumbnailParentFingerprint,
|
||||||
|
ScrubbedPreviewLayoutFingerprint,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||||
@@ -83,6 +89,18 @@ object SpoofSignaturePatch : BytecodePatch(
|
|||||||
"App signature not spoofed for feed videos\\n\\n"
|
"App signature not spoofed for feed videos\\n\\n"
|
||||||
+ "Feed videos will play for less than 1 minute before encountering playback issues"
|
+ "Feed videos will play for less than 1 minute before encountering playback issues"
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_spoof_storyboard",
|
||||||
|
StringResource("revanced_spoof_storyboard_title", "Spoof storyboard"),
|
||||||
|
StringResource("revanced_spoof_storyboard_summary_on", "Storyboard spoofed"),
|
||||||
|
StringResource(
|
||||||
|
"revanced_spoof_storyboard_summary_off",
|
||||||
|
"Storyboard not spoofed\\n\\n"
|
||||||
|
+ "Side effects include:\\n"
|
||||||
|
+ "• No ambient mode\\n"
|
||||||
|
+ "• Seekbar thumbnails are hidden"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -94,7 +112,8 @@ object SpoofSignaturePatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Force the seekbar time and chapters to always show up.
|
// Force the seekbar time and chapters to always show up.
|
||||||
// This is used only if the storyboard spec fetch fails, or when viewing paid videos.
|
// This is used if the storyboard spec fetch fails, for viewing paid videos,
|
||||||
|
// or if storyboard spoofing is turned off.
|
||||||
StoryboardThumbnailParentFingerprint.result?.classDef?.let { classDef ->
|
StoryboardThumbnailParentFingerprint.result?.classDef?.let { classDef ->
|
||||||
StoryboardThumbnailFingerprint.also {
|
StoryboardThumbnailFingerprint.also {
|
||||||
it.resolve(
|
it.resolve(
|
||||||
@@ -124,13 +143,33 @@ object SpoofSignaturePatch : BytecodePatch(
|
|||||||
} ?: throw StoryboardThumbnailFingerprint.exception
|
} ?: throw StoryboardThumbnailFingerprint.exception
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If storyboard spoofing is turned off, then hide the empty seekbar thumbnail view.
|
||||||
|
ScrubbedPreviewLayoutFingerprint.result?.apply {
|
||||||
|
val endIndex = scanResult.patternScanResult!!.endIndex
|
||||||
|
mutableMethod.apply {
|
||||||
|
val imageViewFieldName = getInstruction<ReferenceInstruction>(endIndex).reference
|
||||||
|
addInstructions(
|
||||||
|
implementation!!.instructions.lastIndex,
|
||||||
|
"""
|
||||||
|
iget-object v0, p0, $imageViewFieldName # copy imageview field to a register
|
||||||
|
invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->seekbarImageViewCreated(Landroid/widget/ImageView;)V
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: throw ScrubbedPreviewLayoutFingerprint.exception
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook StoryBoard renderer url
|
* Hook StoryBoard renderer url
|
||||||
*/
|
*/
|
||||||
PlayerResponseModelImplFingerprint.result?.let {
|
arrayOf(
|
||||||
|
PlayerResponseModelImplGeneralFingerprint,
|
||||||
|
PlayerResponseModelImplLiveStreamFingerprint
|
||||||
|
).forEach { fingerprint ->
|
||||||
|
fingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val getStoryBoardIndex = it.scanResult.patternScanResult!!.endIndex
|
val getStoryBoardIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
val getStoryBoardRegister = getInstruction<OneRegisterInstruction>(getStoryBoardIndex).registerA
|
val getStoryBoardRegister =
|
||||||
|
getInstruction<OneRegisterInstruction>(getStoryBoardIndex).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
getStoryBoardIndex,
|
getStoryBoardIndex,
|
||||||
@@ -140,7 +179,38 @@ object SpoofSignaturePatch : BytecodePatch(
|
|||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: throw PlayerResponseModelImplFingerprint.exception
|
} ?: throw fingerprint.exception
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hook recommended seekbar thumbnails quality level.
|
||||||
|
StoryboardRendererDecoderRecommendedLevelFingerprint.result?.let {
|
||||||
|
val moveOriginalRecommendedValueIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
|
val originalValueRegister = it.mutableMethod
|
||||||
|
.getInstruction<OneRegisterInstruction>(moveOriginalRecommendedValueIndex).registerA
|
||||||
|
|
||||||
|
it.mutableMethod.addInstructions(
|
||||||
|
moveOriginalRecommendedValueIndex + 1, """
|
||||||
|
invoke-static { v$originalValueRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getRecommendedLevel(I)I
|
||||||
|
move-result v$originalValueRegister
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
} ?: throw StoryboardRendererDecoderRecommendedLevelFingerprint.exception
|
||||||
|
|
||||||
|
// Hook the recommended precise seeking thumbnails quality level.
|
||||||
|
PlayerResponseModelImplRecommendedLevel.result?.let {
|
||||||
|
it.mutableMethod.apply {
|
||||||
|
val moveOriginalRecommendedValueIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
|
val originalValueRegister =
|
||||||
|
getInstruction<OneRegisterInstruction>(moveOriginalRecommendedValueIndex).registerA
|
||||||
|
|
||||||
|
addInstructions(
|
||||||
|
moveOriginalRecommendedValueIndex, """
|
||||||
|
invoke-static { v$originalValueRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getRecommendedLevel(I)I
|
||||||
|
move-result v$originalValueRegister
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: throw PlayerResponseModelImplRecommendedLevel.exception
|
||||||
|
|
||||||
StoryboardRendererSpecFingerprint.result?.let {
|
StoryboardRendererSpecFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
@@ -158,22 +228,18 @@ object SpoofSignaturePatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
} ?: throw StoryboardRendererSpecFingerprint.exception
|
} ?: throw StoryboardRendererSpecFingerprint.exception
|
||||||
|
|
||||||
// Hook recommended value
|
// Hook the seekbar thumbnail decoder and use a NULL spec for live streams.
|
||||||
StoryboardRendererInitFingerprint.result?.let {
|
StoryboardRendererDecoderSpecFingerprint.result?.let {
|
||||||
val moveOriginalRecommendedValueIndex = it.scanResult.patternScanResult!!.endIndex
|
val storyBoardUrlIndex = it.scanResult.patternScanResult!!.startIndex + 1
|
||||||
|
val storyboardUrlRegister =
|
||||||
|
it.mutableMethod.getInstruction<OneRegisterInstruction>(storyBoardUrlIndex).registerA
|
||||||
|
|
||||||
val originalValueRegister = it.mutableMethod
|
it.mutableMethod.addInstructions(
|
||||||
.getInstruction<OneRegisterInstruction>(moveOriginalRecommendedValueIndex).registerA
|
storyBoardUrlIndex + 1, """
|
||||||
|
invoke-static { v$storyboardUrlRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardDecoderRendererSpec(Ljava/lang/String;)Ljava/lang/String;
|
||||||
it.mutableMethod.apply {
|
move-result-object v$storyboardUrlRegister
|
||||||
addInstructions(
|
|
||||||
moveOriginalRecommendedValueIndex + 1,
|
|
||||||
"""
|
|
||||||
invoke-static { v$originalValueRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getRecommendedLevel(I)I
|
|
||||||
move-result v$originalValueRegister
|
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
} ?: throw StoryboardRendererDecoderSpecFingerprint.exception
|
||||||
} ?: throw StoryboardRendererInitFingerprint.exception
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.fix.playback
|
||||||
|
|
||||||
|
import app.revanced.patcher.data.ResourceContext
|
||||||
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
|
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||||
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||||
|
|
||||||
|
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
|
object SpoofSignatureResourcePatch : ResourcePatch() {
|
||||||
|
internal var scrubbedPreviewThumbnailResourceId: Long = -1
|
||||||
|
|
||||||
|
override fun execute(context: ResourceContext) {
|
||||||
|
scrubbedPreviewThumbnailResourceId = ResourceMappingPatch.resourceMappings.single {
|
||||||
|
it.type == "id" && it.name == "thumbnail"
|
||||||
|
}.id
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ import app.revanced.patcher.fingerprint.MethodFingerprint
|
|||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
object PlayerResponseModelImplFingerprint : MethodFingerprint(
|
object PlayerResponseModelImplGeneralFingerprint : MethodFingerprint(
|
||||||
returnType = "Ljava/lang/String;",
|
returnType = "Ljava/lang/String;",
|
||||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
parameters = emptyList(),
|
parameters = emptyList(),
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.extensions.containsWideLiteralInstructionValue
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object PlayerResponseModelImplLiveStreamFingerprint : 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.containsWideLiteralInstructionValue(70276274)
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.extensions.containsWideLiteralInstructionValue
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object PlayerResponseModelImplRecommendedLevel : MethodFingerprint(
|
||||||
|
returnType = "I",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = emptyList(),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.SGET_OBJECT,
|
||||||
|
Opcode.IGET,
|
||||||
|
Opcode.RETURN
|
||||||
|
),
|
||||||
|
customFingerprint = handler@{ methodDef, _ ->
|
||||||
|
if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) return@handler false
|
||||||
|
|
||||||
|
methodDef.containsWideLiteralInstructionValue(55735497)
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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,23 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves to the same method as [StoryboardRendererDecoderSpecFingerprint].
|
||||||
|
*/
|
||||||
|
object StoryboardRendererDecoderRecommendedLevelFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.IPUT_OBJECT,
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.MOVE_RESULT
|
||||||
|
),
|
||||||
|
strings = listOf("#-1#")
|
||||||
|
)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves to the same method as [StoryboardRendererDecoderRecommendedLevelFingerprint].
|
||||||
|
*/
|
||||||
|
object StoryboardRendererDecoderSpecFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.INVOKE_INTERFACE, // First instruction of the method.
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.CONST_4,
|
||||||
|
Opcode.CONST_4,
|
||||||
|
Opcode.IF_NEZ,
|
||||||
|
),
|
||||||
|
strings = listOf("#-1#")
|
||||||
|
)
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.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
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@@ -67,6 +67,7 @@ inline fun <reified E> fromMethodReference(methodReference: MethodReference)
|
|||||||
search.definedClassName == methodReference.definingClass
|
search.definedClassName == methodReference.definingClass
|
||||||
&& search.methodName == methodReference.name
|
&& search.methodName == methodReference.name
|
||||||
&& methodReference.parameterTypes.toTypedArray().contentEquals(search.methodParams)
|
&& methodReference.parameterTypes.toTypedArray().contentEquals(search.methodParams)
|
||||||
|
&& search.returnType == methodReference.returnType
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun <reified E> filterMapInstruction35c(
|
inline fun <reified E> filterMapInstruction35c(
|
||||||
|
|||||||
Reference in New Issue
Block a user