revanced-patcher
revanced-patcher copied to clipboard
feat: allow fingerprint matching based on instance of
Type
Functionality
Issue
Currently, method fingerprints match using exact class match (or more specifically, 'starts with' matching of a class name). It does not allow polymorphic matching, such as comparing what the class is an instance of.
For example. A target method takes a two obfuscated parameters:
private void a(Lfoo;Lbar;)
Currently it is only possible to match this method by specifying a signature with 2 parameters of any kind of objects:
MethodFingerprint(
parameters = listOf("L", "L")
But looking a these classes we see that:
Lfoo; extends Ljava/lang/Enum;
Lbar; implements Ljava/util/map;
So the method signature should allow specifying an 'instance of' like comparison. Perhaps this can be done by specifying a prefix to the class name:
parameters = listOf("instanceof:Ljava/lang/Enum;", "instanceof:Ljava/util/map;")
This same logic could be used for the return type as well:
returnType = "instanceof:Ljava/util/list;"
Feature
add polymorphic matching to method signatures.
Motivation
Allow better signature matching
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.