mirror of
https://github.com/revanced/revanced-patches
synced 2024-08-29 18:45:23 +02:00
fix(youtube/litho-filter): use correct type for switch case (#1068)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
7c3b4e2036
commit
ab03511e23
@ -65,21 +65,13 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
fun Instruction.toDescriptor() = when (val reference = (this as ReferenceInstruction).reference) {
|
fun Instruction.toDescriptor() = when (val reference = (this as? ReferenceInstruction)?.reference) {
|
||||||
MethodReference::class -> {
|
is MethodReference -> "${reference.definingClass}->${reference.name}(${
|
||||||
val methodReference = reference as MethodReference
|
reference.parameterTypes.joinToString(
|
||||||
"${methodReference.definingClass}->${methodReference.name}(${
|
|
||||||
methodReference.parameterTypes.joinToString(
|
|
||||||
""
|
""
|
||||||
) { it }
|
) { it }
|
||||||
})${methodReference.returnType}"
|
})${reference.returnType}"
|
||||||
}
|
is FieldReference -> "${reference.definingClass}->${reference.name}:${reference.type}"
|
||||||
|
|
||||||
FieldReference::class -> {
|
|
||||||
val fieldReference = reference as FieldReference
|
|
||||||
"${fieldReference.definingClass}->${fieldReference.name}:${fieldReference.type}"
|
|
||||||
}
|
|
||||||
|
|
||||||
else -> throw PatchResultError("Unsupported reference type")
|
else -> throw PatchResultError("Unsupported reference type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user