mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-06-12 05:07:45 +02:00
fix(YouTube - Seekbar): Correctly hide the feed seekbar with target 20.07
This commit is contained in:
@ -84,31 +84,14 @@ internal val playerLinearGradientFingerprint = fingerprint {
|
||||
}
|
||||
|
||||
/**
|
||||
* 19.46 - 19.47
|
||||
* 19.25 - 19.47
|
||||
*/
|
||||
internal val playerLinearGradientLegacy1946Fingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||
parameters("I", "I", "I", "I")
|
||||
internal val playerLinearGradientLegacyFingerprint = fingerprint {
|
||||
returns("V")
|
||||
opcodes(
|
||||
Opcode.FILLED_NEW_ARRAY,
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
)
|
||||
custom { method, _ ->
|
||||
method.name == "setBounds" && method.containsLiteralInstruction(ytYoutubeMagentaColorId)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 19.25 - 19.45
|
||||
*/
|
||||
internal val playerLinearGradientLegacy1925Fingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
|
||||
parameters("Landroid/content/Context;")
|
||||
opcodes(
|
||||
Opcode.FILLED_NEW_ARRAY,
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
)
|
||||
literal { ytYoutubeMagentaColorId }
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.youtube.layout.seekbar
|
||||
|
||||
import app.revanced.patcher.Fingerprint
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
@ -310,14 +311,15 @@ val seekbarColorPatch = bytecodePatch(
|
||||
"""
|
||||
)
|
||||
|
||||
val playerFingerprint =
|
||||
if (is_19_49_or_greater) {
|
||||
playerLinearGradientFingerprint
|
||||
} else if (is_19_46_or_greater) {
|
||||
playerLinearGradientLegacy1946Fingerprint
|
||||
} else {
|
||||
playerLinearGradientLegacy1925Fingerprint
|
||||
}
|
||||
val playerFingerprint: Fingerprint
|
||||
val checkGradientCoordinates: Boolean
|
||||
if (is_19_49_or_greater) {
|
||||
playerFingerprint = playerLinearGradientFingerprint
|
||||
checkGradientCoordinates = true
|
||||
} else {
|
||||
playerFingerprint = playerLinearGradientLegacyFingerprint
|
||||
checkGradientCoordinates = false
|
||||
}
|
||||
|
||||
playerFingerprint.let {
|
||||
it.method.apply {
|
||||
@ -326,10 +328,17 @@ val seekbarColorPatch = bytecodePatch(
|
||||
|
||||
addInstructions(
|
||||
index + 1,
|
||||
"""
|
||||
invoke-static { v$register }, $EXTENSION_CLASS_DESCRIPTOR->getPlayerLinearGradient([I)[I
|
||||
move-result-object v$register
|
||||
"""
|
||||
if (checkGradientCoordinates) {
|
||||
"""
|
||||
invoke-static { v$register, p0, p1 }, $EXTENSION_CLASS_DESCRIPTOR->getPlayerLinearGradient([III)[I
|
||||
move-result-object v$register
|
||||
"""
|
||||
} else {
|
||||
"""
|
||||
invoke-static { v$register }, $EXTENSION_CLASS_DESCRIPTOR->getPlayerLinearGradient([I)[I
|
||||
move-result-object v$register
|
||||
"""
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user