feat!: add classDef parameter to MethodFingerprint (#175)

BREAKING CHANGE: This changes the signature of the `customFingerprint` function.
This commit is contained in:
badawoll 2023-05-10 23:37:17 +00:00 committed by GitHub
parent 223cea7021
commit a2052202b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ abstract class MethodFingerprint(
internal val parameters: Iterable<String>? = null, internal val parameters: Iterable<String>? = null,
internal val opcodes: Iterable<Opcode?>? = null, internal val opcodes: Iterable<Opcode?>? = null,
internal val strings: Iterable<String>? = null, internal val strings: Iterable<String>? = null,
internal val customFingerprint: ((methodDef: Method) -> Boolean)? = null internal val customFingerprint: ((methodDef: Method, classDef: ClassDef) -> Boolean)? = null
) : Fingerprint { ) : Fingerprint {
/** /**
* The result of the [MethodFingerprint] the [Method]. * The result of the [MethodFingerprint] the [Method].
@ -94,7 +94,7 @@ abstract class MethodFingerprint(
) return false ) return false
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION") @Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
if (methodFingerprint.customFingerprint != null && !methodFingerprint.customFingerprint!!(method)) if (methodFingerprint.customFingerprint != null && !methodFingerprint.customFingerprint!!(method, forClass))
return false return false
val stringsScanResult: StringsScanResult? = val stringsScanResult: StringsScanResult? =