mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-13 13:47:42 +02:00
fix(youtube/litho-filter): Incorrect dex syntax
This commit is contained in:
@ -49,13 +49,12 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
|
|
||||||
addFilter = { classDescriptor ->
|
addFilter = { classDescriptor ->
|
||||||
addInstructions(
|
addInstructions(
|
||||||
2,
|
2, """
|
||||||
"""
|
|
||||||
new-instance v1, $classDescriptor
|
new-instance v1, $classDescriptor
|
||||||
invoke-direct {v1}, $classDescriptor-><init>()V
|
invoke-direct {v1}, $classDescriptor-><init>()V
|
||||||
const/4 v2, ${filterCount++}
|
${getConstString(2, filterCount++)}
|
||||||
aput-object v1, v0, v2
|
aput-object v1, v0, v2
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: return LithoFilterFingerprint.toErrorResult()
|
} ?: return LithoFilterFingerprint.toErrorResult()
|
||||||
@ -64,12 +63,17 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun close() = LithoFilterFingerprint.result!!
|
override fun close() = LithoFilterFingerprint.result!!
|
||||||
.mutableMethod.replaceInstruction(0, "const/4 v0, $filterCount")
|
.mutableMethod.replaceInstruction(0, getConstString(0, filterCount))
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
internal lateinit var addFilter: (String) -> Unit
|
internal lateinit var addFilter: (String) -> Unit
|
||||||
private set
|
private set
|
||||||
|
|
||||||
private var filterCount = 0
|
private var filterCount = 0
|
||||||
|
|
||||||
|
private fun getConstString(
|
||||||
|
register: Int,
|
||||||
|
count: Int
|
||||||
|
): String = if (count >= 8) "const/16 v$register, $count" else "const/4 v$register, $count"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user