MIUI Anesthetist

A better view:
https://github.com/neoblackxt/MIUIAnesthetist/blob/master/README.md

一个更好的视图:
https://github.com/neoblackxt/MIUIAnesthetist/blob/master/README_zh.md

MIUI Anesthetist
Carry out surgical strikes against MIUI. This module is committed to remove the limitations of MIUI, allowing you to enter the God mode of MIUI.

FEATURES
Disable MIUI integrity check during boot to prevent boot-loop, so that you can safely force delete System Updater and other system apps.

Remove limit for disabling some packages and prevent some packages from re-enabling during reboot.(For some ultra-sticky system apps we have to reboot after disabling them to take effect)

Prevent MI Market from hijacking Google Play on MIUI China ROMs. Thanks to & for the inspiration from: 跟悟空扯关系@CoolApk 去除MIUI强制调用小米应用商店(非改build)、ccat3z@github 我不要小米应用市场

Remove limit for third-party launchers on MIUI China ROMs. Thanks to & for the inspiration from: tianma8023@github FuckMiui

Allow users to use Security - Manage apps to disable system apps.

Remove limit for installing system apps from unofficial channels on MIUI China ROMs.

USAGE
Install and enable this Xposed module, then reboot.

Freely disable the packages which you don't need. (These packages will be keep disabled after updating system)

To remove system apps, use MIUI Anesthetist Helper Magisk module(hereinafter referred to as "helper module") in release, and Magisk Manager for Recovery Mode(hereinafter referred to as "mm") is also needed. (These packages will be kept removed after updating system)
Modify install.sh file in helper module: add the directory paths which the apps you want to remove are located in to REPLACE="", one path per line, there is a good example in a couple of lines above in this file. Once finished, you can add it to Magisk Manager or install it in recovery mode.
This helper module only removes MiuiSuperMarket by default, it's useless for MIUI global edition users, so remove that line.
You may share your modified and tested helper modules with you friends. :)

Learn more: Magisk guides

NOTICE
The toolchain is as: Magisk -> (Riru-Core) -> (Riru-Ed)Xposed -> MIUI Anesthetist

You should flash Magisk immediately as soon as you update system in recovery mode to ensure the toolchain is working.

If this module is disabled by accident, its magic will disappear and then your phone may boot-loop. (See RESCUE)
The case can be:
①This Xposed module is disabled
②Xposed framework is disabled
③Magisk which Xposed relies on is disabled
④After reinstalling or updating this Xposed module, Xposed installer doesn't detect its update.(You have to disable it and then re-enable it manually in Xposed module list)

Some system apps are Android core programs, they should never be disabled or removed. If you have no idea about a system app, you should Google it first and think twice.

RESCUE
If you have disabled some system apps, remove or rename /data/system/users/0/package-restrictions.xml file to reset disabling app settings.

If you have removed some system apps, disable the helper module using mm to recover all system apps. BTW, you'd better read its README to know its usage early.

If you have really removed some system app files from ROM, flash ROM (NOT need to wipe /data).

Advanced:
①In /data/system/users/0/package-restrictions.xml file, the enabled attribute determines if a package is disabled. enabled=3 means it is disabled, and remove enabled=3 to enable it.
②Magisk determines if a Magisk module is enabled by looking for /data/adb/modules/<module-id>/disable file. If it exists, it means the module is disabled.(Some old versions don't support this)
③(Ed)Xposed's config file is /data/user_de/0/<(Ed)Xposed-installer(manager)-package-name>/conf/modules.list file, its format is Xposed module apk files' absolute paths, one path per line, like /data/app/<Xposed-module-package-name>-<random-string>/base.apk

MISCELLANEOUS
Help me translate or optimize this README if you like.

MIUI麻醉师
对MIUI进行外科手术式打击。此模块致力于解除MIUI的各种功能限制,让你对MIUI开启上帝模式。

功能特性
禁止MIUI系统启动时检查自身完整性,防止删除系统应用后出现循环重启问题(如小米应用商店、系统更新等)。

解除MIUI系统部分系统应用、组件不能被冻结的限制,并且避免被冻结的应用在重启后自动解冻。(对于一些特别顽固的应用需要冻结后再重启才能生效,全球上网必须在MConnService(VsimCore.apk)冻结之后才能成功冻结)

禁止MIUI系统将小米应用商店自动设置为默认应用商店劫持Google Play应用商店。(其实就是去你大爷的小米应用商店) 感谢&启发自:跟悟空扯关系@酷安网 去除MIUI强制调用小米应用商店(非改build)、ccat3z@github 我不要小米应用市场

解除MIUI系统对于未认证的第三方桌面的限制。感谢&启发自:tianma8023@github 糙米

开启 安全中心 -> 应用管理 的停用系统应用的功能。

解除无法从非官方渠道安装系统应用的限制。

使用方法
安装并启用此Xposed模块,重启系统。

使用太极框架的用户须安装太极Magisk开启太极阳,按需添加应用: 应用包管理组件、安全中心、设置。

用任何你喜欢的工具/方式冻结你需要冻结的应用。即使安装系统更新,应用也会保持被冻结的状态。

使用release中的MIUI麻醉师助手Magisk模块(以下简称助手模块)移除你想要移除的系统应用,并安装mm管理器。即使安装系统更新,应用也会保持被移除的状态。
此助手模块默认只移除小米应用商店。修改此模块中的install.sh文件,将你想要移除的应用的所在目录填写在REPLACE=""中,一行一个,格式参照文件中上面几行的例子。修改完成后在Magisk Manager中安装它或在recovery模式下刷入它。
你可以将你修改过的并且测试过没有问题的助手模块分享给你网络社区中的朋友们 :)

更多信息:Magisk模块指南

注意事项
工具链是这样的:Magisk -> (Riru-Core) -> (Riru-Ed)Xposed -> MIUI Anesthetist

通过recovery模式升级系统后,应立即刷入Magisk,然后才能开机,以确保工具链有效。

一旦因误操作致使工具链断裂,此模块功能失效,手机可能无法开机进入系统。解决方案见下方的救援部分。
可能致使工具链断裂的情况有:
①禁用此Xposed模块
②禁用Xposed框架
③禁用Xposed框架依附的Magisk
④重新安装/版本升级此模块后,Xposed Installer没检测到此模块更新(此时必须手动关闭再打开才能再次启用)

有一些系统应用是安卓的核心程序,这些应用是绝对不可以被冻结或者删除的。如果你不了解某个应用,你应该先谷歌一下,三思而后行。

救援
如果因冻结系统应用而无法开机,删除或重命名/data/system/users/0/package-restrictions.xml文件可以重置应用冻结设置。
操作方法:
①在TWRP recovery的 高级 -> 文件管理 中找到该文件删除。
②在recovery终端中执行命令rm /data/system/users/0/package-restrictions.xml。
③用电脑连接recovery模式中的手机,在cmd中执行adb shell,然后rm /data/system/users/0/package-restrictions.xml。
刷机不会有任何帮助,擦除/data分区是可行的但没必要,因为那样会丢失除了/sdcard之外的所有数据。

如果因删除系统应用无法开机,在recovery模式用mm管理器禁用助手模块即可恢复所有系统应用。你最好提前阅读它的使用说明。

如果你没有使用助手模块而是用文件管理器彻底删掉了某个系统应用,可通过刷机恢复(不必清除/data分区)。

高级:
①/data/system/users/0/package-restrictions.xml文件中有关冻结的元素属性是enabled,enabled=3为冻结,删除enabled=3即解冻。
②Magisk配置模块是否启用的方式是查看/data/adb/modules/<module-id>/disable文件是否存在,存在为禁用,反之为启用(旧版Magisk不支持此方式)
③(Ed)Xposed启用模块的配置文件为/data/user_de/0/<(Ed)Xposed-installer(manager)-package-name>/conf/modules.list,配置格式为Xposed模块apk文件的绝对路径,每行一个,形如/data/app/<Xposed-module-package-name>-<random-string>/base.apk

Author(s): 
Package: 
com.xposed.miuianesthetist
Version name: 
3.0
Release type: 
Stable (low risk of bugs)
Number of downloads: 
1,944 in total · 35 in the last 24 hours
MD5 checksum: 
276defa5565681dbcbf150e3e6ed1289
Uploaded on: 
Wednesday, July 17, 2019 - 15:32
Changes: 

1. Optimization: prevent some ultra sticky system apps from running after disabled. (such as MiuiDaemon, reboot to take effect)
2. Add feature: allow users to use Security - Manage apps to disable system apps.
3. Add feature: remove limit for third-party launcher on MIUI China ROMs.

See README https://github.com/neoblackxt/MIUIAnesthetist/blob/master/README.md
查看 读我 https://github.com/neoblackxt/MIUIAnesthetist/blob/master/README_zh.md

Version name: 
2.1
Release type: 
Stable (low risk of bugs)
Number of downloads: 
1,042 in total · 0 in the last 24 hours
MD5 checksum: 
0e792e17a19a79e710abe16cff7870d3
Uploaded on: 
Tuesday, June 4, 2019 - 15:49
Changes: 

Fix bug: prevent hijacking Google Play feature on MIUI China ROMs maybe cause lose default launcher, .apk files can't be opened and voice assistant can't be awaken by volume button.

Version name: 
2.0
Release type: 
Stable (low risk of bugs)
Number of downloads: 
341 in total · 1 in the last 24 hours
MD5 checksum: 
50df13d0e10b8e7c5e7158a6cff809d2
Uploaded on: 
Tuesday, May 28, 2019 - 20:56
Changes: 

1. Add feature: remove limit for disabling some packages
2. Add feature: prevent MI Market from hijacking Google Play on MIUI China ROMs

Version name: 
1.0
Release type: 
Stable (low risk of bugs)
Number of downloads: 
118 in total · 0 in the last 24 hours
MD5 checksum: 
b43b24a38fd0d0df682540e6ce08e460
Uploaded on: 
Tuesday, May 28, 2019 - 01:38
Changes: 

Disable MIUI integrity check when boot