mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 21:30:19 +02:00
fix(YouTube/Hide layout components): Hide official header
doesn't work (A/B tests)
This commit is contained in:
parent
a033d52a54
commit
c3645ddb34
@ -12,7 +12,6 @@ import app.revanced.patches.shared.patch.litho.ComponentParserPatch
|
|||||||
import app.revanced.patches.shared.patch.litho.ComponentParserPatch.generalHook
|
import app.revanced.patches.shared.patch.litho.ComponentParserPatch.generalHook
|
||||||
import app.revanced.patches.youtube.utils.litho.fingerprints.GeneralByteBufferFingerprint
|
import app.revanced.patches.youtube.utils.litho.fingerprints.GeneralByteBufferFingerprint
|
||||||
import app.revanced.patches.youtube.utils.litho.fingerprints.LithoFilterFingerprint
|
import app.revanced.patches.youtube.utils.litho.fingerprints.LithoFilterFingerprint
|
||||||
import app.revanced.patches.youtube.utils.litho.fingerprints.LowLevelByteBufferFingerprint
|
|
||||||
import app.revanced.util.integrations.Constants.ADS_PATH
|
import app.revanced.util.integrations.Constants.ADS_PATH
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
|
|
||||||
@ -21,22 +20,15 @@ import java.io.Closeable
|
|||||||
object LithoFilterPatch : BytecodePatch(
|
object LithoFilterPatch : BytecodePatch(
|
||||||
setOf(
|
setOf(
|
||||||
GeneralByteBufferFingerprint,
|
GeneralByteBufferFingerprint,
|
||||||
LithoFilterFingerprint,
|
LithoFilterFingerprint
|
||||||
LowLevelByteBufferFingerprint
|
|
||||||
)
|
)
|
||||||
), Closeable {
|
), Closeable {
|
||||||
internal lateinit var addFilter: (String) -> Unit
|
internal lateinit var addFilter: (String) -> Unit
|
||||||
private set
|
private set
|
||||||
|
|
||||||
private var filterCount = 0
|
private var filterCount = 0
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
LowLevelByteBufferFingerprint.result?.mutableMethod?.addInstruction(
|
|
||||||
0,
|
|
||||||
"invoke-static { p0 }, $ADS_PATH/LowLevelFilter;->setProtoBuffer(Ljava/nio/ByteBuffer;)V"
|
|
||||||
) ?: throw LowLevelByteBufferFingerprint.exception
|
|
||||||
|
|
||||||
GeneralByteBufferFingerprint.result?.let {
|
GeneralByteBufferFingerprint.result?.let {
|
||||||
(context
|
(context
|
||||||
.toMethodWalker(it.method)
|
.toMethodWalker(it.method)
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.utils.litho.fingerprints
|
|
||||||
|
|
||||||
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 LowLevelByteBufferFingerprint : MethodFingerprint(
|
|
||||||
returnType = "V",
|
|
||||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
|
||||||
parameters = listOf("L", "L"),
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.SGET_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
Opcode.ADD_INT_2ADDR,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.RETURN_VOID
|
|
||||||
)
|
|
||||||
)
|
|
Loading…
x
Reference in New Issue
Block a user