yashsingh1/xdaforums huggingface dataset:
[Magisk] zgfg:
You need to find do you really have stock YT app on /system:

1) Settings, Apps, YouTube, Uninstall (updates)

2) Package Manager (install from Playstore), search for youtube, it will find under which name and in which system folder was installed (if it was)

But (1) is important to get rid of YouTube installation on /data

Instead of (2) (also, after (1)), you can execute from Terminal app (copy/paste the command):

su -c "pm list packages -f |grep youtube"

and it will show you the path and apk name where is it installled
[Magisk] zgfg:
Debloated also Mi 9T, Xiaomi.eu beta v20.12.10,

MiUI 12.3 / Android 11, with the following list

DebloatList="

AndroidAutoStub

BookmarkProvider

Browser

BTProductionLineTool

Calculator

CatchLog

CneApp

EasterEgg

GoogleFeedback

GooglePartnerSetup

Health

Joyose

Lens

MiMover

MiPlayClient

MiRecycle

MiService

MiuiBugReport

MiuiDaemon

mi_connect_service

Notes

PaymentService

PersonalAssistant

SoterService

Stk

TouchAssistant

Traceur

Velvet

VsimCore

WebViewGoogle

wps-lite

"
[Magisk] derei:
Not sure I understand fully how to use this app... so please level with me here:

Do I have to *know* the names of all the apps that i want to debloat in my phone and then manually type them into that list? If so, how do I obtain a list of apps present in my phone?

If you ask me, this is a very bad implementation of a debloater app. Firstly it goes against everything a computer is meant to be: to spare humans of tedious and repetitive tasks. Secondly, it requires a third party solution for finding out all app names ant third,it requires tedious manual input from the user of all the names of the apps one wishes to remove. Typing erroes are something common (see what I did here?) ...

Now, I'm not totally saying that a log-based debloater is a bad thing, but why don't you make your app to generate a list of all apps in the phone, grouped on categories (system/vendor/...) and only require from the user to comment (or uncomment) the app one wants removed in that existing list? Finally, the app could run this list and perform the required operations...

Honestly, the other debloater module that was using a command line interface was way better implemented. Perhaps you'll get inspired and follow the same route. Or even better, perhaps you would like to fork and maintain that one, as the original author has stopped maintaining it.
[Magisk] ipdev:
Hi.:)

Honestly, this kind of modification (even though it is systemless), can cause minor to major problems if handled incorrectly.

So learning about the apps you want to remove, what they interact with and what interacts with them is a good idea.

Yes, you will need to manually create/edit/maintain your SystemlessDebloaterList.sh file.

Think of it as a custom setup config file.

This module uses Magisk's Easy Replace option to hide apps so they are not loaded during boot.

Magisk (Module Tricks) GitHub - Link

Magisk (Easy Replace) GitHub - Link

--

Preinstalled apps can change names over time, not to mention vendor/manufacture and rom.

As example, you can take look at the removal list for OpenGApps.

OpenGApps installer script (Line 171) GitHub - Link

You can see how many names and locations of preinstalled apps they have collected through the years.

The great thing about this module is you only need the name, it will search across the common directories (folders).

If an app changes from system/app to product/priv-app it will still be found.

Once you create a DebloaterList file, you can keep updating/modifying it and use it across devices and/or roms.

Just like other config scripts, you may need to adjust it per device.

As I mentioned in a prior post, no harm checking for apps that do not exist on the device.

It may cause extra lines in the log file and a few seconds of install time.

I uploaded the last file I used as example-SystemlessDebloaterList.sh to my GoogleDrive. Link

If you take a look at it, you can see I wanted to keep Google Quick Search (Velvet) so I just added a # to the name instead of deleting the line. You could add any character to the name, like your typo example, the app will not be found.

There is also a script called list_pfiles.sh that will generate a list of files located in app and/or priv-app of system, product and vendor.

Feel free to use it if you want.

Remember copy and past is your friend. Great defense against ytpos. 🙃

See the bottom half of this post if you want to use the list_pfiles script. xda post - Link

Cheers. :cowboy:
[Magisk] zgfg:
First, this is not an app but Magisk module

Second, yes, you are debloating your phone, it can be any phone with any system 'bloat' you want to remove - hence you are responsible to know what you want to debloat, hence you have to list the names of apps you want to debloat.

If you did carefully read the OP post you will see how you can check the names (but you need to e.g. google around to learn does it have consequences if you remove certain service), and more important it is also described how you can experiment and recover if you debloated something you shouldn't have to

Btw, debloater itself finds in which folder (/system/priv-app, /vendor/app, etc) a particular app was installed and you don't need to know that in advance (btw, you can later see in the where it was).

That info would not help you in deciding should you debloat or not (I've experimented with different Xiaomi firmwares and found the same preinstalled different folders, when comparing one firmware to another)

Last but not the least, you are free to implement a 'better debloater' by your ideas and to provide it to the community😎

- Edit:

Scroll down in the SystemlessDebloater.log to the "System apps, not debloated" section and find e.g. a line:

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

Then copy Email name (if you want to debloat the built-in Email app) into DebloatList in your SystemlessDebloaterList.sh file.

(IMO, easier and less error-prone than selecting the apps for debloating through Terminal app)
[Magisk] zgfg:
New version

SystemlessDebloater_v1.3.9

(see OP post #1 for download link)

Improved log file, now including also the list of all remaining/not-debloated system apps

---

Debloated Xiaomi Mi 9T, Xiaomi.eu 20.12.28, MIUI 12.5 / Android 11 beta with:

DebloatList="

AndroidAutoStub

BookmarkProvider

Browser

BTProductionLineTool

Calculator

CatchLog

CneApp

EasterEgg

GoogleFeedback

GooglePartnerSetup

Health

ims

Joyose

Lens

MiMover

MiPlayClient

MiRecycle

MiService

MiuiBugReport

MiuiDaemon

mi_connect_service

Notes

PaymentService

PersonalAssistant

SoterService

Stk

TouchAssistant

Traceur

Velvet

VsimCore

WebViewGoogle

wps-lite

"
[Magisk] w1nst0n_fr:
Thanks @zgfg for this Magisk module!

It would have been a lot easier for you to directly use a list of paths (to apks) instead of only the APK name. ;)

Some comments after browsing through your code:

Instead of the complicated

if [ ! -z $(echo "$PackageInfo" | grep '^/data') ]; then
continue
fi

You can do do this:

if echo "$PackageInfo" | grep -q '^/data'; then
continue
fi

Or better, if you don't want the user apps you can use the -s option to only output system apps in the first place.

Packages=$(pm list packages -s -f | sed 's!^package:!!g')

I think I'm going to create a different Magisk module for the Universal Android Debloater to support Android 10+. This one is good but this isn't exactly what I need.

Just a question, is there a reason you don't have the module_installer.sh as your update-binary?

Have a nice day. :)
[Magisk] zgfg:
User does not need to know the full path - it would be also more prone for errors (typo in the long path or something).

Or user could think it is still at /system/priv-app but after the OTA update it moved to /vendor/app or something

This one works for A10 and A11

customize.sh does the installation job
[Magisk] w1nst0n_fr:
Yes but according to the documentation, the update-binary is first executed and will source customize.sh.

Actually, your update-binary is the old Magisk's module_instaler.sh. The new one is notably much more factorized.
[Magisk] zgfg:
When I was preparing the module few months ago I downloded the latest official module_installer.sh at that time and properly renamed to update-binary:

Developer Guides

The Magic Mask for Android

topjohnwu.github.io

That update-binary version that I'm still using in the module requires Magisk 20.0 or newer.

You are pointing now to the newer version of update-binary that requires Magisk 20.4 or newer

I tentatively did not want to restrict users that they would must have the latest Magisk since this module works fine also with Magisk v20

Btw, download various Magiskmmodules from the official Magisk repo and you will find that many have even older versions of update-binary, requiring/allowing Magisk v19 or newer. Yet they also work fine with the latest Magisk v21 as of now

Look into the history of that module_installer.sh (aka update-binary) file on TJW Github, and you will find that the one I'm using is the last but one, but when you download modules ftom repo many will have even older versions - thus allowing even some older versions of Magisk

Newer or later update-binary, it souurces my customiz.sh, and my customize.sh script fills the REPLACE list that is then proccessed by Magisk itself (not by update-binary).

Hence, at the end it is irrelevant is it the latest or not update-binary, as long as it is compatible with the latest Magisk (and it is - I'm always using myself the latest Magisk release)
[Magisk] specialdo:
Can I use this module on android 8 stock on my moto z2 play to debloat youtube app ? I want install youtube vanced but there is a stock youtube app and I don't know how uninstall. thanks.
[Magisk] ipdev:
It should work.

I have tested it on a few different devices.

Give it a try.

If all you want to deblote is YouTube.

Make sure to uninstall the YouTube updates.

On device choose the app info and uninstall updates.

In PlayStore select the app and the uninstall option will remove updates.

All you need in your SystemlessDebloaterList.sh file is:

# Define a list of stock apps for debloating:
DebloatList="YouTube
"

I attached one for example.

Cheers. :cowboy:

PS.

I use root Vanced. (YouTube and Music)

Normally you can leave the system (per-installed) YouTube (and YT Music) alone.

Android will find and use the newest version installed. ;)
[Magisk] specialdo:
thanks... leave the system youtube not working for me

i have magisk 22 on my phone and it is in hidden mode.

I deleted all youtube data and removed all updates, then I activated debug mode, connected my moto z2 play to the pc and with adb I gave the following commands:

- adb devices (to be sure that the pc sees my smartphone)

- adb shell

- pm uninstall –k ––user 0 com.google.android.youtube

youtube has now been removed, it is no longer in my installed apps and if I search on the play store, there is the INSTALL button but if I try to install YouTube Vanced, it gives me an error and says that there is already a version of youtube installed.

So with Solid Explorer and root I went to system> data and here there isn't folder's youtube but in system> app instead there is the youtube apk and an OAT folder, then ARM and two files YouTube.odex and YouTube.vdex.

I have tried again to install yotuube vanced with vanced manager but in the end I have the error message that tells me that the youtube app already exists in the system. :(
[Magisk] zgfg:
Use this Systemless Debloater the way how it is described in OP posts (post #1 etc) - hence no adb pm uninstall or deleting by root explorer, etc
[Magisk] specialdo:
ok, thank you. but i don't understand if defloat uninstall youtube or hide the app when magisk load after start up.
[Magisk] zgfg:
Sorry I dont understand your question.

Did you read OP post #1 here?

Did you download and install (through Magisk) the SystemlessDebloater module zip?

As clearly described in OP post #1, that first/empty installation WILL NOT debloat anything - hence don't worry

Once you install the module, do you see and can you open the textual file /Download/SystemlessDebloater.log (Internal memory)

Open, scroll down to the last section:

"System apps, not debloated"

In that section do you see YouTube?

Find that line with YouTube and copy here to your response (you can attach also the whole log)

Please let's start with that - please do things, get familiar, then ask and I will try to help you (if you would follow instructions)
[Magisk] Jadelor:
YouTube isn't in /system at all on my Huawei phone, it's actually in /preas/app/YouTube, I imagine the problem is similar. These Chinese Android forks...
[Magisk] zgfg:
Then not suitable for this module, i.e. cannot be debloated by the underlying Magisk systemless replace method

Btw (I'm curious), what is your Huawei phone, EMUI and Android version
[Magisk] Jadelor:
P30 pro, EMUI 9.1 (Android P)
[Magisk] zgfg:
Just a note, for MIUI:

Do not debloat SoterService - it is needed for a proper Widevine L1 certificate

Xiaomi.eu, 21.2.6 (IMHO, should generally apply to all MIUI).

Settings, Password and Security, Fingerprint unlock, Fingerprint payments, Widevine (L1):

To be able to Update the certificate without error and with results as on the screenshot, SoterService must not be debloated - see also:

[INFO] Widevine L1 Support

This thread should answer most of your questions regarding Widevine L1 support on your device(s). I will try to keep it maintained and up-to-date. Notes: * This list includes only supported Android 10+ devices that either support Widevine L1 officially, or support it unofficially by Xiaomi.eu...

xiaomi.eu
[Magisk] zgfg:
Released v1 41 with some cosmetic changes (as described on Github)

OP post #1 edited to always point to the (at the moment) latest release
[Magisk] kaisar1994:
Did this module work for you? Are you running android 11?
[Magisk] Tony2k:
How can I delete an app that is present in two different folders? This is an example:

system/india/app/By_3rd_HeytapIdProviderIndia

system/product/app/By_3rd_HeytapIdProviderIndia
[Magisk] zgfg:
Did you already install the module and configure it t to search for the app?

Did it find the app in

system/product/app

Please do it, condirm and I will give you manual instructions how to remove also from:

system/india/app
[Magisk] Tony2k:
Yes I installed the module and configured SystemlessDebloaterList.sh like DebloatList="By_3rd_HeytapIdProviderIndia OTHERAPPS". Should I write the full path?
[Magisk] zgfg:
Please find it in the log file:

SystemlessDebloater.log

(it's also textual file)

Search for your app, should be a line like (here for another app)

/system/app/Updater (com.android.updater)

Even better, pls attach here your SystemlessDebloater.log file
[Magisk] Tony2k:
I don't understant the sintax of SystemlessDebloaterList.sh... As I sse I can't use the path.
[Magisk] zgfg:
Everything is described in post #1 - did you read

From the log, module did not find your SystemlessDebloaterList.sh:

Input file not found, creating a template file!

Input-DebloatList=""

Do you know how to use some File Manager on your phone to edit textual files?

You can install and use Miplorer (by far the best file manager)

Go to Download folder on your Internal memory and open that file SystemlessDebloaterList.sh

Choose to open as text file

Inside that file you have to see:

DebloatedList=

"

"

Into the list (between the apostrophes) you have to add the name of your app.

Only the name, without path.

If you list more than one app, they have to be separated by a soace or each one in the new line

Like this:

DebloatList="

Updater

AndroidAutoStub

CneApp

"

Btw, in that same file, there is an example but commented out

Save the sh file and, ooen Magisk and reinstall the same module - then check the log file again
[Magisk] Tony2k:
Can you explain me how to remove also from system/india/app?
[Magisk] mettis88@gmail.com:
The module does not remove applications from /system_ext, although it is deleted according to the logs. For example, EmergencyInfo

Spoiler content hidden.
[Magisk] zgfg:
Ok, you have debloated 34 apps. I hope you didn't debloat 'too many' system apos (e g , you debloated Dialer, etc) that your phone would no more work properly.

In that case you would need to filter out your DebloatList and 'install' the module again

Anyway, back to your By_3rd_HeytapIdProviderIndia:

- use root explorer and go to where Magisk keeps modules:

/data/adb/modules

- further into the SystemlessDebloater/system

- inside, create nested subfolders india/app

- go back to SystemlessDebloater/system and now into product/app subfolder

- here, you should find a subfolder By_3rd_HeytapIdProviderIndia

(inside the subfolder there should be a file: .replace)

-copy that subfolder By_3rd_HeytapIdProviderIndia (with the .replace file) from product/app to india/app

-reboot

But before doing that, check is it really neccessary. Maybe your /system/india and /system/product are mounted one to the other or so.

Please check if the By_3rd_HeytapIdProviderIndia app was already debloated (withyour previous debloating configuration you sent me in the log file)
[Magisk] zgfg:
Interesting. For me it works - my log attached.

I have debloated couple of apps from /system/system_ext/priv-app

But in my case /system_ext is mounted to /system/system_ext - see my screenshots

Please check how these two are mounted one to another on your phone (or they are not) - please send the screenshots

Edit:

Please check also in your

/data/adb/modules/Systemless Debloater/system

Does it contain nested subfolders:

system_ext/priv-app/EmergencyInfo

(inside there must be an empty file .replace)

If not, then you can create nested subfolders:

system_ext/priv-app

Then copy e.g Wellbeing folder from:

product/priv-app

to:

system_ext/priv-app

And rename the copy to have now:

system_ext/priv-app/EmergencyInfo

(with the .replace file inside)

Reboot and check if EmergencyInfo.apk is now properly debloated

If yes, go back to /data/adb/modules/Systemless Debloater/system/system_ext

and copy/rename :

priv-app/EmergencyInfo

to:

priv-app/GoogleFeedback

and to:

app/DeviceInfo

and so on

But be careful, with some of those system apps debloated, phone could stop working properly.

Also, some apps like DeviceInfo are really useful
[Magisk] mettis88@gmail.com:
In my case, the /system_ext folder is not located correctly. It should be located in the /system folder. Why it happens?

View attachment 5397717View attachment 5397715
[Magisk] zgfg:
Please read again my previous post/answer to you and:

1) Investigate if your /system_ext is mounted to /system/system_ext

This question has nothing to do with this nodule but with your ROM/system

See my screenshots, you can use Terminal app and the commands as in my screenshot.

And/or, use an appropriate file explorer - I used MiXplorer

Obaerve that here I am not talking about the structure of

/data/adb/modules/SystemlessDebloater/system_ext

and

/data/adb/modules/SystemlessDebloater/system/system_ext

but about:

/system_ext

and

/system/system_ext

2) You can try by manually copying your system_ext folder (generated by the module, with all the stuff in)

from:

/data/adb/modules/SystemlessDebloater/

to:

/data/adb/modules/SystemlessDebloater/system

I'm asking:

1) Because /system_ext should be mounted to /systen/system_ext

This is how the module assumes but from the result it seems it was not the case on your phone

In fact, module uses REPLACE mechanism provided by Magisk, and that mechanism (by Magisk documentation) works only for subfolders in the /system

Btw, are you using the latest Magisk v23?

2) Try the manual trick as above to see would it 'fix' debloating result (although I doubt if you have a strange SAR configuration on your ROM/system level as per (1))
[Magisk] mettis88@gmail.com:
View attachment 5397811

I manually moved /system_ext to the /system folder. Now the removal has happened successfully.

Yes, im use Magisk v23
[Magisk] mettis88@gmail.com:
View attachment 5397815

I manually moved /system_ext to the /system folder. Now the removal has happened successfully.

View attachment 5397817

Yes, im use Magisk v23

Why does the patch incorrectly create a path for /system_ext?
[Magisk] zgfg:
Ok, so your issue is solved by manual 'intervention'. Good

Anyway, from your terminal screenshot your /system_ext is mounted to itself - which is pointless and actually wrong (should be mounted to /system/system_ext - that's the point of SAR=System As Root).

Btw, same for your /vendor and /product

Don't know what is your phone and ROM/firmware
[Magisk] mettis88@gmail.com:
My device Poco X3 MIUI 12.5 Android 11
[Magisk] mettis88@gmail.com:
I installed EvolutionX Android 11. The same situation with the /system_ext folder

The path should look like /systems/ system_ext

View attachment 5398225
[Magisk] zgfg:
Probably the custom ROM does not change SAR configuration

Nevertheless, please try the following Systemless Debloater v1.42 does it fix debloating your /system_ext apps (i.e., no more need to manually move the stuff):

<link from Mega - removed>

Please confirm if ok for you, I will upload it then for the new official module version.

Thanks

Edit: Mega link removed, this has become now the latest v1.42 release, downloadable from Github - see post #1
[Magisk] mettis88@gmail.com:
Good job. All work. What did you fix in the new version?

View attachment 5398665
[Magisk] zgfg:
The customize.sh script looks for every app ftom your DebloatList under /system and if not found there, additionally under /system_ext, /product, /vendor

and now added also to look under:

/india

(but you don't have /india apps)

Observe that if mounts are proper, all those paths like /system_ext, /product, /vendor will be already mounted under /system and therefore searching additionally under /system_ext, /product, /vendor is not needed

When the particular app is found, it checks if its path does not begin with "/system" and then it prepends "/system" to that path

However, that check was not good for apps found under /system_ext, it must be checked instead if the path begins with "/system/" (because the paths like "/system_ext/app/SomeApp/SomeApp.apk" already begin with "/system" but not with "/system/")

Ofc, the old search was ok for apps found under /product, /vendor

So, for the matter of fact, I have also MIUI 12.6, A11 (Mi 9T, Xiaomi eu weekly builds) but e.g. my /system_ext is mounted to /system/system_ext and hence my apps from there already begin with "/system/system_ext/..."

I realized the problem by looking into your mounts, it was strange how the script prepends /system to your /product paths but not to your /system_ext paths (for you, both /product and /system_ext are not mounted under /system hence the paths for apps found from both must be equally prepended with /system)

Edit: This version, v.1.42, uploaded now to Github as the latest release - see post #1
[Magisk] zgfg:
Systemless Debloater v1.43

If there are 'duplicates' on /system for an app you want to debloat (possible case with some ROMs), all 'duplicates" will be debloated now

New setting for SystemlessDebloaterList.sh, put into that file a new line:

VerboseLog="true"

to force extensive logging in the SystemlessDebloater.log file.

Comment out that line (by prepending the line with an ampersand #), for less logging (and faster module installation)

For the installation link to Github, go to OP post #1

Many thanks to @ipdev for testing on and suggestions based on his One Plus 6T with OnePlus OS where he actually does observe 'duplicates' of the /system apk files (in various folders)

For example, he has three instances of the Account.apk:

/system/india/app/Account/Account.apk

/system/product/app/Account/Account.apk

/system/product/priv-app/Account/Account.apk

All three are correctly debloated together now
[Magisk] neroita:
Perfectly working on android 11 motorola G 200.
[Magisk] xdduser:
Guys is there any debloater tool for K20 which does NOT require Root?