mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-24 10:52:10 +02:00
fix(music/remember-video-quality): not compatible with latest version
This commit is contained in:
parent
0553584d5c
commit
b1adb5f584
@ -63,11 +63,26 @@ class VideoQualityPatch : BytecodePatch(
|
|||||||
for ((index, instruction) in implementation!!.instructions.withIndex()) {
|
for ((index, instruction) in implementation!!.instructions.withIndex()) {
|
||||||
if (instruction.opcode != Opcode.INVOKE_INTERFACE) continue
|
if (instruction.opcode != Opcode.INVOKE_INTERFACE) continue
|
||||||
|
|
||||||
qualityReference =
|
|
||||||
getInstruction<ReferenceInstruction>(index - 1).reference
|
|
||||||
qIndexMethodName =
|
qIndexMethodName =
|
||||||
((getInstruction<Instruction35c>(index).reference) as MethodReference).name
|
((getInstruction<Instruction35c>(index).reference) as MethodReference).name
|
||||||
|
|
||||||
|
val qIndexMethodClass =
|
||||||
|
((getInstruction<Instruction35c>(index).reference) as MethodReference).definingClass
|
||||||
|
|
||||||
|
for (qualityReferenceIndex in index downTo 0) {
|
||||||
|
if (getInstruction(qualityReferenceIndex).opcode != Opcode.IGET_OBJECT) continue
|
||||||
|
|
||||||
|
val targetReference =
|
||||||
|
getInstruction<ReferenceInstruction>(qualityReferenceIndex).reference
|
||||||
|
|
||||||
|
if (!targetReference.toString()
|
||||||
|
.endsWith(qIndexMethodClass)
|
||||||
|
) continue
|
||||||
|
|
||||||
|
qualityReference = targetReference
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
0,
|
0,
|
||||||
"invoke-static {p3}, $INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->userChangedQuality(I)V"
|
"invoke-static {p3}, $INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->userChangedQuality(I)V"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user