[Root] System Debloat script

Pointless816

Member
Mar 6, 2009
33
19
0
Manhattan
Hello,

I've created a simple .bat file which can be run from a Windows computer while your phone is booted into TWRP to remove various apps that I consider bloat. I have not encountered any issues in my usage the past week, but your usage pattern may vary. This is tested on a G8142 running Oreo 47.1.A.5.51, but there is no reason it should not work on other versions. This is limited to Windows, but the commands are all ADB-specific and have nothing to do with Windows, so it should also work on Mac & Linux by changing the file extension. I take no responsibility if this messes up your phone! But, all changes this script makes can be reversed by flashing system & oem with Newflasher.

Note: This script will remove Sony Home! Please make sure you have an alternate launcher installed or remove that app from the script!!! Additionally, the app removes Google Messages, Sony Clock, Sony Calendar, Chrome, Sony Email, Gmail, Google, various international keyboard layouts, and Text-to-speech functionality. All of these, or alternatives, can be re-installed through the Play Store though.

To Modify:
The .bat file can be modified by opening with any text editor. All apps are labeled with their name, as below:
::Google Messages
adb shell rm -rf /system/app/Messages
adb shell rm -rf /data/user/0/com.google.android.apps.messaging

To prevent this app from being uninstalled, just delete those lines.

To add an app that is not on the list, use an app such as App Inspector to find the directory the app is installed to and the directory its data is located in, then add those to the list as below:
adb shell rm -rf <app Source Dir, excluding last /******.apk>
adb shell rm -rf <app Data Dir>


In some instances, such as if the app has been updated from the Play Store, you may need to remove it from /data/app/ and from /system/app/ (or /system/priv-app) as below:
::Sony What's New
adb shell rm -rf /system/priv-app/sonyentrance2-release
adb shell rm -rf /data/app/com.sonymobile.entrance*
adb shell rm -rf /data/user/0/com.sonymobile.entrance

The * above is used as a wildcard, meaning that any folder that matches everything before the * will be deleted. This is needed because random strings of letters and numbers are added to the end of the app name when installed to /data/app/. Please be careful with your * use, since using something like "adb shell rm -rf /data/app/com.sonymobile.*" would clear out several apps' data!

Instructions:
  • Power down the device
  • Reboot into TWRP by holding Power and Volume Down (phone must not be plugged into computer yet)
  • Attach phone to computer
  • Unzip JunkCleaner.zip (this is not a flashable zip!) and extract JunkCleaner.bat
  • Move JunkCleaner.bat to a folder that contains adb.exe
  • Double click on JunkCleaner.bat and let run to completion
  • You're all set!

Known Issues:
Swiftkey may force close on you, to fix this, clear the cache from Settings -> Apps & notifications -> App Info -> Swiftkey Keyboard -> Storage -> Clear Cache
You will see a notification that com.sonymobile.rcahandler has force closed when you first boot the phone. This can be fixed by turning on Ultra Stamina mode, turning it off, then rebooting a second time after Ultra Stamina Mode has already rebooted your phone.

To Return to Stock/Reinstall any apps:
To get back to stock, just use Newflasher to reinstall system & oem partitions. This will restore all apps that this script removes.

Please let me know if there are any apps that you have safely removed that are not in my list, as I'm sure the amount of apps can be whittled down even further.
 

Attachments

Last edited:

Saadkhalid786

Senior Member
May 9, 2017
111
13
0
just what i needed. thank you!

and what about those system apps like basic sleep mode and crash monitor? doe they have any effect on phone after uninstalling? going to flash Oreo now and will use your debloater :)
 

Pointless816

Member
Mar 6, 2009
33
19
0
Manhattan
Should not be any harm, no. The Basic Sleep Mode Apps are for Android's Screensaver (under Settings -> Display -> Screen Saver), which is a bit useless without an AMOLED display since it will just kill your battery. The Crash Monitor is used by Sony for getting diagnostic info in case of a crash, but we're out of warranty by unlocking the phone, so no real effect there either.
 
  • Like
Reactions: Saadkhalid786

Saadkhalid786

Senior Member
May 9, 2017
111
13
0
UPDATE:

just flashed this on nougat. successfully removed all apps specified. i edited the script and excluded xperia home, album and music. works as expected. maybe you can try to find more useless apps that doesnt do anything but hog up the Ram and battery.

UPDATE 2:
used this on Oreo and everything is also good there. however, there are some apps that cannot be uninstalled either from root uninstallers or by deleting their folder. maybe you can add these apps to the junkcleaner :

Audio settings (clear audio+ DSEE etc)
com.qualcomm.qti.telephonyservice (tell me if it is important to keep)
download manager (guess its important to keep)
home network (tell if important to keep)
shell (tell if imp)
software update app (probably not used since unlocked bootloader, other apps can be updated from playstore)
wap push (tell if needed to keep)

will be even more thankful :)

much respect from me :)
 
Last edited:

FartyParty

Senior Member
Jan 18, 2017
629
210
0
For anyone that doesn't want to use this but still want to easily debloat many apps at once.
Titanium Backup has an (un)installer feature which lets you pick all the apps you want and then hit (un)install.
 

Saadkhalid786

Senior Member
May 9, 2017
111
13
0
For anyone that doesn't want to use this but still want to easily debloat many apps at once.
Titanium Backup has an (un)installer feature which lets you pick all the apps you want and then hit (un)install.
that doesnt uninstall all apps. advanced logging cant be removed for me. also prime video was never removed with TB
 

Saadkhalid786

Senior Member
May 9, 2017
111
13
0
It does uninstall whatever you want so please stop spreading lies :)
it never did uninstall prime video and audio settings for me.
can u pls try and remove audio settings and prime video on OREO 5.51 with TB (any version)?
all im asking is him to add these apps to the script.
i'll wait :)
 

Pointless816

Member
Mar 6, 2009
33
19
0
Manhattan
It does uninstall whatever you want so please stop spreading lies :)
It may be that because Amazon Prime Video is located in the /oem partition rather than /system/app or /system/priv-app, Titanium Backup does not have code to grant write access to that directory, though I have not tested myself. Even then, the benefit of this script is that it saves you from having to manually delete ~50+ apps each time a monthly patch comes out.

UPDATE:
UPDATE 2:
used this on Oreo and everything is also good there. however, there are some apps that cannot be uninstalled either from root uninstallers or by deleting their folder. maybe you can add these apps to the junkcleaner :

Audio settings (clear audio+ DSEE etc)
com.qualcomm.qti.telephonyservice (tell me if it is important to keep)
download manager (guess its important to keep)
home network (tell if important to keep)
shell (tell if imp)
software update app (probably not used since unlocked bootloader, other apps can be updated from playstore)
wap push (tell if needed to keep)

will be even more thankful :)

much respect from me :)
Glad it's working well for you! I'll take a look at removing some of those and try and update the package later tonight. Fairly certain that telephonyservice and shell are both required by Android, but will see if any of the rest can be taken out.
 
  • Like
Reactions: Saadkhalid786

gerald.mrrsn

Member
Jul 11, 2013
16
2
0
Prince Rupert
Hello,

I've created a simple .bat file which can be run from a Windows computer while your phone is booted into TWRP to remove various apps that I consider bloat. I have not encountered any issues in my usage the past week, but your usage pattern may vary. This is tested on a G8142 running Oreo 47.1.A.5.51, but there is no reason it should not work on other versions. This is limited to Windows, but the commands are all ADB-specific and have nothing to do with Windows, so it should also work on Mac & Linux by changing the file extension. I take no responsibility if this messes up your phone! But, all changes this script makes can be reversed by flashing system & oem with Newflasher.

Note: This script will remove Sony Home! Please make sure you have an alternate launcher installed or remove that app from the script!!! Additionally, the app removes Google Messages, Sony Clock, Sony Calendar, Chrome, Sony Email, Gmail, Google, various international keyboard layouts, and Text-to-speech functionality. All of these, or alternatives, can be re-installed through the Play Store though.

To Modify:
The .bat file can be modified by opening with any text editor. All apps are labeled with their name, as below:
::Google Messages
adb shell rm -rf /system/app/Messages
adb shell rm -rf /data/user/0/com.google.android.apps.messaging

To prevent this app from being uninstalled, just delete those lines.

To add an app that is not on the list, use an app such as App Inspector to find the directory the app is installed to and the directory its data is located in, then add those to the list as below:
adb shell rm -rf <app Source Dir, excluding last /******.apk>
adb shell rm -rf <app Data Dir>


In some instances, such as if the app has been updated from the Play Store, you may need to remove it from /data/app/ and from /system/app/ (or /system/priv-app) as below:
::Sony What's New
adb shell rm -rf /system/priv-app/sonyentrance2-release
adb shell rm -rf /data/app/com.sonymobile.entrance*
adb shell rm -rf /data/user/0/com.sonymobile.entrance

The * above is used as a wildcard, meaning that any folder that matches everything before the * will be deleted. This is needed because random strings of letters and numbers are added to the end of the app name when installed to /data/app/. Please be careful with your * use, since using something like "adb shell rm -rf /data/app/com.sonymobile.*" would clear out several apps' data!

Instructions:
  • Power down the device
  • Reboot into TWRP by holding Power and Volume Down (phone must not be plugged into computer yet)
  • Attach phone to computer
  • Unzip JunkCleaner.zip (this is not a flashable zip!) and extract JunkCleaner.bat
  • Move JunkCleaner.bat to a folder that contains adb.exe
  • Double click on JunkCleaner.bat and let run to completion
  • You're all set!

Known Issues:
Swiftkey may force close on you, to fix this, clear the cache from Settings -> Apps & notifications -> App Info -> Swiftkey Keyboard -> Storage -> Clear Cache
You will see a notification that com.sonymobile.rcahandler has force closed when you first boot the phone. This can be fixed by turning on Ultra Stamina mode, turning it off, then rebooting a second time after Ultra Stamina Mode has already rebooted your phone.

To Return to Stock/Reinstall any apps:
To get back to stock, just use Newflasher to reinstall system & oem partitions. This will restore all apps that this script removes.

Please let me know if there are any apps that you have safely removed that are not in my list, as I'm sure the amount of apps can be whittled down even further.
I was wondering how to use this exactly?? cause i ran it within the adb folder and it processed the list but nothing happened on the phone...i wanna debloat my phone with this but i cant get it to work for me :( lol any help would be much appreciated :) i am running the same oreo firmware..
 

Mackay53

Senior Member
Apr 1, 2011
2,039
716
183
Edinburgh
I was wondering how to use this exactly?? cause i ran it within the adb folder and it processed the list but nothing happened on the phone...i wanna debloat my phone with this but i cant get it to work for me :( lol any help would be much appreciated :) i am running the same oreo firmware..
I use system app remover from the store. Works pretty well and it's quick for multiple uninstalls
 

Pointless816

Member
Mar 6, 2009
33
19
0
Manhattan
@gerald.mrrsn
Sorry to hear it was giving you troubles! I have a flashable version that you can try that's attached to this post.
@Patrck744
New flashable is attached! :)

I've attached a new flashable version of the script to this post--just stick it on your phone and flash in TWRP. I've added a few more apps to it compared to my original script and have also improved deletion of apps which may have been updated. I'm still planning to add more apps to the list and will update the main post with instructions on modifying the flashable zip and update the original .bat file once I've done some testing on removing additional apps.
 

Attachments

Patrck744

Senior Member
Oct 28, 2010
59
5
0
Thanks, you're doing good work!


I tried uninstalling majority of the junk using TitaniumBackUp but I just got a bootloop. I'll test it and let you know if there are any issues with flashable version.
 

tolol

Member
Mar 26, 2009
46
2
28
UPDATE:

just flashed this on nougat. successfully removed all apps specified. i edited the script and excluded xperia home, album and music. works as expected. maybe you can try to find more useless apps that doesnt do anything but hog up the Ram and battery.

UPDATE 2:
used this on Oreo and everything is also good there. however, there are some apps that cannot be uninstalled either from root uninstallers or by deleting their folder. maybe you can add these apps to the junkcleaner :

Audio settings (clear audio+ DSEE etc)
com.qualcomm.qti.telephonyservice (tell me if it is important to keep)
download manager (guess its important to keep)
home network (tell if important to keep)
shell (tell if imp)
software update app (probably not used since unlocked bootloader, other apps can be updated from playstore)
wap push (tell if needed to keep)

will be even more thankful :)

much respect from me :)
would you kindly post modified script for download.