Skip to content

Commit

Permalink
fix(music/remember-video-quality): not compatible with latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 committed Sep 5, 2023
1 parent 0553584 commit b1adb5f
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,26 @@ class VideoQualityPatch : BytecodePatch(
for ((index, instruction) in implementation!!.instructions.withIndex()) {
if (instruction.opcode != Opcode.INVOKE_INTERFACE) continue

qualityReference =
getInstruction<ReferenceInstruction>(index - 1).reference
qIndexMethodName =
((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(
0,
"invoke-static {p3}, $INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->userChangedQuality(I)V"
Expand Down

0 comments on commit b1adb5f

Please sign in to comment.