mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-08 16:14:25 +02:00
fix!: check for two methods parameters orders (#183)
BREAKING CHANGE: This requires changes to `MethodFingerprint`
This commit is contained in:
parent
8f1c835299
commit
b6d6a7591b
@ -220,17 +220,15 @@ private fun replaceOffset(
|
|||||||
*/
|
*/
|
||||||
internal fun Method.cloneMutable(registerCount: Int = 0) = clone(registerCount).toMutable()
|
internal fun Method.cloneMutable(registerCount: Int = 0) = clone(registerCount).toMutable()
|
||||||
|
|
||||||
// FIXME: also check the order of parameters as different order equals different method overload
|
|
||||||
internal fun parametersEqual(
|
internal fun parametersEqual(
|
||||||
parameters1: Iterable<CharSequence>, parameters2: Iterable<CharSequence>
|
parameters1: Iterable<CharSequence>, parameters2: Iterable<CharSequence>
|
||||||
): Boolean {
|
): Boolean {
|
||||||
return parameters1.count() == parameters2.count() && parameters1.all { parameter ->
|
if (parameters1.count() != parameters2.count()) return false
|
||||||
parameters2.any {
|
val iterator1 = parameters1.iterator()
|
||||||
it.startsWith(
|
parameters2.forEach {
|
||||||
parameter
|
if (!it.startsWith(iterator1.next())) return false
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val nullOutputStream = object : OutputStream() {
|
internal val nullOutputStream = object : OutputStream() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user