on
Debloating an Android Device
I recently got a cheap Android tablet in order to read while slouching on the sofa. The problem is that it came with a ton of preinstalled bloatware and there was no option to uninstall much of it.
After some research, I found the universal-android-debloater on GitHub. Poking around before installing (you should at least take a look at projects before blindly installing them), I found out the list that they use for debloating. It is just a JSON array that contains objects with fields such as id for the package and removal if it is recommended. And then I thought, why do I not just use this list and the command line to debloat my tablet?
Prerequisites
You will need to install adb. There is a guide for every OS out there, just google/bing/duckduckgo. Additionally, I am using grep and jq. If you are using a Linux OS, they should be installed or be easy to install.
Additionally, you will need to activate the developer options on your device. Due to devices being slightly different, do check online on how to do that. Then go into the developer options and enable USB debugging.
Debloating
The first thing we need to do is get the list from GitHub.
wget https://raw.githubusercontent.com/0x192/universal-android-debloater/refs/heads/main/resources/assets/uad_lists.json
Let’s extract all the package IDs that are recommended for removal.
jq -r '.[] | select(.removal=="Recommended") | .id' uad_lists.json > bloat_ids
Jq is a lightweight command-line tool for processing JSON data and is the perfect tool for the job. What does the command above do:
-rremoves the quotes from the result strings.[]returns all the elements of the array|pipes the information into the next filterselect(.removal=="Recommended")filter packages that are only recommended for removal.idextracts the ID> bloat_idswrite the output into the file
Now we have the package IDs for removal, but it would be nice to actually know which ones are installed on our system and remove just them. We are going to get all the package IDs from our Android and match them against the bloat IDs and create a new list.
adb shell pm list packages | sed 's/package://g'> my_device_ids
grep -F -x -f my_device_ids bloat_ids > to_remove_ids
Uninstall these packages.
cat to_remove_ids | xargs -n1 adb uninstall --user 0
--user 0 run as root
Conclusion
You should be good to go now. Enjoy your new device. Some apps that I find good:
- Aurora Store - Google Play Store alternative
- F-Droid - Google Play Store alternative
- SshDeamon - to be able to copy all your files locally