-
-
Notifications
You must be signed in to change notification settings - Fork 249
Description
Type
Functionality
Issue
Everytime resolving happens, it searches thru all classes and methods until it finds a match.
But since most patches work only for a few app versions, that means the match for the fingerprint can found, saved, and then bundled with the patch data.
Then on future patching attempts, the previously found class/method can be used as a 'hint' during resolving and the hinted class is tried first.
In other words, first try resolving a method signature against the class listed in the patch resolver hints. And then only if the hinted class / method does not match (ie: patching a non target app version, or a patch was changed but the hints file is not yet updated), then and only then search thru all the classes as usual.
Feature
Add an optional patcher flag 'save resolving hints'. When enabled, after finding a match for each method signature, record which class/method it matched against.
After patching completes, write out to a separate file the class and/or method each signature matched to. This hint file could support only a single target app version to keep the file simple and lightweight - no hassle of managing multiple app versions in the hints file.
Stick this generated file somewhere in the patches project, and when building include it with the patches jar file.
This creation of this 'resolver hints' would need to be done by a developer (and not automated here on GitHub), since it would require the target apk.
The only maintenance to this file, is the developer would update the resolver hints file before a merging a branch with lots of patch changes (ie: before merging dev to main), or when the preferred target app version changes.
This feature probably should not be used for apps with only a few patches (little performance gain for the cost of manually checking in a generated file). Similarly this feature should not be used for apps with no target version.
But for YouTube or any app with more than a dozen patches and a single preferred target app version, this feature could dramatically speed up the patching process.
Motivation
Speed up the patching process for both developers and the end users.
Additional context
No response
Acknowledgements
- I have searched the existing issues and this is a new and no duplicate or related to another open issue.
- I have written a short but informative title.
- I filled out all of the requested information in this issue properly.