refactor: rename method to resolverMethod

This commit is contained in:
Lucaskyy 2022-04-13 21:04:26 +02:00 committed by oSumAtrIX
parent 0f30eac32c
commit b2dab3fabf
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4
3 changed files with 5 additions and 6 deletions

View file

@ -11,7 +11,6 @@ import org.jf.dexlib2.Opcode
* @param methodParameters The parameters of the method. * @param methodParameters The parameters of the method.
* @param opcodes A list of opcodes of the method. * @param opcodes A list of opcodes of the method.
*/ */
@Suppress("ArrayInDataClass")
data class MethodSignature( data class MethodSignature(
val name: String, val name: String,
val metadata: SignatureMetadata, val metadata: SignatureMetadata,
@ -46,10 +45,10 @@ data class MethodMetadata(
/** /**
* Metadata for the Patcher, this contains things like how the Patcher should interpret this signature. * Metadata for the Patcher, this contains things like how the Patcher should interpret this signature.
* @param method The method the resolver should use to resolve the signature. * @param resolverMethod The method the resolver should use to resolve the signature.
*/ */
data class PatcherMetadata( data class PatcherMetadata(
val method: ResolverMethod val resolverMethod: ResolverMethod
) )
/** /**

View file

@ -89,8 +89,8 @@ internal class SignatureResolver(
val pattern = signature.opcodes!! val pattern = signature.opcodes!!
val size = pattern.count() val size = pattern.count()
var threshold = 0 var threshold = 0
if (signature.metadata.patcher.method is ResolverMethod.Fuzzy) { if (signature.metadata.patcher.resolverMethod is ResolverMethod.Fuzzy) {
threshold = signature.metadata.patcher.method.threshold threshold = signature.metadata.patcher.resolverMethod.threshold
} }
for (instructionIndex in 0 until count) { for (instructionIndex in 0 until count) {

View file

@ -39,7 +39,7 @@ internal class PatcherTest {
comment = "Main method of TestClass. Version 1.0.0" comment = "Main method of TestClass. Version 1.0.0"
), ),
patcher = PatcherMetadata( patcher = PatcherMetadata(
method = ResolverMethod.Fuzzy(2) resolverMethod = ResolverMethod.Fuzzy(2)
) )
), ),
"V", "V",