Open Aunali321 opened 1 year ago
Also fields and other metadata like access flags
This feature came up in a discussion here.
Not sure what the best way to implement this would be (I don't have much Kotlin development experience), I came up with two viable solutions (they both expose ClassDef
to `customFingerprint):
customFingerprint
signature to (Method, ClassDef) -> Bool
. It's clean (nice API), but breaks pretty much all patches that depend on a custom fingerprint.MethodProxy
class that implements Method
, but also accepts a ClassDef
as a constructor argument, and makes it publicly accessible. Doesn't break API, but feels more hacky.Maybe there exists even a cleaner way? I looked at extensions, but I couldn't find a nice way to pass a local variable into an extension function/field.
MethodFingerprint
could also be reworked to perform matching on the ClassDef
.
The first way is not an issue. The commit will be marked as a breaking change, if patches update to it, they will have to adjust.
Type
Functionality
Issue
Class fingerprints are helpful to find methods that have same method signature.
Feature
ClassFingerprint: This is a class that extends the Fingerprint class and is used to define the fingerprint of the target class. The ClassFingerprint includes a set of characteristics that uniquely identify the target class, such as the class name, method signatures, and number of methods in the class.
Other details are self-explanatory.
Motivation
Additional context
No response
Acknowledgements