Skip to content

Commit 68b2266

Browse files
lingqiqi5211Sevtinge
authored andcommitted
refactor: Optimize and enhance resource hooking
This commit refactors the `ResourcesTool` for more efficient and robust resource hooking. Key changes: - Implemented on-demand, incremental hooking for resource types (e.g., color, drawable) to improve performance. - Added recursion protection using `ThreadLocal` to prevent infinite loops during resource replacement. - Enhanced `TypedArray` hooking to support a wider range of methods and replacement types (ID, density, object). - Optimized resource key resolution and caching for faster lookups. - Ensured preference change listeners are only registered once.
1 parent 299cb77 commit 68b2266

1 file changed

Lines changed: 282 additions & 222 deletions

File tree

  • library/libhook/src/main/java/com/sevtinge/hyperceiler/libhook/utils/hookapi/tool

0 commit comments

Comments
 (0)