mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-08 18:44:34 +02:00
drop support for old YouTube versions
This commit is contained in:
parent
bd1428fc34
commit
b086822adb
@ -6,17 +6,10 @@ import app.revanced.patcher.annotation.Package
|
|||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf(
|
"com.google.android.youtube", arrayOf(
|
||||||
"18.06.41",
|
|
||||||
"18.07.35",
|
|
||||||
"18.08.39",
|
|
||||||
"18.09.39",
|
|
||||||
"18.10.37",
|
|
||||||
"18.11.36",
|
|
||||||
"18.12.35",
|
"18.12.35",
|
||||||
"18.13.38",
|
"18.13.38",
|
||||||
"18.14.41",
|
"18.14.41",
|
||||||
"18.15.40",
|
"18.15.40",
|
||||||
"18.16.37",
|
|
||||||
"18.16.39"
|
"18.16.39"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
@ -47,8 +47,6 @@ class ButtonContainerPatch : ResourcePatch {
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
with(LithoFilterPatch.lithoMethod) {
|
with(LithoFilterPatch.lithoMethod) {
|
||||||
if (LithoFilterPatch.bufferFingerprintResolved) {
|
|
||||||
// 18.11.36+
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
0, """
|
0, """
|
||||||
move-object/from16 v10, p3
|
move-object/from16 v10, p3
|
||||||
@ -58,15 +56,6 @@ class ButtonContainerPatch : ResourcePatch {
|
|||||||
iget-object v10, v10, ${LithoFilterPatch.bufferReference}->b:Ljava/nio/ByteBuffer;
|
iget-object v10, v10, ${LithoFilterPatch.bufferReference}->b:Ljava/nio/ByteBuffer;
|
||||||
""" + instructionList,listOf(ExternalLabel("do_not_block", LithoFilterPatch.lithoMethod.instruction(0)))
|
""" + instructionList,listOf(ExternalLabel("do_not_block", LithoFilterPatch.lithoMethod.instruction(0)))
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
val secondParameter = LithoFilterPatch.lithoMethod.parameters[2]
|
|
||||||
LithoFilterPatch.lithoMethod.addInstructions(
|
|
||||||
0, """
|
|
||||||
move-object/from16 v10, p3
|
|
||||||
iget-object v10, v10, $secondParameter->b:Ljava/nio/ByteBuffer;
|
|
||||||
""" + instructionList,listOf(ExternalLabel("do_not_block", LithoFilterPatch.lithoMethod.instruction(0)))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -47,8 +47,6 @@ class QuickActionsPatch : ResourcePatch {
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
with(LithoFilterPatch.lithoMethod) {
|
with(LithoFilterPatch.lithoMethod) {
|
||||||
if (LithoFilterPatch.bufferFingerprintResolved) {
|
|
||||||
// 18.11.36+
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
0, """
|
0, """
|
||||||
move-object/from16 v10, p3
|
move-object/from16 v10, p3
|
||||||
@ -58,15 +56,6 @@ class QuickActionsPatch : ResourcePatch {
|
|||||||
iget-object v10, v10, ${LithoFilterPatch.bufferReference}->b:Ljava/nio/ByteBuffer;
|
iget-object v10, v10, ${LithoFilterPatch.bufferReference}->b:Ljava/nio/ByteBuffer;
|
||||||
""" + instructionList,listOf(ExternalLabel("do_not_block", LithoFilterPatch.lithoMethod.instruction(0)))
|
""" + instructionList,listOf(ExternalLabel("do_not_block", LithoFilterPatch.lithoMethod.instruction(0)))
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
val secondParameter = LithoFilterPatch.lithoMethod.parameters[2]
|
|
||||||
LithoFilterPatch.lithoMethod.addInstructions(
|
|
||||||
0, """
|
|
||||||
move-object/from16 v10, p3
|
|
||||||
iget-object v10, v10, $secondParameter->b:Ljava/nio/ByteBuffer;
|
|
||||||
""" + instructionList,listOf(ExternalLabel("do_not_block", LithoFilterPatch.lithoMethod.instruction(0)))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -47,15 +47,10 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
|
||||||
try {
|
|
||||||
with (LithoBufferFingerprint.result!!) {
|
with (LithoBufferFingerprint.result!!) {
|
||||||
val startIndex = this.scanResult.patternScanResult!!.startIndex
|
val startIndex = this.scanResult.patternScanResult!!.startIndex
|
||||||
bufferReference = (this.mutableMethod.instruction(startIndex) as BuilderInstruction21c).reference.toString()
|
bufferReference = (this.mutableMethod.instruction(startIndex) as BuilderInstruction21c).reference.toString()
|
||||||
}
|
}
|
||||||
bufferFingerprintResolved = true
|
|
||||||
} catch (_: Exception) {
|
|
||||||
bufferFingerprintResolved = false
|
|
||||||
}
|
|
||||||
|
|
||||||
LithoObjectFingerprint.result?.let {
|
LithoObjectFingerprint.result?.let {
|
||||||
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
@ -67,14 +62,12 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
lithoMethod = result.mutableMethod
|
lithoMethod = result.mutableMethod
|
||||||
|
|
||||||
with (lithoMethod.implementation!!.instructions) {
|
with (lithoMethod.implementation!!.instructions) {
|
||||||
// 18.06.41+
|
|
||||||
val bufferIndex = indexOfFirst {
|
val bufferIndex = indexOfFirst {
|
||||||
it.opcode == Opcode.CONST &&
|
it.opcode == Opcode.CONST &&
|
||||||
(it as Instruction31i).narrowLiteral == 168777401
|
(it as Instruction31i).narrowLiteral == 168777401
|
||||||
}
|
}
|
||||||
val bufferRegister = (lithoMethod.instruction(bufferIndex) as Instruction31i).registerA
|
val bufferRegister = (lithoMethod.instruction(bufferIndex) as Instruction31i).registerA
|
||||||
|
|
||||||
// 18.06.41+
|
|
||||||
val targetIndex = indexOfFirst {
|
val targetIndex = indexOfFirst {
|
||||||
it.opcode == Opcode.CONST_STRING &&
|
it.opcode == Opcode.CONST_STRING &&
|
||||||
(it as BuilderInstruction21c).reference.toString() == "Element missing type extension"
|
(it as BuilderInstruction21c).reference.toString() == "Element missing type extension"
|
||||||
@ -103,8 +96,6 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if (bufferFingerprintResolved) {
|
|
||||||
// 18.11.36+
|
|
||||||
val objectIndex = indexOfFirst {
|
val objectIndex = indexOfFirst {
|
||||||
it.opcode == Opcode.CONST_STRING &&
|
it.opcode == Opcode.CONST_STRING &&
|
||||||
(it as BuilderInstruction21c).reference.toString() == ""
|
(it as BuilderInstruction21c).reference.toString() == ""
|
||||||
@ -120,16 +111,6 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
iget-object v$bufferRegister, v$bufferRegister, $bufferReference->b:Ljava/nio/ByteBuffer;
|
iget-object v$bufferRegister, v$bufferRegister, $bufferReference->b:Ljava/nio/ByteBuffer;
|
||||||
""" + instructionList,listOf(ExternalLabel("not_an_ad", lithoMethod.instruction(insertIndex + 1)))
|
""" + instructionList,listOf(ExternalLabel("not_an_ad", lithoMethod.instruction(insertIndex + 1)))
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
val secondParameter = lithoMethod.parameters[2]
|
|
||||||
lithoMethod.addInstructions(
|
|
||||||
insertIndex + 1,
|
|
||||||
"""
|
|
||||||
move-object/from16 v$bufferRegister, p3
|
|
||||||
iget-object v$bufferRegister, v$bufferRegister, $secondParameter->b:Ljava/nio/ByteBuffer;
|
|
||||||
""" + instructionList,listOf(ExternalLabel("not_an_ad", lithoMethod.instruction(insertIndex + 1)))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ?: return LithoFingerprint.toErrorResult()
|
} ?: return LithoFingerprint.toErrorResult()
|
||||||
@ -140,7 +121,6 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
internal companion object {
|
internal companion object {
|
||||||
var objectRegister by Delegates.notNull<Int>()
|
var objectRegister by Delegates.notNull<Int>()
|
||||||
var bufferFingerprintResolved by Delegates.notNull<Boolean>()
|
|
||||||
|
|
||||||
lateinit var lithoMethod: MutableMethod
|
lateinit var lithoMethod: MutableMethod
|
||||||
lateinit var bufferReference: String
|
lateinit var bufferReference: String
|
||||||
|
Loading…
x
Reference in New Issue
Block a user