mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-12 00:17:45 +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() })
|
patcher.addPatches(Index.patches.map { it() })
|
||||||
val unresolved = mutableListOf<MethodSignature>()
|
val unresolved = mutableListOf<MethodSignature>()
|
||||||
for (signature in patcher.resolveSignatures()) {
|
for (signature in patcher.resolveSignatures()) {
|
||||||
if (!signature.resolved) unresolved.add(signature)
|
if (!signature.resolved) {
|
||||||
|
unresolved.add(signature)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
val patternScanMethod = signature.metadata.patternScanMethod
|
val patternScanMethod = signature.metadata.patternScanMethod
|
||||||
if (patternScanMethod is PatternScanMethod.Fuzzy) {
|
if (patternScanMethod is PatternScanMethod.Fuzzy) {
|
||||||
val warnings = patternScanMethod.warnings
|
val warnings = patternScanMethod.warnings!!
|
||||||
println("Signature ${signature.metadata.name} had ${warnings.size} warnings!")
|
println("Signature ${signature.metadata.name} had ${warnings.size} warnings!")
|
||||||
for (warning in 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())
|
println(warning.toString())
|
||||||
|
for (i in warning.expectedIndex - 5 .. warning.expectedIndex + 1) {
|
||||||
|
println(instructions[i].opcode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user