[Magisk] zgfg:
Magisk Module Systemless Debloater

Download:

GitHub - zgfg/SystemlessDebloater: Select and systemlessly debloat preinstalled system apps. Supporting up to System As Root (SAR), Dynamic partitions and Android 13. Module must be installed through Magisk app, not TWRP

Select and systemlessly debloat preinstalled system apps. Supporting up to System As Root (SAR), Dynamic partitions and Android 13. Module must be installed through Magisk app, not TWRP - zgfg/Syst...

github.com

GitHub - Magisk-Modules-Alt-Repo/SystemlessDebloater: Select and systemlessly debloat preinstalled system apps. Supporting up to System As Root (SAR), Dynamic partitions and Android 13. Module must be installed through Magisk app, not TWRP

Select and systemlessly debloat preinstalled system apps. Supporting up to System As Root (SAR), Dynamic partitions and Android 13. Module must be installed through Magisk app, not TWRP - Magisk-Mo...

github.com

Wiki pages by @ipdev:

ConfigScript

Guide for the Systemless Debloater Module. Contribute to mModule/guide_sDebloater development by creating an account on GitHub.

github.com

with his examples of apps that can be debloated (Android, Google, Oppo, Samsung, Xiaomi, LineageOS):

CommunityList

Guide for the Systemless Debloater Module. Contribute to mModule/guide_sDebloater development by creating an account on GitHub.

github.com

*** Yet another System(less) debloater, how and why?

- Systemless means that all changes made are active only when Magisk is loaded and module is enabled.

For OTA or anything, just disable the module (or boot without Magisk) and your system partitions are no more affected

- For Android up to 9 and/or 10 (depending on devices), system partitions were read-write, hence hard-debloating by use of eg TWRP, Titanium, etc (to delete the pre-installed system apps) was possible

This is no more possible for the phones released with Android 10 and higher.

System (System As Root, Dynamical partitions) becomes read-only on the file-system level and stock apps could be debloated (the same holds for any changes on the system partitions) only by the systemless approach - by use of Magisk to dynamically overlay the required changes at boot time

Hence, this module also uses the Magisk REPLACE mechanism and dynamical mounting through the module's service.sh script

- The module debloates only (stock) apps pre-installed to the system partitions, traditionally named as /system, /system-ext, /product, /vendor and /apex; plus additionally on A12 and A13 devices, variably named system partitions like /india, /my_bigball, etc

Hence sorry, to debloat user apps installed to /data, please use the other methods (first of all, just simply uninstall them or at least uninstall their updates)

- Originally I started development with Xiaomi Mi 9T (MIUI 10-12.5, Android 10-12) and later continued with Xiaomi 11 Lite 5G NE (MIUI 12-13, Android 11-12). However, the module relies on the common Magisk overlay mechanism and the list of apps to be 'debloated' is configurable hence there are many users who successfully use this module on the various other devices (like Pixel, Samsung, One Plus, etc.), with the stock or custom ROMs, and with up to Android 13

- Original, default list coming when the module is installed will be empty - user must define then himself which apps should be debloated, depending on his device, ROM and preferences

To (re)configure the list of apps for debloating, simply edit the (textual) /Download/SystemlessDebloater.cfg config file on Internal memory.

Module automatically installs the config file with instructions inside but with the empty list

(Re)configure your list of system apps you want to debloat, reinstall the module (always through the Magisk Manager, not TWRP) and reboot - to take your changes in effect

You only need to provide the proper names (not package names) for the preinstalled system apps, the module will find their exact System paths

- However, the user bears the risks and responsibility himself (device may no more boot when certain system apps are removed/debloated) but the Troubleshooting section below provides instructions how to recover, even from the bootloop cases

Nevertheless, whenever you want to 'debloat' some service or app you are not familiar with, please google first to find what that app is really about and is it generally safe to be debloated (on your but also on the other phones and even by other methods, it doesn't matter)

Don't be afraid of the module and debloating, but be cautious what are you going to debloat

*** Installation

- Download the latest module from GitHub - scroll down, open Assets and find the latest v1.5.4 zip:

Release Systemless Debloater v1.5.4 · zgfg/SystemlessDebloater

Fix for SystemlessDebloater.cfg for Magisk v26.3

github.com

- In Magisk app (manage), open Modules tab and take Install from storage, navigate to the downloaded SystemlessDebloater.zip (as is, do not unzip)

Read what Magisk prints while installing and find the module's log in /Download/SystemlessDebloater.log file on Internal memory

To finish the installation (it applies to all Magisk modules), reboot the phone

- First time the module will not debloat anything - it will just create the input/config file /Download/SystemlessDebloater.cfg on Internal memory

Open that config file, read the instructions in the file and fill your own list of app names for debloating - look at the commented examples you will find in that config file

- Save the config file, reinstall the module and reboot.

Inspect the log and consult the Troubleshooting section below if needed

- To find what system apps you have on your phone and what are their exact names, scroll down through the SystemlessDebloater.log to the "System apps, not debloated" section

Find e.g. a line:

/system/app/Email (com.android.email)

Then copy/add just the Email name (supposed that you want to debloat the built-in Email app) into the SystemlessDebloater.cfg config file

Repeat for the other apps you want to debloat. Then reinstall the module (only on the reinstallation, module processes the config file) and reboot

Fine tune your list of apps for debloating but every time reinstall the module and reboot

- Last but not the least: Once debloated, apps can no more be found (until you reconfigure, disable or uninstall the debloater) under the Settings / Apps

Hence, if you want to delete their cache or data, do Clear cache/data before debloating the apps

Moreover, before trying to debloat any app, look first if you could simply Uninstall that app (ie, if it was a user and not the system app) from Settings / Apps

If Uninstall is not available for that app, try to Uninstall updates: updates are also installed to Data while SystemlessDebloater 'debloats' only from the System - hence the app's update on Data may still remain there

*** Troubleshooting

- What if I eg have configured the app EMail to debloat, but the app is still present?

Check if you have missed to perform Uninstall / Uninstall updates from Settings, Apps - perform, reboot and test again

Check if you have miss-spelled the application name - correct in the config file SystemlessDebloater.cfg, save, reinstall the module and reboot

App names are cases sensitive - eg, the correct name might be Email, not EMail

- To help yourself, use eg Package Manager app (from Playstore) where you can search for all the apps/services, find their exact names and installation paths (to see are them System or User apps)

- What if I change my mind and I want to un-debloat and use Email, but to debloat now eg, Chrome browser?

No problem, reconfigure the list in SystemlessDebloater.cfg, save, reinstall the module and reboot

- What if after a week or so, I realize that some functionalities on the phone were affected?

Sorry, you had decided to debloat the 'wrong' apps/services

Google about which app(s) are safe to debloat or not, reconfigure your list in the config file, reinstall the module and reboot

Or disable the module and reboot, to figure out was the problem really due to debloating

- Oops, what if I have a bootloop (phone does no more boot since the 'wrong' apps were debloated)?

If you have TWRP with the read/write access to Data, navigate to /data/adb/modules/SystemlessDebloater and by using Advanced / File explorer from TWRP, create a dummy file named disable (without extension) in that folder

Reboot and Magisk will boot but with the debloater disabled - hence, all the previously debloated apps will be un-debloated now (to see if debloating was really responsible for the bootloop)

Instead of dummy file named disable, put the remove dummy file to trigger Magisk to uninstall that module on the next reboot (all that applies to any module possibly causing your bootloops)

If the proper TWRP is not available for your device and ROM, boot to the Android Safe Mode - google for a key-combo to boot in, for my Xiaomi it takes (re)booting with Vol+ and Vol+ pressed simultaneously

Don't do anything in Android Safe mode but reboot then to 'normal' mode - Magisk will boot now with all the modules disabled (this method does not work for Magisk v20.4 or earlier)

You will have to re-enable MagiskHide/DenyList (don't worry, your list of apps to hide the Magisk from was not lost), re-enable the other modules, correct SystemlessDebloater.cfg, reinstall debloater and reboot

There is also a third method (adb wait-for-device shell magisk --remove-modules), but search yourself and read about from the Wiki Documentation on the Magisk GitHub page

*** Enough for the theory, install now and practice debloating