mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-23 02:57:31 +01:00
fix: constrain old-quality-layout
to older version
This commit is contained in:
parent
d1c7edfc87
commit
add7232619
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
|
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@ -37,15 +37,23 @@ class OldQualityLayoutPatch : BytecodePatch(
|
|||||||
|
|
||||||
val implementation = result.mutableMethod.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
|
// use this register because it is free
|
||||||
|
val containerRegister = 5
|
||||||
|
|
||||||
// if useOldStyleQualitySettings == true, jump over all instructions
|
// if useOldStyleQualitySettings == true, jump over all instructions
|
||||||
val jmpInstruction = BuilderInstruction21t(
|
implementation.addInstruction(
|
||||||
Opcode.IF_NEZ, 0, implementation.instructions[result.patternScanResult!!.endIndex].location.labels.first()
|
4, BuilderInstruction21t(
|
||||||
|
Opcode.IF_NEZ,
|
||||||
|
containerRegister,
|
||||||
|
implementation.instructions[result.patternScanResult!!.endIndex].location.labels.first()
|
||||||
)
|
)
|
||||||
implementation.addInstruction(5, jmpInstruction)
|
)
|
||||||
|
|
||||||
|
// insert the new condition
|
||||||
result.mutableMethod.addInstructions(
|
result.mutableMethod.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/OldStyleQualityPatch;->useOldStyleQualitySettings()Z
|
invoke-static { }, Lapp/revanced/integrations/patches/OldStyleQualityPatch;->useOldStyleQualitySettings()Z
|
||||||
move-result v0
|
move-result v$containerRegister
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user