mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-03 00:12:56 +01:00
refactor: print surrounding opcodes of a warning
This commit is contained in:
parent
a0dcea3a13
commit
6d4158af85
@ -17,14 +17,24 @@ internal class SignatureChecker {
|
||||
patcher.addPatches(Index.patches.map { it() })
|
||||
val unresolved = mutableListOf<MethodSignature>()
|
||||
for (signature in patcher.resolveSignatures()) {
|
||||
if (!signature.resolved) unresolved.add(signature)
|
||||
if (!signature.resolved) {
|
||||
unresolved.add(signature)
|
||||
continue
|
||||
}
|
||||
|
||||
val patternScanMethod = signature.metadata.patternScanMethod
|
||||
if (patternScanMethod is PatternScanMethod.Fuzzy) {
|
||||
val warnings = patternScanMethod.warnings
|
||||
val warnings = patternScanMethod.warnings!!
|
||||
println("Signature ${signature.metadata.name} had ${warnings.size} warnings!")
|
||||
for (warning in warnings) {
|
||||
val instructions = signature.result!!.method.implementation!!.instructions
|
||||
for (i in warning.expectedIndex - 5 until warning.expectedIndex) {
|
||||
println(instructions[i].opcode)
|
||||
}
|
||||
println(warning.toString())
|
||||
for (i in warning.expectedIndex - 5 .. warning.expectedIndex + 1) {
|
||||
println(instructions[i].opcode)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user