mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-04-30 21:34:25 +02:00
refactor: better naming for resolver warning parameters
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
5ca5a1c29e
commit
c8b68e36e0
@ -92,14 +92,14 @@ interface PatternScanMethod {
|
||||
|
||||
/**
|
||||
* Represents a resolver warning.
|
||||
* @param expected The opcode the signature expected it to be.
|
||||
* @param current The current opcode in the pattern. Always different from [expected].
|
||||
* @param correctOpcode The opcode the signature expected it to be.
|
||||
* @param wrongOpcode The opcode the signature currently has.
|
||||
* @param instructionIndex The index of the opcode relative to the instruction list.
|
||||
* @param patternIndex The index of the opcode relative to the pattern list from the signature.
|
||||
*/
|
||||
data class Warning(
|
||||
val expected: Opcode,
|
||||
val current: Opcode,
|
||||
val correctOpcode: Opcode,
|
||||
val wrongOpcode: Opcode,
|
||||
val instructionIndex: Int,
|
||||
val patternIndex: Int,
|
||||
)
|
||||
|
@ -127,15 +127,15 @@ internal class SignatureResolver(
|
||||
) = buildList {
|
||||
val pattern = signature.opcodes!!
|
||||
for ((patternIndex, originalIndex) in (scanResult.startIndex until scanResult.endIndex).withIndex()) {
|
||||
val originalOpcode = instructions.elementAt(originalIndex).opcode
|
||||
val correctOpcode = instructions.elementAt(originalIndex).opcode
|
||||
val patternOpcode = pattern.elementAt(patternIndex)
|
||||
if (
|
||||
patternOpcode != null && // unknown opcode
|
||||
originalOpcode != patternOpcode
|
||||
correctOpcode != patternOpcode
|
||||
) {
|
||||
this.add(
|
||||
PatternScanMethod.Fuzzy.Warning(
|
||||
originalOpcode, patternOpcode,
|
||||
correctOpcode, patternOpcode,
|
||||
originalIndex, patternIndex,
|
||||
)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user