revanced-patcher
revanced-patcher copied to clipboard
feat: duplicates scanning for fingerprints
🐞 Issue
Currently fingerprints resolve to the first thing found that matches. This can be unsafe, for example if a fingerprint matches multiple places -> wrong stuff is getting patched -> app crashes at runtime.
❗ Solution
Patcher should have the ability to make sure fingerprints are unique and only find exactly one specific thing.
❓ Motivation
Make sure fingerprints find one thing and warn devs in case something is not unique anymore.
⚠ Additional context
Initial discussion because of fingerprints "safety": https://github.com/revanced/revanced-patches/pull/239
Performance + CLI
For performance reasons the duplicates checking should be disabled by default (when patching known to work versions).
The CLI should not scan for duplicates for patching supported versions.
However when --experimental
flag is enabled it could make use of duplicate checking.
This behavior could also be applied to patches with no version constrain, since it's possible for newly released app targets to have multiple matches.
All existing apps with no version constraint have only a few patches and the extra time to patch will likely be under a few seconds. The performance penalty won't be noticable to the end user and it better guarantees patching is correct.