feat(YouTube Music): add support versions 7.01.53 ~ 7.02.51

This commit is contained in:
inotia00
2024-05-26 16:01:24 +09:00
parent 904f1d6357
commit f15a5d5259
10 changed files with 119 additions and 30 deletions

View File

@ -18,7 +18,6 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMut
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c
import com.android.tools.smali.dexlib2.iface.Method
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@ -212,7 +211,14 @@ fun Method.getEmptyStringInstructionIndex()
fun Method.getStringInstructionIndex(value: String) = implementation?.let {
it.instructions.indexOfFirst { instruction ->
instruction.opcode == Opcode.CONST_STRING
&& (instruction as? BuilderInstruction21c)?.reference.toString() == value
&& (instruction as? ReferenceInstruction)?.reference.toString() == value
}
} ?: -1
fun Method.getStartsWithStringInstructionIndex(value: String) = implementation?.let {
it.instructions.indexOfFirst { instruction ->
instruction.opcode == Opcode.CONST_STRING
&& (instruction as? ReferenceInstruction)?.reference.toString().startsWith(value)
}
} ?: -1