2 |
AppRetentionHook
3 |
4 | 
5 | 
6 | 
7 | [](https://github.com/Xposed-Modules-Repo/Com.HChen.Hook/releases)
8 | [](https://github.com/Xposed-Modules-Repo/Com.HChen.Hook/releases)
9 | 
10 | 
11 |
12 |
English | 简体中文
13 |
Hook system kill logic to implement background keep alive
14 |
15 |
16 | ---
17 |
18 | ## ✨ Module Introduction
19 |
20 | AppRetentionHook is an **LSP module** that implements **background retention** by hooking into the system’s kill logic.
21 | 📌 **Version 5.1 is a completely refactored new version!!** Give it a try!
22 |
23 | 🔹 **Supported Systems** (for version 5.1):
24 |
25 | - ✅ **HyperOS V1 / V2**
26 | - ✅ **AOSP 11-15**
27 | - ✅ **Samsung OneUI** (Usage scope is unknown)
28 | - 🚧 **Color OS** (Not fully adapted yet, but usable)
29 |
30 | ---
31 |
32 | ## 🛠 Usage Notice
33 |
34 | > 📌 **Why might some applications still be killed?**
35 | > **This module only intercepts kills triggered by system scheduling; it cannot address application crashes, self-termination, or other similar behaviors!**
36 |
37 | 📌 **Intercepted Kill Sources (system behaviors):**
38 |
39 | - Idle device cleanup
40 | - Process count limitations
41 | - Maximum background process restrictions
42 | - Restricted application policies
43 | - Scheduled task cleanup
44 | - Doze/empty process restrictions
45 |
46 | ⚠ **The module does NOT intercept the following kill behaviors:**
47 |
48 | - Active killing by lmkd (triggered by memory overload)
49 | - Application ANR (not responding), updates, self-termination, uninstallation, crashes, etc.
50 |
51 | 💡 **Module Objective:**
52 | **Opened applications will not be killed due to system scheduling, thereby prolonging their background retention as much as possible!**
53 |
54 | ---
55 |
56 | ## 🔧 Installation and Usage
57 |
58 | 📌 **Please enable this module within LSP!**
59 |
60 | 1. **Installation**: Download and install this module.
61 | 2. **Activation**: Open LSP, select this module, and enable it.
62 | 3. **Select the applicable scopes** (depending on the system):
63 | - **MIUI / HyperOS**: `System Framework (system)` and `Battery & Performance (powerkeeper)` [if available]
64 | - **Color OS**: `Athena`, `Battery`, and `System Framework (system)` (Note: Version 5.1 is not fully adapted for Color OS, but it is usable)
65 | - **OneUI**: `System Framework (system)`
66 | 4. **Restart your device!**
67 |
68 | ---
69 |
70 | ## 🌟 Module Effects
71 |
72 | ✅ Testing shows that the background retention time of apps has **significantly increased**, with no system-initiated app kills observed over extended periods.
73 | ✅ **Even after an entire night, apps continue to run in the background.**
74 | ✅ **Example Apps** (including but not limited to):
75 |
76 | - QQ, Bilibili, Douyin
77 | - GitHub (Android), Twitter (X), Telegram, YouTube, etc.
78 |
79 | ---
80 |
81 | ## ⚠ Potential Issues
82 |
83 | ⚠ **Due to modifications in the system’s operational logic, this module may have the following impacts:**
84 |
85 | 1. **Failure of system memory management**: When memory is low, automatic cleanup will not occur, which may result in system freezes.
86 | 2. **Increased standby power consumption**: Although the impact is minor, battery usage may be slightly higher.
87 | 3. **Some devices may experience boot hang issues.**
88 |
89 | 🚨 **Strongly Recommended**: Please ensure you have a backup before using this module to avoid extreme issues such as failure to boot!
90 |
91 | ---
92 |
93 | ## 🔍 Frequently Asked Questions
94 |
95 | ❓ **Q: How do I use this module?**
96 | 💡 A: Please carefully read the README and ensure that the correct LSP scopes are configured.
97 |
98 | ❓ **Q: Does this module conflict with other retention modules?**
99 | 💡 A: Yes, **please do not use multiple modules with the same functionality simultaneously!**
100 | Examples of conflicting modules include:
101 | - **Don-t-Kill**
102 | - **Cemiuiler** (overlapping functionalities)
103 | - **A1 Memory Management LSP Module**
104 |
105 | ❓ **Q: Why is my system freezing?**
106 | 💡 A: Please check your device's **memory usage**. This module does not perform automatic memory cleanup.
107 |
108 | ❓ **Q: Why has my standby power consumption increased?**
109 | 💡 A: With apps staying alive in the background for longer, **increased power consumption is a normal phenomenon**, though the impact is minimal.
110 |
111 | ❓ **Q: Why does my device hang during boot?**
112 | 💡 A: Some devices may be incompatible. If you encounter this issue, please uninstall the module and provide feedback.
113 |
114 | ---
115 |
116 | ## 🙏 Acknowledgments
117 |
118 | 💡 Some parts of this module's code reference the following projects. Special thanks to:
119 |
120 | | Project Name | Project Link |
121 | |----------------|-----------------------------------------------------------------------------------|
122 | | Cemiuiler | [Cemiuiler GitHub](https://github.com/Team-Cemiuiler/Cemiuiler/tree/main) |
123 | | Don't Kill | [Don-t-Kill](https://github.com/HChenX/Don-t-Kill) |
124 |
125 | 📌 **Translation Provided By:**
126 |
127 | - **English**: HChen (焕晨HChen), ℓοѕτ οиє ⌕ — 🚫🥄 (Telegram Name)
128 | - **Simplified Chinese**: HChen (焕晨HChen)
129 |
130 | ---
131 |
132 | ## 📢 Project Disclaimer
133 |
134 | ⚠ **By using this module, you agree to assume all risks and consequences!**
135 | ⚠ **This project is not responsible for any derivative projects!**
136 | ⚠ **Plagiarism will result in the project becoming closed source! Please attribute the author!**
137 |
138 | ---
139 |
140 | ## 🎉 Conclusion
141 |
142 | 💖 **Thank you for your support. Enjoy your day!** 🚀
143 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |