revanced-patcher
revanced-patcher copied to clipboard
feat: use class fingerprint instead of method fingerprint
Type
Functionality
Issue
Class fingerprints are helpful to find methods that have same method signature.
Feature
object MyClassFingerprint : ClassFingerprint(
"com/example/package/MyClass", // Name of the class
listOf( // list of method signatures present in the class
MethodFingerprint("V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L", "L"), listOf(
// Opcode list for method 1
)),
MethodFingerprint(strings = listOf("force_overlay", "Media#updateFields", "live_reels_metadata"))
MethodFingerprint(customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("ClipsEditMetadataController;")
}),
// Add more method fingerprints as needed
),
// Number of methods in the class
3
)
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
- Class structure is more stable
- More precise matching
- Less prone to false positives
Additional context
No response
Acknowledgements
- [X] I have searched the existing issues and this is a new and no duplicate or related to another open issue.
- [X] I have written a short but informative title.
- [X] I filled out all of the requested information in this issue properly.