[SCRIPT] [2021-01-30] [v2.9] Universal Android Debloater

BabaJega

New member
Dec 25, 2020
1
0
1
Hello there, Im new to all this "debloating my phone" business and first of all I want to say: Thank you to whoever created this. All the installed packages on my phone kept getting me confused. I didnt know what I could debloat safely and this script is awesome for a situation like that. Just kick back, let it debloat and be happy.

So I went through with the whole (well documented) debloating instructions and debloated everything there was to debloat until the script said "nothing to debloat :)" on every selectable option.

Now the phone wont boot anymore. It reboots once and is stuck in the "Samsung" boot screen basically forever.

I followed the instructions step by step and did everything exactly the way I was told to do.
Im using a Samsung Galaxy S20+ with Android 11 installed.

This is not a complaint. Bad stuff happens. No worries, I will just factory reset the phone. Its more like a bug report. Maybe we can make it work together so that future S20+ users with Android 11 can debloat their phones successfully with the script.

Is this a known issue already? I can be a tester if there are some fixes on the way.

Keep up the good work! :)

EDIT: I tried to just use "debloat" --> "samsung" after the factory reset but now the system settings app wont open anymore which is a bummer. Any way to fix this?
 
Last edited:

w1nst0n_fr

Member
Dec 27, 2019
44
65
38
gitlab.com
Hi,

So I went through with the whole (well documented) debloating instructions and debloated everything there was to debloat until the script said "nothing to debloat :)" on every selectable option. [...] Now the phone wont boot anymore.
[...] Is this a known issue already? I can be a tester if there are some fixes on the way.
A new big release (v2.8) is coming soon.

As for the bootloop, I'm sorry. It seems this only happens (for now) on newer Samsung devices with OneUI 3.0. This is a known issue (see #39). The faulty package seems to be a Google one but hasn't been found yet.

Only users of those phones can identify it. I can't do anything alone. I would be delighted if you help me on this. Come over to Gitlab. It's easier to track issues. :)

Any idea why the debloat script won't recognize that I've updated bash to the latest version and set it to default on my MacBook?
Well... I dunno how I could have failed this but here it is:

On the 4th line of code, in the if it should be:
"${BASH_VERSINFO[0]}" < 5 instead of BASH_VERSINFO < 5

It will be fixed in the next release.
 
Last edited:

Draygon

Senior Member
Jul 11, 2011
464
91
48
Edit: Found the issue, please remove following app from Google.sh:
"com.google.android.ext.services "

It's causing the stuck boot issue. Everything else was set to default during my test.


I just found this script and tested it with my new Pixel 4a directly after a factory reset.

Only the "Google" list was used with default settings to debloat, after rebooting my Pixel is stuck in a bootloop. It seems to be an issue with Android 11 on the latest patch from January 2021, some packages seem mandatory.

Edit: Added this to an existing gitlab issue

Any idea how I can troubleshoot which package is causing the issue?
 
Last edited:
  • Like
Reactions: w1nst0n_fr

w1nst0n_fr

Member
Dec 27, 2019
44
65
38
gitlab.com
Happy new year!

I wouldn't have thought this release would take me this long! Finally, here is the v2.8:


The changelog is on Gitlab, as usual. This is the last major update for the bash script. I'm sure a lot of people will be happy to know that I added root support. You can even generate a flashable zip if you want!

I am now focusing on developing a cross-platform GUI.

EDIT: I reworked the logic behind the flashable zip generation. There was an issue. It is now much simpler and correctly works. I also added a backup of the apks before the flashable zip generation. It's safer.

I released an hotfix (v2.8.1) with these changes.
 
Last edited:

sapphirexda

New member
Jan 12, 2021
2
3
3
Hello and a very Happy New Year to you! Hope 2021 is a lot better than 2020!

Firstly thanks for putting in so much effort into this tool.

I ran through the steps listed in your GitLab page using Ubuntu 20.04 connected to my Samsung a21s. Running "adb devices" in the terminal listed the device successfully and USB debugging was switched on.

On the Main Menu, I selected "Debloat packages" and then proceeded to select and run "samsung". The script ran as follows:

==== samsung debload list ----
[user 0] android.autoinstalls.config.samsung --> [user 0] com.hiya.star --> [user 0] ...... and so on

On rebooting the phone, it didn't seem like anything was debloated.

I think I saw somewhere somoene had posted a video showing "SUCCESS" listed if debloating worked.

Not sure if I'm doing something wrong but I wonder if someone can help please?

ps. I did try running the bash script as sudo and it didn't do anything.

edit - I may have interpreted incorrectly, but in the script it seems like a debloated_packages.txt file should be created in the directory. I also don't seem to have that.
 
Last edited:
  • Like
Reactions: freeelect

freeelect

New member
Jan 12, 2021
2
1
1
Hello and a very Happy New Year to you! Hope 2021 is a lot better than 2020!

Firstly thanks for putting in so much effort into this tool.

I ran through the steps listed in your GitLab page using Ubuntu 20.04 connected to my Samsung a21s. Running "adb devices" in the terminal listed the device successfully and USB debugging was switched on.

On the Main Menu, I selected "Debloat packages" and then proceeded to select and run "samsung". The script ran as follows:

==== samsung debload list ----
[user 0] android.autoinstalls.config.samsung --> [user 0] com.hiya.star --> [user 0] ...... and so on

On rebooting the phone, it didn't seem like anything was debloated.

I think I saw somewhere somoene had posted a video showing "SUCCESS" listed if debloating worked.

Not sure if I'm doing something wrong but I wonder if someone can help please?

ps. I did try running the bash script as sudo and it didn't do anything.

edit - I may have interpreted incorrectly, but in the script it seems like a debloated_packages.txt file should be created in the directory. I also don't seem to have that.
I also want to firstly thank you for this awesome tool and everyone who has helped with it. I truly think after debloating and disabled Google Play Services, this is the easiest way for privacy mitigation if you don't want to mess with custom roms or iPhone. After what happened to Parler this week, man, this solution is > than iPhone IMHO.

I'm experiencing the same issue as sapphirexda with v2.8.

I started using the universal android debloater v2.7 a week ago and just loving it! To think I almost switched to an iPhone because I didn't want the hassle of getting a pixel and using GrapheneOS or something similar.

So I was able to debloat a samsung S8, an older phone of mine just to try it out, just in case I couldn't "function" for everyday use. I was able to disable Google Play Services, which is HUGE to me and can turn on and off according to when I need it, which isn't very often, but at least I can when I need.

So I wiped, and started from scratch debloating a Note 9, the phone I want to use for now on. This was yesterday and I saw that v2.8 was out and excited to use it. Well I was also unable to debloat the Note 9 with v2.8. At first I had Samsung Secure Folder activated because I wanted to "sandbox" the few apps I need to turn Gapps on and off for. After the debloat didn't work and the phone kept rebooting, I deleted the secure folder to see if I could debloat with v2.8, but still wasn't able to. So I went back to v2.7 and it worked out great just like before.

I wanted to share my experience as well when I saw sapphirexda mention the issue.

Thanks again!
 

w1nst0n_fr

Member
Dec 27, 2019
44
65
38
gitlab.com
@freeelect & @sapphirexda

I'm really sorry. I messed up with a variable name. Non-root features in v2.8, v2.8.1 and v2.8.2 are broken.

I've just released a third (and hopefully last) hotfix fixing this issue.

 

sapphirexda

New member
Jan 12, 2021
2
3
3
@freeelect & @sapphirexda

I'm really sorry. I messed up with a variable name. Non-root features in v2.8, v2.8.1 and v2.8.2 are broken.

I've just released a third (and hopefully last) hotfix fixing this issue.

No need to apologise at all :) I am very grateful and really appreciate what you are doing for this project. Thank you ever so much.
 

freeelect

New member
Jan 12, 2021
2
1
1
@freeelect & @sapphirexda

I'm really sorry. I messed up with a variable name. Non-root features in v2.8, v2.8.1 and v2.8.2 are broken.

I've just released a third (and hopefully last) hotfix fixing this issue.

No sorry! This is awesome! Just finished debloating with v2.8.3 and it worked beautifully! I even was able to get Secure Folder working. I get to keep Gapps "sandboxed" when needed.

I'm so excited. Thanks again you're awesome!
 
  • Love
Reactions: w1nst0n_fr

boringtech

Member
Jan 10, 2021
20
1
3
I have a rooted Motorola Moto G 5G Plus and I get the follwwing error:

Code:
==== motorola debloat list ====

Your apks are beeing backed-up in apks_backup/ (in case you mess up)

adb: error: failed to stat remote object '/data/app/android.autoinstalls.config.motorola.layout-pc7OJrTj8S6kJLmbrXrPvQ': No such file or directory
I don't think that should be the cause, but I modified a bit Motorola.sh, commenting:

"com.motorola.android.fmradio"
"com.motorola.fmplayer"
"com.motorola.gesture"
"com.motorola.moto"
"com.motorola.actions"
"com.motorola.hiddenmenuapp"
"com.motorola.carriersettingsext"

By reading your terse manual, I don't understand if I can use Debloat APKs (Root) straight or need to use Debloat packages first. Also what is "Create a flashable zip" for?
Finally what is the file between the single ADB back-up and the individual APKs? Doesn't the ADB back-up contiain already the APKs?


** EDIT **

As regards the error, I think it depends on the pattern matching (%%) in the function associate_path_with_package, when APK paths have equal literals (=).

** EDIT 2 **

The error above seems fixed by removing one percentage symbol at line 185. But many other occurs.

Such as twice:
Code:
mount: '/system' not in /proc/mounts
and for several APKs:
Code:
rm -rf /product/priv-app/HotwordEnrollmentOKGoogleHEXAGON/HotwordEnrollmentOKGoogleHEXAGON.apk
Eventually the program stops with
Code:
[EXIT TRAP] Hum... something is wrong. Error on line 414

If you think this is a bug. Please report it :)
==> https://gitlab.com/W1nst0n/universal-android-debloater/-/issues
The line 414 is:
Code:
adb shell "su -c '$commandes'"
where $command is defined as a mount command.

Checking better requirements, I have also realised that the program wants qpdf. Why?
 
Last edited:

w1nst0n_fr

Member
Dec 27, 2019
44
65
38
gitlab.com
There are 2 issues here:

As regards the error, I think it depends on the pattern matching (%%) in the function associate_path_with_package, when APK paths have equal literals (=).

The error above seems fixed by removing one percentage symbol at line 185. But many other occurs.
1) Good catch. I'll fix this.


2) You're on Android 10+ right ? As I explained in the v2.8.4 changelog, root features doesn't work with Android 10+ right now because Google introduced a new dynamic partitioning system which, in short, prevent to easily mount system filesystem in read-write. I'm working on a workaround (a flashable Magisk module to debloat systemlessly)

In any case, all the non-root features work on any Android version.

Checking better requirements, I have also realised that the program wants qpdf. Why?
zlib-flate (which is part of qpdf) is only used to check ABD backup integrity. You don't need it for anything else.
 
Last edited:

boringtech

Member
Jan 10, 2021
20
1
3
root features doesn't work with Android 10+ right now because Google introduced a new dynamic partitioning system which, in short, prevent to easily mount system filesystem in read-write. I'm working on a workaround (a flashable Magisk module to debloat systemlessly)
I missed the changelog. Do you have a link to @topjohnwu solution? Just out of curiosity.
 

w1nst0n_fr

Member
Dec 27, 2019
44
65
38
gitlab.com
I missed the changelog. Do you have a link to @topjohnwu solution? Just out of curiosity.
There are some nice explanations in the documentation but you'll need to dig a bit in the code if you really want to understand how he did this.

I honestly don't exactly know how this works under the hood. The thing is, I know I can root Android 10+ systemlessly with Magisk and create modules to debloat system apps.

Systemlessly, Magisk can only replace system files but not delete them. The trick is just to replace apks with empty files.
 
  • Like
Reactions: boringtech

Nick-6

Member
Jun 1, 2020
7
2
3
I've been using this script from time to time. It always worked like a charm. Thanks Dev.

But, today, I download the latest version 2.8.4 and tried to debloat my old Redmi Pro (eu ROM - Android 6.0). I've twrp and magisk installed.

Every entry is returning "Nothing to debloat :)" . What am I doing wrong? (I can manually search a pkg and remove successfully it by ROOT method).
 
Last edited:

w1nst0n_fr

Member
Dec 27, 2019
44
65
38
gitlab.com
@w1nst0n_fr is it really a good idea, to make another root debloater? There are numerous solutions out there. But you gave the world a debloater for locked bootloader devices.
Yes I know but most of them aren't systemless (i.e don't work on Android 10+) and aren't backed by documented apks/packages lists. Don't worry, this Magisk module is really easy/quick to make.

Every entry is returning "Nothing to debloat :)" . What am I doing wrong? (I can manually search a pkg and remove successfully it by ROOT method).
Well... I don't know. Custom list generation works fine on my end.

Upload your package list please.

Bash:
adb shell 'pm list packages -s -u' | sed 's/package://g' > packages.txt
Are you sure the packages you want to remove are uncommented in the debloat lists? Have you the same issue with the non-root debloat feature?
 
Last edited:

FourSilver

Member
Jan 11, 2021
19
3
3
Hello,

I would like to contribute to this project. I recently installed the environment required to run the debloater script without any issues. Nothing was returned when I ran the script; this is because I ran it against a new Unihertz Atom XL.

The documentation references this script to check if my list has no duplicate with the current lists of the repo. However, when I run it from the home directory, it throws an error indicating that it cannot find 'universal-android-debloater/lists/'

Could you please provide information on how to properly run this script?
 
  • Like
Reactions: w1nst0n_fr