Стороннее управление памятью, работающее на Android, может уменьшить оперативную память, используемую приложениями.
-
-
-## ✨Важные особенности
-- Управление фоновым процессом жизни и смерти
-- Укажите, чтобы освободить дочерний процесс фонового приложения.
-- Не позволяйте демону убийцы с низким объемом памяти убивать фон
-- Автоматическое освобождение неиспользуемой памяти
-- Приложения для сна, чтобы уменьшить использование процессора и памяти.
-
-## 💡Описание
-- Этот модуль поддерживает только Android8 ~ 14, а платформа поддерживает только arm64-v8a.
-- Магиск не ниже 20.4+, и большинство ксу совместимы
-- Этот модуль вряд ли будет конфликтовать с другими модулями.
-
-### Путь к списку по умолчанию
-
-- Список имен: /sdcard/Android/HChai/HC_memory/名单列表.conf
-
-## 📱Терминальный интерфейс
-Настройка функции переключения, поддерживается только простое переключение функций. Для более детальной настройки параметров, пожалуйста, смотрите 📝 Пользовательские настройки.
-
-Как получить доступ к терминальному интерфейсу?
-- Вы можете использовать команду `amui` в Termux или выполнить /sdcard/Android/HChai/HC_memory/`terminal.sh` в менеджере mt.
-
-Как сохранить и переключить функции?
-- Используйте стрелки для навигации и нажмите Enter для сохранения.
-- Если нет клавиатуры, нажмите на иконку "lm" в нижнем правом углу, чтобы вызвать клавиатуру.
-
-Для чего эта функция?
-- Пояснение будет добавлено в терминальный интерфейс позже. В настоящее время доступно только руководство по настройке Json.
-
-## 📝Пользовательская конфигурация
-Встроенная конфигурация подходит для большинства устройств, но есть еще некоторые устройства, которые не относятся к конфигурации по умолчанию, поэтому открывается больше встроенных настраиваемых параметров. Это требование было учтено при разработке фреймворка HAMv2.Большинство параметров можно настраивать и корректировать, а этот проект можно встраивать в другие модули для запуска. Файл конфигурации Json находится по адресу ['/data/adb/modules/Hc_memory/config/memory.json'].
-
-### Информационный проект
-```json
-"project": {
- "name": "官方配置 [23.06.25]",
- "author": "火機@coolapk"
-}
-```
-
-| имя поля | тип | описание |
-| -------- | ------ | -------------------------------------------- |
-| name | string | Имя конфигурационного файла |
-| author | string | информация об авторе конфигурационного файла |
-
-`name` и `author` отражаются в журнале следующим образом:
-```
-[2023-07-06 19:00:22] [info] config 官方配置 [23.06.25] | by: 火機@coolapk
-```
-
-- Более подробное описание конфигурационного файла json см. [здесь](config/JSON-CONFIG-ru.md)
-
-## 🔍Часто задаваемые вопросы
-
-Можно ли использовать его с другими модулями оптимизации памяти?
-- Управление памятью A1 полностью отличается от других принципов оптимизации памяти, поэтому эффект от использования других модулей будет только 1+1=2.
-
-Будет ли он потреблять энергию?
-- Вовсе нет. Когда я разрабатывал инфраструктуру HAMv2, я потратил много времени на оптимизацию основного кода и принял базовый язык C/C++. Следовательно, потребление энергии, вызванное рамкой, незначительно.
-
-Будет ли это вызывать конфликты с другими модулями Magisk или модулями Xp?
-- Конфликт с другими модулями практически невозможен, конфликтов с этим модулем пока не встречалось.
-
-Влияет ли это на энергопотребление в режиме ожидания?
-- Фреймворк HAMv2 не будет вызывать энергопотребление в режиме ожидания, так как в режиме ожидания управление памятью A1 переходит в неактивное состояние.
-
-Включите, чтобы lmkd не убивал фон, почему фон все равно убивается?
-- Потому что он не позволяет lmkd убивать фон и не включает фоновые программы-убийцы различных производителей мобильных телефонов.
-
-Как настроить милый список?
-- Для настройки смарт-списка необходимо добавить в соответствующий список правило "KILL имя пакета: имя дочернего процесса". Перед добавлением вам необходимо убедиться, что вы понимаете функцию и роль подпроцесса, чтобы не вызвать непредвиденных проблем.
-
-Почему он переходит в режим fb после входа в систему в течение определенного периода времени?
-- Большинство телефонов, у которых есть эта проблема, являются телефонами Samsung, и функция перехвата, которая не позволяет lmkd завершить процесс, включена, что может быть причиной. В настоящее время нет способа исправить это, но это можно сделать, отключив функцию, которая не позволяет lmkd убивать процессы.
-
-Почему процесс воспроизведения аудио приостановлен?
-- Редко случается, что аудио процесс приостанавливается, если это все же происходит, вы можете добавить процесс в белый список, либо отключить функцию сна приложения. Это гарантирует, что аудиопроцесс продолжит работать без паузы.
-
-При установке модуля пишет Не совместимо с этой платформой: xxxx
-- В настоящее время модуль поддерживает только платформу arm-v8a, а другие платформы временно не поддерживают его.
-
-## 🚀 Скачать
-- [Перейдите на Github для загрузки](https://github.com/OneB1ank/A1Memory/releases)
-
-## 🌟Любимый тренд
-
-
-
-
-
-
-
-
-
-## 🙏 Спасибо
-
-Благодаря исходному коду следующих пользователей или проектов за их помощь в этом проекте:
-- [@yc9559](https://github.com/yc9559)
-- [@HChenX](https://github.com/HChenX)
-
-Спасибо следующим пользователям за отзывы о тестировании и обнаружение ошибок:
-- @火機(coolapk)
-
-## 🎉 Пожертвовать на поддержку
-Как вы думаете, этот модуль очень полезен, вы можете пожертвовать, чтобы поддержать меня
-- [爱发电](https://afdian.net/a/HCha1)
-- [patreon](https://patreon.com/A1memory)
-- USDT(TRC20)
- > Address: TSqTqn2NcyUAbEwsdGgsrYoU5pokno5PnQ
diff --git a/README-zh.md b/README-zh.md
deleted file mode 100644
index 3292985..0000000
--- a/README-zh.md
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-## ✨重要功能
-- 管理后台进程存活和死亡
-- 指定释放后台应用子进程
-- 阻止Low Memory Killer Daemon杀后台
-- 自动释放非常用内存
-- 让应用休眠减少CPU和内存使用
-
-## 💡说明
-- 该模块只支持Android8 ~ 14,平台仅支持arm64-v8a
-- Magisk不低于20.4+,ksu大部分可兼容
-- 此模块基本不会与其他模块产生冲突
-
-### 默认列表路径
-
-- 名单列表:/sdcard/Android/HChai/HC_memory/名单列表.conf
-
-## 📱终端UI
-自定义开关功能,只支持简单的功能开关,更具体的参数配置请查看📝自定义配置。
-
-如何打开终端UI界面?
-- 可在Termux中使用`amui`命令,也可在mt管理器中执行/sdcard/Android/HChai/HC_memory/`terminal.sh`
-
-如何保存和开关功能?
-- 使用方向键来控制,回车保存。
-- 如果没有键盘点击右下角lm呼出键盘。
-
-功能作用?
-- 之后会在终端UI中添加说明,目前只有Json配置说明。
-
-## 📝自定义配置
-自带配置适用于绝大多数设备,但还是有一些设备不适用默认配置,因此开放更多内置可调参数。在设计HAMv2框架时遍已经考虑到该需求,绝大多数的参数都可自定义调整,而且此项目可嵌入到其他模块中运行。Json配置文件位于`/data/adb/modules/Hc_memory/config/memory.json`
-
-### 项目信息
-```json
-"project": {
- "name": "官方配置 [23.06.25]",
- "author": "火機@coolapk"
-}
-```
-
-| 字段名 | 类型 | 描述 |
-| ------ | ------ | ------------------ |
-| name | string | 配置文件的名称 |
-| author | string | 配置文件的作者信息 |
-
-`name`与`author`在日志以如下方式体现:
-```
-[2023-07-06 19:00:22] [info] config 官方配置 [23.06.25] | by: 火機@coolapk
-```
-
-- 更详细的json配置文件说明请参考[这里](config/JSON-CONFIG-zh.md)
-
-## 🔍常见问题
-
-可以搭配其他内存优化模块吗?
-- A1内存管理与其他内存优化原理完全不同,因此搭配其他模块效果只会是1+1=2。
-
-是否会耗电?
-- 完全不会。我在开发HAMv2框架时,花费了大量时间来优化核心代码,并采用了底层的C/C++语言。因此,该框架所造成的耗电量微乎其微,可以忽略不计。
-
-与其他Magisk模块或者Xp模块会造成冲突吗?
-- 几乎不太可能与其他模块发生冲突,至今尚未遇到与本模块发生冲突的情况。
-
-是否造成待机耗电?
-- HAMv2框架不会导致待机耗电,因为在待机状态下,A1内存管理会进入休眠状态。
-
-启用阻止lmkd杀后台,为什么后台还是被杀了?
-- 因为只阻止lmkd杀后台,不包含各个手机厂商的杀后台程序。
-
-如何配置乖巧列表?
-- 要配置乖巧列表,你需要在相应的列表中添加"KILL 包名:子进程名"的规则。在添加之前,你需要确保了解子进程的功能和作用,以免造成意外问题。
-
-为什么进入系统一段时间后进入fb模式?
-- 出现该问题的大部分都是三星手机,并且启用了hook阻止lmkd杀进程的功能,这可能是导致的原因。目前尚无法解决这个问题,但可以通过关闭阻止lmkd杀进程的功能来解决。
-
-为什么播放音频的进程被暂停了?
-- 音频进程被暂停的情况很少发生,如果确实发生了,可以将该进程添加到白名单中,或者关闭应用休眠功能。这样可以确保音频进程持续运行而不被暂停。
-
-安装模块时提示Not compatible with this platform: xxxx
-- 目前模块仅支持arm-v8a平台,其他平台暂时不支持。
-
-## 🚀下载
-- [前往Github下载](https://github.com/OneB1ank/A1Memory/releases)
-
-## 🌟收藏趋势
-
-
-
-
-
-
-
-
-
-## 🙏致谢
-
-感谢以下用户或项目的源码对本项目的帮助:
-- [@yc9559](https://github.com/yc9559)
-- [@HChenX](https://github.com/HChenX)
-
-感谢以下用户的测试反馈和错误定位:
-- @火機(coolapk)
-
-## 🎉捐赠支持
-如何你觉得这个模块很好用,可以捐赠来支持我
-- [爱发电](https://afdian.net/a/HCha1)
-- [patreon](https://patreon.com/A1memory)
-- USDT(TRC20)
- > 地址: TSqTqn2NcyUAbEwsdGgsrYoU5pokno5PnQ
diff --git a/README.md b/README.md
index 1212bee..858de88 100644
--- a/README.md
+++ b/README.md
@@ -91,7 +91,7 @@ Not compatible with this platform: xxxx error when installing the module.
- Currently, the module only supports the arm-v8a platform and does not support other platforms.
## 🚀download
-- [Go to Github to download](https://github.com/Referrance/B1Mem/releases)
+- [Go to Github to download](https://github.com/chaprnks/B1Mem/releases)
## 🙏Acknowledgments
diff --git a/module/LICENSE b/module/LICENSE
new file mode 100644
index 0000000..f288702
--- /dev/null
+++ b/module/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/module/NOTICE b/module/NOTICE
new file mode 100644
index 0000000..d6d5fa6
--- /dev/null
+++ b/module/NOTICE
@@ -0,0 +1,45 @@
+A1Memroy
+
+Third-Party Software Notices and Information
+============================================
+
+This repository incorporates components from the following projects:
+
+1. Dobby (https://github.com/jmpews/Dobby): a lightweight, multi-platform, multi-architecture hook framework.
+
+ - License: Apache License 2.0 (https://github.com/jmpews/Dobby/blob/master/LICENSE)
+ - Copyright: jmpews
+ - Other relevant information: Please refer to the Dobby project for additional details and acknowledgments.
+
+2. And64InlineHook (https://github.com/Rprop/And64InlineHook): Lightweight ARMv8-A(ARM64, AArch64, Little-Endian) Inline Hook Library for Android C/C++
+
+ - License: MIT License (https://github.com/Rprop/And64InlineHook/blob/master/LICENSE)
+ - Copyright: Rprop
+ - Other relevant information: Please refer to the And64InlineHook project for additional details and acknowledgments.
+
+3. json (https://github.com/nlohmann/json): JSON for Modern C++
+
+ - License: MIT License (https://github.com/nlohmann/json/blob/develop/LICENSE.MIT)
+ - Copyright: nlohmann
+ - Other relevant information: Please refer to the json project for additional details and acknowledgments.
+
+4. spdlog (https://github.com/gabime/spdlog): Fast C++ logging library.
+
+ - License: MIT License (https://github.com/gabime/spdlog/blob/v1.x/LICENSE)
+ - Copyright: gabime
+ - Other relevant information: Please refer to the spdlog project for additional details and acknowledgments.
+
+5. imgui (https://github.com/ocornut/imgui): Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
+
+ - License: MIT License (https://github.com/ocornut/imgui/blob/master/LICENSE.txt)
+ - Copyright: ocornut
+ - Other relevant information: Please refer to the imgui project for additional details and acknowledgments.
+
+6. FTXUI (https://github.com/ArthurSonzogni/FTXUI): 💻 C++ Functional Terminal User Interface. ❤️
+
+ - License: MIT License (https://github.com/ArthurSonzogni/FTXUI/blob/main/LICENSE)
+ - Copyright: ArthurSonzogni
+ - Other relevant information: Please refer to the FTXUI project for additional details and acknowledgments.
+
+Please refer to the individual components' licenses and original sources for more detailed information.
+The licenses and copyright notices for each component can be found in their respective source code files or accompanying documentation.
diff --git a/module/README.md b/module/README.md
new file mode 100644
index 0000000..1212bee
--- /dev/null
+++ b/module/README.md
@@ -0,0 +1,107 @@
+### Help would be appreciated for translating project to English
+## Some code is proprietary and I can't edit it. Would appreciate help
+
+
+
B1 memory management
+
+
+
+
Third-party Android memory management, aimed to be less aggressive, for low RAM devices
+
+
+## What does it do?
+- Managing the survival and termination of background processes
+- Specifying the release of background application child processes
+- Preventing Low Memory Killer Daemon from killing background processes
+- Automatically releasing non-essential memory
+- Putting applications to sleep to reduce CPU and memory usage
+
+## 💡Description
+- This module only supports Android 8 to 16 (only tested on 15), and arm64-v8a.
+- Latest Magisk version should be used, and KernelSu is working.
+- This module is not known to conflict with any others
+
+### Default List Path
+
+- List File: /sdcard/Android/HChai/HC_memory/名单列表.conf
+
+## 📱Terminal UI
+Custom toggle functionality, only supports simple feature toggling. For more detailed parameter configurations, please see 📝 Custom Configuration.
+
+How to access the Terminal UI interface?
+- You can use the `amui` command in Termux or execute /sdcard/Android/HChai/HC_memory/`terminal.sh` in the mt manager.
+
+How to save and toggle features?
+- Use the arrow keys for navigation and press Enter to save.
+- If there's no keyboard, click on the bottom right corner "lm" to summon the keyboard.
+
+What does the feature do?
+- An explanation will be added to the Terminal UI later. Currently, only the Json configuration guide is available.
+
+## 📝Custom Configuration
+The built-in configuration is suitable for most devices, but there are still some devices that may not work with the default configuration. Therefore, more adjustable parameters are provided. This requirement was already taken into consideration when designing the HAMv2 framework, and most parameters can be customized and adjusted. Moreover, this project can be embedded and run within other modules. The JSON configuration file is located at `/data/adb/modules/Hc_memory/config/memory.json`
+
+### Project Information
+```json
+"project": {
+ "name": "官方配置 [23.06.25]",
+ "author": "火機@coolapk"
+}
+```
+
+| Field | Type | Description |
+| ------ | ------ | -------------------------------------------- |
+| name | string | Name of the configuration file |
+| author | string | Author information of the configuration file |
+
+The `name` and `author` are reflected in the logs in the following format:
+```
+[2023-07-06 19:00:22] [info] config 官方配置 [23.06.25] | by: 火機@coolapk
+```
+
+- For more detailed instructions on the JSON configuration file, please refer to[here.](config/JSON-CONFIG.md)
+
+## 🔍Frequently Asked Questions
+
+Can it be used in conjunction with other memory optimization modules?
+- B1 memory management works completely differently from other memory optimization methods, so using it together with other modules will only yield a cumulative effect of 1+1=2.
+
+Does it consume power?
+- Not at all. A considerable amount of time optimizing the core code was spent while developing the HAMv2 framework. It is implemented in low-level languages such as C/C++, resulting in minimal power consumption that can be completely ignored.
+
+Does it conflict with other Magisk modules or Xposed modules?
+- It is highly unlikely to conflict with other modules. So far, no conflicts have been encountered with this module.
+
+Does it cause power consumption during standby?
+- The HAMv2 framework does not cause power consumption during standby, as the B1 memory management enters a sleep state when the device is in standby mode.
+
+Why is the background process still killed even after enabling the lmkd process kill prevention?
+- This is because it only prevents lmkd from killing background processes and does not include the background process killing programs from various phone manufacturers. MIUI/HyperOS are really aggressive with this.
+
+How to configure the smart list?
+- To configure the smart list, you need to add the rule "KILL package_name:subprocess_name" in the respective list. Before adding, make sure you understand the functionality and purpose of the subprocess to avoid any unexpected issues.
+
+Why does the device enter fb mode after a certain period of time?
+- Most cases of this issue occur on Samsung devices when the hook to prevent lmkd process killing is enabled. This is likely the cause of the problem. Currently, there is no solution available, but you can try disabling the hook to prevent lmkd process killing to resolve it.
+
+Why is the process playing audio being paused?
+- The occurrence of audio process being paused is rare. If it indeed happens, you can add the process to the whitelist or disable the app hibernation feature. This will ensure continuous operation of the audio process without being paused.
+
+Not compatible with this platform: xxxx error when installing the module.
+- Currently, the module only supports the arm-v8a platform and does not support other platforms.
+
+## 🚀download
+- [Go to Github to download](https://github.com/Referrance/B1Mem/releases)
+
+
+## 🙏Acknowledgments
+
+Thanks to the following users or projects for their source code contributions to this project:
+- [@yc9559](https://github.com/yc9559)
+- [@HChenX](https://github.com/HChenX)
+
+Thanks to the following users for their testing feedback and bug identification:
+- @火機(coolapk)
+
+Thanks to the really cool guy who originally made this:
+- [@OneB1ank](https://github.com/OneB1ank)
diff --git a/module/changelog.md b/module/changelog.md
new file mode 100644
index 0000000..f92904f
--- /dev/null
+++ b/module/changelog.md
@@ -0,0 +1,158 @@
+# 【更新日志】
+
+## Richard8 2023.11.26
+- 更新ndk到r26b
+- 更新hllvm混淆
+
+## Richard7 2023.11.08
+- 修复Inotify导致的问题
+- 优化代码减少CPU消耗
+
+## Richard6 2023.11.07
+- 更新依赖库
+- Inotify优化减少消耗
+- 优化service.sh代码
+- 删除沉淀代码
+
+## Richard5 2023.11.06
+- 尝试修复Android14无限重启
+- 未实验谨慎更新
+
+## Richard4 2023.11.04
+- 注入支持Android14
+- 修复注入一些问题
+- 注入隐藏避免被检测
+
+## Richard3 2023.10.05
+- 修复小窗不被识别为前台
+- 限制三星开启阻止lmkd
+- 内置/外置参数更变
+
+## Richard2 2023.09.30
+- 重构注入,修复若干个问题
+- 对三星手机不再有注入的限制
+- 大概率解决了注入后导致系统程序出现问题
+
+## Richard1 2023.09.29
+- 添加更加详细的日志问题
+- 更改默认配置
+- 结束Beta测试版
+
+## Beta24 2023.09.27
+- 修复乖巧误识别
+- 修改内存管理前台后台判断逻辑
+
+## Beta23 2023.09.26
+- 修复导致开机时间增加
+- 终端UI添加功能简单说明
+- 修复HEAD不改变
+
+## Beta22 2023.09.25
+- 修复判断sys.boot_completed造成陷入死循环
+
+## Beta21 2023.09.24
+- 预支持Android14
+- 解决多次注入导致lmkd发生错误
+
+## Beta20 2023.09.19
+- 修复了部分手机无法使用v4
+- 减少初始化消耗CPU资源
+- 因争议取消本地socket,并且取消本地模块之间互联,包括未来xp模块与magisk模块相互通信(模块只有本地通信)
+- 优化线程池代码
+
+## Beta19 2023.09.10
+- 减少非必要运行的代码
+- 修改框架核心逻辑
+- 增加线程池
+- 多线程接收/发送socket通信
+
+## Beta18 2023.08.25
+- 修改代码核心逻辑
+- 验证运行环境
+
+## Beta17 2023.08.16
+- 删除非必要的hook
+
+## Beta16 2023.08.15
+- 修复内存阈值逻辑bug
+- 卸载自动删除附加app
+
+## Beta15 2023.08.14
+- 新增西班牙语支持(es-ES)
+- 修复dobby框架导致注入无效
+- 修改判断magisk和ksu的逻辑
+- 附加lsp模块保活后台
+- 修复log文件夹权限被改导致无法创建的问题
+- 新增拦截相机杀后台
+- 修复lmkd进程优先级问题
+
+## Beta14 2023.08.05
+- 支持多国语言(en-US,zh-CN,ru-RU,de-DE)
+- 可自定义添加其他语言
+
+## Beta13 2023.07.30
+- 优化核心代码逻辑
+- 删除部分日志
+
+## Beta12 2023.07.27
+- 终端添加基础功能开关
+- 调整日志输出
+- 配置文件可继承与补丁
+- 说明、专业配置、日志预览、设备参数等等,后续添加
+- 修复面板错误
+
+## Beta11 2023.07.26
+- 预更新终端面板
+- 应用休眠实现方式更改
+- 增加了一些日志
+
+## Beta10 2023.07.18
+- 调整hook代码
+- 减少lmkd进程消耗
+
+## Beta9 2023.07.14
+- 修复了指针异常导致HC_memory进程崩溃
+- 修复了一处可能导致HC_memory进程崩溃的问题
+
+## Beta8 2023.07.13
+- 默认关闭保活和应用休眠
+- 优化注入代码
+- 预加入控制面板
+
+## Beta7 2023.07.12
+- 更改为c++20标准
+- 日志方面进行了优化
+- 修复三星手机无法正常运行的问题
+
+## Beta6 2023.07.11
+- 修复了模块从未生效的问题
+- 修复了一处可能陷入死循环的问题
+- 优化了正则表达式性能
+
+## Beta5 2023.07.10
+- 参数细微调整
+- 更换dobby版本
+- 这次更新不再有问题
+
+## Beta4 2023.07.09
+- 修复休眠后无法唤醒的问题
+- 默认关闭疯狂杀戮
+
+## Beta3 2023.07.08
+- 更改A1发送SIGKILL信号为SIGTERM
+- 内置com.android.shell白名单防止掉root
+- 优化了正则表达式性能
+- 修复重启HC_memory进程不删除旧日志
+
+## Beta2 2023.07.07
+
+- 修复kill面具导致掉root
+- 默认开启疯狂杀戮
+
+## Beta1 2023.07.06
+
+- 重建项目,使用HAMv2框架
+- 相对于内存管理v3.1减少80%性能消耗
+- 改进编译优化,减少二进制体积
+
+## 重要更新在频道通知:[TG频道](https://t.me/HCha1234) | [项目地址](https://github.com/OneB1ank/A1Memory)
\ No newline at end of file
diff --git "a/module/config/HC_memory/\345\220\215\345\215\225\345\210\227\350\241\250.conf" "b/module/config/HC_memory/\345\220\215\345\215\225\345\210\227\350\241\250.conf"
deleted file mode 100644
index 64811c0..0000000
--- "a/module/config/HC_memory/\345\220\215\345\215\225\345\210\227\350\241\250.conf"
+++ /dev/null
@@ -1,124 +0,0 @@
-————————————————————————
-#A1内存管理 配置文件 作者: HChai || A1 Memory Management configuration file Author: HChai
-————————————————————————
-#使用说明 || Instructions for use:
-————————————————————————
-#必须遵守初始化名单的格式 || The format of the initialization list must be followed
-
-#添加到白名单的包名前必须添加WHITE
-#WHITE must be added before the package name added to the whitelist
-
-#添加到乖巧名单的包名跟白名单同理,添加KILL
-#The package name added to the list of child processes to be killed is the same as the white list, add KILL
-
-#如果你不按照规定随意添加,A1内存管理将会直接失效
-#If you do not follow the regulations to add at will, A1 memory management will directly fail
-
-#我相信只要你不是傻瓜,都会按照下面的初始化名单列表格式添加包名
-#I believe as long as you are not a fool, you will add the package name according to the initialization list list format below
-
-#注释字符串一定要添加#
-#The comment string must add #
-
-————————————————————————
-#白名单 || whitelist:
-————————————————————————
-{
-WHITE com.netease.cloudmusic
-WHITE com.tencent.mm
-WHITE com.tencent.mobileqq
-}
-
-————————————————————————
-#乖巧名单 || list of child processes to kill:
-————————————————————————
-{
-#TIM
-KILL com.tencent.tim:mail
-KILL com.tencent.tim:web
-KILL com.tencent.tim:MSF
-KILL com.tencent.tim:troop
-#QQ
-KILL com.tencent.mobileqq:peak
-KILL com.tencent.mobileqq:qzone
-KILL com.tencent.mobileqq:tool
-#哔哩哔哩 || Bilibili
-KILL tv.danmaku.bili:download
-KILL tv.danmaku.bili:pushservice
-KILL tv.danmaku.bili:web
-#酷安 || coolapk
-KILL com.coolapk.market:xg_vip_service
-#腾讯视频 || QQlive
-KILL com.tencent.qqlive:cache
-KILL com.tencent.qqlive:wxa_container0
-KILL com.tencent.qqlive:services
-KILL com.tencent.ilink.ServiceProcess
-KILL com.tencent.qqlive:pmservice
-KILL com.tencent.qqlive:mini1
-#KILL com.tencent.qqlive:xg_vip_service
-#虎牙 || Huya live
-KILL com.duowan.kiwi:remoteweb
-KILL com.duowan.kiwi:logcat
-KILL com.duowan.kiwi:lelinkps
-KILL com.duowan.kiwi:cloudpatch
-KILL com.duowan.kiwi:Unity
-KILL com.duowan.kiwi:download
-KILL com.duowan.kiwi:pushservice
-#抖音 || douyin
-KILL com.ss.android.ugc.aweme:push
-KILL com.ss.android.ugc.aweme:sandboxed_process1
-KILL com.ss.android.ugc.aweme:pushservice
-#快手 || quick hand
-KILL com.smile.gifmaker:messagesdk
-#微信 || weixin
-KILL com.tencent.mm:toolsmp
-KILL com.tencent.mm:tools
-#美团 || meituan
-KILL com.sankuai.meituan:miniApp0
-KILL com.sankuai.meituan:MgcProcess
-KILL com.sankuai.meituan.takeoutnew:download
-KILL com.sankuai.youxuan:download
-KILL com.sankuai.meituan:dppushservice
-KILL com.sankuai.meituan.takeoutnew:dppushservice
-#网易云 || Netease Music
-KILL com.netease.cloudmusic:videoplay
-KILL com.netease.cloudmusic:viewer
-KILL com.netease.cloudmusic:mp1
-KILL com.netease.cloudmusic:browser
-#喜马拉雅 || Himalaya
-KILL com.ximalaya.ting.android:pushservice
-#百度网盘 || Baidu Baohe
-KILL com.baidu.netdisk:operator_thumbnail
-KILL com.baidu.netdisk:p2p
-#百度贴吧 || Baidu Post Bar
-KILL com.baidu.tieba:media
-KILL com.baidu.tieba:swan0
-KILL com.baidu.tieba:remote
-#知乎 || Quora
-KILL com.zhihu.android:channel
-KILL com.zhihu.android:pushservice
-#番茄小说 || dragon
-KILL com.dragon.read:push
-KILL com.dragon.read:pushservice
-KILL com.dragon.read:sandboxed_process1
-KILL com.dragon.read:sandboxed_process2
-KILL com.dragon.read:sandboxed_process3
-#淘宝 || taobao
-KILL com.taobao.taobao:channel
-KILL com.taobao.taobao:sandboxed_privilege_process0
-KILL com.taobao.taobao:gpu_process
-#闲鱼 || coco
-KILL com.taobao.idlefish:wml1
-KILL com.taobao.idlefish:channel
-#支付宝 || Alipay
-KILL com.eg.android.AlipayGphone:tools
-KILL com.eg.android.AlipayGphone:push
-KILL com.eg.android.AlipayGphone:lite1
-#QQ邮箱 || qq mail
-KILL com.tencent.androidqqmail
-KILL com.tencent.androidqqmail:Push
-#饿了么 || ele
-KILL me.ele:sandboxed_privilege_process0
-KILL me.ele:gpu_process
-KILL me.ele:channel
-}
diff --git a/module/config/JSON-CONFIG.md b/module/config/JSON-CONFIG.md
new file mode 100644
index 0000000..efdc648
--- /dev/null
+++ b/module/config/JSON-CONFIG.md
@@ -0,0 +1,386 @@
+# Description of A1 memory management v4 Json configuration file
+
+A1 Memory Management v4 utilizes the HAMv2 framework, allowing you to adjust memory management parameters through configuration files without modifying the source code. This document will provide a detailed guide on how to configure the JSON configuration file.
+
+## Customizing Modules Parameters
+
+```json
+"config": {
+ "path": "/sdcard/Android/HChai/HC_memory",
+ "modulePath": "/data/adb/modules/Hc_memory",
+ "list": {
+ "name": "名单列表.conf",
+ "whiteList": {
+ "optional": true,
+ "smart": true,
+ "system": false
+ }
+ }
+}
+```
+
+| Field Name | Type | Description |
+| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------------- |
+| path | string | The path to the configuration file. |
+| modulePath | string | The path to the module name. |
+| name | string | The filename of the configuration list file, which stores the whitelist and naughty list. |
+| optional | bool | Indicates whether the whitelist is enabled. When enabled, processes in the whitelist will not be killed. |
+| smart | bool | Indicates whether the smart whitelist is enabled. When enabled, processes will be automatically added to the whitelist. |
+| system | bool | Indicates whether the system whitelist is enabled. When enabled, all system software will be added to the whitelist. |
+
+Please note that when adding entries to the whitelist, they should follow the following format:
+
+```
+WHITE PackageName
+```
+
+## Log path/level
+
+Logging Runtime Logs for A1 Memory Management v4, which can be Adjusted by Modifying Log Path and Log Level.
+
+```json
+"log": {
+ "path": "/sdcard/Android/HChai/HC_memory/Run.log",
+ "level": "info"
+}
+```
+
+| Field Name | Type | Description |
+| ---------- | ------ | --------------------------------------------------------------------- |
+| path | string | The path to the log file. |
+| level | string | The log level. Available options: debug, info, warn, err, critical. |
+
+If you wish to disable logging, you can set the log level to "critical". Alternatively, if you only want to view logs related to runtime errors, you can set the log level to "warn".
+
+## Main function running parameters
+
+The purpose of this parameter is to prevent the execution of the main function when switching to a foreground process within a certain period of time after a change in the foreground application.
+
+```json
+"initProcess": {
+ "afterTopChange": {
+ "sleep": 1
+ }
+}
+```
+
+| Field Name | Type | Description |
+| ---------- | ---- | ---------------------------- |
+| sleep | int | The waiting time in seconds. |
+
+The "sleep" parameter represents the waiting time, in seconds, after a change in the foreground application. Setting it to 1 second means that after a change in the foreground application, the main function will wait for 1 second before being executed again upon switching to the foreground. In other words, during this 1-second interval of foreground switching, the main function will not be executed.
+This parameter can be used to control the avoidance of repetitive execution of the main function within a certain period of time after a change in the foreground application. It helps prevent unnecessary operations or resource wastage.
+
+## A1 memory management ends unnecessary processes
+
+A1 Memory Management v4 can terminate unnecessary processes to free up memory. Here is an example of the parameters used to control this behavior:
+
+```json
+"a1Memory": {
+ "enable": true,
+ "oomAdj": 905
+}
+```
+
+| Field Name | Type | Description |
+| ---------- | ---- | --------------------------------------------------------------------------------------------- |
+| enable | bool | Indicates whether to enable the termination of unnecessary processes by A1 Memory Management. |
+| oomAdj | int | Only processes with an oomAdj value greater than the specified value will be terminated. |
+
+- `enable`: Specifies whether to enable A1 Memory Management to terminate unnecessary processes. When set to true, A1 Memory Management will perform process termination. When set to false, A1 Memory Management will not terminate any processes.
+- `oomAdj`: Represents the adjustment value used to determine whether a process should be terminated. Only processes with an oomAdj value greater than the specified "oomAdj" value will be terminated by A1 Memory Management. The "oomAdj" value ranges from 0 to 1000. A higher value will result in fewer terminated processes, while a lower value will result in more terminated processes. It is important to note that not all processes will be identified and terminated. Only processes deemed unnecessary by the algorithm and with an oomAdj value higher than the specified threshold will be terminated.
+
+## Let the application automatically release memory
+
+A1 Memory Management v4 can enable automatic memory release for applications. Here is an example of the parameters used to control this behavior:
+
+```json
+"initCutMemory": {
+ "freed": {
+ "enable": true,
+ "level": "80",
+ "regex": "( CAC|SVC|CEM).*",
+ "change": 20
+ }
+}
+```
+
+| Field Name | Type | Description |
+| ---------- | ------ | ---------------------------------------------------------------------------------------------------- |
+| enable | bool | Indicates whether to enable automatic memory release for applications. |
+| level | string | A value between 0 and 100, where higher values result in more memory being released. |
+| regex | string | A regular expression used to match the application status for which memory release is required. |
+| change | int | Specifies the number of foreground switches before triggering an automatic memory release operation. |
+
+- `enable`: Specifies whether to enable automatic memory release for applications. When set to true, A1 Memory Management will perform automatic memory release operations for applications. When set to false, A1 Memory Management will not perform automatic memory release operations.
+- `level`: Determines the extent of memory release. The value ranges from 0 to 100, where higher values indicate a greater amount of memory being released, and lower values indicate less memory being released.
+- `regex`: Specifies a regular expression used to match the application status for which memory release is required. Only applications that match the defined regex pattern will have their memory released. The regex pattern follows the same rules as the JavaScript language. You can refer to[this link](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions)for more information on regular expressions in JavaScript.
+- `change`: Specifies the number of foreground application switches before triggering an automatic memory release operation. It is recommended to set this value between 10 and 30.
+
+How do I know which applications' memory needs to be released? You can obtain the status by using a command:
+```shell
+Command: dumpsys activity lru
+Output: ACTIVITY MANAGER LRU PROCESSES (dumpsys activity lru)
+ Activities:
+ #67: fg TOP LCMN 6918:bin.mt.plus/u0a226 act:activities|recents
+ #66: vis BFGS ---N 3152:com.miui.home/u0a80 act:activities
+ #65: prev LAST ---- 25424:com.omarea.vtools/u0a672 act:activities|recents
+ #64: cch CAC ---- 5586:com.kiwibrowser.browser/u0a91 act:activities|recents
+ #63: cch CACC ---- 5961:com.kiwibrowser.browser:kiwi_sandboxed_process0:org.chromium.content.app.KiwiSandboxedProcessService0:4/u0a91i-8996 act:client
+ #62: cch+10 CAC ---- 22204:com.tencent.mobileqq/u0a481 act:activities|recents
+ #61: cch+10 CACC ---- 22308:com.tencent.mobileqq:MSF/u0a481 act:client
+ #60: cch+20 CACC ---- 5715:com.kiwibrowser.browser:kiwi_privileged_process0/u0a91 act:client
+ #59: cch+20 CACC ---- 5748:com.kiwibrowser.browser:kiwi_sandboxed_process0:org.chromium.content.app.KiwiSandboxedProcessService0:1/u0a91i-8999 act:client
+ #58: hvy CAC ---- 31098:com.coolapk.market/u0a677 act:activities|recents
+ #57: hvy SVC ---- 9696:com.tencent.mm/u0a201 act:activities|recents
+ #56: vis SVC ---- 4370:com.google.android.gms/u0a159 act:client
+ #55: vis BFGS ---N 4265:com.google.android.gms.persistent/u0a159 act:client
+ #54: hvy SVC ---- 9290:com.tencent.mm:push/u0a201 act:client
+ #53: cch+30 CACC ---- 6104:com.kiwibrowser.browser:kiwi_sandboxed_process0:org.chromium.content.app.KiwiSandboxedProcessService0:5/u0a91i-8995 act:client
+ #52: hvy CAC ---- 22734:org.telegram.plus/u0a386 act:activities|recents
+ #51: hvy CAC ---- 24029:mark.via/u0a222 act:activities|recents
+ #50: cch+30 CACC ---- 24074:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0/u0a222i1 act:client
+ #49: cch+40 CAC ---- 25274:com.google.android.apps.translate/u0a548 act:activities|recents
+ #48: hvy CAC ---- 21987:com.github.kr328.clash/u0a329 act:activities|recents
+ Other:
+ #47: fg BTOP ---N 4315:com.miui.securitycenter.remote/1000
+ #46: vis BFGS ---N 4948:com.miui.powerkeeper/1000
+ #45: cch+ 5 CEM ---- 4209:com.miui.weather2/u0a203
+ #44: vis BTOP ---N 4853:com.miui.securitycenter.bootaware/1000
+ #43: cch+15 CEM ---- 11717:com.android.mms/u0a66
+ #42: cch+25 CEM ---- 7159:egrn.pucm.pgo/u0a764
+ #41: psvc PER LCMN 4197:com.android.providers.media.module/u0a197
+ #40: prcp FGS ---N 5977:com.miui.gallery/u0a68
+ #39: vis FGS ---N 22036:com.github.kr328.clash:background/u0a329 act:client
+ #38: cch+35 SVC ---- 31061:com.android.settings:remote/1000
+ #37: svcb SVC ---- 4569:com.xiaomi.xmsf/u0a141
+ #36: cch+45 CEM ---- 5950:com.xiaomi.aiasst.service/1000
+ #35: prcp FGS ---N 20376:com.miui.misound/u0a126
+ #34: fg BFGS ---N 5543:com.xiaomi.misettings:remote/1000
+ #33: fg FGS ---N 5665:com.miui.notification:remote/1000
+ #32: cch+55 CEM ---- 4396:com.android.providers.calendar/u0a50
+ #31: cch+65 CEM ---- 9210:com.xiaomi.market:guard/u0a117
+ #30: hvy CEM ---- 9075:com.xiaomi.joyose/1000
+ #29: cch+75 CEM ---- 8819:com.miui.core/u0a145
+ #28: cch+85 CEM ---- 8352:com.android.shell/2000
+ #27: prcp TRNB ---- 4793:com.lbe.security.miui/u0a52
+ #26: vis BFGS LCMN 5035:com.sohu.inputmethod.sogou.xiaomi/u0a134 act:treated
+ #25: pers PER LCMN 4180:com.miui.face/1000
+ #24: pers PER LCMN 4171:com.qualcomm.location/u0a182
+ #23: pers PER LCMN 4149:org.mipay.android.manager/u0a150
+ #22: pers PER LCMN 4130:com.tencent.soter.soterserver/u0a151 act:client
+ #21: pers PER LCMN 4126:com.qualcomm.qti.workloadclassifier/u0a191
+ #20: pers PER LCMN 4073:com.xiaomi.mircs/u0a76
+ #19: pers PER LCMN 4081:com.xiaomi.xmsfkeeper/u0a140
+ #18: pers PER LCMN 4061:com.miui.voicetrigger/u0a102
+ #17: pers PER LCMN 4038:.slas/1000
+ #16: pers PER LCMN 4001:system/u0a46
+ #15: pers PER LCMN 4003:org.ifaa.aidl.manager/u0a149
+ #14: pers PER LCMN 3996:com.android.nfc/1027
+ #13: pers PER LCMN 3967:com.miui.contentcatcher/1000
+ #12: vis BFGS LCMN 2913:com.miui.miwallpaper/u0a119
+ #11: vis IMPF ---- 3432:com.android.smspush/u0a187
+ #10: pers PER LCMN 3135:com.android.systemui/1000
+ # 9: pers PER LCMN 3119:com.android.phone/1001
+ # 8: pers PER LCMN 3104:com.xiaomi.finddevice/6110
+ # 7: pers PER LCMN 3103:com.android.se/1068
+ # 6: pers PER LCMN 3137:.dataservices/1001
+ # 5: pers PER LCMN 3106:com.qualcomm.qti.devicestatisticsservice/u0a161
+ # 4: pers PER LCMN 3094:org.codeaurora.ims/u0a184
+ # 3: pers PER LCMN 3098:com.qti.qualcomm.mstatssystemservice/u0a186
+ # 2: pers PER LCMN 3072:com.qti.phone/u0a175
+ # 1: pers PER LCMN 3051:.qtidataservices/u0a148
+ # 0: sys PER LCMN 1824:system/1000
+```
+You are correct that you may not be familiar with the meaning of the process states. Let me provide a brief explanation:
+- PER (Persistent): This is a permanent state indicating that the process will not be killed by the system. It typically applies to critical system processes, such as system services.
+- PERU (Persistent and Upward): This is also a permanent state but allows the system to terminate the process when memory is low. This means the process can be killed under certain circumstances but will generally remain running.
+- TOP (Top): This indicates that the process is the currently visible foreground application, meaning the application with which the user is actively interacting.
+- BTOP (Bound Top): This is a state similar to TOP, but the system may choose to terminate the process due to memory constraints. This often occurs when the device is running multiple applications and memory is scarce.
+- FGS (Foreground Service): It indicates that the process is providing a foreground service. Foreground services are services that interact with the user and may display notifications or other user interfaces.
+- BFGS (Bound Foreground Service): Similar to FGS, but the system may terminate the process due to memory constraints.
+- IMPF (Important Background): This indicates that the process is an important background process performing critical tasks but does not need to be shown in the foreground to the user.
+- IMPB (Important Background and Upward): This is a state similar to IMPF, but the system may choose to terminate the process due to memory constraints.
+- TRNB (Trusted Background): It represents a trusted background process performing trusted tasks.
+- BKUP (Backup): It signifies that the process is performing application backup operations, such as backing up data to the cloud or other storage devices.
+- SVC (Service): It denotes that the process is a background service performing certain functionalities without the need to be displayed in the foreground to the user.
+- RCVR (Receiver): It indicates that the process is a broadcast receiver used to receive and handle broadcast messages sent by the system or applications.
+- TPSL (Top Sleeping): It represents a process in the top-level sleep state, where the application is in sleep mode but still remains in the foreground.
+- HVY (Heavy Weight): It signifies that the process is a heavyweight process, usually because it utilizes a significant amount of system resources, such as memory or CPU.
+- HOME: It indicates that the process is the main home screen application of the device, i.e., the user's desktop.
+- LAST: It represents the process of the previously terminated application.
+- CAC (Cached Activity Client): It signifies that the process is a cached activity client, typically an application running in the background.
+- CACC (Cached Recent): It represents a cached recent activity client that is often terminated when memory is low.
+- CRE (Cached Empty): It indicates that the process is a cached empty process with no active tasks.
+- CEM (Cached Empty and Maintained): It denotes a cached empty process that may be terminated when memory is low.
+- NONE: It signifies that the process has no state or its state cannot be determined.
+
+## Hook injection related parameters
+
+A1 Memory Management v4 can utilize hooks to prevent lmkd (low memory killer daemon) from killing background processes. Below is an example of the parameters used to control this behavior:
+
+```json
+"initInjection": {
+ "enable": true,
+ "processName": "/system/bin/lmkd",
+ "symbolsFunc": "hc_hook",
+ "libraryPath": "/data/adb/modules/Hc_memory/lib/arm64-v8a/libhook_lmkd.so",
+ "lmkd": {
+ "memThreshold": {
+ "enable": true,
+ "value": 90
+ },
+ "hookFunc": {
+ "kill": true,
+ "pidfd_send_signal": true,
+ "__android_log_print": false,
+ "meminfo": {
+ "updateTime": 60
+ }
+ },
+ "model": {
+ "inlineHook": "dobby"
+ }
+ }
+}
+```
+
+| Field Name | Type | Description |
+| ------------- | ------ | -------------------------------------------------- |
+| initInjection | object | Initialization injection configuration. |
+| enable | bool | Indicates whether to enable lmkd hooking. |
+| processName | string | The name of the process. |
+| symbolsFunc | string | The name of the function to execute after hooking. |
+| libraryPath | string | The path to the hook library. |
+
+You can modify the path to inject your hook library into the specified process. I recommend using the absolute path for the process name.
+- `initInjection`: Represents the configuration for initialization injection.
+- `enable`Indicates whether to enable lmkd hooking. When set to true, A1 Memory Management will hook lmkd. When set to false, A1 Memory Management will not hook lmkd.
+
+### memory threshold
+
+| Field Name | Type | Description |
+| ------------ | ------ | -------------------------------------------------------------------------------------- |
+| memThreshold | object | Memory threshold configuration. |
+| enable | bool | Indicates whether to enable the memory threshold. |
+| value | int | The value at which the memory usage reaches 90%, allowing lmkd to terminate processes. |
+
+The memory threshold feature is important as it allows you to stop preventing lmkd from terminating processes when the memory usage reaches a certain level. This feature helps prevent excessive memory usage, which can lead to system lag, but it may result in background processes being terminated. Therefore, you can control the prevention of lmkd from terminating processes by setting the memory threshold.
+- `memThreshold`: Represents the memory threshold feature.
+- `enable`: Indicates whether to enable the memory threshold feature. When set to true, A1 Memory Management will enable the memory threshold feature. When set to false, A1 Memory Management will not enable the memory threshold feature.
+- `value`: Specifies the threshold at which the memory usage reaches 90%. Once the memory usage exceeds this threshold, A1 Memory Management will no longer prevent lmkd from terminating processes.
+
+### Selecting the functions to hook
+
+| Field Name | Type | Description |
+| ------------------- | ------ | ------------------------------------------------------------- |
+| hookFunc | object | Function hook configuration. |
+| kill | bool | Indicates whether to hook the `kill` function. |
+| pidfd_send_signal | bool | Indicates whether to hook the `pidfd_send_signal` function. |
+| __android_log_print | bool | Indicates whether to hook the `__android_log_print` function. |
+| meminfo | object | Memory information configuration. |
+| updateTime | int | Update time in seconds for the memory information. |
+
+- `hookFunc`: Represents the function hook configuration.
+- `kill`: When set to true, A1 Memory Management will hook the `kill` function. When set to false, A1 Memory Management will not hook the `kill` function.
+- `pidfd_send_signal`: When set to true, A1 Memory Management will hook the `pidfd_send_signal` function to prevent process termination. When set to false, A1 Memory Management will not hook the `pidfd_send_signal` function.
+- `__android_log_print`: When set to true, A1 Memory Management will hook the `__android_log_print` function. When set to false, A1 Memory Management will not hook the `__android_log_print` function. It is not recommended to enable this feature as it may prevent log outputs and potentially cause lmkd abnormalities.
+
+### Memory information refresh time
+
+To efficiently avoid performance impact caused by repetitive refreshing of meminfo memory information, you can control the update interval by setting the updateTime parameter.
+- `meminfo`: Represents the memory information.
+- `updateTime`: Specifies the update interval for the occupied memory percentage. It is recommended to set the value between 30 and 90. A higher value results in longer update intervals and lower performance impact, while a lower value leads to shorter update intervals and higher performance impact.
+
+| Field Name | Type | Description |
+| ---------- | ------ | ------------------- |
+| model | object | Mode configuration. |
+| inlineHook | string | Inline hook mode. |
+
+- `model`Represents the mode configuration.
+- `inlineHook`By default, A1 Memory Management v4 uses[dobby](https://github.com/jmpews/Dobby)for modifying function addresses. If the hooking process is not working as expected, you can try modifying it to [And64InlineHook](https://github.com/Rprop/And64InlineHook).
+## Enabling app hibernation reduces CPU and memory usage.
+
+A1 Memory Management v4 can enable app hibernation to reduce CPU and memory usage. Here is an example of the parameters used to control this behavior:
+
+| Field Name | Type | Description |
+| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| appSleep | object | App hibernation configuration. |
+| enable | bool | Indicates whether to enable app hibernation to reduce CPU and memory usage. |
+| idle | string | User idle setting: "all" for all users, "current" for the current user (not applicable to multi-user environments). |
+| bg | string | Background app status setting: "ignore" to ignore wake-up and launch requests, "allow" to allow wake-up and launch requests, "deny" to deny wake-up and launch requests. |
+| top | string | Foreground app status setting: Same options as `bg`. |
+
+- `enable`: Set to true to enable app hibernation and reduce CPU and memory usage; set to false to disable it.
+- `idle`: User idle setting. Available values are "all" (all users) and "current" (the current user). Note that "current" setting does not apply in multi-user environments.
+- `bg`: Background app status setting. Available values are "ignore" (ignore wake-up and launch requests), "allow" (allow wake-up and launch requests), and "deny" (deny wake-up and launch requests).
+- `top`: Foreground app status setting. Same options as `bg` parameter.
+
+## Clever Mode
+
+In simple terms, Clever Mode is designed to kill an application's child processes and attempt to prevent the main process from relaunching the child processes, thereby reducing the CPU and memory usage of the application.
+To meet the diverse needs of users, A1 Memory Management v4 already includes some child processes of applications by default. However, it may not cover all scenarios. If you need to kill other child processes, you can add them by editing the whitelist.conf file. Here is an example of the format for the whitelist.conf file:
+```
+KILL package_name:child_process_name
+```
+
+| Field Name | Type | Description |
+| ---------- | ------ | ---------------------------------------- |
+| clever | object | Clever Mode configuration. |
+| enable | bool | Indicates whether to enable Clever Mode. |
+
+## Crazy Kill
+
+The Crazy Kill feature utilizes kernel APIs to kill certain processes. Currently, the exact mechanism behind it is not clear, but it can effectively terminate specific processes. It is speculated that it may be based on the OOM (Out of Memory) score of the processes. Below is an example of the parameters used to control this behavior:
+
+| Field Name | Type | Description |
+| ---------- | ------ | --------------------------------------- |
+| crazyKill | object | Crazy Kill configuration. |
+| enable | bool | Indicates whether to enable Crazy Kill. |
+
+## Write Content to File
+
+You can write content to files using A1 Memory Management v4. Below is an example of the parameters used to control this behavior:
+
+```json
+"file": {
+ "write": [
+ {
+ "path": "/proc/sys/fs/inotify/max_queued_events",
+ "content": "102400"
+ },
+ {
+ "path": "/proc/sys/fs/inotify/max_user_watches",
+ "content": "102400"
+ },
+ ...
+ ]
+}
+```
+
+In the above example, we write content to two files, enabling the inotify feature.
+
+| Field Name | Type | Description |
+| ---------- | ------ | ------------------------------- |
+| write | array | Write content to files. |
+| path | string | File path. |
+| content | string | Content to write into the file. |
+
+### Restart the Phone or Terminate HC_memory Process to Apply Configuration Changes
+
+## Acknowledgments
+
+Thanks to the following users or projects for their source code contributions to this project:
+- [@yc9559](https://github.com/yc9559)
+- [@HChenX](https://github.com/HChenX)
+
+Thanks to the following users for their testing feedback and bug identification:
+- @火機(coolapk)
+
+## Support Donations
+If you find this module useful, you can make a donation to support me.
+- [爱发电](https://afdian.net/a/HCha1)
+- [patreon](https://patreon.com/A1memory)
+- USDT(TRC20)
+ > Address: TSqTqn2NcyUAbEwsdGgsrYoU5pokno5PnQ
+
diff --git a/module/config/Language/language.json b/module/config/Language/language.json
deleted file mode 100644
index b9adfa5..0000000
--- a/module/config/Language/language.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "language": [
- {
- "name": "简体中文",
- "path": "/data/adb/modules/Hc_memory/config/Language/list/zh-CN.json"
- },
- {
- "name": "English",
- "path": "/data/adb/modules/Hc_memory/config/Language/list/en-US.json"
- },
- {
- "name": "Русский",
- "path": "/data/adb/modules/Hc_memory/config/Language/list/ru-RU.json"
- },
- {
- "name": "Deutsch",
- "path": "/data/adb/modules/Hc_memory/config/Language/list/de-DE.json"
- },
- {
- "name": "Español",
- "path": "/data/adb/modules/Hc_memory/config/Language/list/es-ES.json"
- }
- ]
-}
\ No newline at end of file
diff --git a/module/config/Language/list/de-DE.json b/module/config/Language/list/de-DE.json
deleted file mode 100644
index d3546ff..0000000
--- a/module/config/Language/list/de-DE.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "htop": {
- "cpu_usage": "Gesamte CPU-Auslastung: ",
- "network": "Netzwerk [MiB/s] [Hoch/Runter]",
- "ram": "Speicher [%]",
- "ram_usage": "Physische Speicherauslastung",
- "swap_usage": "Virtuelle Speicherauslastung",
- "title": "Startseite"
- },
- "fswitch": {
- "title": "Funktionen",
- "function_switch": {
- "title": "Funktionsumschalter",
- "clever": "Clever-Modus",
- "a1Memory": "A1-Speicherverwaltung",
- "CutMemoryFreed": "Speicherfreigabe",
- "appSleep": "App-Schlaf",
- "crazyKill": "Prozessbeendigung",
- "injection": "Injektion in Aktivität",
- "memThreshold": "Speicherschwelle"
- },
- "numerical_parameter": {
- "title": "Numerische Parameter",
- "memThreshold_value": "Schwelle: ",
- "memThreshold_slider": "Schwellen-Schieberegler"
- }
- },
- "other": {
- "save": "[Speichern]",
- "quit": "[Beenden]",
- "teffect": "[Sofort anwenden]",
- "join": "[TG-Kanal beitreten]",
- "github": "[GitHub-Projekt]"
- },
- "feature_Description": {
- "clever": {
- "Description_title": "Schlauer Modus",
- "Description": "Beendet benutzerdefinierte Prozesse, um Speicher freizugeben; diese werden nur beendet, wenn sie nicht im Vordergrund laufen."
- },
- "a1Memory": {
- "Description_title": "A1 Speicherverwaltung",
- "Description": "Verwaltet den Speicher automatisch und wählt je nach Situation aus, ob ein Teil des Speichers eines Prozesses freigegeben oder die Prozesse bei Bedarf direkt beendet werden."
- },
- "CutMemoryFreed": {
- "Description_title": "Speicherfreigabe",
- "Description": "Standardmäßig wird der Speicherverbrauch von zwischengespeicherten Prozessen reduziert. Aber keine Sorge, dies dient nur dazu, sie speichereffizienter zu machen und beendet diese Prozesse nicht wirklich."
- },
- "appSleep": {
- "Description_title": "App Schlafmodus",
- "Description": "Diese Funktion verhindert, dass Unterprozesse einer App nach ihrer Beendigung neu gestartet werden. Obwohl sie nicht zu 100% den Neustart von Unterprozessen verhindern kann, hilft sie auch, den Speicher- und CPU-Verbrauch zu reduzieren."
- },
- "crazyKill": {
- "Description_title": "Intensives Beenden",
- "Description": "Ruft eine Kernel-Schnittstelle auf, um Speicher freizugeben, auch wenn die spezifischen Kriterien nicht sehr klar sind. Basierend auf aktuellen Überprüfungen hilft es jedoch, das Telefon flüssiger laufen zu lassen. Beachten Sie jedoch, dass einige Hintergrund-App-Prozesse möglicherweise beendet werden."
- },
- "injection": {
- "Description_title": "lmkd verhindern",
- "Description": "Verknüpft und injiziert in lmkd, modifiziert seine Ausführungslogik und verhindert so, dass es Hintergrund-App-Prozesse beendet. Das bedeutet, dass Sie viele App-Prozesse ausführen können, ohne sich Gedanken darüber zu machen, dass sie beendet werden. Seien Sie jedoch vorsichtig, da zu viele App-Prozesse dazu führen könnten, dass das Telefon weniger flüssig läuft."
- },
- "memThreshold": {
- "Description_title": "Speicherschwelle",
- "Description": "Wenn diese Funktion aktiviert ist und der physische Speicherverbrauch einen bestimmten Schwellenwert erreicht, darf lmkd App-Prozesse beenden, wodurch Telefonverzögerungen oder erzwungene Neustarts verhindert werden. Bitte beachten Sie, dass diese Funktion nur aktiv wird, wenn lmkd verhindert ist."
- }
- },
- "tag": {
- "content": "Bitte schließen Sie die Memory-Management-Benutzeroberfläche, um unnötigen Batterieverbrauch zu vermeiden. Nach dem Speichern der Konfiguration in der Benutzeroberfläche sollten Sie diese unbedingt beenden.",
- "title": "Bitte speichern Sie die Konfiguration und starten Sie das Telefon neu, Prozess: UI_memory"
- }
-}
\ No newline at end of file
diff --git a/module/config/Language/list/es-ES.json b/module/config/Language/list/es-ES.json
deleted file mode 100644
index 4853ae6..0000000
--- a/module/config/Language/list/es-ES.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "htop": {
- "cpu_usage": "Uso total de CPU: ",
- "network": "Red [MiB/s] [Subir/Descargar]",
- "ram": "Memoria [%]",
- "ram_usage": "Uso de memoria física",
- "swap_usage": "Uso de memoria virtual",
- "title": "Inicio"
- },
- "fswitch": {
- "title": "Función",
- "function_switch": {
- "title": "Interruptor de función",
- "clever": "Modo astuto",
- "a1Memory": "Gestión de memoria A1",
- "CutMemoryFreed": "Liberación de memoria",
- "appSleep": "Hibernación de aplicación",
- "crazyKill": "Proceso de eliminación masiva",
- "injection": "Prevenir lmkd",
- "memThreshold": "Umbral de memoria"
- },
- "numerical_parameter": {
- "title": "Parámetros numéricos",
- "memThreshold_value": "Umbral: ",
- "memThreshold_slider": "Deslizador de umbral"
- }
- },
- "other": {
- "save": "[Guardar]",
- "quit": "[Salir]",
- "teffect": "[Aplicar ahora]",
- "join": "[Unirse al canal TG]",
- "github": "[Proyecto de GitHub]"
- },
- "feature_Description": {
- "clever": {
- "Description_title": "Modo Astuto",
- "Description": "Termina los procesos agregados personalizados para liberar memoria, solo se finalizarán si no están en primer plano."
- },
- "a1Memory": {
- "Description_title": "Gestión de memoria A1",
- "Description": "Administra automáticamente la memoria, eligiendo liberar parte de la memoria del proceso o, si es necesario, finalizar estos procesos directamente."
- },
- "CutMemoryFreed": {
- "Description_title": "Liberación de memoria",
- "Description": "Por defecto reduce el uso de memoria de los procesos en caché. Pero no te preocupes, esto solo es para que sean más eficientes en el uso de memoria y no finalizará estos procesos."
- },
- "appSleep": {
- "Description_title": "Suspensión de la aplicación",
- "Description": "Esta función evita que los subprocesos de la aplicación se reinicien después de ser finalizados. Aunque no garantiza un 100% de prevención de reinicio, también ayuda a reducir el uso de memoria y CPU."
- },
- "crazyKill": {
- "Description_title": "Finalización intensiva",
- "Description": "Invoca una interfaz del núcleo para liberar memoria, aunque los criterios exactos aún no están claros. Sin embargo, según las pruebas actuales, puede hacer que el teléfono funcione más fluidamente. Pero ten en cuenta que puede finalizar algunos procesos de aplicaciones en segundo plano."
- },
- "injection": {
- "Description_title": "Bloqueo de lmkd",
- "Description": "Inyección hook en lmkd, modificando su lógica de ejecución, evitando que finalice procesos de aplicaciones en segundo plano. Esto significa que puedes tener muchos procesos de aplicaciones ejecutándose sin preocuparte de que sean finalizados. Sin embargo, ten en cuenta que tener demasiados procesos puede hacer que el teléfono funcione con menos fluidez."
- },
- "memThreshold": {
- "Description_title": "Umbral de memoria",
- "Description": "Al activar esta función, cuando el uso de memoria física alcance un umbral especificado, lmkd puede finalizar procesos de la aplicación, evitando así bloqueos o reinicios del teléfono. Es importante saber que esta función solo estará activa si se bloquea lmkd."
- }
- },
- "tag": {
- "content": "Por favor, cierre la interfaz de gestión de memoria para evitar un consumo innecesario de energía en segundo plano. Una vez que haya guardado la configuración en la interfaz, salga.",
- "title": "Por favor, guarde la configuración y reinicie el teléfono. Proceso: UI_memory"
- }
-}
diff --git a/module/config/Language/list/ru-RU.json b/module/config/Language/list/ru-RU.json
deleted file mode 100644
index 2ed8cad..0000000
--- a/module/config/Language/list/ru-RU.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "htop": {
- "cpu_usage": "Общее использование ЦП: ",
- "network": "Сеть [MiB/s] [Вверх/Вниз]",
- "ram": "Память [%]",
- "ram_usage": "Использование физической памяти",
- "swap_usage": "Использование виртуальной памяти",
- "title": "Главная"
- },
- "fswitch": {
- "title": "Функции",
- "function_switch": {
- "title": "Переключатели функций",
- "clever": "Режим умной оптимизации",
- "a1Memory": "Управление памятью A1",
- "CutMemoryFreed": "Освобождение памяти",
- "appSleep": "Сон приложений",
- "crazyKill": "Убийство процессов",
- "injection": "Инъекция в активность",
- "memThreshold": "Порог памяти"
- },
- "numerical_parameter": {
- "title": "Числовые параметры",
- "memThreshold_value": "Порог: ",
- "memThreshold_slider": "Ползунок порога"
- }
- },
- "other": {
- "save": "[Сохранить]",
- "quit": "[Выход]",
- "teffect": "[Применить сейчас]",
- "join": "[Присоединиться к TG-каналу]",
- "github": "[GitHub проект]"
- },
- "feature_Description": {
- "clever": {
- "Description_title": "Умный режим",
- "Description": "Завершает процессы, добавленные пользователем, чтобы освободить память. Завершает только в фоновом режиме."
- },
- "a1Memory": {
- "Description_title": "Управление памятью A1",
- "Description": "Автоматическое управление памятью. Освобождает часть памяти процесса или завершает процессы при необходимости."
- },
- "CutMemoryFreed": {
- "Description_title": "Освобождение памяти",
- "Description": "По умолчанию уменьшает использование памяти кэш-процессами. Не беспокойтесь, это только для экономии памяти, не завершая эти процессы."
- },
- "appSleep": {
- "Description_title": "Сон приложения",
- "Description": "Эта функция предотвращает перезапуск дочерних процессов приложения после их завершения. Хотя она не может гарантировать предотвращение перезапуска, она также помогает уменьшить использование памяти и CPU."
- },
- "crazyKill": {
- "Description_title": "Безумное завершение",
- "Description": "Вызывает ядерный интерфейс для освобождения памяти, хотя конкретные критерии еще не совсем ясны. Однако, на основе текущей проверки, он действительно может сделать работу телефона более плавной. Но стоит помнить, что это может привести к завершению некоторых фоновых приложений."
- },
- "injection": {
- "Description_title": "Блокировка lmkd",
- "Description": "Hook-инъекция в lmkd, изменяя его логику выполнения, предотвращая завершение фоновых приложений. Это означает, что вы можете запустить множество процессов приложений, не боясь, что их убьют. Однако следует помнить, что запуск слишком многих процессов может замедлить работу телефона."
- },
- "memThreshold": {
- "Description_title": "Порог памяти",
- "Description": "При включении этой функции, когда физическая память достигает определенного уровня использования, lmkd может завершить процессы приложения, предотвращая торможение или перезагрузку устройства. Стоит помнить, что это будет работать только при блокировке lmkd."
- }
- },
- "tag": {
- "content": "Пожалуйста, закройте интерфейс управления памятью, чтобы избежать ненужного потребления заряда батареи. После сохранения конфигурации в интерфейсе обязательно выйдите из него.",
- "title": "Пожалуйста, сохраните конфигурацию и перезагрузите телефон. Процесс: UI_memory"
- }
-}
\ No newline at end of file
diff --git a/module/config/Language/list/zh-CN.json b/module/config/Language/list/zh-CN.json
deleted file mode 100644
index 00817f9..0000000
--- a/module/config/Language/list/zh-CN.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "htop": {
- "cpu_usage": "CPU 总使用率: ",
- "network": "网络 [MiB/s] [上/下]",
- "ram": "内存 [%]",
- "ram_usage": "物理内存使用率",
- "swap_usage": "虚拟内存使用率",
- "title": "主页"
- },
- "fswitch": {
- "title": "功能",
- "function_switch": {
- "title": "功能开关",
- "clever": "乖巧模式",
- "a1Memory": "A1内存管理",
- "CutMemoryFreed": "内存释放",
- "appSleep": "应用休眠",
- "crazyKill": "狂杀进程",
- "injection": "阻止lmkd",
- "memThreshold": "内存阈值"
- },
- "numerical_parameter": {
- "title": "数值参数",
- "memThreshold_value": "阈值: ",
- "memThreshold_slider": "阈值滑块"
- }
- },
- "other": {
- "save": "[保存]",
- "quit": "[退出]",
- "teffect": "[立刻生效]",
- "join": "[加入TG频道]",
- "github": "[GitHub项目]"
- },
- "feature_Description": {
- "clever": {
- "Description_title": "乖巧模式-说明",
- "Description": "结束自定义添加的进程来释放内存,非前台状态下才会结束。"
- },
- "a1Memory": {
- "Description_title": "A1内存管理-说明",
- "Description": "自动管理内存根据情况选择释放 进程的部分内存,或者在必要时 直接结束这些进程。"
- },
- "CutMemoryFreed": {
- "Description_title": "内存释放-说明",
- "Description": "默认是减少缓存进程的内存占用。不过 不用担心,这只是为了让它们更加节省 内存,并不会真的结束这些进程。"
- },
- "appSleep": {
- "Description_title": "应用休眠-说明",
- "Description": "该功能为了防止应用的子进程在被杀死后重新启动。虽然不能百分百保 证阻止子进程重启,但同时它们也帮助减少了内存和CPU的使用。"
- },
- "crazyKill": {
- "Description_title": "狂杀进程-说明",
- "Description": "调用了内核接口来释放内存,尽管它的具体判定条件还不太清楚。但根 据目前的验证,它确实可以让手机运行得更加流畅。不过,需要注意的 是,这可能会导致一些后台应用进程被结束。"
- },
- "injection": {
- "Description_title": "阻止lmkd-说明",
- "Description": "hook注入lmkd,修改了其运行逻辑, 从而避免了它结束后台的应用进程. 这意味着你可以开启很多应用进程 而不用担心它们被杀。但要注意, 开启过多的应用进程不杀可能会使 手机不流畅。"
- },
- "memThreshold": {
- "Description_title": "内存阈值-说明",
- "Description": "开启此功能,当物理内存使用率 达到指定的阈后,将允许lmkd结 束应用进程,从而避免手机出现 卡顿或死机重启的情况。需要注 意的是,只有在开启阻止lmkd后, 这个功能才会生效。"
- }
- },
- "tag": {
- "content": "请关闭内存管理UI避免造成意外的后台耗电,使用UI保存配置后一定要退出。",
- "title": "请保存配置后重启手机,进程:UI_memory"
- }
-}
\ No newline at end of file
diff --git a/module/config/README.md b/module/config/README.md
new file mode 100644
index 0000000..20f2d45
--- /dev/null
+++ b/module/config/README.md
@@ -0,0 +1,3 @@
+## A1内存管理Json配置文件说明
+
+[English document](JSON-CONFIG.md) | [中文文档](JSON-CONFIG-zh.md) | [Русский язык](JSON-CONFIG-ru.md)
\ No newline at end of file
diff --git a/module/config/memory.json b/module/config/memory.json
new file mode 100644
index 0000000..f935406
--- /dev/null
+++ b/module/config/memory.json
@@ -0,0 +1,92 @@
+{
+ "project": {
+ "name": "官方配置 [23.09.29]",
+ "author": "火機@coolapk"
+ },
+ "modules": {
+ "config": {
+ "path": "/sdcard/Android/HChai/HC_memory",
+ "modulePath": "/data/adb/modules/Hc_memory",
+ "list": {
+ "name": "list.conf",
+ "whiteList": {
+ "optional": true,
+ "smart": true,
+ "system": false
+ }
+ }
+ },
+ "log": {
+ "path": "/sdcard/Android/HChai/HC_memory/Run.log",
+ "level": "info"
+ },
+ "initProcess": {
+ "afterTopChange": {
+ "sleep": 2
+ }
+ },
+ "a1Memory": {
+ "enable": true,
+ "oomAdj": 905
+ },
+ "initCutMemory": {
+ "freed": {
+ "enable": true,
+ "level": "80",
+ "regex": "( CAC|SVC|CEM).*",
+ "change": 20
+ }
+ },
+ "initInjection": {
+ "enable": false,
+ "processName": "/system/bin/lmkd",
+ "symbolsFunc": "hc_hook",
+ "libraryPath": "/data/adb/modules/Hc_memory/lib/arm64-v8a/libhook_lmkd.so",
+ "lmkd": {
+ "memThreshold": {
+ "enable": true,
+ "value": 85
+ },
+ "hookFunc": {
+ "kill": true,
+ "pidfd_send_signal": true,
+ "__android_log_print": false,
+ "meminfo": {
+ "updateTime": 30
+ }
+ },
+ "model": {
+ "inlineHook": "dobby"
+ }
+ }
+ },
+ "appSleep": {
+ "enable": false,
+ "idle": "current",
+ "bg": "ignore",
+ "top": "allow"
+ },
+ "clever": {
+ "enable": true
+ },
+ "crazyKill": {
+ "enable": false
+ }
+ },
+ "file": {
+ "write": [
+ {
+ "path": "/proc/sys/fs/inotify/max_queued_events",
+ "content": "16384"
+ },
+ {
+ "path": "/proc/sys/fs/inotify/max_user_watches",
+ "content": "98304"
+ },
+ {
+ "path": "/proc/sys/fs/inotify/max_user_instances",
+ "content": "896"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/module/image/list.jpg b/module/image/list.jpg
new file mode 100644
index 0000000..04bf314
Binary files /dev/null and b/module/image/list.jpg differ
diff --git a/module/image/ui_us.jpg b/module/image/ui_us.jpg
new file mode 100644
index 0000000..f0450da
Binary files /dev/null and b/module/image/ui_us.jpg differ
diff --git a/module/magisk.sh b/module/magisk.sh
new file mode 100644
index 0000000..51674d7
--- /dev/null
+++ b/module/magisk.sh
@@ -0,0 +1,28 @@
+#
+# OneB1ank
+#
+
+set -e
+
+MODPATH=${0%/*}
+CURRENT_DATE=$(date +%Y-%m-%d)
+
+init() {
+ cd $MODPATH/module
+ echo "- Switch to Module Path"
+}
+
+packaged_Modules() {
+ cp -f $MODPATH/config/memory.json $MODPATH/module/config/memory.json
+ zip -r -9 "A1Memory-$CURRENT_DATE.zip" *
+ mv -f "A1Memory-$CURRENT_DATE.zip" "../build/"
+ echo "- Packaging successful: Module Name" "A1Memory-$CURRENT_DATE.zip"
+}
+
+clear() {
+ rm config/memory.json
+}
+
+init
+packaged_Modules
+clear
\ No newline at end of file
diff --git a/module/module.prop b/module/module.prop
deleted file mode 100644
index a12ad31..0000000
--- a/module/module.prop
+++ /dev/null
@@ -1,8 +0,0 @@
-id=Hc_memory
-name=B1Mem
-version=v4 (2026.02)
-versionCode=439
-author=HChai, Referrance
-description=Third-party memory management, support Android 8 ~ 14. project: https://github.com/Referrance/B1Mem
-updateJson=https://ghproxy.com/https://raw.githubusercontent.com/OneB1ank/A1Memory/main/version.json
-originalAuthor=HChai
diff --git a/module/module/B1Memory.zip b/module/module/B1Memory.zip
new file mode 100644
index 0000000..c65d9be
Binary files /dev/null and b/module/module/B1Memory.zip differ
diff --git a/module/HC_memory b/module/module/HC_memory
similarity index 100%
rename from module/HC_memory
rename to module/module/HC_memory
diff --git a/module/META-INF/com/google/android/update-binary b/module/module/META-INF/com/google/android/update-binary
similarity index 100%
rename from module/META-INF/com/google/android/update-binary
rename to module/module/META-INF/com/google/android/update-binary
diff --git a/module/META-INF/com/google/android/updater-script b/module/module/META-INF/com/google/android/updater-script
similarity index 100%
rename from module/META-INF/com/google/android/updater-script
rename to module/module/META-INF/com/google/android/updater-script
diff --git a/module/app/app-release.apk b/module/module/app/app-release.apk
similarity index 60%
rename from module/app/app-release.apk
rename to module/module/app/app-release.apk
index 2724783..bb92393 100644
Binary files a/module/app/app-release.apk and b/module/module/app/app-release.apk differ
diff --git a/module/module/config/HC_memory/List.conf b/module/module/config/HC_memory/List.conf
new file mode 100644
index 0000000..f98405a
--- /dev/null
+++ b/module/module/config/HC_memory/List.conf
@@ -0,0 +1,17 @@
+————————————————————————
+# HChai || A1 Memory Management configuration file Author: HChai
+————————————————————————
+# whitelist:
+————————————————————————
+{
+WHITE com.workyard.crew
+WHITE com.google.android.inputmethod.latin
+WHITE com.teslacoilsw.launcher
+WHITE org.telegram.plus
+}
+
+————————————————————————
+# kill list:
+————————————————————————
+{
+}
diff --git a/module/module/config/Language/language.json b/module/module/config/Language/language.json
new file mode 100644
index 0000000..dcff0ad
--- /dev/null
+++ b/module/module/config/Language/language.json
@@ -0,0 +1,8 @@
+{
+ "language": [
+ {
+ "name": "English",
+ "path": "/data/adb/modules/Hc_memory/config/Language/list/en-US.json"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/module/config/Language/list/en-US.json b/module/module/config/Language/list/en-US.json
similarity index 100%
rename from module/config/Language/list/en-US.json
rename to module/module/config/Language/list/en-US.json
diff --git a/module/module/config/memory.json b/module/module/config/memory.json
new file mode 100644
index 0000000..f935406
--- /dev/null
+++ b/module/module/config/memory.json
@@ -0,0 +1,92 @@
+{
+ "project": {
+ "name": "官方配置 [23.09.29]",
+ "author": "火機@coolapk"
+ },
+ "modules": {
+ "config": {
+ "path": "/sdcard/Android/HChai/HC_memory",
+ "modulePath": "/data/adb/modules/Hc_memory",
+ "list": {
+ "name": "list.conf",
+ "whiteList": {
+ "optional": true,
+ "smart": true,
+ "system": false
+ }
+ }
+ },
+ "log": {
+ "path": "/sdcard/Android/HChai/HC_memory/Run.log",
+ "level": "info"
+ },
+ "initProcess": {
+ "afterTopChange": {
+ "sleep": 2
+ }
+ },
+ "a1Memory": {
+ "enable": true,
+ "oomAdj": 905
+ },
+ "initCutMemory": {
+ "freed": {
+ "enable": true,
+ "level": "80",
+ "regex": "( CAC|SVC|CEM).*",
+ "change": 20
+ }
+ },
+ "initInjection": {
+ "enable": false,
+ "processName": "/system/bin/lmkd",
+ "symbolsFunc": "hc_hook",
+ "libraryPath": "/data/adb/modules/Hc_memory/lib/arm64-v8a/libhook_lmkd.so",
+ "lmkd": {
+ "memThreshold": {
+ "enable": true,
+ "value": 85
+ },
+ "hookFunc": {
+ "kill": true,
+ "pidfd_send_signal": true,
+ "__android_log_print": false,
+ "meminfo": {
+ "updateTime": 30
+ }
+ },
+ "model": {
+ "inlineHook": "dobby"
+ }
+ }
+ },
+ "appSleep": {
+ "enable": false,
+ "idle": "current",
+ "bg": "ignore",
+ "top": "allow"
+ },
+ "clever": {
+ "enable": true
+ },
+ "crazyKill": {
+ "enable": false
+ }
+ },
+ "file": {
+ "write": [
+ {
+ "path": "/proc/sys/fs/inotify/max_queued_events",
+ "content": "16384"
+ },
+ {
+ "path": "/proc/sys/fs/inotify/max_user_watches",
+ "content": "98304"
+ },
+ {
+ "path": "/proc/sys/fs/inotify/max_user_instances",
+ "content": "896"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/module/customize.sh b/module/module/customize.sh
similarity index 66%
rename from module/customize.sh
rename to module/module/customize.sh
index 5a28646..1f78a21 100644
--- a/module/customize.sh
+++ b/module/module/customize.sh
@@ -1,18 +1,5 @@
#
-#Copyright (C) 2022-2023 OneB1ank
-#
-#This program is free module: you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation, either version 3 of the License, or
-#(at your option) any later version.
-#
-#This program is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with this program. If not, see .
+# OneB1ank
#
CONFIG_PATH="/sdcard/Android/HChai/HC_memory"
@@ -26,7 +13,7 @@ LMKDRC_PATH="/system/etc/init/lmkd.rc"
config() {
[ ! -d "$CONFIG_PATH" ] && mkdir -p "$CONFIG_PATH"
- [ ! -f "$CONFIG_PATH/名单列表.conf" ] && cp "$MODPATH/config/HC_memory/名单列表.conf" "$CONFIG_PATH"
+ [ ! -f "$CONFIG_PATH/List.conf" ] && cp "$MODPATH/config/HC_memory/List.conf" "$CONFIG_PATH"
rm -rf "$MODPATH/config/HC_memory"
[ -f "$MODULE_PATH/config/memory.json" ] && cp "$MODULE_PATH/config/memory.json" "$MODPATH/config/memory.json"
cp "$MODPATH/system/bin/amui" "$CONFIG_PATH/terminal.sh"
diff --git a/module/lib/arm64-v8a/libhook_lmkd.so b/module/module/lib/arm64-v8a/libhook_lmkd.so
similarity index 100%
rename from module/lib/arm64-v8a/libhook_lmkd.so
rename to module/module/lib/arm64-v8a/libhook_lmkd.so
diff --git a/module/module/module.prop b/module/module/module.prop
new file mode 100644
index 0000000..903a4c7
--- /dev/null
+++ b/module/module/module.prop
@@ -0,0 +1,8 @@
+id=Hc_memory
+name=B1Mem
+version=v4 (2026.02)
+versionCode=439
+author=HChai, Referrance
+description=Third-party memory management, support Android 8 ~ 14. project
+updateJson=https://raw.githubusercontent.com/Referrance/B1Mem/main/version.json
+originalAuthor=HChai
\ No newline at end of file
diff --git a/module/module/service.sh b/module/module/service.sh
new file mode 100644
index 0000000..309c03b
--- /dev/null
+++ b/module/module/service.sh
@@ -0,0 +1,36 @@
+#!/system/bin/sh
+#
+# OneB1ank
+#
+
+# Define Module Directory
+MODDIR="$(dirname "$0")"
+COUNT=0
+
+# Waiting for the device to complete booting...
+while [ "$(getprop sys.boot_completed)" != "1" ] && [ $COUNT -lt 3]; do
+ sleep 10
+ COUNT=$((COUNT+1))
+done
+
+adjustPermissions() {
+ local dir="$1"
+ chmod u+r,u+w,g+r,g+w,o+r,o+w "$dir"
+}
+
+init() {
+ cd $MODDIR
+ logfile_path=$(grep -A 3 '"log":' config/memory.json | grep '"path":' | awk -F'"path": "' '{print $2}' | awk -F'"' '{print $1}')
+}
+
+memory() {
+ rm -rf "$logfile_path"
+ touch "$logfile_path"
+ $MODDIR/HC_memory
+ sleep 60
+ memory
+}
+
+init
+adjustPermissions "/data/media/0/Android/HChai/HC_memory"
+memory
\ No newline at end of file
diff --git a/module/system.prop b/module/module/system.prop
similarity index 100%
rename from module/system.prop
rename to module/module/system.prop
diff --git a/module/system/bin/UI_memory b/module/module/system/bin/UI_memory
similarity index 100%
rename from module/system/bin/UI_memory
rename to module/module/system/bin/UI_memory
diff --git a/module/system/bin/amui b/module/module/system/bin/amui
similarity index 100%
rename from module/system/bin/amui
rename to module/module/system/bin/amui
diff --git a/module/module/uninstall.sh b/module/module/uninstall.sh
new file mode 100644
index 0000000..1780838
--- /dev/null
+++ b/module/module/uninstall.sh
@@ -0,0 +1,8 @@
+#
+# OneB1ank
+#
+
+rm -rf /sdcard/Android/HChai/HC_memory
+rm -rf /data/HC_memory
+rm -rf /data/HC_language
+pm uninstall com.hchai.rescueplan
\ No newline at end of file
diff --git a/module/service.sh b/module/service.sh
deleted file mode 100644
index 9d3c47a..0000000
--- a/module/service.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/system/bin/sh
-#
-#Copyright (C) 2022-2023 OneB1ank
-#
-#This program is free module: you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation, either version 3 of the License, or
-#(at your option) any later version.
-#
-#This program is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with this program. If not, see .
-#
-
-# 定义模块目录
-MODDIR="$(dirname "$0")"
-COUNT=0
-
-# 等待设备完成引导
-while [ "$(getprop sys.boot_completed)" != "1" ] && [ $COUNT -lt 3]; do
- sleep 10
- COUNT=$((COUNT+1))
-done
-
-adjustPermissions() {
- local dir="$1"
- chmod u+r,u+w,g+r,g+w,o+r,o+w "$dir"
-}
-
-init() {
- cd $MODDIR
- logfile_path=$(grep -A 3 '"log":' config/memory.json | grep '"path":' | awk -F'"path": "' '{print $2}' | awk -F'"' '{print $1}')
-}
-
-memory() {
- rm -rf "$logfile_path"
- touch "$logfile_path"
- $MODDIR/HC_memory
- sleep 60
- memory
-}
-
-init
-adjustPermissions "/data/media/0/Android/HChai/HC_memory"
-memory
\ No newline at end of file
diff --git a/module/uninstall.sh b/module/uninstall.sh
deleted file mode 100644
index e8a396f..0000000
--- a/module/uninstall.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-#Copyright (C) 2022-2023 OneB1ank
-#
-#This program is free module: you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation, either version 3 of the License, or
-#(at your option) any later version.
-#
-#This program is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with this program. If not, see .
-#
-
-rm -rf /sdcard/Android/HChai/HC_memory
-rm -rf /data/HC_memory
-rm -rf /data/HC_language
-pm uninstall com.hchai.rescueplan
\ No newline at end of file
diff --git a/module/version.json b/module/version.json
new file mode 100644
index 0000000..a2ccf07
--- /dev/null
+++ b/module/version.json
@@ -0,0 +1,6 @@
+{
+ "version": "v4 (2023.11.26)",
+ "versionCode": 439,
+ "zipUrl": "https://ghproxy.com/https://github.com/OneB1ank/A1Memory/releases/download/Richard8/A1Memory-2023-11-26.zip",
+ "changelog": "https://ghproxy.com/https://raw.githubusercontent.com/OneB1ank/A1Memory/main/changelog.md"
+}
\ No newline at end of file