Commit b33eeda
committed
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 417ca76 commit b33eeda
2 files changed
Lines changed: 285 additions & 222 deletions
File tree
- library/libhook/src/main/java/com/sevtinge/hyperceiler/libhook
- base
- utils/hookapi/tool
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| |||
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
| 187 | + | |
185 | 188 | | |
186 | 189 | | |
0 commit comments